lkml.org 
[lkml]   [2018]   [Sep]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH v2 2/4] spi: spi-fsl-dspi: Fix delete the processing of undefined bitmask for rxdata
Date


> -----Original Message-----
> From: Boris Brezillon <boris.brezillon@bootlin.com>
> Sent: 2018年9月30日 18:07
> To: Chuanhua Han <chuanhua.han@nxp.com>
> Cc: broonie@kernel.org; linux-spi@vger.kernel.org;
> linux-kernel@vger.kernel.org; eha@deif.com
> Subject: Re: [PATCH v2 2/4] spi: spi-fsl-dspi: Fix delete the processing of
> undefined bitmask for rxdata
>
> On Sun, 30 Sep 2018 17:25:33 +0800
> Chuanhua Han <chuanhua.han@nxp.com> wrote:
>
> > This patch fixes the problem of rxdata being equal to 0 during the
> > XSPI mode transfer of the dspi controller.
> > In XSPI mode, If it is not deleted, the value of rxdata will be equal
> > to 0, and the data received will not be received correctly, causing
> > the receiving transfer of the spi to fail.
> >
> > Signed-off-by: Chuanhua Han <chuanhua.han@nxp.com>
> > ---
> > Changes in v2:
> > -The original patch is divided into multiple patches(the original
> > patch theme is "spi: spi-fsl-dspi: Fix support for XSPI transport
> > mode"),one of which is segmented.
> >
> > drivers/spi/spi-fsl-dspi.c | 3 ---
> > 1 file changed, 3 deletions(-)
> >
> > diff --git a/drivers/spi/spi-fsl-dspi.c b/drivers/spi/spi-fsl-dspi.c
> > index 3082e72e4f6c..4dc1064bf408 100644
> > --- a/drivers/spi/spi-fsl-dspi.c
> > +++ b/drivers/spi/spi-fsl-dspi.c
> > @@ -243,9 +243,6 @@ static void dspi_push_rx(struct fsl_dspi *dspi, u32
> rxdata)
> > if (!dspi->rx)
> > return;
> >
> > - /* Mask of undefined bits */
> > - rxdata &= (1 << dspi->bits_per_word) - 1;
> > -
>
> Why not
In xspi mode, the value of rxdata after the statement is processed is equal to 0 no matter what data is received.
>
> if (dspi->bits_per_word)
> rxdata &= (1 << dspi->bits_per_word) - 1;
>
> > if (dspi->bytes_per_word == 1)
> > *(u8 *)dspi->rx = rxdata;
> > else if (dspi->bytes_per_word == 2)

\
 
 \ /
  Last update: 2018-09-30 12:11    [W:0.045 / U:0.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site