From: Michael Welling <mwelling@ieee.org>
To: Jonathan Cameron <jic23@kernel.org>
Cc: knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net,
san@rosetechnology.dk, linux-kernel@vger.kernel.org,
linux-iio@vger.kernel.org
Subject: Re: [PATCH v2] iio: mcp320x: Fix occasional incorrect readings
Date: Thu, 7 May 2015 18:48:17 -0500 [thread overview]
Message-ID: <20150507234817.GA24969@deathray> (raw)
In-Reply-To: <554B3ABB.7050306@kernel.org>
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@ieee.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,
> >
>
next prev parent reply other threads:[~2015-05-07 23:48 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-06 16:49 [PATCH v2] iio: mcp320x: Fix occasional incorrect readings Michael Welling
2015-05-07 10:13 ` Jonathan Cameron
2015-05-07 23:48 ` Michael Welling [this message]
2015-05-08 10:54 ` jic23
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150507234817.GA24969@deathray \
--to=mwelling@ieee.org \
--cc=jic23@kernel.org \
--cc=knaack.h@gmx.de \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pmeerw@pmeerw.net \
--cc=san@rosetechnology.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.