Re: PXA25x: GPIO driver fails probe due to resource conflict with pinctrl driver

Jonathan Neuschäfer
2022-12-08T21:53:51Z

[-- Attachment #1: Type: text/plain, Size: 2099 bytes --]

Thank you both for you help!

On Thu, Dec 08, 2022 at 09:19:12PM +0100, Robert Jarzmik wrote:
>
> "Russell King (Oracle)" <linux@armlinux.org.uk> writes:
> > From a quick look, I think this commit is to blame:
> >
> > 542c25b7a209 drivers: gpio: pxa: use devm_platform_ioremap_resource()
> >
> > Someone "helpfully" making this change:
> >
> > - res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> > - if (!res)
> > - return -EINVAL;
> > - gpio_reg_base = devm_ioremap(&pdev->dev, res->start,
> > - resource_size(res));
> > +
> > + gpio_reg_base = devm_platform_ioremap_resource(pdev, 0);
> >
> > which introduces request_mem_region() to the PXA GPIO driver, resulting
> > in this resource clash.
> You're right.
>
> Now, as for Jonathan, there are 2 options :
> - first one : revert the patch Russell pointed out

I'll try that first.

> - second one : a lot of work, detailed below :
>
> Given that Arnd is removing legacy platformdata code, that will only leave
> the
> device-tree one, which works only with the pinctrl driver enabled.
> That gives the opportunity to drop the use of GPDR from the gpio-pxa driver,
> and now we can map with separate iomem ressources pinctrl-pxa and gpio-pxa.
>
> Therefore, if Jonathan has the will to make a patch, I would :
> - keep the patch identfied by Russell (ie. don't revert it)
> - amend the device-tree descriptions for pxa
> - pxa2xx.dtsi
> ...
> gpio: gpio@40e00000 {
> ...
> reg = <0x40e00000 0xc>, <0x40e00018 0x3c>, <0x40e00100 4>, <0x40e00118
> 0x34>;
> - amend the gpio_pxa.c driver, to map the 4 regions (and not only one as
> before)
> - the pinctrl-pxa25.c and its device-tree are already mapping the holes in
> the
> previous list
> - check that I didn't mess up the 4 iomem regions, they should overlap with
> "pinctrl: pinctrl@40e00000".

And I might try this as well and see if I hit any additional obstacles.
I'll probably get around to it in january.

Thanks again,
Jonathan

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]