public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Michael Welling <mwelling@ieee.org>,
	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, 07 May 2015 11:13:15 +0100	[thread overview]
Message-ID: <554B3ABB.7050306@kernel.org> (raw)
In-Reply-To: <1430930957-14588-1-git-send-email-mwelling@ieee.org>

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
> ---
> 
> 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,
> 


  reply	other threads:[~2015-05-07 23:33 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 [this message]
2015-05-07 23:48   ` Michael Welling
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=554B3ABB.7050306@kernel.org \
    --to=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=mwelling@ieee.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox