diff mbox series

[1/2] x86/platform/intel-mid: Create pinctrl platform device at later initcall

Message ID 20190611103330.21306-1-jarkko.nikula@linux.intel.com (mailing list archive)
State Deferred, archived
Headers show
Series [1/2] x86/platform/intel-mid: Create pinctrl platform device at later initcall | expand

Commit Message

Jarkko Nikula June 11, 2019, 10:33 a.m. UTC
Postpone "pinctrl-merrifield" platform device creation later than
subsys_initcall. This is preparation for an another patch that does ACPI
namespace walk which is not possible yet at subsys_initcall phase.

Currently if kernel is built with ACPI support and platform has the ACPI
device "INTC1002" with the same MMIO resources than "pinctrl-merrifield"
platform device then these devices conflict and typically probing of
"INTC1002" will fail in drivers/pinctrl/intel/pinctrl-merrifield.c due
conflicting resources:

[    0.873523] pinctrl-merrifield INTC1002:00: can't request region for resource [mem 0xff0c0000-0xff0c7fff]
[    0.879464] pinctrl-merrifield: probe of INTC1002:00 failed with error -16

Moreover also dependent drivers/gpio/gpio-merrifield.c will fail to
probe due it tries to bind with pinctrl device named after "INTC1002"
rather than "pinctrl-merrifield" when "INTC1002" is present in ACPI tables:

[    5.825231] gpio gpiochip0: (0000:00:0c.0): could not create pin range
[    5.825710] gpio-merrifield 0000:00:0c.0: failed to add GPIO pin range

Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
---
Andy: I'm not sure is this with the next patch the right fix or would it be
possible to just delete this "pinctrl-merrifield" initialization filei? I
went to this path since I don't know are there platforms without
"INTC1002" in their ACPI tables or do some users want to run non-ACPI
kernels.
---
 .../x86/platform/intel-mid/device_libs/platform_mrfld_pinctrl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Andy Shevchenko June 11, 2019, 12:58 p.m. UTC | #1
On Tue, Jun 11, 2019 at 1:33 PM Jarkko Nikula
<jarkko.nikula@linux.intel.com> wrote:
>
> Postpone "pinctrl-merrifield" platform device creation later than
> subsys_initcall. This is preparation for an another patch that does ACPI
> namespace walk which is not possible yet at subsys_initcall phase.
>
> Currently if kernel is built with ACPI support and platform has the ACPI
> device "INTC1002" with the same MMIO resources than "pinctrl-merrifield"
> platform device then these devices conflict and typically probing of
> "INTC1002" will fail in drivers/pinctrl/intel/pinctrl-merrifield.c due
> conflicting resources:
>
> [    0.873523] pinctrl-merrifield INTC1002:00: can't request region for resource [mem 0xff0c0000-0xff0c7fff]
> [    0.879464] pinctrl-merrifield: probe of INTC1002:00 failed with error -16
>
> Moreover also dependent drivers/gpio/gpio-merrifield.c will fail to
> probe due it tries to bind with pinctrl device named after "INTC1002"
> rather than "pinctrl-merrifield" when "INTC1002" is present in ACPI tables:
>
> [    5.825231] gpio gpiochip0: (0000:00:0c.0): could not create pin range
> [    5.825710] gpio-merrifield 0000:00:0c.0: failed to add GPIO pin range
>
> Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
> ---
> Andy: I'm not sure is this with the next patch the right fix or would it be
> possible to just delete this "pinctrl-merrifield" initialization filei? I
> went to this path since I don't know are there platforms without
> "INTC1002" in their ACPI tables or do some users want to run non-ACPI
> kernels.

I have locally one hack with another approach, i.e. check for SFI
availability like the rest of the files in this folder works, with few
exceptions as this one.

So, something like

if (sfi_disabled)
  return -EINVAL.

If you have time, you can split and submit the
https://github.com/andy-shev/linux/commit/7a0cb10387a437f5811435b9c790043c64816d08
Jarkko Nikula June 12, 2019, 8:21 a.m. UTC | #2
On 6/11/19 3:58 PM, Andy Shevchenko wrote:
>> Andy: I'm not sure is this with the next patch the right fix or would it be
>> possible to just delete this "pinctrl-merrifield" initialization filei? I
>> went to this path since I don't know are there platforms without
>> "INTC1002" in their ACPI tables or do some users want to run non-ACPI
>> kernels.
> 
> I have locally one hack with another approach, i.e. check for SFI
> availability like the rest of the files in this folder works, with few
> exceptions as this one.
> 
> So, something like
> 
> if (sfi_disabled)
>    return -EINVAL.
> 
> If you have time, you can split and submit the
> https://github.com/andy-shev/linux/commit/7a0cb10387a437f5811435b9c790043c64816d08
> 
Seems to accomplish the same. Are you planning to send it out and do you 
think are my patches needed after it? If you think they are needed I can 
rebase my patches on top of yours and resend.
Andy Shevchenko June 12, 2019, 8:43 a.m. UTC | #3
On Wed, Jun 12, 2019 at 11:21 AM Jarkko Nikula
<jarkko.nikula@linux.intel.com> wrote:
> On 6/11/19 3:58 PM, Andy Shevchenko wrote:
> >> Andy: I'm not sure is this with the next patch the right fix or would it be
> >> possible to just delete this "pinctrl-merrifield" initialization filei? I
> >> went to this path since I don't know are there platforms without
> >> "INTC1002" in their ACPI tables or do some users want to run non-ACPI
> >> kernels.
> >
> > I have locally one hack with another approach, i.e. check for SFI
> > availability like the rest of the files in this folder works, with few
> > exceptions as this one.
> >
> > So, something like
> >
> > if (sfi_disabled)
> >    return -EINVAL.
> >
> > If you have time, you can split and submit the
> > https://github.com/andy-shev/linux/commit/7a0cb10387a437f5811435b9c790043c64816d08
> >
> Seems to accomplish the same.

Yes.

> Are you planning to send it out

At some point. There is more important things to push first (make USB
OTG work on vanilla).
That's why I asked if you have time. The mentioned change should be
simple split and commit message massaged.

> and do you
> think are my patches needed after it? If you think they are needed I can
> rebase my patches on top of yours and resend.

I don't think they will be needed.
diff mbox series

Patch

diff --git a/arch/x86/platform/intel-mid/device_libs/platform_mrfld_pinctrl.c b/arch/x86/platform/intel-mid/device_libs/platform_mrfld_pinctrl.c
index 4de8a664e6a1..43f801b66c1a 100644
--- a/arch/x86/platform/intel-mid/device_libs/platform_mrfld_pinctrl.c
+++ b/arch/x86/platform/intel-mid/device_libs/platform_mrfld_pinctrl.c
@@ -40,4 +40,4 @@  static int __init mrfld_pinctrl_init(void)
 
 	return -ENODEV;
 }
-arch_initcall(mrfld_pinctrl_init);
+device_initcall(mrfld_pinctrl_init);