Re: xHCI problem? [was Re: Erratic USB device behavior and device loss]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Hello Alan,


On Wed, 2016-08-24 at 10:10 -0400, Alan Stern wrote:
> On Wed, 24 Aug 2016, Ritesh Raj Sarraf wrote:
> 
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA512
>
> > On Tue, 2016-08-23 at 15:14 -0400, Alan Stern wrote:
> > > Okay, good.  The "Driver=rtsx_usb" is what I wanted to see.  Something
> > > funny is going on with that driver -- it claims to support autosuspend 
> > > but it doesn't ever call usb_mark_last_busy() or 
> > > usb_autopm_get_interface().
> > > 
> > > In the meantime, can you post the output from "lsmod"?
> > > 
> > > Also, I'd like to see the output from the following (do this before 
> > > the device disappears):
> > > 
> > >         cd /sys/bus/pci/devices/0000:00:14.0/usb?/usb?-4/
> > >         ls -lR
> > > 
>
> > Please find the asked output at the following links:
>
> > https://people.debian.org/~rrs/tmp/usb-ls-lR.txt
> > https://people.debian.org/~rrs/tmp/lsmod-usb.txt
> 
> Do you happen to know which driver is being used: the memstick
> (rtsx_usb_ms) or mmc (rtsx_usb_sdmmc) driver?  I suppose this may 
> depend on what type of card you insert in the reader.
> 


I think it is the rtsx_usb_sdmmc which is in use. I removed the rtsx_usb_ms
kernel module and still was able to access the sdcard.

rrs@learner:~$ lsmod | grep usb_ms
2016-08-25 / 18:45:52 ♒♒♒  ☹  => 1  

rrs@learner:~$ lsmod | grep usb_sd
rtsx_usb_sdmmc         24576  0
rtsx_usb               24576  1 rtsx_usb_sdmmc
mmc_core              135168  4 mmc_block,sdhci,sdhci_acpi,rtsx_usb_sdmmc
2016-08-25 / 18:45:55 ♒♒♒  ☺  


The interesting bit is that when I enter the adapter into the reader, I get the
following error 5 times, and then it can access the card.

[  496.822613] mmc0: tuning execution failed: -22
[  496.822629] mmc0: error -22 whilst initialising SD card
[  501.980908] mmc0: tuning execution failed: -22
[  501.980922] mmc0: error -22 whilst initialising SD card
[  507.119953] mmc0: tuning execution failed: -22
[  507.119968] mmc0: error -22 whilst initialising SD card
[  513.148143] mmc0: tuning execution failed: -22
[  513.148157] mmc0: error -22 whilst initialising SD card
[  518.702215] mmc0: tuning execution failed: -22
[  518.702222] mmc0: error -22 whilst initialising SD card
[  524.081122] mmc0: new ultra high speed SDR50 SDHC card at address 0002
[  524.082596] mmcblk0: mmc0:0002 NCard 14.9 GiB 
[  524.084240]  mmcblk0: p1
[  524.306434] FAT-fs (mmcblk0p1): utf8 is not a recommended IO charset for FAT
filesystems, filesystem will be case sensitive!
[  584.890000] mmc0: card 0002 removed
[  623.662587] mmc0: tuning execution failed: -22
[  623.662603] mmc0: error -22 whilst initialising SD card
[  629.373424] mmc0: tuning execution failed: -22
[  629.373439] mmc0: error -22 whilst initialising SD card
[  634.544907] mmc0: tuning execution failed: -22
[  634.544914] mmc0: error -22 whilst initialising SD card
[  641.375119] mmc0: tuning execution failed: -22
[  641.375134] mmc0: error -22 whilst initialising SD card
[  646.725767] mmc0: tuning execution failed: -22
[  646.725782] mmc0: error -22 whilst initialising SD card
[  651.305528] mmc0: new ultra high speed SDR50 SDHC card at address 0002
[  651.306491] mmcblk0: mmc0:0002 NCard 14.9 GiB 
[  651.307906]  mmcblk0: p1
[  651.536923] FAT-fs (mmcblk0p1): utf8 is not a recommended IO charset for FAT
filesystems, filesystem will be case sensitive!
2016-08-25 / 18:45:04 ♒♒♒  ☺  

> > I have a question though. For power saving, I use Laptop Mode Tools. Based
> on
> > power state (AC or BATT), it enables/disables power saving knobs.
>
> > https://github.com/rickysarraf/laptop-mode-tools
>
> > Since I suspected the same problem (incapable of LPM) I have had this device
> > blacklisted in Laptop Mode Tools. Here are the attributes for this
> particular
> > device, while on battery.
>
> > rrs@learner:/sys/bus/usb/devices/1-4$ cat power/autosuspend
> > 0
> > 2016-08-24 / 14:47:07 ♒♒♒  ☺  
> > rrs@learner:/sys/bus/usb/devices/1-4$ cat power/control 
> > on
> > 2016-08-24 / 14:47:34 ♒♒♒  ☺  
> > rrs@learner:/sys/bus/usb/devices/1-4$ cat power/level 
> > on
> > 2016-08-24 / 14:47:38 ♒♒♒  ☺  
>
>
> > While I write this, the bug hasn't triggered again. I think what may have
> > happened is this:
>
> > * OS Boots
> > * Goes on battery
> > * LMT sets OS to power saving mode, but blacklists device 1-4
> > * Eventually, the device resets (device/driver bug?)
> > * Upon reset, driver re-initializes the power saving values to default (?).
> >   At this time LMT will not re-apply any settings, because it only gets
> invoked
> > when a power_supply state change is sensed, i.e. ON_BATT or ON_AC.
> 
> That sounds like a bug in LMT.  It ought to handle hotplug events.  You 
> could report that to the authors.
> 

