linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: <Codrin.Ciubotariu@microchip.com>
To: <wsa@the-dreams.de>
Cc: <linux-gpio@vger.kernel.org>, <linux-i2c@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>, <Ludovic.Desroches@microchip.com>,
	<Nicolas.Ferre@microchip.com>, <alexandre.belloni@bootlin.com>,
	<kamel.bouhara@bootlin.com>, <linux@armlinux.org.uk>,
	<linus.walleij@linaro.org>, <alan@softiron.com>
Subject: Re: Re: [RFC PATCH] i2c: at91: Fix pinmux after devm_gpiod_get() for bus recovery
Date: Wed, 13 May 2020 11:07:07 +0000	[thread overview]
Message-ID: <c7a35978-03dd-3c73-6e7d-15ed40b5c57c@microchip.com> (raw)
In-Reply-To: <20200505151256.GF2468@ninjato>

On 05.05.2020 18:12, Wolfram Sang wrote:
> On Wed, Apr 15, 2020 at 10:06:43AM +0300, Codrin Ciubotariu wrote:
>> devm_gpiod_get() usually calls gpio_request_enable() for non-strict pinmux
>> drivers. These puts the pins in GPIO mode, whithout notifying the pinctrl
>> driver. At this point, the I2C bus no longer owns the pins. To mux the
>> pins back to the I2C bus, we use the pinctrl driver to change the state
>> of the pins to GPIO, before using devm_gpiod_get(). After the pins are
>> received as GPIOs, we switch theer pinctrl state back to the default
>> one,
>>
>> Fixes: d3d3fdcc4c90 ("i2c: at91: implement i2c bus recovery")
>> Signed-off-by: Codrin Ciubotariu <codrin.ciubotariu@microchip.com>
> 
> Applied to for-current, thanks!

Just looked at this patch and noticed that I should change the pinctrl 
state back to default if we can't get the gpio pins. I will submit a 
patch to fix this.

> 
> This will do for 5.7. For 5.8 or 5.9, I can imagine to take the two
> pinctrl_state pointers into bus_recovery_info and handle all this in the
> core. I will try this later this week if noone is super-eager to try it
> out before.
> 

By 'all this' you mean to move the entire function in the core, right? 
Having just these two pointers bus_recinovery_info won't help much. I 
can try it, if you haven't already started...

Best regards,
Codrin


  reply	other threads:[~2020-05-13 11:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-15  7:06 [RFC PATCH] i2c: at91: Fix pinmux after devm_gpiod_get() for bus recovery Codrin Ciubotariu
2020-04-19 12:50 ` ludovic.desroches
2020-05-05 15:12 ` Wolfram Sang
2020-05-13 11:07   ` Codrin.Ciubotariu [this message]
2020-05-20 16:27     ` Wolfram Sang
2020-06-09 11:43       ` Codrin.Ciubotariu

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=c7a35978-03dd-3c73-6e7d-15ed40b5c57c@microchip.com \
    --to=codrin.ciubotariu@microchip.com \
    --cc=Ludovic.Desroches@microchip.com \
    --cc=Nicolas.Ferre@microchip.com \
    --cc=alan@softiron.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=kamel.bouhara@bootlin.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=wsa@the-dreams.de \
    /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).