linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Lee Jones <lee.jones@linaro.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Lee Jones <lee@kernel.org>, Andy Shevchenko <andy@kernel.org>,
	Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Subject: Re: [PATCH v2 01/10] mfd: intel_soc_pmic: Fix an error handling path in intel_soc_pmic_i2c_probe()
Date: Mon, 1 Aug 2022 11:52:00 +0200	[thread overview]
Message-ID: <98f1509a-2386-7c8f-cf53-cdb93990aa74@redhat.com> (raw)
In-Reply-To: <CAHp75VcmuVcA_heURNh96zBDtpeNvx0t9buDOxnWNoea2G1uDg@mail.gmail.com>

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.


  reply	other threads:[~2022-08-01  9:52 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-31 20:12 [PATCH v2 01/10] mfd: intel_soc_pmic: Fix an error handling path in intel_soc_pmic_i2c_probe() Andy Shevchenko
2022-07-31 20:12 ` [PATCH v2 02/10] mfd: intel_soc_pmic_crc: Merge Intel PMIC core to crc Andy Shevchenko
2022-07-31 20:24   ` Christophe JAILLET
2022-08-01  9:30     ` Andy Shevchenko
2022-07-31 20:12 ` [PATCH v2 03/10] mfd: intel_soc_pmic: Move non-Intel Makefile entries to their own group Andy Shevchenko
2022-07-31 20:12 ` [PATCH v2 04/10] mfd: intel_soc_pmic_crc: Use devm_regmap_add_irq_chip() Andy Shevchenko
2022-07-31 20:12 ` [PATCH v2 05/10] mfd: intel_soc_pmic_crc: Convert to use i2c_get/set_clientdata() Andy Shevchenko
2022-07-31 20:12 ` [PATCH v2 06/10] mfd: intel_soc_pmic_crc: Switch from CONFIG_PM_SLEEP guards to pm_sleep_ptr() etc Andy Shevchenko
2022-07-31 20:12 ` [PATCH v2 07/10] mfd: intel_soc_pmic_crc: Drop redundant ACPI_PTR() and ifdeffery Andy Shevchenko
2022-07-31 20:12 ` [PATCH v2 08/10] mfd: intel_soc_pmic_crc: Convert driver to use ->probe_new() Andy Shevchenko
2022-07-31 20:12 ` [PATCH v2 09/10] mfd: intel_soc_pmic_crc: Replace intel_soc_pmic with crystal_cove Andy Shevchenko
2022-07-31 20:12 ` [PATCH v2 10/10] mfd: intel_soc_pmic_crc: Update the copyright year Andy Shevchenko
2022-08-01  8:43 ` [PATCH v2 01/10] mfd: intel_soc_pmic: Fix an error handling path in intel_soc_pmic_i2c_probe() Hans de Goede
2022-08-01  9:14   ` Andy Shevchenko
2022-08-01  9:29     ` Andy Shevchenko
2022-08-01  9:52       ` Hans de Goede [this message]
2022-08-01 10:38         ` Andy Shevchenko
2022-08-01 10:53           ` Hans de Goede
2022-08-01 11:34             ` Andy Shevchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=98f1509a-2386-7c8f-cf53-cdb93990aa74@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=andy@kernel.org \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=lee.jones@linaro.org \
    --cc=lee@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).