All of lore.kernel.org
 help / color / mirror / Atom feed
From: Linus Walleij <linus.walleij@linaro.org>
To: Janusz Krzysztofik <jmkrzyszt@gmail.com>
Cc: ext Tony Lindgren <tony@atomide.com>,
	Aaro Koskinen <aaro.koskinen@iki.fi>,
	Greg KH <gregkh@linuxfoundation.org>,
	Jiri Slaby <jslaby@suse.com>,
	Linux ARM <linux-arm-kernel@lists.infradead.org>,
	Linux-OMAP <linux-omap@vger.kernel.org>,
	linux-serial@vger.kernel.org,
	"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/3] ARM: OMAP1: ams-delta: initialize latch2 pins to safe values
Date: Thu, 23 Aug 2018 12:44:06 +0200	[thread overview]
Message-ID: <CACRpkdaEahLO=z4TxyNfUNOqnTvQWsTzvd-HEciZWX57tQ5-mQ@mail.gmail.com> (raw)
In-Reply-To: <20180820181333.2527-3-jmkrzyszt@gmail.com>

On Mon, Aug 20, 2018 at 8:12 PM Janusz Krzysztofik <jmkrzyszt@gmail.com> wrote:

> Latch2 pins control a number of on-board devices, namely LCD, NAND,
> MODEM and CODEC.  Those pins used to be initialized with safe values
> from init_machine before that operation was:
> 1) moved to late_initcall in preparation for conversion of latch2 to
> GPIO device - see commit f7519d8c8290 ("ARM: OMAP1: ams-delta: register
> latch dependent devices later"),
> 2) replaced with non-atomic initialization performed by means of
> gpio_request_array() - see commit 937eb4bb0058 ("ARM: OMAP1: ams-delta:
> convert latches to basic_mmio_gpio"),
> 3) made completely asynchronous by delegation of GPIO request
> operations performed on subsets of pins to respective device drivers in
> subsequent commits.
>
> One visible negative result of that disintegration was corrupt keyboard
> data reported by serio driver, recently fixed by commit 41f8fee385a0
> ("ARM: OMAP1: ams-delta: Hog "keybrd_dataout" GPIO pin").
>
> Moreover, initialization of LATCH2_PIN_MODEM_CODEC still performed with
> ams_delta_latch2_write() wrapper from late_init() is now done on not
> requested GPIO pin.
>
> Reintroduce atomic initialization of latch2 pins at machine_init to
> prevent from random values potentially corrupting NAND data or maybe
> even destroing other hardware.  Also take care of MODEM/CODEC related
> pins so MODEM device probe succeeds even if latch2 GPIO device or
> dependent regulator is not ready and CODEC can be reached over the
> MODEM even if audio driver doesn't take control over
> LATCH2_PIN_MODEM_CODEC.
>
> Once done, remove the no longer needed GPIO based implementation of
> ams_delta_latch_write() and its frontend macro.
>
> Signed-off-by: Janusz Krzysztofik <jmkrzyszt@gmail.com>

This should turn into a nice pin control driver some day.

But until then, this looks way better after than before the patch,
so:
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

WARNING: multiple messages have this Message-ID (diff)
From: linus.walleij@linaro.org (Linus Walleij)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/3] ARM: OMAP1: ams-delta: initialize latch2 pins to safe values
Date: Thu, 23 Aug 2018 12:44:06 +0200	[thread overview]
Message-ID: <CACRpkdaEahLO=z4TxyNfUNOqnTvQWsTzvd-HEciZWX57tQ5-mQ@mail.gmail.com> (raw)
In-Reply-To: <20180820181333.2527-3-jmkrzyszt@gmail.com>

On Mon, Aug 20, 2018 at 8:12 PM Janusz Krzysztofik <jmkrzyszt@gmail.com> wrote:

