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]
Message-ID: <20150507234817.GA24969@deathray>
Date:	Thu, 7 May 2015 18:48:17 -0500
From:	Michael Welling <mwelling@...e.org>
To:	Jonathan Cameron <jic23@...nel.org>
Cc:	knaack.h@....de, lars@...afoo.de, pmeerw@...erw.net,
	san@...etechnology.dk, linux-kernel@...r.kernel.org,
	linux-iio@...r.kernel.org
Subject: Re: [PATCH v2] iio: mcp320x: Fix occasional incorrect readings

On Thu, May 07, 2015 at 11:13:15AM +0100, Jonathan Cameron wrote:
> On 06/05/15 17:49, Michael Welling wrote:
> > Without the cacheline alignment, the readings will occasionally incorrectly
> > return 0.
> > 
> > Signed-off-by: Michael Welling <mwelling@...e.org>
> Applied to the fixes-togreg branch of iio.git.  Not sure
> when I'll be able to push this out publicly as travelling
> / working nights and generally having a silly week.
> 
> J

Thanks.

Appearently code can be silly too:
https://lkml.org/lkml/2015/5/7/879

> > ---
> > 
> > v2: Moved buffers to the end of the mcp320x struct per suggestion to keep
> > them on their own cacheline.
> > 
> >  drivers/iio/adc/mcp320x.c |    6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> > 
> > diff --git a/drivers/iio/adc/mcp320x.c b/drivers/iio/adc/mcp320x.c
> > index efbfd12..8d9c9b9 100644
> > --- a/drivers/iio/adc/mcp320x.c
> > +++ b/drivers/iio/adc/mcp320x.c
> > @@ -60,12 +60,12 @@ struct mcp320x {
> >  	struct spi_message msg;
> >  	struct spi_transfer transfer[2];
> >  
> > -	u8 tx_buf;
> > -	u8 rx_buf[2];
> > -
> >  	struct regulator *reg;
> >  	struct mutex lock;
> >  	const struct mcp320x_chip_info *chip_info;
> > +
> > +	u8 tx_buf ____cacheline_aligned;
> > +	u8 rx_buf[2];
> >  };
> >  
> >  static int mcp320x_channel_to_tx_data(int device_index,
> > 
> 
--
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