linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] spi/spi: don't release the spi device twice
@ 2010-11-22 13:35 Sebastian Andrzej Siewior
       [not found] ` <20101122133503.GA25553-Hfxr4Dq0UpYb1SvskN2V4Q@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: Sebastian Andrzej Siewior @ 2010-11-22 13:35 UTC (permalink / raw)
  To: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
  Cc: dirk.brandewie-Re5JQEeQqe8AvxtiuMwx3w, David Brownell

While rmmoding pxa2xx_spi I hit:

|BUG: unable to handle kernel paging request at 6b6b6b9b
|IP: [<c115bf61>] device_del+0x11/0x140
|Call Trace:
| [<c115c09b>] ? device_unregister+0xb/0x20
| [<c118fe33>] ? spi_unregister_master+0x93/0xc0
| [<f806c554>] ? pxa2xx_spi_remove+0x84/0xc0 [pxa2xx_spi]

According to my debug printks, the loop

| dummy = device_for_each_child(master->dev.parent, &master->dev,
| 		__unregister);

calls __unregister for all childs of spi devicee (spidev in my case) and
the spi device itself. So calling device_unregister() for the device
itself leads to trouble.
This seems to be comming from  3486008 aka ("spi: free children in
spi_unregister_master, not siblings") so therefore I cc stable for v36.

Cc: <stable-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> # .36.x
Signed-off-by: Sebastian Andrzej Siewior <bigeasy-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>
---
This is on v2.6.37-rc1. Unless this got fixed somewhere else in the
meantime it is still there.

 drivers/spi/spi.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index 709c836..3c8ff6f 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -586,7 +586,6 @@ void spi_unregister_master(struct spi_master *master)
 
 	dummy = device_for_each_child(master->dev.parent, &master->dev,
 					__unregister);
-	device_unregister(&master->dev);
 }
 EXPORT_SYMBOL_GPL(spi_unregister_master);
 
-- 
1.7.3.2


------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2010-12-09 16:06 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-22 13:35 [PATCH] spi/spi: don't release the spi device twice Sebastian Andrzej Siewior
     [not found] ` <20101122133503.GA25553-Hfxr4Dq0UpYb1SvskN2V4Q@public.gmane.org>
2010-11-23  0:43   ` David Lamparter
     [not found]     ` <20101123004301.GA1034746-sd4rSCkhOesKVZNVnti56SRbHCANfdcW@public.gmane.org>
2010-11-23 10:33       ` Sebastian Andrzej Siewior
     [not found]         ` <4CEB985F.90805-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>
2010-11-23 14:24           ` Feng Tang
2010-11-23 14:59             ` [PATCH v2] " Sebastian Andrzej Siewior
     [not found]               ` <20101123145910.GA23880-Hfxr4Dq0UpYb1SvskN2V4Q@public.gmane.org>
2010-11-23 16:45                 ` David Lamparter
     [not found]                   ` <20101123164520.GA1384937-sd4rSCkhOesKVZNVnti56SRbHCANfdcW@public.gmane.org>
2010-11-24  7:59                     ` Feng Tang
2010-12-09 16:06                 ` [v2] " Sebastian Andrzej Siewior

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).