Hot unplugging a device in the middle of a read
Adrian McMenamin
lkmladrian at gmail.com
Mon Jan 12 17:01:48 EST 2009
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
More information about the linux-mtd
mailing list