lkml.org 
[lkml]   [2022]   [Aug]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v2 01/10] mfd: intel_soc_pmic: Fix an error handling path in intel_soc_pmic_i2c_probe()
From
Hi,

On 8/1/22 11:29, Andy Shevchenko wrote:
> On Mon, Aug 1, 2022 at 11:14 AM Andy Shevchenko
> <andy.shevchenko@gmail.com> wrote:
>> On Mon, Aug 1, 2022 at 10:43 AM Hans de Goede <hdegoede@redhat.com> wrote:
>>> On 7/31/22 22:12, Andy Shevchenko wrote:
>
> ...
>
>>>> err_del_irq_chip:
>>>> + pwm_remove_table(crc_pwm_lookup, ARRAY_SIZE(crc_pwm_lookup));
>>>> regmap_del_irq_chip(pmic->irq, pmic->irq_chip_data);
>>>> return ret;
>>>
>>> Note alternatively we could just move the pwm_add_table() to just before the "return 0",
>>> there is no strict ordering between adding the mfd devices and the pwm_add_table()
>>> (the pwm device only becomes available after the pwm-driver has bound to the mfd
>>> instantiated platform device which happens later).
>
> Just to be sure... How is it guaranteed that that happens later?

Ah you are right, it could happen immediately if the driver is builtin and
has already registered (if the PWM driver is a module, as it is on Fedora,
then the driver will only bind once the module is loaded).

Regardless there are no ordering guarantees between the probe() function of
intel_soc_pmic and the consumer of the PWM device, so the consumer must
be prepared to deal with the lookup not being present yet when its probe()
function runs (*).

Regards,

Hans


*) ATM this is actually an unsolved problem and this works only because the PMIC
drivers are builtin and i915, which consumes the PWM for backlight control
is a module. Swapping the order does not impact this.

\
 
 \ /
  Last update: 2022-08-01 11:52    [W:0.061 / U:0.276 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site