[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200607200910.GA13138@amd>
Date: Sun, 7 Jun 2020 22:09:11 +0200
From: Pavel Machek <pavel@...x.de>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: linux-kernel@...r.kernel.org, stable@...r.kernel.org,
fengsheng <fengsheng5@...wei.com>,
Xinwei Kong <kong.kongxinwei@...ilicon.com>,
Mark Brown <broonie@...nel.org>,
Sasha Levin <sashal@...nel.org>
Subject: Re: [PATCH 4.19 15/28] spi: dw: use "smp_mb()" to avoid sending spi
data error
Hi!
> Because of out-of-order execution about some CPU architecture,
> In this debug stage we find Completing spi interrupt enable ->
> prodrucing TXEI interrupt -> running "interrupt_transfer" function
> will prior to set "dw->rx and dws->rx_end" data, so this patch add
> memory barrier to enable dw->rx and dw->rx_end to be visible and
> solve to send SPI data error.
So, this is apparently CPU-vs-device issue...
> +++ b/drivers/spi/spi-dw.c
> @@ -304,6 +304,9 @@ static int dw_spi_transfer_one(struct spi_controller *master,
> dws->len = transfer->len;
> spin_unlock_irqrestore(&dws->buf_lock, flags);
>
> + /* Ensure dw->rx and dw->rx_end are visible */
> + smp_mb();
> +
But we use SMP-only memory barrier, thus the bug will still be there
in single-processor configurations. Should this be mb()?
Best regards,
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
Download attachment "signature.asc" of type "application/pgp-signature" (182 bytes)
Powered by blists - more mailing lists