mbox series

[v2,0/3] pinctrl: sunxi: Start to enforce the strict mode

Message ID cover.3e8ef5cb08d0164375d7644df0548e5f39b0fe66.1507582414.git-series.maxime.ripard@free-electrons.com
Headers show
Series pinctrl: sunxi: Start to enforce the strict mode | expand

Message

Maxime Ripard Oct. 9, 2017, 8:53 p.m. UTC
Hi,

Here is an attempt to enable pinctrl's strict mode on our pinctrl drivers.
Indeed, our controllers should have had that mode enabled since its
introduction.

However, there's a number of issues with old device trees that prevent from
just enabling it for all the devices. There's basically two of them:

  - Most of our old DTs have a pinctrl node for GPIOs, which will result in
    an error when the driver is going to request the gpio because it would
    already be requested automatically by pinctrl. We cannot break those.

  - Some of these GPIOs also need to change their pin configuration to add
    a bias or change the current output, and there isn't a migration path.

Let's just keep the old behaviour for the old SoCs, and enforce it on the
new one, and enabled it by default so that the situation at least doesn't
get worse.

This has been tested on an A83t (strict on) and an H3 (strict off) board.

Let me know what you think,
Maxime

Changes from v1:
  - Duplicate the pmx_ops before modifying them
  - Disable the strict mode for R_PIO as well

Maxime Ripard (3):
  pinctrl: sunxi: Introduce the strict flag
  pinctrl: sunxi: Disable strict mode for old pinctrl drivers
  pinctrl: sunxi: Enforce the strict mode by default

 drivers/pinctrl/sunxi/pinctrl-sun4i-a10.c   |  1 +
 drivers/pinctrl/sunxi/pinctrl-sun5i.c       |  1 +
 drivers/pinctrl/sunxi/pinctrl-sun6i-a31-r.c |  1 +
 drivers/pinctrl/sunxi/pinctrl-sun6i-a31.c   |  1 +
 drivers/pinctrl/sunxi/pinctrl-sun8i-a23-r.c |  1 +
 drivers/pinctrl/sunxi/pinctrl-sun8i-a23.c   |  1 +
 drivers/pinctrl/sunxi/pinctrl-sun8i-a33.c   |  1 +
 drivers/pinctrl/sunxi/pinctrl-sun8i-h3-r.c  |  3 ++-
 drivers/pinctrl/sunxi/pinctrl-sun8i-h3.c    |  3 ++-
 drivers/pinctrl/sunxi/pinctrl-sun9i-a80-r.c |  1 +
 drivers/pinctrl/sunxi/pinctrl-sun9i-a80.c   |  1 +
 drivers/pinctrl/sunxi/pinctrl-sunxi.c       | 13 ++++++++++++-
 drivers/pinctrl/sunxi/pinctrl-sunxi.h       |  1 +
 13 files changed, 26 insertions(+), 3 deletions(-)

base-commit: bba731ac5505e73c9b0681762ee0cfa52ccfffed
-- 
git-series 0.9.1
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Chen-Yu Tsai Oct. 10, 2017, 2:36 a.m. UTC | #1
On Tue, Oct 10, 2017 at 4:53 AM, Maxime Ripard
<maxime.ripard@free-electrons.com> wrote:
> Hi,

>

> Here is an attempt to enable pinctrl's strict mode on our pinctrl drivers.

> Indeed, our controllers should have had that mode enabled since its

> introduction.

>

> However, there's a number of issues with old device trees that prevent from

> just enabling it for all the devices. There's basically two of them:

>

>   - Most of our old DTs have a pinctrl node for GPIOs, which will result in

>     an error when the driver is going to request the gpio because it would

>     already be requested automatically by pinctrl. We cannot break those.

>

>   - Some of these GPIOs also need to change their pin configuration to add

>     a bias or change the current output, and there isn't a migration path.

>

> Let's just keep the old behaviour for the old SoCs, and enforce it on the

> new one, and enabled it by default so that the situation at least doesn't

> get worse.

>

> This has been tested on an A83t (strict on) and an H3 (strict off) board.

>

> Let me know what you think,

> Maxime

>

> Changes from v1:

>   - Duplicate the pmx_ops before modifying them

>   - Disable the strict mode for R_PIO as well

>

> Maxime Ripard (3):

>   pinctrl: sunxi: Introduce the strict flag

>   pinctrl: sunxi: Disable strict mode for old pinctrl drivers

>   pinctrl: sunxi: Enforce the strict mode by default


Acked-by: Chen-Yu Tsai <wens@csie.org>

--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Maxime Ripard Oct. 25, 2017, 12:40 p.m. UTC | #2
Hi Linus,

On Mon, Oct 09, 2017 at 10:53:36PM +0200, Maxime Ripard wrote:
> Hi,

> 

> Here is an attempt to enable pinctrl's strict mode on our pinctrl drivers.

> Indeed, our controllers should have had that mode enabled since its

> introduction.

> 

> However, there's a number of issues with old device trees that prevent from

> just enabling it for all the devices. There's basically two of them:

> 

>   - Most of our old DTs have a pinctrl node for GPIOs, which will result in

>     an error when the driver is going to request the gpio because it would

>     already be requested automatically by pinctrl. We cannot break those.

> 

>   - Some of these GPIOs also need to change their pin configuration to add

>     a bias or change the current output, and there isn't a migration path.

> 

> Let's just keep the old behaviour for the old SoCs, and enforce it on the

> new one, and enabled it by default so that the situation at least doesn't

> get worse.

> 

> This has been tested on an A83t (strict on) and an H3 (strict off) board.


Did you have some time to look at this?

The earlier we merge it the better, so ideally I'd really like to get
this into 4.15.

Thanks!
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
Linus Walleij Oct. 31, 2017, 8:44 a.m. UTC | #3
On Mon, Oct 9, 2017 at 10:53 PM, Maxime Ripard
<maxime.ripard@free-electrons.com> wrote:

> Our pinctrl device should have had strict set all along. However, it wasn't

> the case, and most of our old device trees also have a pinctrl group in

> addition to the GPIOs properties, which mean that we can't really turn it

> on now.

>

> All our new SoCs don't have that group, so we should still enable that mode

> on the newer one though.

>

> In order to enable it by default, add a flag that will allow to disable

> that mode that should be set by pinctrl drivers that cannot be migrated.

>

> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>


Patch applied.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Linus Walleij Oct. 31, 2017, 8:46 a.m. UTC | #4
On Wed, Oct 25, 2017 at 2:40 PM, Maxime Ripard
<maxime.ripard@free-electrons.com> wrote:

> Did you have some time to look at this?

>

> The earlier we merge it the better, so ideally I'd really like to get

> this into 4.15.


Just overloaded as usual.

Patches applied.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html