linux-mmc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* mmc: Huge delay is seen when SD card is removed while transferring large media file
@ 2010-11-17 14:38 Sujit Reddy
  2010-11-17 16:56 ` Chris Ball
  0 siblings, 1 reply; 2+ messages in thread
From: Sujit Reddy @ 2010-11-17 14:38 UTC (permalink / raw)
  To: linux-mmc

Hi,

Scenario: After SD card is inserted and partitions are mounted, start
transferring a large media file (for ex: 200MB) to SD. Remove the card
in between.

Problem: There is a huge delay of ~20secs when the user get notified
about the card removal. This delay depends on the size of the file to
be transferred.

dmesg shows continuous I/O errors even after card removal notification
(card xxxx removed in MMC layer)

==============================
[ 3182.791614] mmcblk0: error -123 sending status comand
[ 3182.791619] mmcblk0: error -123 sending read/write command,
response 0x0, card status 0x0
[ 3182.803637] mmcblk0: error -123 requesting status
[ 3182.805658] end_request: I/O error, dev mmcblk0, sector 1527146
[ 3182.805665] end_request: I/O error, dev mmcblk0, sector 1527154
[ 3182.805670] end_request: I/O error, dev mmcblk0, sector 1527162
[ 3182.805675] end_request: I/O error, dev mmcblk0, sector 1527170
[ 3182.805680] end_request: I/O error, dev mmcblk0, sector 1527178
[ 3182.805684] end_request: I/O error, dev mmcblk0, sector 1527186
[ 3182.805689] end_request: I/O error, dev mmcblk0, sector 1527194
[ 3182.805694] end_request: I/O error, dev mmcblk0, sector 1527202
[ 3182.805699] end_request: I/O error, dev mmcblk0, sector 1527210
[ 3182.805704] end_request: I/O error, dev mmcblk0, sector 1527218
[ 3182.805708] end_request: I/O error, dev mmcblk0, sector 1527226
[ 3182.805713] end_request: I/O error, dev mmcblk0, sector 1527234
[ 3182.805717] end_request: I/O error, dev mmcblk0, sector 1527242
[ 3182.805722] end_request: I/O error, dev mmcblk0, sector 1527250
[ 3182.805727] end_request: I/O error, dev mmcblk0, sector 1527258
[ 3182.805731] end_request: I/O error, dev mmcblk0, sector 1527266
====================================

I have observed that del_gendisk() called in mmc_blk_remove() to stop
new requests getting into the queue contributes much to the delay.
While flushing the requests there are still requests coming to process
(which fail as there is no card hence these errors). Isn't there any
notifier mechanism for VFS to know when the card is removed and as
soon as this card is removed new requests are flushed immediately
without any delay.

BTW I am using 2.6.35 kernel version and formatted the SD card with
FAT (also tried with ext3 but not much of difference seen). Card
insertion and removal is interrupt based.

Thanks
Sujit

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

* Re: mmc: Huge delay is seen when SD card is removed while transferring large media file
  2010-11-17 14:38 mmc: Huge delay is seen when SD card is removed while transferring large media file Sujit Reddy
@ 2010-11-17 16:56 ` Chris Ball
  0 siblings, 0 replies; 2+ messages in thread
From: Chris Ball @ 2010-11-17 16:56 UTC (permalink / raw)
  To: Sujit Reddy; +Cc: linux-mmc

Hi Sujit,

On Wed, Nov 17, 2010 at 08:08:38PM +0530, Sujit Reddy wrote:
> Problem: There is a huge delay of ~20secs when the user get notified
> about the card removal. This delay depends on the size of the file to
> be transferred.
> 
> dmesg shows continuous I/O errors even after card removal notification
> (card xxxx removed in MMC layer)

You're right, we're not handling the card removal case as quickly as we
should.  We talked about this recently:

http://thread.gmane.org/gmane.linux.kernel.mmc/2714/focus=3474

I'll add implementing Adrian's suggestion there to my workqueue.

Thanks,

-- 
Chris Ball   <cjb@laptop.org>   <http://printf.net/>
One Laptop Per Child

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

end of thread, other threads:[~2010-11-17 16:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-17 14:38 mmc: Huge delay is seen when SD card is removed while transferring large media file Sujit Reddy
2010-11-17 16:56 ` Chris Ball

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