linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: Aisheng Dong <aisheng.dong@nxp.com>
Cc: BOUGH CHEN <haibo.chen@nxp.com>,
	"festevam@gmail.com" <festevam@gmail.com>,
	"shawnguo@kernel.org" <shawnguo@kernel.org>,
	"stefan@agner.ch" <stefan@agner.ch>,
	"kernel@pengutronix.de" <kernel@pengutronix.de>,
	"linus.walleij@linaro.org" <linus.walleij@linaro.org>,
	"s.hauer@pengutronix.de" <s.hauer@pengutronix.de>,
	dl-linux-imx <linux-imx@nxp.com>,
	"christophe.jaillet@wanadoo.fr" <christophe.jaillet@wanadoo.fr>,
	"dan.carpenter@oracle.com" <dan.carpenter@oracle.com>,
	"linux@roeck-us.net" <linux@roeck-us.net>,
	"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>
Subject: Re: [PATCH v2] Revert "pinctrl: freescale: imx: Use 'devm_of_iomap()' to avoid a resource leak in case of error in 'imx_pinctrl_probe()'"
Date: Tue, 16 Jun 2020 21:15:43 +0300	[thread overview]
Message-ID: <CAHp75VdvV-tBtZKU6WKHJy+yuesaq6c=PbxCFaJuvujeWhmm-Q@mail.gmail.com> (raw)
In-Reply-To: <AM6PR04MB4966D0FCE44CC173F95C139A809D0@AM6PR04MB4966.eurprd04.prod.outlook.com>

On Tue, Jun 16, 2020 at 5:54 AM Aisheng Dong <aisheng.dong@nxp.com> wrote:

> Could you help apply this patch as it blocked MX7D booting for a while?

> > This reverts commit ba403242615c2c99e27af7984b1650771a2cc2c9.
> >
> > After commit 26d8cde5260b ("pinctrl: freescale: imx: add shared input select
> > reg support"). i.MX7D has two iomux controllers iomuxc and iomuxc-lpsr which
> > share select_input register for daisy chain settings.
> > If use 'devm_of_iomap()', when probe the iomuxc-lpsr, will call
> > devm_request_mem_region() for the region <0x30330000-0x3033ffff> for the
> > first time. Then, next time when probe the iomuxc, API
> > devm_platform_ioremap_resource() will also use the API
> > devm_request_mem_region() for the share region <0x30330000-0x3033ffff>
> > again, then cause issue, log like below:
> >
> > [    0.179561] imx7d-pinctrl 302c0000.iomuxc-lpsr: initialized IMX pinctrl
> > driver
> > [    0.191742] imx7d-pinctrl 30330000.pinctrl: can't request region for
> > resource [mem 0x30330000-0x3033ffff]
> > [    0.191842] imx7d-pinctrl: probe of 30330000.pinctrl failed with error -16

It means that shared support took a wrong approach. If something has
shared resources, another schema should be used, something like MFD
(parent device which keeps only shared resources). Easiest way is to
switch to the regmap API.

P.S. The revert is okay as a quick fix but... see above.

-- 
With Best Regards,
Andy Shevchenko

  reply	other threads:[~2020-06-16 18:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-09  3:27 [PATCH v2] Revert "pinctrl: freescale: imx: Use 'devm_of_iomap()' to avoid a resource leak in case of error in 'imx_pinctrl_probe()'" haibo.chen
2020-06-16  2:53 ` Aisheng Dong
2020-06-16 18:15   ` Andy Shevchenko [this message]
2020-06-17  1:14     ` Peng Fan
2020-06-17  2:53       ` Aisheng Dong
2020-06-17  2:56         ` Peng Fan
2020-06-17  2:43     ` Aisheng Dong
2020-06-16  8:21 ` Linus Walleij

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='CAHp75VdvV-tBtZKU6WKHJy+yuesaq6c=PbxCFaJuvujeWhmm-Q@mail.gmail.com' \
    --to=andy.shevchenko@gmail.com \
    --cc=aisheng.dong@nxp.com \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=dan.carpenter@oracle.com \
    --cc=festevam@gmail.com \
    --cc=haibo.chen@nxp.com \
    --cc=kernel@pengutronix.de \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-imx@nxp.com \
    --cc=linux@roeck-us.net \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    --cc=stefan@agner.ch \
    /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).