LMT does handle the events. But given that this device was troubling a lot, I
had the device blacklisted for any power savings.


With your patch applied, the initial errors messages (xhci_hcd 0000:00:14.0: dev
4 ep1out scatterlist error -104/-110) are not seen so far.

The device does reset (as you had mentioned), but it doesn't seem to have any
power drain related negative effects.


rrs@learner:~$ less /var/tmp/dmesg-post-patch.txt  | tail -n 25
[11922.283067] wlan0: RX AssocResp from 00:40:77:bb:55:12 (capab=0x411 status=0
aid=1)
[11922.283743] wlan0: associated
[11922.283801] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[11922.883849] systemd[1]: apt-daily.timer: Adding 8h 36min 18.323966s random
time.
[11923.081426] systemd[1]: apt-daily.timer: Adding 2h 23min 22.221062s random
time.
[13799.616838] atkbd serio0: Unknown key pressed (translated set 2, code 0xbe on
isa0060/serio0).
[13799.616843] atkbd serio0: Use 'setkeycodes e03e <keycode>' to make it known.
[13799.625901] atkbd serio0: Unknown key released (translated set 2, code 0xbe
on isa0060/serio0).
[13799.625905] atkbd serio0: Use 'setkeycodes e03e <keycode>' to make it known.
[13800.547966] usb 1-4: USB disconnect, device number 15
[13801.707137] usb 1-4: new high-speed USB device number 16 using xhci_hcd
[13801.880788] usb 1-4: New USB device found, idVendor=0bda, idProduct=0129
[13801.880791] usb 1-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[13801.880792] usb 1-4: Product: USB2.0-CRW
[13801.880793] usb 1-4: Manufacturer: Generic
[13801.880794] usb 1-4: SerialNumber: 20100201396000000
[13802.809031] usb 1-4: USB disconnect, device number 16
[13803.390459] usb 1-4: new high-speed USB device number 18 using xhci_hcd
[13808.807084] usb 1-4: new high-speed USB device number 19 using xhci_hcd
[13808.980827] usb 1-4: New USB device found, idVendor=0bda, idProduct=0129
[13808.980831] usb 1-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[13808.980833] usb 1-4: Product: USB2.0-CRW
[13808.980834] usb 1-4: Manufacturer: Generic
[13808.980835] usb 1-4: SerialNumber: 20100201396000000
[14367.255033] usb 1-7: reset full-speed USB device number 5 using xhci_hcd
2016-08-25 / 18:53:16 ♒♒♒  ☺  

Note: These resets are seen without any card/adapter in the reader.


> As you mentioned above, there's another aspect to power management 
> besides runtime PM, namely Link Power Management.  Perhaps the device 
> can't handle LPM.
> 
> You can test this by editing the usb_device_supports_lpm() routine in 
> drivers/usb/core/hub.c.  If you make it always return 0 immediately, 
> that will disable LPM for all USB devices.  If the spontaneous 
> disconnects don't reappear, we'll have the answer.
> 
> Alan Stern
> 


I'll try this out on a new build and share my results again on this thread.

As for the patch, will it qualify for inclusion into the mainline kernel ?

THanks,
Ritesh

- -- 
Ritesh Raj Sarraf
RESEARCHUT - http://www.researchut.com
"Necessity is the mother of invention."
-----BEGIN PGP SIGNATURE-----

iQIcBAEBCgAGBQJXvvPJAAoJEKY6WKPy4XVpgOUP/iMGoGhUDURwPFZ1vl+7Cq5f
XhCwxcWF/YpQVWtF/filwFnLd+lYVWG88eV2/ncKfhUUfvsDsMAnoWSj2uuOg/s9
dFTQvS30F2/1ObDsuIFNws+sC/VngWG1qMkJPPcZKt5IbFDerFm9bku84/7BRyF4
TvkIYYGfA5oac1Q4aCs39y0hw5Jy76Moa4+PFShopzyacM+NreV4lW+BWRRD0P1q
g3xy6OvDPutoI7dvvRXChHaOEQhho7c/2mX91RML29pmm6XbFq6VlQEbKLv7r469
nB9WEzKGWmUV6U5GEt7oo28kLt5xZFIGgbepUaCHLyefF+V2+rlhnRhYqhaHRTlE
WS7ycseaBeq1p6jQn5xBsrB5KNZ04dcNG7vObl4GQNi3ye3bmN+YkbamcQuebVny
FNToiW7IZEzLLBqLUMlGm79jSaSou0VtB2cpHAkHwlLSWf0owPkSBnUKQgotQE1I
+hY1pkWyzWsTBCuBFXDsXxxa1Yxao0USCpaLf4X6yCLpHQ9DbkfoNPKDHN1FIILE
wBZlJRBKUhmQDCcpex1qGQHi9FDQNeHFrMf4nmEwyqGkqlvlQFun0DQ8Q39f1J59
eWfkrGHC2m+F5e9QjHztOtmcJ2IDgBx33a9i6ekVS9ze4FoSFBBhvV3mPt7YbQNz
FxWAzF4Defr8a8fJT8Y8
=xsS+
-----END PGP SIGNATURE-----

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux