linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] MIPS: TXx9: Move GPIO setup from .mem_setup() to .arch_init()
@ 2016-09-11  8:48 Geert Uytterhoeven
  2016-09-11  8:48 ` [PATCH v2 1/2] MIPS: TXx9: tx39xx: " Geert Uytterhoeven
  2016-09-11  8:48 ` [PATCH v2 2/2] MIPS: TXx9: tx49xx: " Geert Uytterhoeven
  0 siblings, 2 replies; 3+ messages in thread
From: Geert Uytterhoeven @ 2016-09-11  8:48 UTC (permalink / raw)
  To: Ralf Baechle, Atsushi Nemoto; +Cc: linux-mips, linux-gpio, Geert Uytterhoeven

	Hi Ralf, Nemoto-san,

After upgrading my good old rbtx4927 from v3.13-rc3 to v4.6-rc3, I
noticed the following warning:

	gpiod_direction_output_raw: invalid GPIO

This is caused by the following code in arch/mips/txx9/rbtx4927/setup.c:

	static void __init rbtx4927_mem_setup(void)
	{

		/* TX4927-SIO DTR on (PIO[15]) */
		gpio_request(15, "sio-dtr");

returns -EPROBE_DEFER

		gpio_direction_output(15, 1);

VALIDATE_DESC triggers the warning.

Note that as of commit 54d77198fdfbc4f0 ("gpio: bail out silently on
NULL descriptors") the warning message is no longer printed, but the
underlying issue is still there.

Nemoto-san pointed out that the GPIO setup may now be done too early,
and that indeed is the case.  Hence the following patch series postpones
GPIO setup from .mem_setup() time to .arch_init() time to fix it, for
all TXx9 platforms.

Changes since v1:
  - Add Acked-by.

This has been tested on RBTX4927 only.

Thanks!

Geert Uytterhoeven (2):
  MIPS: TXx9: tx39xx: Move GPIO setup from .mem_setup() to .arch_init()
  MIPS: TXx9: tx49xx: Move GPIO setup from .mem_setup() to .arch_init()

 arch/mips/txx9/generic/setup_tx3927.c |  1 -
 arch/mips/txx9/generic/setup_tx4927.c |  1 -
 arch/mips/txx9/generic/setup_tx4938.c |  1 -
 arch/mips/txx9/jmr3927/setup.c        | 11 +++++++++--
 arch/mips/txx9/rbtx4927/setup.c       | 32 ++++++++++++++++++++++----------
 arch/mips/txx9/rbtx4938/setup.c       |  1 +
 6 files changed, 32 insertions(+), 15 deletions(-)

-- 
1.9.1

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-09-11  8:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-11  8:48 [PATCH v2 0/2] MIPS: TXx9: Move GPIO setup from .mem_setup() to .arch_init() Geert Uytterhoeven
2016-09-11  8:48 ` [PATCH v2 1/2] MIPS: TXx9: tx39xx: " Geert Uytterhoeven
2016-09-11  8:48 ` [PATCH v2 2/2] MIPS: TXx9: tx49xx: " Geert Uytterhoeven

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).