* Hot unplugging a device in the middle of a read
@ 2009-01-12 22:01 Adrian McMenamin
2009-01-13 21:18 ` Adrian McMenamin
0 siblings, 1 reply; 3+ messages in thread
From: Adrian McMenamin @ 2009-01-12 22:01 UTC (permalink / raw)
To: linux-mtd; +Cc: Adrian McMenamin
I am working on a map driver for the virtual memory unit (VMU) flash
on the SEGA Dreamcast. I have a specifc concurrency issue which maybe
somebody here could help with.
The VMUs are pluggable devices - users can just push them in and pull
them out when they like.
It would be a perverse way to behave but it does mean users can whack
the thing in and pull it out straight away.
With the block translation layer turned on this results in a crash -
how do I tell the mtd/translation/block layer that the device has
gone?
(The ouput below has some additional debug messages I have added)
[ 184.105630] mtdblock: read on "vmu1.1.0" at 0x7400, size 0x200
[ 184.122698] mtdblock: read on "vmu1.1.0" at 0x7600, size 0x200
[ 184.139001] mtdblock: read on "vmu1.1.0" at 0x7800, size 0x200
[ 184.156062] mtdblock: read on "vmu1.1.0" at 0x7a00, size 0x200
[ 184.172359] mtdblock: read on "vmu1.1.0" at 0x7c00, size 0x200
[ 184.189424] mtdblock: read on "vmu1.1.0" at 0x7e00, size 0x200
[ 184.206051] mtdblock: read on "vmu1.1.0" at 0x8000, size 0x200
[ 184.222790] mtdblock: read on "vmu1.1.0" at 0x8200, size 0x200
[ 184.239093] mtdblock: read on "vmu1.1.0" at 0x8400, size 0x200
[ 184.256158] mtdblock: read on "vmu1.1.0" at 0x8600, size 0x200
[ 184.268478] Maple bus device detaching at (1, 1) busy is 1
[ 184.275221] In vmu_disconnect
[ 184.277538] Removing MTD device #0 (vmu1.1.0) with use count 1
[ 184.302421] releasing device at (1, 1) and address 0x8C8B1980 with
queue at 0x8C5C8180
[ 185.570107] end_request: I/O error, dev mtdblock0, sector 64
[ 185.575136] Buffer I/O error on device mtdblock0, logical block 8
[ 185.584332] Unable to handle kernel paging request at virtual
address 6b6b6b6b
[ 185.590955] pc = 8c1511e8
[ 185.593649] *pde = 00000000
[ 185.596531] Oops: 0000 [#1]
[ 185.599395] Modules linked in:
[ 185.602626]
[ 185.604072] Pid : 824, Comm: mtdblockd
[ 185.608210] CPU : 0 Not tainted
(2.6.28-06142-ga079e18-dirty #188)
[ 185.608240]
[ 185.617027] PC is at strnlen+0x8/0x60
[ 185.620791] PR is at string+0x2e/0xc0
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Hot unplugging a device in the middle of a read
2009-01-12 22:01 Hot unplugging a device in the middle of a read Adrian McMenamin
@ 2009-01-13 21:18 ` Adrian McMenamin
2009-01-14 0:52 ` Adrian McMenamin
0 siblings, 1 reply; 3+ messages in thread
From: Adrian McMenamin @ 2009-01-13 21:18 UTC (permalink / raw)
To: linux-mtd; +Cc: Adrian McMenamin
2009/1/12 Adrian McMenamin <lkmladrian@gmail.com>:
> I am working on a map driver for the virtual memory unit (VMU) flash
> [ 184.277538] Removing MTD device #0 (vmu1.1.0) with use count 1
Having looked through the sources I can see that this is indicating
there is an additional user in play - because when I pull the VMU out
when not in the middle of the initial reads I don't get this message
(as use count is obviously 0) even though the code path is the same.
Can I just put in an extra 'put'? Or is there some other way of doing this?
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Hot unplugging a device in the middle of a read
2009-01-13 21:18 ` Adrian McMenamin
@ 2009-01-14 0:52 ` Adrian McMenamin
0 siblings, 0 replies; 3+ messages in thread
From: Adrian McMenamin @ 2009-01-14 0:52 UTC (permalink / raw)
To: linux-mtd; +Cc: Adrian McMenamin
2009/1/13 Adrian McMenamin <lkmladrian@gmail.com>:
> 2009/1/12 Adrian McMenamin <lkmladrian@gmail.com>:
>> I am working on a map driver for the virtual memory unit (VMU) flash
>
>> [ 184.277538] Removing MTD device #0 (vmu1.1.0) with use count 1
>
> Having looked through the sources I can see that this is indicating
> there is an additional user in play - because when I pull the VMU out
> when not in the middle of the initial reads I don't get this message
> (as use count is obviously 0) even though the code path is the same.
>
> Can I just put in an extra 'put'? Or is there some other way of doing this?
>
For the sake of completeness for those searching on google - I wrote a
function that checks if the usecount > 0, if it is, then I just have
to live with the block read errors but I don't crash the system
because I don't delete the mtd_info
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-01-14 0:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-12 22:01 Hot unplugging a device in the middle of a read Adrian McMenamin
2009-01-13 21:18 ` Adrian McMenamin
2009-01-14 0:52 ` Adrian McMenamin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox