From: Matthias Schwarzott <zzam@gentoo.org>
To: linux-usb@vger.kernel.org, usb-storage@lists.one-eyed-alien.net
Cc: hirofumi@mail.parknet.co.jp
Subject: Amazon Kindle disconnect after Synchronize Cache
Date: Fri, 5 Mar 2021 17:54:43 +0100 [thread overview]
Message-ID: <9f57532f-1fb7-0fdd-b91c-2dfecef5aff3@gentoo.org> (raw)
Hi folks,
I have an issue with my Amazon Kindle. Since some time the device
disconnects 2 seconds after a sync command sent via USB.
See also this matching bug report:
https://bugzilla.kernel.org/show_bug.cgi?id=203973
My current workaround is this udev-rule:
SUBSYSTEM=="block", ACTION=="add", ENV{DEVTYPE}=="disk",
ENV{ID_VENDOR}=="Kindle", RUN+="/bin/bash -c 'echo write\ through >
/sys/block/%k/queue/write_cache'"
But I like to find a proper solution.
I did various recordings of usb-traffic with wireshark on linux and windows.
On windows, the device does not disconnect after the "Synchronize Cache"
command.
One major difference I noticed looking at service answer time statistics:
Windows sends a lot more requests of type "Test Unit Ready".
* Windows: 6385 calls
* linux: 71 calls
After most of the "Synchronize Cache" commands on windows there was
directly a following "WRITE" command. It seems WRITE commands avoid the
disconnect.
But sending a plain "Synchronize Cache" under windows (8.1 and 10) does
not trigger the disconnect.
Windows:
1583 14.891478 host 1.6.1 USBMS 58 SCSI: Synchronize Cache(10) LUN: 0x00
(LBA: 0x00000000, Len: 0)
1584 14.891595 1.6.1 host USB 27 URB_BULK out
1585 14.891613 host 1.6.1 USB 27 URB_BULK in
1586 14.896866 1.6.1 host USBMS 40 SCSI: Response LUN: 0x00 (Synchronize
Cache(10)) (Good)
1589 15.687209 host 1.6.1 USBMS 58 SCSI: Test Unit Ready LUN: 0x00
1590 15.687353 1.6.1 host USB 27 URB_BULK out
1591 15.687358 host 1.6.1 USB 27 URB_BULK in
1592 15.687405 1.6.1 host USBMS 40 SCSI: Response LUN: 0x00 (Test Unit
Ready) (Good)
1713 16.699689 host 1.6.1 USBMS 58 SCSI: Test Unit Ready LUN: 0x00
1714 16.699820 1.6.1 host USB 27 URB_BULK out
1715 16.699825 host 1.6.1 USB 27 URB_BULK in
1716 16.699915 1.6.1 host USBMS 40 SCSI: Response LUN: 0x00 (Test Unit
Ready) (Good)
1717 17.709334 host 1.6.1 USBMS 58 SCSI: Test Unit Ready LUN: 0x00
1718 17.709547 1.6.1 host USB 27 URB_BULK out
1719 17.709552 host 1.6.1 USB 27 URB_BULK in
1720 17.709586 1.6.1 host USBMS 40 SCSI: Response LUN: 0x00 (Test Unit
Ready) (Good)
1721 18.712864 host 1.6.1 USBMS 58 SCSI: Test Unit Ready LUN: 0x00
1722 18.713081 1.6.1 host USB 27 URB_BULK out
1723 18.713086 host 1.6.1 USB 27 URB_BULK in
1724 18.713148 1.6.1 host USBMS 40 SCSI: Response LUN: 0x00 (Test Unit
Ready) (Good)
1741 19.735245 host 1.6.1 USBMS 58 SCSI: Test Unit Ready LUN: 0x00
1742 19.735410 1.6.1 host USB 27 URB_BULK out
1743 19.735415 host 1.6.1 USB 27 URB_BULK in
1744 19.735474 1.6.1 host USBMS 40 SCSI: Response LUN: 0x00 (Test Unit
Ready) (Good)
1811 20.747477 host 1.6.1 USBMS 58 SCSI: Test Unit Ready LUN: 0x00
1812 20.747699 1.6.1 host USB 27 URB_BULK out
1813 20.747704 host 1.6.1 USB 27 URB_BULK in
1814 20.747766 1.6.1 host USBMS 40 SCSI: Response LUN: 0x00 (Test Unit
Ready) (Good)
1905 21.755419 host 1.6.1 USBMS 58 SCSI: Test Unit Ready LUN: 0x00
1906 21.755579 1.6.1 host USB 27 URB_BULK out
1907 21.755584 host 1.6.1 USB 27 URB_BULK in
1908 21.755674 1.6.1 host USBMS 40 SCSI: Response LUN: 0x00 (Test Unit
Ready) (Good)
1911 22.769205 host 1.6.1 USBMS 58 SCSI: Test Unit Ready LUN: 0x00
1912 22.769355 1.6.1 host USB 27 URB_BULK out
1913 22.769360 host 1.6.1 USB 27 URB_BULK in
1914 22.769415 1.6.1 host USBMS 40 SCSI: Response LUN: 0x00 (Test Unit
Ready) (Good)
How can I get further on this topic?
Thanks
Matthias
linux:
===========================================================================
SCSI Service Antwortzeit - kindle-linux-copy.pcap:
Index Procedure Calls Min SRT (s) Max SRT (s) Avg SRT (s) Sum SRT (s)
---------------------------------------------------------------------------
SBC (disk)
Inquiry 18 1 0.000742 0.000742 0.000742 0.000742
Mode Sense(6) 26 6 0.104194 0.110284 0.108607
0.651640
Prevent/Allow Medium Removal 30 10 0.000115 0.015012
0.002431 0.024309
Read Capacity(10) 37 3 0.000631 0.001004 0.000835
0.002506
Read(10) 40 2200 0.000136 0.020928 0.002452 5.393555
Request Sense 3 27 0.000295 0.003102 0.001022
0.027604
Synchronize Cache(10) 53 6 0.000223 2.703190
0.654663 3.927976
Test Unit Ready 0 71 0.000081 0.007955 0.000816
0.057908
Write(10) 42 195 0.001204 0.236517 0.022452 4.378117
SBC (disk)
---------------------------------------------------------------------------
windows:
===========================================================================
SCSI Service Antwortzeit - Kindle-sideload-win81.pcapng:
Index Procedure Calls Min SRT (s) Max SRT (s) Avg SRT (s) Sum SRT (s)
---------------------------------------------------------------------------
SBC (disk)
Inquiry 18 6 0.001026 0.109327 0.055329 0.331972
Mode Select(6) 21 2 0.001499 0.002851 0.002175
0.004350
Mode Sense(6) 26 8 0.102380 0.116633 0.108400
0.867199
Prevent/Allow Medium Removal 30 9 0.000274 0.644009
0.072284 0.650556
Read Capacity(10) 37 51 0.000144 0.109027 0.009779
0.498711
Read(10) 40 1269 0.000537 0.107562 0.003026 3.840104
Request Sense 3 19 0.000461 0.001388 0.000889
0.016893
Start Stop Unit 27 1 0.001695 0.001695 0.001695
0.001695
Synchronize Cache(10) 53 7 0.000511 0.001765
0.001052 0.007362
Test Unit Ready 0 6385 0.000090 0.083883 0.000605
3.859785
Unknown-0x%02x 35 3 0.108739 0.111119 0.109720
0.329159
Write(10) 42 303 0.001117 0.257120 0.030089 9.117113
SBC (disk)
---------------------------------------------------------------------------
next reply other threads:[~2021-03-05 16:55 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-05 16:54 Matthias Schwarzott [this message]
2021-03-05 19:14 ` Amazon Kindle disconnect after Synchronize Cache Alan Stern
[not found] ` <CAL411-qf+c_CB4cL=2349QqCCYimOBCYxXbsOfLbvVYOg0294g@mail.gmail.com>
2021-03-06 16:07 ` Alan Stern
2021-03-07 5:58 ` Matthias Schwarzott
2021-03-07 15:52 ` Alan Stern
2021-03-07 16:52 ` Matthias Schwarzott
2021-03-07 16:58 ` Alan Stern
2021-03-08 21:59 ` Matthias Schwarzott
2021-03-09 15:50 ` [usb-storage] " Alan Stern
2021-03-10 20:56 ` Matthias Schwarzott
2021-03-10 21:46 ` Alan Stern
2021-03-11 6:05 ` Matthias Schwarzott
2021-03-11 14:39 ` Alan Stern
2021-03-16 5:26 ` Matthias Schwarzott
2021-03-16 16:26 ` Alan Stern
2021-03-16 16:43 ` [systemd-devel] " Hans de Goede
2021-03-16 17:04 ` Alan Stern
2021-03-16 21:52 ` Matthias Schwarzott
2021-03-17 12:21 ` Hans de Goede
2021-03-17 15:17 ` Alan Stern
2021-03-17 16:47 ` Lennart Poettering
[not found] ` <F279F9BC020000F5AE14D9EC@gwsmtp.uni-regensburg.de>
[not found] ` <C63C44570200006665972EEF@gwsmtp.uni-regensburg.de>
[not found] ` <B960C12A020000A667ECE9F9@gwsmtp.uni-regensburg.de>
[not found] ` <B72C58530200001565972EEF@gwsmtp.uni-regensburg.de>
[not found] ` <0F2319EB020000F567ECE9F9@gwsmtp.uni-regensburg.de>
[not found] ` <DE3F57520200009E65972EEF@gwsmtp.uni-regensburg.de>
[not found] ` <52CC0074020000A3D68BC3D5@gwsmtp.uni-regensburg.de>
2021-03-18 7:03 ` Antw: [EXT] " Ulrich Windl
2021-03-18 14:59 ` Alan Stern
[not found] ` <474C42CD02000091AE14D9EC@gwsmtp.uni-regensburg.de>
2021-03-18 7:04 ` Ulrich Windl
[not found] ` <D43A6F56020000F865972EEF@gwsmtp.uni-regensburg.de>
2021-03-18 7:10 ` Antw: [EXT] [systemd-devel] [PATCH] usb-storage: Add quirk to defeat Kindle's automatic unload Ulrich Windl
2021-03-18 15:03 ` Alan Stern
2021-03-17 17:56 ` [systemd-devel] [usb-storage] Re: Amazon Kindle disconnect after Synchronize Cache Matthias Schwarzott
2021-03-17 18:31 ` Hans de Goede
2021-03-17 19:06 ` [PATCH] usb-storage: Add quirk to defeat Kindle's automatic unload Alan Stern
2021-03-18 11:39 ` Hans de Goede
2021-03-18 13:50 ` [systemd-devel] " Tomasz Torcz
2021-03-18 15:07 ` Alan Stern
2021-03-16 21:43 ` [usb-storage] Re: Amazon Kindle disconnect after Synchronize Cache Matthias Schwarzott
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9f57532f-1fb7-0fdd-b91c-2dfecef5aff3@gentoo.org \
--to=zzam@gentoo.org \
--cc=hirofumi@mail.parknet.co.jp \
--cc=linux-usb@vger.kernel.org \
--cc=usb-storage@lists.one-eyed-alien.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.