lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 6 Mar 2017 10:30:43 +0100
From:   Uwe Kleine-König 
        <u.kleine-koenig@...gutronix.de>
To:     Geert Uytterhoeven <geert@...ux-m68k.org>
Cc:     Richard Genoud <richard.genoud@...il.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Geert Uytterhoeven <geert+renesas@...der.be>,
        Nicolas Ferre <nicolas.ferre@...rochip.com>,
        Boris Brezillon <boris.brezillon@...e-electrons.com>,
        "linux-arm-kernel@...ts.infradead.org" 
        <linux-arm-kernel@...ts.infradead.org>,
        "linux-serial@...r.kernel.org" <linux-serial@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Janusz Uzycki <j.uzycki@...roma.com.pl>,
        "linux-gpio@...r.kernel.org" <linux-gpio@...r.kernel.org>
Subject: Re: [PATCH 4/4] tty/serial: sh-sci: remove uneeded IS_ERR_OR_NULL
 calls

Hello Geert,

On Mon, Mar 06, 2017 at 10:09:50AM +0100, Geert Uytterhoeven wrote:
> On Mon, Mar 6, 2017 at 9:58 AM, Uwe Kleine-König
> <u.kleine-koenig@...gutronix.de> wrote:
> > On Mon, Mar 06, 2017 at 09:49:39AM +0100, Geert Uytterhoeven wrote:
> >> > Given that mctrl-gpio can be useful on legacy platforms, a device could
> >> > silently run without cts-gpio even there.
> >>
> >> On platforms were CONFIG_GPIOLIB=n, this is not true, so the issue is moot.
> >>
> >> All serial drivers using (optional) mctrl-gpio have this in Kconfig:
> >>
> >>     select SERIAL_MCTRL_GPIO if GPIOLIB
> >>
> >> So they will use mctrl-gpio when GPIOLIB is enabled.
> >> If GPIOPLIB is disabled, no flow control GPIOs are expected, and the
> >> driver should not break that case.
> >
> > So it all boils down to the question: Is GPIOLIB=n enough to assume no
> > gpio is needed?
> >
> > I'd say it is not.
> 
> How does the platform register these GPIOs when GPIOPLIB is not enabled by
> the platform, and gpiod_add_lookup_table() is thus not available?

Obviously the platformcode cannot. In this case you could argue that
platformcode shouldn't register the device if a gpio is necessary. But
this reasoning doesn't work for (DT=y || ACPI=y) && GPIOLIB=n.

I wouldn't want to code this in each driver (something like:

	if (IS_ENABLED(GPIOLIB) || device_is_instantiated_by_dt(dev) || device_is_instantiated_by_acpi(dev))
		gpios = mctrl_gpio_init(...);
	else
		gpios = NULL;

). Putting this into GPIOLIB is the right approach, and so this is
another argument for HALFGPIOLIB. This would fix mctrl_gpio_init en
passant.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