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, 20 Feb 2012 22:42:04 +0100
From:	Linus Walleij <linus.walleij@...aro.org>
To:	Stephen Warren <swarren@...dia.com>
Cc:	Linus Walleij <linus.walleij@...ricsson.com>, B29396@...escale.com,
	s.hauer@...gutronix.de, dongas86@...il.com, shawn.guo@...aro.org,
	thomas.abraham@...aro.org, tony@...mide.com,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 08/20] pinctrl: Assume map table entries can't have a NULL
 name field

On Mon, Feb 20, 2012 at 7:45 AM, Stephen Warren <swarren@...dia.com> wrote:

> pinctrl_register_mappings() already requires that every mapping table
> entry have a non-NULL name field.
>
> Logically, this makes sense too; drivers should always request a specific
> named state so they know what they're getting. Relying on getting the
> first mentioned state in the mapping table is error-prone, and a nasty
> special case to implement, given that a given the mapping table may define
> multiple states for a device.
>
> Update a few places in the code and documentation that still allowed for
> NULL name fields.
>
> Signed-off-by: Stephen Warren <swarren@...dia.com>

This causes a regression on U300 and most certainly on the Sirf Prima II
as well. The U300 can be fixed up as per below:

diff --git a/arch/arm/mach-u300/core.c b/arch/arm/mach-u300/core.c
index bb1034f..66555d7 100644
--- a/arch/arm/mach-u300/core.c
+++ b/arch/arm/mach-u300/core.c
@@ -1645,7 +1645,7 @@ static int __init u300_pinctrl_fetch(void)
                struct pinctrl *p;
                int ret;

-               p = pinctrl_get(u300_mux_hogs[i].dev, NULL);
+               p = pinctrl_get(u300_mux_hogs[i].dev, u300_mux_hogs[i].name);
                if (IS_ERR(p)) {
                        pr_err("u300: could not get pinmux hog %s\n",
                               u300_mux_hogs[i].name);


The drivers/tty/serial/sirfsoc_uart.c asks for it's UART pinctrl like
this:

sirfport->p = pinctrl_get(&pdev->dev, NULL);

I don't know quite what to encode in there, if "deafult" is sensible
we might just

#define PIN_MAP_NAME_DEFAULT "default"
In <linux/pinctrl/consumer.h> and <linux/pinctrl/machine.h> alike,
maybe in some <linux/pinctrl/mapnames.h> that both of these
include?

the have the driver ask for:

sirfport->p = pinctrl_get(&pdev->dev, PIN_MAP_NAME_DEFAULT);

(Similar changes can be done for U300, naming all its map
"default".)

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