Message ID | 20161017221355.1861551-5-arnd@arndb.de (mailing list archive) |
---|---|
State | Accepted |
Commit | 5c0ba57744b1422d528f19430dd66d6803cea86f |
Headers | show |
On Tue, Oct 18, 2016 at 12:13:38AM +0200, Arnd Bergmann wrote: > When we get a spurious interrupt in fsl_espi_irq, we end up > processing four uninitalized bytes of data, as shown in this > warning message: This doesn't apply against current code, please check and resend.
Am 24.10.2016 um 19:27 schrieb Mark Brown: > On Tue, Oct 18, 2016 at 12:13:38AM +0200, Arnd Bergmann wrote: >> When we get a spurious interrupt in fsl_espi_irq, we end up >> processing four uninitalized bytes of data, as shown in this >> warning message: > > This doesn't apply against current code, please check and resend. > The not yet reviewed part of my patch series from Oct 2nd, namely "[PATCH 07/11] spi: fsl-espi: fix and improve reading from RX FIFO" replaces the code in question. There's more to fix like removing polling from the ISR. If you prefer to apply Arnd's fix first I'd rebase the open part of the patch series and resend it. -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Mon, Oct 24, 2016 at 08:36:37PM +0200, Heiner Kallweit wrote: > Am 24.10.2016 um 19:27 schrieb Mark Brown: > > This doesn't apply against current code, please check and resend. > The not yet reviewed part of my patch series from Oct 2nd, > namely "[PATCH 07/11] spi: fsl-espi: fix and improve reading > from RX FIFO" replaces the code in question. > There's more to fix like removing polling from the ISR. > If you prefer to apply Arnd's fix first I'd rebase the open part > of the patch series and resend it. If there are dependencies you should mention them when you resend (in general you should always mention any unapplied or cross tree dependencies when sending things).
On Monday, October 24, 2016 7:45:43 PM CEST Mark Brown wrote: > On Mon, Oct 24, 2016 at 08:36:37PM +0200, Heiner Kallweit wrote: > > Am 24.10.2016 um 19:27 schrieb Mark Brown: > > > > This doesn't apply against current code, please check and resend. > > > The not yet reviewed part of my patch series from Oct 2nd, > > namely "[PATCH 07/11] spi: fsl-espi: fix and improve reading > > from RX FIFO" replaces the code in question. > > There's more to fix like removing polling from the ISR. > > If you prefer to apply Arnd's fix first I'd rebase the open part > > of the patch series and resend it. > > If there are dependencies you should mention them when you resend (in > general you should always mention any unapplied or cross tree > dependencies when sending things). I think my patch (the version I sent) should ideally make it into v4.9 as a bugfix. This was the powerpc warning I saw from Olof's autobuilder with the -Wmaybe-uninitialized warning added back, and it's one of the actual bugs I found (though rather unlikely to hit in practice). Merging with Heiner's patches should be trivial, and I'm pretty sure we want the patch either way. Not sure if we need a backport, it was introduced earlier this year in commit 6319a68011b8 ("spi/fsl-espi: avoid infinite loops on fsl_espi_cpu_irq()") as I now found. Arnd -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Mon, Oct 24, 2016 at 10:37:53PM +0200, Arnd Bergmann wrote: > I think my patch (the version I sent) should ideally make it into > v4.9 as a bugfix. This was the powerpc warning I saw from Olof's > autobuilder with the -Wmaybe-uninitialized warning added back, and > it's one of the actual bugs I found (though rather unlikely > to hit in practice). > Merging with Heiner's patches should be trivial, and I'm pretty > sure we want the patch either way. Not sure if we need a backport, > it was introduced earlier this year in commit 6319a68011b8 > ("spi/fsl-espi: avoid infinite loops on fsl_espi_cpu_irq()") as > I now found. Sorry but I've lost track of which patches are being talked about here. If there's stuff for v4.9 can you send me a version that applies on Linus' tree and I'll merge that up into what's applied for -next?
On Tuesday, October 25, 2016 8:13:09 PM CEST Mark Brown wrote: > > Not enough information to check signature validity. Show Details > On Mon, Oct 24, 2016 at 10:37:53PM +0200, Arnd Bergmann wrote: > > > I think my patch (the version I sent) should ideally make it into > > v4.9 as a bugfix. This was the powerpc warning I saw from Olof's > > autobuilder with the -Wmaybe-uninitialized warning added back, and > > it's one of the actual bugs I found (though rather unlikely > > to hit in practice). > > > Merging with Heiner's patches should be trivial, and I'm pretty > > sure we want the patch either way. Not sure if we need a backport, > > it was introduced earlier this year in commit 6319a68011b8 > > ("spi/fsl-espi: avoid infinite loops on fsl_espi_cpu_irq()") as > > I now found. > > Sorry but I've lost track of which patches are being talked about here. > If there's stuff for v4.9 can you send me a version that applies on > Linus' tree and I'll merge that up into what's applied for -next? > Done. Arnd -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/drivers/spi/spi-fsl-espi.c b/drivers/spi/spi-fsl-espi.c index 7451585..2c175b9 100644 --- a/drivers/spi/spi-fsl-espi.c +++ b/drivers/spi/spi-fsl-espi.c @@ -458,7 +458,7 @@ static void fsl_espi_cpu_irq(struct mpc8xxx_spi *mspi, u32 events) mspi->len -= rx_nr_bytes; - if (mspi->rx) + if (rx_nr_bytes && mspi->rx) mspi->get_rx(rx_data, mspi); }
When we get a spurious interrupt in fsl_espi_irq, we end up processing four uninitalized bytes of data, as shown in this warning message: drivers/spi/spi-fsl-espi.c: In function 'fsl_espi_irq': drivers/spi/spi-fsl-espi.c:462:4: warning: 'rx_data' may be used uninitialized in this function [-Wmaybe-uninitialized] This adds another check so we skip the data in this case. Signed-off-by: Arnd Bergmann <arnd@arndb.de> --- drivers/spi/spi-fsl-espi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)