linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* fake ACPI IDs in the drivers
@ 2020-11-25 11:14 Andy Shevchenko
  2020-11-25 11:47 ` Lars-Peter Clausen
  0 siblings, 1 reply; 7+ messages in thread
From: Andy Shevchenko @ 2020-11-25 11:14 UTC (permalink / raw)
  To: Jonathan Cameron, Lars-Peter Clausen, Peter Meerwald, linux-iio
  Cc: Hans de Goede

Hi!

Recent discussion [1] [2] around faking ACPI ID in RTC subsystem and a
sudden check [3] (due to last Hans' patches related to ACPI based
systems) of IIO makes me wonder if we may start cleaning drivers from
faked ACPI IDs and establish a stricter rules for the ID table
entries.

Thoughts?

[1]: https://lore.kernel.org/linux-rtc/20201112130734.331094-3-ch@denx.de/
[2]: https://review.coreboot.org/c/coreboot/+/47235
[3]: git grep -n -A10 -w acpi_device_id -- drivers/iio/

-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: fake ACPI IDs in the drivers
  2020-11-25 11:14 fake ACPI IDs in the drivers Andy Shevchenko
@ 2020-11-25 11:47 ` Lars-Peter Clausen
  2020-11-25 12:00   ` Andy Shevchenko
  0 siblings, 1 reply; 7+ messages in thread
From: Lars-Peter Clausen @ 2020-11-25 11:47 UTC (permalink / raw)
  To: Andy Shevchenko, Jonathan Cameron, Peter Meerwald, linux-iio
  Cc: Hans de Goede

On 11/25/20 12:14 PM, Andy Shevchenko wrote:
> Hi!
>
> Recent discussion [1] [2] around faking ACPI ID in RTC subsystem and a
> sudden check [3] (due to last Hans' patches related to ACPI based
> systems) of IIO makes me wonder if we may start cleaning drivers from
> faked ACPI IDs and establish a stricter rules for the ID table
> entries.
>
> Thoughts?

The cat is probably out of the bag.

If there are systems shipping with those unregistered ACPI IDs we still 
have to support them.

I'd assume that most drivers that have a acpi_device_id table do have 
hardware that uses that ID and were not just cargo culted.

For new drivers we should push back on unregistered IDs, but if there is 
hardware that uses them we have to take the patches.

- Lars



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: fake ACPI IDs in the drivers
  2020-11-25 11:47 ` Lars-Peter Clausen
@ 2020-11-25 12:00   ` Andy Shevchenko
  2020-11-25 12:05     ` Lars-Peter Clausen
  2020-11-25 15:32     ` Jonathan Cameron
  0 siblings, 2 replies; 7+ messages in thread
From: Andy Shevchenko @ 2020-11-25 12:00 UTC (permalink / raw)
  To: Lars-Peter Clausen
  Cc: Jonathan Cameron, Peter Meerwald, linux-iio, Hans de Goede

On Wed, Nov 25, 2020 at 1:47 PM Lars-Peter Clausen <lars@metafoo.de> wrote:
> On 11/25/20 12:14 PM, Andy Shevchenko wrote:

> > Recent discussion [1] [2] around faking ACPI ID in RTC subsystem and a
> > sudden check [3] (due to last Hans' patches related to ACPI based
> > systems) of IIO makes me wonder if we may start cleaning drivers from
> > faked ACPI IDs and establish a stricter rules for the ID table
> > entries.
> >
> > Thoughts?
>
> The cat is probably out of the bag.
>
> If there are systems shipping with those unregistered ACPI IDs we still
> have to support them.

Yes, but we can do our best to google for them and try other sources
(like contacts with vendor companies who can acknowledge if there were
an ID issued or not).

> I'd assume that most drivers that have a acpi_device_id table do have
> hardware that uses that ID and were not just cargo culted.
>
> For new drivers we should push back on unregistered IDs, but if there is
> hardware that uses them we have to take the patches.

Right. But at the same time we have to push the idea of proper IDs to
the vendor companies, so they won't abuse ACPI specification anymore.

-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: fake ACPI IDs in the drivers
  2020-11-25 12:00   ` Andy Shevchenko
@ 2020-11-25 12:05     ` Lars-Peter Clausen
  2020-11-25 12:22       ` Alexandru Ardelean
  2020-11-25 12:45       ` Andy Shevchenko
  2020-11-25 15:32     ` Jonathan Cameron
  1 sibling, 2 replies; 7+ messages in thread
From: Lars-Peter Clausen @ 2020-11-25 12:05 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Jonathan Cameron, Peter Meerwald, linux-iio, Hans de Goede

On 11/25/20 1:00 PM, Andy Shevchenko wrote:
>> I'd assume that most drivers that have a acpi_device_id table do have
>> hardware that uses that ID and were not just cargo culted.
>>
>> For new drivers we should push back on unregistered IDs, but if there is
>> hardware that uses them we have to take the patches.
> Right. But at the same time we have to push the idea of proper IDs to
> the vendor companies, so they won't abuse ACPI specification anymore.

