Re: [PATCH] mrst_pmu: driver for Intel Moorestown Power Management Unit

From: Len Brown
Date: Mon Aug 01 2011 - 01:47:45 EST


> > +static struct mrst_device *pci_id_2_mrst_dev(u16 pci_dev_num)
> > +{
...
> > + else
> > + BUG();
> > +
> > + BUG_ON(pci_dev_num != mrst_devs[index].pci_dev_num);
>
> That strikes me as needlessly unfriendly, you could warn/return NULL and
> propogate a WARN_ONCE back to the user.

This code asserts that the firmware is correct, and today it is.
If somebody breaks the firmware in the future, I want them to discover
it the instant they break it. If I had the option of shooting
lazer beams out of the system to instantly kill the firmware programmer,
I'd do it. But alas, I have to settle for crashing their system:-)

> > +static int __init scu_fw_check(void)

if (!mrst_pmu)
return 0;

> > +late_initcall(scu_fw_check);
>
> NAK. I pointed this problem with the driver to you way back - this code
> gets run always - even on machines that are not in fact Moorestown which
> are then going to crash.
>
> You need to check that the platform is Moorestown (not just the CPU
> either because of Oaktrail)

Right-o. I think the 1-liner to check mrst_pmu above should do it.

thanks for reading, and sorry for being a slow listener,
-Len

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/