Linux-GPIO Archive on lore.kernel.org
 help / color / Atom feed
From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
To: Rodrigo Alencar <455.rodrigo.alencar@gmail.com>
Cc: linux-gpio <linux-gpio@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	Rodrigo Alencar <alencar.fmce@imbel.gov.br>
Subject: Re: [PATCH] gpio: gpio-max730x: bring gpiochip_add_data after port config
Date: Fri, 22 May 2020 17:02:19 +0200
Message-ID: <CAMpxmJXwS21ByzGTsZf6MC-ar-ajUeCCxzP-vNrBEWSLKD9+sw@mail.gmail.com> (raw)
In-Reply-To: <1589461212-27357-1-git-send-email-alencar.fmce@imbel.gov.br>

czw., 14 maj 2020 o 15:00 Rodrigo Alencar
<455.rodrigo.alencar@gmail.com> napisał(a):
>
> gpiochip_add_data being called before might cause premature calls of
> the gpiochip operations before the port_config values are initialized,
> which would possibily write zeros to port gonfiguration registers,
> an operation not allowed. For example, if there are gpio-hog nodes
> in a device-tree, the sequence of function calls are performed
>
> gpiochip_add_data
> of_gpiochip_add
> of_gpiochip_scan_gpios
> of_gpiochip_add_hog
> gpiod_hog
> gpiochip_request_own_desc
> gpiod_configure_flags
> gpiod_direction_output/gpiod_direction_input
>
> which would call later the gpiochip operation direction_output or
> direction_input prior the port_config[] initialization.
>
> Moreover, gpiochip_get_data is replaced by the container_of macro
> inside the gpiochip operations, which would allow the calling of
> max7301_direction_input prior to gpiochip_add_data
>
> Signed-off-by: Rodrigo Alencar <455.rodrigo.alencar@gmail.com>

Applied with some tweaks to the commit message.

Bartosz

      reply index

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-14 13:00 Rodrigo Alencar
2020-05-22 15:02 ` Bartosz Golaszewski [this message]

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=CAMpxmJXwS21ByzGTsZf6MC-ar-ajUeCCxzP-vNrBEWSLKD9+sw@mail.gmail.com \
    --to=bgolaszewski@baylibre.com \
    --cc=455.rodrigo.alencar@gmail.com \
    --cc=alencar.fmce@imbel.gov.br \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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

Linux-GPIO Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-gpio/0 linux-gpio/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-gpio linux-gpio/ https://lore.kernel.org/linux-gpio \
		linux-gpio@vger.kernel.org
	public-inbox-index linux-gpio

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-gpio


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git