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:	Sun, 2 Nov 2014 12:20:41 -0800
From:	Sören Brinkmann <soren.brinkmann@...inx.com>
To:	Linus Walleij <linus.walleij@...aro.org>
CC:	Michal Simek <michal.simek@...inx.com>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"linux-arm-kernel@...ts.infradead.org" 
	<linux-arm-kernel@...ts.infradead.org>,
	Steffen Trumtrar <s.trumtrar@...gutronix.de>
Subject: Re: [PATCH RFC v2 8/8] ARM: zynq: DT: Add pinctrl information

On Fri, 2014-10-31 at 10:40AM -0700, Sören Brinkmann wrote:
> On Fri, 2014-10-31 at 06:36PM +0100, Linus Walleij wrote:
> > On Fri, Oct 31, 2014 at 5:57 PM, Sören Brinkmann
> > <soren.brinkmann@...inx.com> wrote:
> > > On Fri, 2014-10-31 at 09:17AM +0100, Linus Walleij wrote:
> > 
> > >> Again it seems to be a sequencing problem. And device tree is
> > >> not good at sequences, therefore all states should be self-contained.
> > >
> > > I agree, but how would I define a pin with pull-up enabled and
> > > tri-state disabled - assume the pin is currently in a random state that
> > > can have those things set/not set arbitrarily.
> > 
> > I was more thinking as everything you don't enable explicitly
> > in a state is per definition disabled.
> > 
> > So if you are in state A and tri-state is enabled there and you
> > move to state B where pull-up is enabled, then tri-state should
> > be disabled, since it is not explicitly enabled.
> > 
> > > I can't put bias-disable in DT since it would potentially disable both
> > > and the pull-up enable would have only a transient effect.
> > 
> > Well look at the callback from the core:
> > 
> >         int (*pin_config_set) (struct pinctrl_dev *pctldev,
> >                                unsigned pin,
> >                                unsigned long *configs,
> >                                unsigned num_configs);
> > 
> > You get all configs in an array. The driver can walk over the list and
> > make informed decisions on what to do *BEFORE* poking any registers.
> > 
> > Avoiding transients as you describe is part of why the callback
> > looks as it does. This is why every driver has its own for-loop.
> 
> Okay, I guess that is possible. I find usage of the arguments more
> elegant since it is more explicit and reduces code in the driver, but I
> suspect it should work.

It does work with some limitation though.
This was how I originally described a state in DT:
	pinctrl_uart1_default: pinctrl-uart1-default {
		common {
			groups = "uart1_10_grp";
			function = "uart1";
			bias-pull-up = <0>;
			slew-rate = <0>;
			io-standard = <1>;
		};
	
		rx {
			pins = "MIO49";
			bias-high-impedance = <1>;
		};
	
		tx {
			pins = "MIO48";
			bias-high-impedance = <0>;
		};
	};

Now, I removed the arguments for tri-state and pull-up. The problem,
this state is handled per-sub-node. I.e. one call to the cfg-set
callback per node. I.e. I cannot split things in common, rx and tx, but
I need to duplicate the pinconf props in rx and tx, resulting in:
	pinctrl_uart1_default: pinctrl-uart1-default {
		common {
			groups = "uart1_10_grp";
			function = "uart1";
		};

		rx {
			pins = "MIO49";
			slew-rate = <0>;
			io-standard = <1>;
			bias-high-impedance;
		};

		tx {
			pins = "MIO48";
			slew-rate = <0>;
			io-standard = <1>;
		};
	};

In a nutshell, yes, it's possible to work without the arguments for
pull-up or tri-state. But it adds complexity in the driver and the DT
description.

	Sören
--
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