The last couple of years have made me very cynical on this. Vendors will 
ship whatever works, not what is correct.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: fake ACPI IDs in the drivers
  2020-11-25 12:05     ` Lars-Peter Clausen
@ 2020-11-25 12:22       ` Alexandru Ardelean
  2020-11-25 12:45       ` Andy Shevchenko
  1 sibling, 0 replies; 7+ messages in thread
From: Alexandru Ardelean @ 2020-11-25 12:22 UTC (permalink / raw)
  To: Lars-Peter Clausen
  Cc: Andy Shevchenko, Jonathan Cameron, Peter Meerwald, linux-iio,
	Hans de Goede

On Wed, Nov 25, 2020 at 2:08 PM Lars-Peter Clausen <lars@metafoo.de> wrote:
>
> On 11/25/20 1:00 PM, Andy Shevchenko wrote:
> >> I'd assume that most drivers that have a acpi_device_id table do have
> >> hardware that uses that ID and were not just cargo culted.
> >>
> >> For new drivers we should push back on unregistered IDs, but if there is
> >> hardware that uses them we have to take the patches.
> > Right. But at the same time we have to push the idea of proper IDs to
> > the vendor companies, so they won't abuse ACPI specification anymore.
>
> The last couple of years have made me very cynical on this. Vendors will
> ship whatever works, not what is correct.
>

hear hear

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: fake ACPI IDs in the drivers
  2020-11-25 12:05     ` Lars-Peter Clausen
  2020-11-25 12:22       ` Alexandru Ardelean
@ 2020-11-25 12:45       ` Andy Shevchenko
  1 sibling, 0 replies; 7+ messages in thread
From: Andy Shevchenko @ 2020-11-25 12:45 UTC (permalink / raw)
  To: Lars-Peter Clausen
  Cc: Jonathan Cameron, Peter Meerwald, linux-iio, Hans de Goede

On Wed, Nov 25, 2020 at 2:05 PM Lars-Peter Clausen <lars@metafoo.de> wrote:
>
> On 11/25/20 1:00 PM, Andy Shevchenko wrote:
> >> I'd assume that most drivers that have a acpi_device_id table do have
> >> hardware that uses that ID and were not just cargo culted.
> >>
> >> For new drivers we should push back on unregistered IDs, but if there is
> >> hardware that uses them we have to take the patches.
> > Right. But at the same time we have to push the idea of proper IDs to
> > the vendor companies, so they won't abuse ACPI specification anymore.
>
> The last couple of years have made me very cynical on this. Vendors will
> ship whatever works, not what is correct.

Yes, but with some vendors (esp. if they have their record in ACPI/PNP
registry) we may insist to follow the process.

-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: fake ACPI IDs in the drivers
  2020-11-25 12:00   ` Andy Shevchenko
  2020-11-25 12:05     ` Lars-Peter Clausen
@ 2020-11-25 15:32     ` Jonathan Cameron
  1 sibling, 0 replies; 7+ messages in thread
From: Jonathan Cameron @ 2020-11-25 15:32 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Lars-Peter Clausen, Jonathan Cameron, Peter Meerwald, linux-iio,
	Hans de Goede

On Wed, 25 Nov 2020 14:00:54 +0200
Andy Shevchenko <andy.shevchenko@gmail.com> wrote:

> On Wed, Nov 25, 2020 at 1:47 PM Lars-Peter Clausen <lars@metafoo.de> wrote:
> > On 11/25/20 12:14 PM, Andy Shevchenko wrote:  
> 
> > > Recent discussion [1] [2] around faking ACPI ID in RTC subsystem and a
> > > sudden check [3] (due to last Hans' patches related to ACPI based
> > > systems) of IIO makes me wonder if we may start cleaning drivers from
> > > faked ACPI IDs and establish a stricter rules for the ID table
> > > entries.
> > >
> > > Thoughts?  
> >
> > The cat is probably out of the bag.
> >
> > If there are systems shipping with those unregistered ACPI IDs we still
> > have to support them.  
> 
> Yes, but we can do our best to google for them and try other sources
> (like contacts with vendor companies who can acknowledge if there were
> an ID issued or not).
> 
> > I'd assume that most drivers that have a acpi_device_id table do have
> > hardware that uses that ID and were not just cargo culted.

I fear that is overly optimistic :(

Every time the ID is non obvious we are pretty safe it has come from real
hardware (whether registered or not) but we have a bunch were introduced
by various fairly new contributors that I let in before I knew better :(
Those tend to just be part numbers squished into ACPI ID format.

> >
> > For new drivers we should push back on unregistered IDs, but if there is
> > hardware that uses them we have to take the patches.  
> 
> Right. But at the same time we have to push the idea of proper IDs to
> the vendor companies, so they won't abuse ACPI specification anymore.
> 

Absolutely.  Sometimes it is just a case of moaning and asking whether
hardware is already shipping with the ID - if not push back hard so they
ideally go persuade their management to put a proper process in place.

So upshot, in my view, is to be very careful removing existing IDs
but definitely be very resistive to introducing any new ones without
confirmation they are on some companies official registers.

Jonathan



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-11-25 15:33 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-25 11:14 fake ACPI IDs in the drivers Andy Shevchenko
2020-11-25 11:47 ` Lars-Peter Clausen
2020-11-25 12:00   ` Andy Shevchenko
2020-11-25 12:05     ` Lars-Peter Clausen
2020-11-25 12:22       ` Alexandru Ardelean
2020-11-25 12:45       ` Andy Shevchenko
2020-11-25 15:32     ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).