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:	Sat, 30 Nov 2013 09:07:01 -0800
From:	Tony Lindgren <tony@...mide.com>
To:	Peter Ujfalusi <peter.ujfalusi@...com>
Cc:	Tomi Valkeinen <tomi.valkeinen@...com>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/3] pinctrl: single: fix pcs_disable with bits_per_mux

* Peter Ujfalusi <peter.ujfalusi@...com> [131128 04:01]:
> On 11/28/2013 01:29 PM, Tomi Valkeinen wrote:
> > pcs_enable() uses vals->mask instead of pcs->fmask when bits_per_mux is
> > enabled. However, pcs_disable() always uses pcs->fmask.
> > 
> > Fix pcs_disable() to use vals->mask with bits_per_mux.
> 
> I wonder how did I missed this?

Probably because the disable can be a nop for some hardware.

> Acked-by: Peter Ujfalusi <peter.ujfalusi@...com>

Acked-by: Tony Lindgren <tony@...mide.com>
 
 
> > Signed-off-by: Tomi Valkeinen <tomi.valkeinen@...com>
> > ---
> >  drivers/pinctrl/pinctrl-single.c | 10 ++++++++--
> >  1 file changed, 8 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/pinctrl/pinctrl-single.c b/drivers/pinctrl/pinctrl-single.c
> > index 829b98c5c66f..174f4c50cd77 100644
> > --- a/drivers/pinctrl/pinctrl-single.c
> > +++ b/drivers/pinctrl/pinctrl-single.c
> > @@ -525,12 +525,18 @@ static void pcs_disable(struct pinctrl_dev *pctldev, unsigned fselector,
> >  	for (i = 0; i < func->nvals; i++) {
> >  		struct pcs_func_vals *vals;
> >  		unsigned long flags;
> > -		unsigned val;
> > +		unsigned val, mask;
> >  
> >  		vals = &func->vals[i];
> >  		raw_spin_lock_irqsave(&pcs->lock, flags);
> >  		val = pcs->read(vals->reg);
> > -		val &= ~pcs->fmask;
> > +
> > +		if (pcs->bits_per_mux)
> > +			mask = vals->mask;
> > +		else
> > +			mask = pcs->fmask;
> > +
> > +		val &= ~mask;
> >  		val |= pcs->foff << pcs->fshift;
> >  		pcs->write(val, vals->reg);
> >  		raw_spin_unlock_irqrestore(&pcs->lock, flags);
> > 
> 
> 
> -- 
> Péter
--
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