* [PATCH] spi: dw-pci: fix bug when regs left uninitialized
@ 2014-08-27 13:21 Andy Shevchenko
2014-08-27 14:46 ` Mark Brown
0 siblings, 1 reply; 3+ messages in thread
From: Andy Shevchenko @ 2014-08-27 13:21 UTC (permalink / raw)
To: Baruch Siach, Mark Brown, linux-spi-u79uwXL29TY76Z2rM5mHXA
Cc: Andy Shevchenko, stable-u79uwXL29TY76Z2rM5mHXA
The commit 04f421e7 "spi: dw: use managed resources" changes drivers to use
managed functions, but seems wasn't properly tested in PCI case. The regs field
of struct dw_spi left uninitialized. Thus, kernel crashes when tries to access
to the SPI controller registers. This patch fixes the issue.
Signed-off-by: Andy Shevchenko <andriy.shevchenko-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
Cc: <stable-u79uwXL29TY76Z2rM5mHXA@public.gmane.org> # v3.14+
---
drivers/spi/spi-dw-pci.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/spi/spi-dw-pci.c b/drivers/spi/spi-dw-pci.c
index e203d8f..473bd52 100644
--- a/drivers/spi/spi-dw-pci.c
+++ b/drivers/spi/spi-dw-pci.c
@@ -59,6 +59,8 @@ static int spi_pci_probe(struct pci_dev *pdev,
if (ret)
return ret;
+ dws->regs = pcim_iomap_table(pdev)[pci_bar];
+
dws->bus_num = 0;
dws->num_cs = 4;
dws->irq = pdev->irq;
--
2.1.0
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] spi: dw-pci: fix bug when regs left uninitialized
2014-08-27 13:21 [PATCH] spi: dw-pci: fix bug when regs left uninitialized Andy Shevchenko
@ 2014-08-27 14:46 ` Mark Brown
[not found] ` <20140827144608.GE17528-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Mark Brown @ 2014-08-27 14:46 UTC (permalink / raw)
To: Andy Shevchenko; +Cc: Baruch Siach, linux-spi, stable
[-- Attachment #1: Type: text/plain, Size: 482 bytes --]
On Wed, Aug 27, 2014 at 04:21:12PM +0300, Andy Shevchenko wrote:
> The commit 04f421e7 "spi: dw: use managed resources" changes drivers to use
> managed functions, but seems wasn't properly tested in PCI case. The regs field
> of struct dw_spi left uninitialized. Thus, kernel crashes when tries to access
> to the SPI controller registers. This patch fixes the issue.
Applied. Please use the Fixes: tag and use a minimum of 12 characters
for the commit ID (to avoid collisions).
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] spi: dw-pci: fix bug when regs left uninitialized
[not found] ` <20140827144608.GE17528-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
@ 2014-08-27 14:53 ` Andy Shevchenko
0 siblings, 0 replies; 3+ messages in thread
From: Andy Shevchenko @ 2014-08-27 14:53 UTC (permalink / raw)
To: Mark Brown
Cc: Baruch Siach, linux-spi-u79uwXL29TY76Z2rM5mHXA,
stable-u79uwXL29TY76Z2rM5mHXA
On Wed, 2014-08-27 at 15:46 +0100, Mark Brown wrote:
> On Wed, Aug 27, 2014 at 04:21:12PM +0300, Andy Shevchenko wrote:
> > The commit 04f421e7 "spi: dw: use managed resources" changes drivers to use
> > managed functions, but seems wasn't properly tested in PCI case. The regs field
> > of struct dw_spi left uninitialized. Thus, kernel crashes when tries to access
> > to the SPI controller registers. This patch fixes the issue.
>
> Applied. Please use the Fixes: tag and use a minimum of 12 characters
> for the commit ID (to avoid collisions).
Noted, thank you!
--
Andy Shevchenko <andriy.shevchenko-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Intel Finland Oy
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-08-27 14:53 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-27 13:21 [PATCH] spi: dw-pci: fix bug when regs left uninitialized Andy Shevchenko
2014-08-27 14:46 ` Mark Brown
[not found] ` <20140827144608.GE17528-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2014-08-27 14:53 ` Andy Shevchenko
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).