> Latch2 pins control a number of on-board devices, namely LCD, NAND,
> MODEM and CODEC.  Those pins used to be initialized with safe values
> from init_machine before that operation was:
> 1) moved to late_initcall in preparation for conversion of latch2 to
> GPIO device - see commit f7519d8c8290 ("ARM: OMAP1: ams-delta: register
> latch dependent devices later"),
> 2) replaced with non-atomic initialization performed by means of
> gpio_request_array() - see commit 937eb4bb0058 ("ARM: OMAP1: ams-delta:
> convert latches to basic_mmio_gpio"),
> 3) made completely asynchronous by delegation of GPIO request
> operations performed on subsets of pins to respective device drivers in
> subsequent commits.
>
> One visible negative result of that disintegration was corrupt keyboard
> data reported by serio driver, recently fixed by commit 41f8fee385a0
> ("ARM: OMAP1: ams-delta: Hog "keybrd_dataout" GPIO pin").
>
> Moreover, initialization of LATCH2_PIN_MODEM_CODEC still performed with
> ams_delta_latch2_write() wrapper from late_init() is now done on not
> requested GPIO pin.
>
> Reintroduce atomic initialization of latch2 pins at machine_init to
> prevent from random values potentially corrupting NAND data or maybe
> even destroing other hardware.  Also take care of MODEM/CODEC related
> pins so MODEM device probe succeeds even if latch2 GPIO device or
> dependent regulator is not ready and CODEC can be reached over the
> MODEM even if audio driver doesn't take control over
> LATCH2_PIN_MODEM_CODEC.
>
> Once done, remove the no longer needed GPIO based implementation of
> ams_delta_latch_write() and its frontend macro.
>
> Signed-off-by: Janusz Krzysztofik <jmkrzyszt@gmail.com>

This should turn into a nice pin control driver some day.

But until then, this looks way better after than before the patch,
so:
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

  reply	other threads:[~2018-08-23 10:44 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-20 18:13 [PATCH 0/3] ARM: OMAP1: ams-delta: Clean up GPIO setup for MODEM Janusz Krzysztofik
2018-08-20 18:13 ` Janusz Krzysztofik
2018-08-20 18:13 ` [PATCH 1/3] ARM: OMAP1: ams-delta: assign MODEM IRQ from GPIO descriptor Janusz Krzysztofik
2018-08-20 18:13   ` Janusz Krzysztofik
2018-08-23 10:42   ` Linus Walleij
2018-08-23 10:42     ` Linus Walleij
2018-08-20 18:13 ` [PATCH 2/3] ARM: OMAP1: ams-delta: initialize latch2 pins to safe values Janusz Krzysztofik
2018-08-20 18:13   ` Janusz Krzysztofik
2018-08-23 10:44   ` Linus Walleij [this message]
2018-08-23 10:44     ` Linus Walleij
2018-08-20 18:13 ` [PATCH 3/3] ARM: OMAP1: ams-delta: register MODEM device earlier Janusz Krzysztofik
2018-08-20 18:13   ` Janusz Krzysztofik
2018-08-23 10:45   ` Linus Walleij
2018-08-23 10:45     ` Linus Walleij
2018-09-07 16:56 ` [PATCH 0/3] ARM: OMAP1: ams-delta: Clean up GPIO setup for MODEM Tony Lindgren
2018-09-07 16:56   ` Tony Lindgren
2018-09-09 23:44 ` [PATCH v2 " Janusz Krzysztofik
2018-09-09 23:44   ` Janusz Krzysztofik
2018-09-09 23:44   ` Janusz Krzysztofik
2018-09-09 23:44   ` [PATCH v2 1/3] ARM: OMAP1: ams-delta: assign MODEM IRQ from GPIO descriptor Janusz Krzysztofik
2018-09-09 23:44     ` Janusz Krzysztofik
2018-09-09 23:44     ` Janusz Krzysztofik
2018-09-09 23:44   ` [PATCH v2 2/3] ARM: OMAP1: ams-delta: initialize latch2 pins to safe values Janusz Krzysztofik
2018-09-09 23:44     ` Janusz Krzysztofik
2018-09-09 23:44     ` Janusz Krzysztofik
2018-09-09 23:44   ` [PATCH v2 3/3] ARM: OMAP1: ams-delta: register MODEM device earlier Janusz Krzysztofik
2018-09-09 23:44     ` Janusz Krzysztofik
2018-09-09 23:44     ` Janusz Krzysztofik
2018-09-10 21:49   ` [PATCH v2 0/3] ARM: OMAP1: ams-delta: Clean up GPIO setup for MODEM Janusz Krzysztofik
2018-09-10 21:49     ` Janusz Krzysztofik
2018-09-20 21:23     ` Tony Lindgren
2018-09-20 21:23       ` Tony Lindgren
2018-09-20 22:43       ` Janusz Krzysztofik
2018-09-20 22:43         ` Janusz Krzysztofik

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='CACRpkdaEahLO=z4TxyNfUNOqnTvQWsTzvd-HEciZWX57tQ5-mQ@mail.gmail.com' \
    --to=linus.walleij@linaro.org \
    --cc=aaro.koskinen@iki.fi \
    --cc=gregkh@linuxfoundation.org \
    --cc=jmkrzyszt@gmail.com \
    --cc=jslaby@suse.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=tony@atomide.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.