Re: [PATCH 3/3] ACPI: video: Fix apple gmux detection

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Andy,

On 1/23/23 17:37, Andy Shevchenko wrote:
> On Mon, Jan 23, 2023 at 1:38 PM Hans de Goede <hdegoede@xxxxxxxxxx> wrote:
>>
>> Some apple laptop models have an ACPI device with a HID of APP000B
>> and that device has an IO resource (so it does not describe the new
>> unsupported MMIO based gmux type), but there actually is no gmux
>> in the laptop at all.
>>
>> The gmux_probe() function of the actual apple-gmux driver has code
>> to detect this, this code has been factored out into a new
>> apple_gmux_detect() helper in apple-gmux.h.
>>
>> Use this new function to fix acpi_video_get_backlight_type() wrongly
>> returning apple_gmux as type on these new laptops.
> 
> ...
> 
>> -static bool apple_gmux_backlight_present(void)
>> -{
>> -       struct acpi_device *adev;
>> -       struct device *dev;
>> -
>> -       adev = acpi_dev_get_first_match_dev(GMUX_ACPI_HID, NULL, -1);
>> -       if (!adev)
>> -               return false;
>> -
>> -       dev = acpi_get_first_physical_node(adev);
>> -       if (!dev)
>> -               return false;
>> -
>> -       /*
>> -        * drivers/platform/x86/apple-gmux.c only supports old style
>> -        * Apple GMUX with an IO-resource.
>> -        */
>> -       return pnp_get_resource(to_pnp_dev(dev), IORESOURCE_IO, 0) != NULL;
>> -}
> 
> Oh, the leak is already somewhere... Lemme cook a patch...

This code is very likely going away, with a Fixes tag
for the original commit which introduced it.

So IMHO it is best to let the leak be (I will fix it
in the replacement in this patch-set).

This patch-set fixes an actual regression and is intended
for stable. So also having a leak fix "flying around" is
only going to confuse things.

Regards,

Hans





[Index of Archives]     [Linux Kernel Development]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux