* Re: [PATCH] platform/x86: intel_cht_int33fe: Work around BIOS bug on some devices
[not found] ` <06a1d48c-9f75-4aab-107d-f71ce8ebbb26@redhat.com>
@ 2017-08-31 16:04 ` Andy Shevchenko
2017-09-01 6:25 ` Jarkko Nikula
2017-09-01 9:19 ` Mika Westerberg
0 siblings, 2 replies; 5+ messages in thread
From: Andy Shevchenko @ 2017-08-31 16:04 UTC (permalink / raw)
To: Hans de Goede, Rafael J. Wysocki, Mika Westerberg
Cc: Darren Hart, Andy Shevchenko, Platform Driver,
linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org
On Mon, Aug 14, 2017 at 11:52 PM, Hans de Goede <hdegoede@redhat.com> wrote:
> On 14-08-17 22:45, Andy Shevchenko wrote:
>> On Mon, Aug 14, 2017 at 11:14 PM, Hans de Goede <hdegoede@redhat.com>
>> wrote:
>>> +int cht_int33fe_check_for_max17047(struct device *dev, void *data)
>>> +{
>>> + const char *name = dev_name(dev);
>>> + struct i2c_client **max17047 = data;
>>> +
>>> + if (name && strcmp(name, "i2c-MAX17047:00") == 0) {
>>
>>
>> Can we stop using bad practice of comparing against _instance_?
>> If device is suppose to be single in the system, wouldn't _HID be enough?
> Yes _HID would be enough, but that takes some extra code with little
> gain IMHO, we are effectively checking the HID here as that is where
> the device-name comes from.
>
> Anyways if you strongly prefer a HID check I can do a v2 doing that
> either way let me know.
Currently we have the following modules where ACPI instance is used in:
drivers/acpi/acpi_lpss.c
drivers/input/touchscreen/goodix.c
drivers/platform/x86/silead_dmi.c
drivers/power/supply/axp288_charger.c
and plenty under sound/soc/intel.
I do not care right now about sound/soc/intel stuff, while everywhere
else would be better to avoid this.
Mika, Rafael, what're yours opinions regarding to use ACPI instances
in the drivers?
For me it sounds fragile.
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] platform/x86: intel_cht_int33fe: Work around BIOS bug on some devices
2017-08-31 16:04 ` [PATCH] platform/x86: intel_cht_int33fe: Work around BIOS bug on some devices Andy Shevchenko
@ 2017-09-01 6:25 ` Jarkko Nikula
2017-09-01 9:19 ` Mika Westerberg
1 sibling, 0 replies; 5+ messages in thread
From: Jarkko Nikula @ 2017-09-01 6:25 UTC (permalink / raw)
To: Andy Shevchenko, Hans de Goede, Rafael J. Wysocki,
Mika Westerberg
Cc: Darren Hart, Andy Shevchenko, Platform Driver,
linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org
On 08/31/2017 07:04 PM, Andy Shevchenko wrote:
> On Mon, Aug 14, 2017 at 11:52 PM, Hans de Goede <hdegoede@redhat.com> wrote:
>> On 14-08-17 22:45, Andy Shevchenko wrote:
>>> On Mon, Aug 14, 2017 at 11:14 PM, Hans de Goede <hdegoede@redhat.com>
>>> wrote:
>
>>>> +int cht_int33fe_check_for_max17047(struct device *dev, void *data)
>>>> +{
>>>> + const char *name = dev_name(dev);
>>>> + struct i2c_client **max17047 = data;
>>>> +
>>>> + if (name && strcmp(name, "i2c-MAX17047:00") == 0) {
>>>
>>>
>>> Can we stop using bad practice of comparing against _instance_?
>>> If device is suppose to be single in the system, wouldn't _HID be enough?
>
>> Yes _HID would be enough, but that takes some extra code with little
>> gain IMHO, we are effectively checking the HID here as that is where
>> the device-name comes from.
>>
>> Anyways if you strongly prefer a HID check I can do a v2 doing that
>> either way let me know.
>
> Currently we have the following modules where ACPI instance is used in:
>
> drivers/acpi/acpi_lpss.c
> drivers/input/touchscreen/goodix.c
> drivers/platform/x86/silead_dmi.c
> drivers/power/supply/axp288_charger.c
>
> and plenty under sound/soc/intel.
>
> I do not care right now about sound/soc/intel stuff, while everywhere
> else would be better to avoid this.
>
My 2 cents: sound subsystem needs to match exactly against instance
since we (must) know how each component are wired in HW. For instance
nothing prevents to have multiple audio codec chips with the same HID.
There are couple examples under sound/soc/intel where system have
multiple codecs with the same HID.
(I don't know do we have yet a better way in ACPI to describe audio HW
than matching know instances and tying them together with a code).
--
Jarkko
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] platform/x86: intel_cht_int33fe: Work around BIOS bug on some devices
2017-08-31 16:04 ` [PATCH] platform/x86: intel_cht_int33fe: Work around BIOS bug on some devices Andy Shevchenko
2017-09-01 6:25 ` Jarkko Nikula
@ 2017-09-01 9:19 ` Mika Westerberg
2017-09-01 21:58 ` Hans de Goede
1 sibling, 1 reply; 5+ messages in thread
From: Mika Westerberg @ 2017-09-01 9:19 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Hans de Goede, Rafael J. Wysocki, Darren Hart, Andy Shevchenko,
Platform Driver, linux-kernel@vger.kernel.org,
linux-acpi@vger.kernel.org
On Thu, Aug 31, 2017 at 07:04:46PM +0300, Andy Shevchenko wrote:
> On Mon, Aug 14, 2017 at 11:52 PM, Hans de Goede <hdegoede@redhat.com> wrote:
> > On 14-08-17 22:45, Andy Shevchenko wrote:
> >> On Mon, Aug 14, 2017 at 11:14 PM, Hans de Goede <hdegoede@redhat.com>
> >> wrote:
>
> >>> +int cht_int33fe_check_for_max17047(struct device *dev, void *data)
> >>> +{
> >>> + const char *name = dev_name(dev);
> >>> + struct i2c_client **max17047 = data;
> >>> +
> >>> + if (name && strcmp(name, "i2c-MAX17047:00") == 0) {
> >>
> >>
> >> Can we stop using bad practice of comparing against _instance_?
> >> If device is suppose to be single in the system, wouldn't _HID be enough?
>
> > Yes _HID would be enough, but that takes some extra code with little
> > gain IMHO, we are effectively checking the HID here as that is where
> > the device-name comes from.
> >
> > Anyways if you strongly prefer a HID check I can do a v2 doing that
> > either way let me know.
>
> Currently we have the following modules where ACPI instance is used in:
>
> drivers/acpi/acpi_lpss.c
> drivers/input/touchscreen/goodix.c
> drivers/platform/x86/silead_dmi.c
> drivers/power/supply/axp288_charger.c
>
> and plenty under sound/soc/intel.
>
> I do not care right now about sound/soc/intel stuff, while everywhere
> else would be better to avoid this.
>
> Mika, Rafael, what're yours opinions regarding to use ACPI instances
> in the drivers?
Since the instance name is generated by the ACPI core and in theory
could change, I agree this is pretty fragile. Using _HID/_UID should be
the preferred way. However, it is not always possible so we end up doing
hacks like this.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] platform/x86: intel_cht_int33fe: Work around BIOS bug on some devices
2017-09-01 9:19 ` Mika Westerberg
@ 2017-09-01 21:58 ` Hans de Goede
2017-09-02 7:16 ` Mika Westerberg
0 siblings, 1 reply; 5+ messages in thread
From: Hans de Goede @ 2017-09-01 21:58 UTC (permalink / raw)
To: Mika Westerberg, Andy Shevchenko
Cc: Rafael J. Wysocki, Darren Hart, Andy Shevchenko, Platform Driver,
linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org
Hi,
On 09/01/2017 11:19 AM, Mika Westerberg wrote:
> On Thu, Aug 31, 2017 at 07:04:46PM +0300, Andy Shevchenko wrote:
>> On Mon, Aug 14, 2017 at 11:52 PM, Hans de Goede <hdegoede@redhat.com> wrote:
>>> On 14-08-17 22:45, Andy Shevchenko wrote:
>>>> On Mon, Aug 14, 2017 at 11:14 PM, Hans de Goede <hdegoede@redhat.com>
>>>> wrote:
>>
>>>>> +int cht_int33fe_check_for_max17047(struct device *dev, void *data)
>>>>> +{
>>>>> + const char *name = dev_name(dev);
>>>>> + struct i2c_client **max17047 = data;
>>>>> +
>>>>> + if (name && strcmp(name, "i2c-MAX17047:00") == 0) {
>>>>
>>>>
>>>> Can we stop using bad practice of comparing against _instance_?
>>>> If device is suppose to be single in the system, wouldn't _HID be enough?
>>
>>> Yes _HID would be enough, but that takes some extra code with little
>>> gain IMHO, we are effectively checking the HID here as that is where
>>> the device-name comes from.
>>>
>>> Anyways if you strongly prefer a HID check I can do a v2 doing that
>>> either way let me know.
>>
>> Currently we have the following modules where ACPI instance is used in:
>>
>> drivers/acpi/acpi_lpss.c
>> drivers/input/touchscreen/goodix.c
>> drivers/platform/x86/silead_dmi.c
>> drivers/power/supply/axp288_charger.c
>>
>> and plenty under sound/soc/intel.
>>
>> I do not care right now about sound/soc/intel stuff, while everywhere
>> else would be better to avoid this.
>>
>> Mika, Rafael, what're yours opinions regarding to use ACPI instances
>> in the drivers?
>
> Since the instance name is generated by the ACPI core and in theory
> could change, I agree this is pretty fragile. Using _HID/_UID should be
> the preferred way. However, it is not always possible so we end up doing
> hacks like this.
Given that on the device in question where we need this workaround there
is only ever 1 max17047, including the instance number in the check really
is a non-problem, but if there is a strong preference for me to change
the check over to a _HID check then I can do a v2 doing so.
Regards,
Hans
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] platform/x86: intel_cht_int33fe: Work around BIOS bug on some devices
2017-09-01 21:58 ` Hans de Goede
@ 2017-09-02 7:16 ` Mika Westerberg
0 siblings, 0 replies; 5+ messages in thread
From: Mika Westerberg @ 2017-09-02 7:16 UTC (permalink / raw)
To: Hans de Goede
Cc: Andy Shevchenko, Rafael J. Wysocki, Darren Hart, Andy Shevchenko,
Platform Driver, linux-kernel@vger.kernel.org,
linux-acpi@vger.kernel.org
On Fri, Sep 01, 2017 at 11:58:55PM +0200, Hans de Goede wrote:
> Given that on the device in question where we need this workaround there
> is only ever 1 max17047, including the instance number in the check really
> is a non-problem, but if there is a strong preference for me to change
> the check over to a _HID check then I can do a v2 doing so.
I would still prefer _HID check if possible. Otherwise someone finds
this hack later and uses it in another driver thinking it is the right
thing to do ;-)
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2017-09-02 7:16 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20170814201425.20991-1-hdegoede@redhat.com>
[not found] ` <CAHp75Vdityzx+fzU_q0vULGpT3ww8C0_D0fYtEW77Hyh1yTX6A@mail.gmail.com>
[not found] ` <06a1d48c-9f75-4aab-107d-f71ce8ebbb26@redhat.com>
2017-08-31 16:04 ` [PATCH] platform/x86: intel_cht_int33fe: Work around BIOS bug on some devices Andy Shevchenko
2017-09-01 6:25 ` Jarkko Nikula
2017-09-01 9:19 ` Mika Westerberg
2017-09-01 21:58 ` Hans de Goede
2017-09-02 7:16 ` Mika Westerberg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox