[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <678F3D1BB717D949B966B68EAEB446ED1F1B7CD4@dggemm526-mbx.china.huawei.com>
Date: Mon, 12 Nov 2018 11:56:00 +0000
From: "Zengtao (B)" <prime.zeng@...ilicon.com>
To: Alan Stern <stern@...land.harvard.edu>
CC: "jejb@...ux.vnet.ibm.com" <jejb@...ux.vnet.ibm.com>,
"martin.petersen@...cle.com" <martin.petersen@...cle.com>,
"gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
"linux-scsi@...r.kernel.org" <linux-scsi@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>,
"usb-storage@...ts.one-eyed-alien.net"
<usb-storage@...ts.one-eyed-alien.net>
Subject: RE: scsi_set_medium_removal timeout issue
Hi Alan:
>-----Original Message-----
>From: Alan Stern [mailto:stern@...land.harvard.edu]
>Sent: Wednesday, October 31, 2018 10:20 PM
>To: Zengtao (B) <prime.zeng@...ilicon.com>
>Cc: jejb@...ux.vnet.ibm.com; martin.petersen@...cle.com;
>gregkh@...uxfoundation.org; linux-scsi@...r.kernel.org;
>linux-kernel@...r.kernel.org; linux-usb@...r.kernel.org;
>usb-storage@...ts.one-eyed-alien.net
>Subject: RE: scsi_set_medium_removal timeout issue
>
>On Wed, 31 Oct 2018, Zengtao (B) wrote:
>
>> Hi:
>>
>> >-----Original Message-----
>> >From: Alan Stern [mailto:stern@...land.harvard.edu]
>> >Sent: Tuesday, October 30, 2018 10:08 PM
>> >To: Zengtao (B) <prime.zeng@...ilicon.com>
>> >Cc: jejb@...ux.vnet.ibm.com; martin.petersen@...cle.com;
>> >gregkh@...uxfoundation.org; linux-scsi@...r.kernel.org;
>> >linux-kernel@...r.kernel.org; linux-usb@...r.kernel.org;
>> >usb-storage@...ts.one-eyed-alien.net
>> >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
>> >partition).
>> >> 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.
>> >> https://www.spinics.net/lists/linux-usb/msg53739.html
>> >>
>> >> For the issue itself, there is my observation:
>> >> In the step 4, the Host will issue an
>> >PREVENT_ALLOW_MEDIUM_REMOVAL scsi command.
>> >> and and timeout happens due to the device 's very slow
>> >fsg_lun_fsync_sub.
>> >
>> >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?
>
>Or it could be something else. Can you please post the dmesg log from
>the host, showing what happens when the device is first plugged in?
>
I have enabled the SCSI log for the host, please refer to the attachment.
Thanks.
Zengtao
View attachment "1940.txt" of type "text/plain" (59096 bytes)
Powered by blists - more mailing lists