lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 20 May 2015 12:39:22 +0300
From:	Robert Dolca <robert.dolca@...il.com>
To:	Mika Westerberg <mika.westerberg@...ux.intel.com>
Cc:	Robert Dolca <robert.dolca@...el.com>, linux-i2c@...r.kernel.org,
	linux-acpi@...r.kernel.org,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Wolfram Sang <wsa@...-dreams.de>,
	"Rafael J. Wysocki" <rjw@...ysocki.net>,
	Len Brown <lenb@...nel.org>,
	Daniel Baluta <daniel.baluta@...el.com>
Subject: Re: [PATCH RFC] i2c: Use ID table to detect ACPI I2C devices

On Wed, May 20, 2015 at 10:47 AM, Mika Westerberg wrote:
> On Tue, May 19, 2015 at 05:03:29PM +0300, Robert Dolca wrote:
>> For i2c devices enumerated with ACPI you need to declare both
>> acpi_match_table and id_table. When using ACPI, the i2c_device_id structure
>> supplied to the probe function is null and you have to handle this case
>> in the driver.
>>
>> The current name for the i2c client when using ACPI is "HID:UID" where the
>> UID has 7 or 8 characters and the UID has 2 characters. The UID is not
>> relevant for identifying the chip so it does not have any practical
>> purpose.
>
> First of all, it is not "HID:UID" since the number after ":" is actually
> increasing number assigned by the ACPI core. Nothing to do with _UID.

You are right. My mistake.

> Secondly we do not list "_HID:nn" in drivers acpi_match_tables but
> instead it is either "HID" or "CID", no ":nn" there.

I didn't say that you do that :)

>
>> Modifying i2c_match_id we make the comparison by ignoring the UID from the
>> client name when the device was discovered using ACPI. The comparison is
>> case insensitive because the ACPI names are uppercase and the DT and ID
>> table names are lowercase. It would not make sense to have two different
>> chips with the same name and the only diference being the capitalized
>> letters.
>>
>> With these changes the probe function gets a valid i2c_device_id and the
>> driver doesn't have to declare acpi_match_table.
>
> No. We don't do that for DT and we definitely don't want to mix ACPI
> identifiers with arbitrary I2C device names.
>
> You are not supposed to put ACPI identifiers into i2c_device_id table.

Currently, if the name used for DT (in dts) matches one of the names
specified in the id table you will have a match. Isn't that an
intended behavior?

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