[lkml]   [2018]   [Oct]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRE: scsi_set_medium_removal timeout issue

>-----Original Message-----
>From: Alan Stern []
>Sent: Tuesday, October 30, 2018 10:08 PM
>To: Zengtao (B) <>
>Subject: Re: scsi_set_medium_removal timeout issue
>On Tue, 30 Oct 2018, Zengtao (B) wrote:
>> Hi
>> I have recently met a scsi_set_medium_removal timeout issue, and it's
>> related to both SCSI and USB MASS storage.
>> Since i am not an expert in either scsi or usb mass storage, i am
>> writing to report the issue and ask for a solution from you guys.
>> My test scenario is as follow:
>> 1.Linux HOST-----Linux mass storage gadget(the back store is a flash
>> 2.Host mount the device.
>> 3.Host writes some data to the Mass storage device.
>> 4.Host Unmount the device.
>> Both Linux kernels(Host and Device) are Linux 4.9.
>> Some has reported the same issue a long time ago, but it remains there.
>> For the issue itself, there is my observation:
>> In the step 4, the Host will issue an
>> and and timeout happens due to the device 's very slow
>Something is wrong here. Before sending PREVENT-ALLOW MEDIUM
>REMOVAL, the host should issue SYNCHRONIZE CACHE. This will force
>fsg_lun_fsync_sub to run, and the host should allow a long timeout for
>this command. Then when PREVENT-ALLOW MEDIUM REMOVAL is sent,
>nothing will need to be flushed.

Definitely, I haven't seen the SYNCHRONIZE CACHE from the host, it directly
issued the PREVENT-ALLOW MEDIUM REMOVAL, so maybe something wrong
with the scsi layer or something wrong with the mass storage class driver?


>Alan Stern
>> I found there are two methods to workaround the issue:
>> 1. Change the timeout value of host scsi command
>> PREVENT_ALLOW_MEDIUM_REMOVAL to to about 60 seconds from 10
>> 2. Remove the fsg_lun_fsync_sub in the device's Mass storage gadget
>> Thanks
>> Regards
>> zentao

 \ /
  Last update: 2018-10-31 03:35    [W:0.110 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site