Re: USB storage device cause usb bus can't enter runtime suspend
On Wed, 26 Nov 2014, tianjulin wrote: Hi Stern, Many Thanks!!! You're welcome. I use command as follows,the usb bus can enter runtime suspend when I connect usb storage,and if have operate on usb storage,the usb bus can be resume,if have not any operate on usb storage,the usb bus can enter runtime suspend. echo auto /sys/bus/usb/devices/1-1/power/control auto echo auto /sys/bus/usb/devices/1-1:1.0/host0/target0:0:0/0:0:0:0/power/control auto echo 1000 /sys/bus/usb/devices/1-1:1.0/host0/target0:0:0/0:0:0:0/power/autosuspend_delay_ms 100 But how to modify source code to implement this feature?can you provide some help? If you want to enable runtime suspend automatically, you can write a udev script to do it (assuming your platform uses udev). Alan Stern -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: USB storage device cause usb bus can't enter runtime suspend
On Wed, 26 Nov 2014, liu chunlin wrote: Hi Stern, My platform not use udev,do you have good idea to modify usb driver to enable usb storage runtime suspend? It is not possible to do what you want by modifying the USB driver. What does your platform use instead of udev? Alan Stern -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: USB storage device cause usb bus can't enter runtime suspend
On Tue, 25 Nov 2014, tianjulin wrote: Hi Stern, *1*:I turn off media-change polling when connect sdcard-reader,the usb bus still can't enter runtime suspend.I guss sdcard-reader can't enter runtime suspend cause the usb bus cat't enter runtime suspend,but I can't understand that why the sdcard-reader can't enter runtime suspend if have no Operating. Because you have to enable runtime suspend. It is turned off by default. *2*: connect USB storage,the run command as A-B-C-D,the usb bus still can't enter runtime suspend. *A:* shell@byt_t_crv2:/sys/bus/usb/devices # ls 1-0:1.0 1-2 *1-2:1.0* 2-0:1.0 usb1 usb2 shell@byt_t_crv2:/sys/bus/usb/devices # *B:* shell@byt_t_crv2:/sys/bus/usb/devices/1-2:1.0/power # ls shell@byt_t_crv2:/sys/bus/usb/devices/1-2:1.0/power # have any files show. *C:* shell@byt_t_crv2:/sys/bus/usb/devices/1-2/power # ls active_duration autosuspend autosuspend_delay_ms connected_duration control level persist runtime_active_time runtime_status runtime_suspended_time shell@byt_t_crv2:/sys/bus/usb/devices/1-2/power # *D:* shell@byt_t_crv2:#echo auto /sys/bus/usb/devices/1-2/power/control *3:*The bus won't enter runtime suspend until all of the devices attached to the bus are in runtime suspend ---why I have no any operation,connect usb and run echo auto control,the usb bus still can't runtime suspend? why usb storage can't enter runtime suspend if have no any operation? What you did isn't enough. You also need to enable runtime suspend for the card reader's sd device. For example, echo 1000 /sys/bus/usb/devices/1-2:1.0/host2/target2:0:0/2:0:0:0/power/autosuspend_delay_ms echo auto /sys/bus/usb/devices/1-2:1.0/host2/target2:0:0/2:0:0:0/power/control Some of those path names may be different on your system. Basically, you need to visit every power directory under /sys/bus/usb/devices/1-2, and make sure they contain auto in power/control and a reasonable value in power/autosuspend_delay_ms. Alan Stern -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: USB storage device cause usb bus can't enter runtime suspend
On Mon, 24 Nov 2014, tianjulin wrote: Hi Stern, 1:Thanks your kind support,but how to turn off media-change polling? echo -1 /sys/block/sdX/events_poll_msecs Replace the X with the drive letter for your card reader. or may I change the polling time for long time to fixed this bug? Yes. Replace the -1 above with the polling time, in milliseconds. 2:If media-change polling prevent the device entering runtime suspend, Why connect USB storage devices without operator and usb mouse also may cause USB bus can't enter runtime suspend? You have to enable runtime suspend for the devices. By default, runtime suspend is disabled. You can enable runtime suspend by writing auto into the device's power/control sysfs file. You may also want to write an appropriate delay value into the device's power/autosuspend_delay_ms sysfs file. 3:I have check my source code,as follows commit have include in my kernel version. 66311274691e 6c9546675864 c8158819d506 9b21493c4520 6df339a51e3b d20ec597cba1 c60855cdb976 10c580e4239d 4:I have try several of kind devices (usb mouse,usb storage,usb-card,etc)on usb bus ,all of them may cause usb bus can't enter runtime suspend. The bus won't enter runtime suspend until all of the devices attached to the bus are in runtime suspend. *5:When I insert a sdcard into sdcard-read,the usb bus still can't enter runtime suspend.* Alan Stern -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Bug ID::88761 USB storage device cause usb bus can't enter runtime suspend
Bug ID::88761 Summary:USB storage device cause usb bus can't enter runtime suspend AS I known,SDcard use SDIO interface,I need use a sdcard-reader( USB to SDIO)if I want to use sdcard on my board ,but I have try many sdcard-reader without sdcard to connect usb ,all of them will cause usb bus can't enter runtime suspend. and I try to connect a usb storage on my demo board also will cause usb bus can't enter runtime suspend,but if I press power button,the usb bus can enter suspend mode.I guess the driver hav not implemented this function. Alan Stern tell me that Runtime suspend for USB storage devices was added in the 3.14 kernel,but I can't find the patches about USB runtime.Who can help me? -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: USB storage device cause usb bus can't enter runtime suspend
On Sun, 23 Nov 2014, liu chunlin wrote: Hi all, AS I known,SDcard use SDIO interface,I need use a sdcard-reader( USB to SDIO)if I want to use sdcard on my board ,but I have try many sdcard-reader without sdcard to connect usb ,all of them will cause usb bus can't enter runtime suspend. and I try to connect a usb storage on my demo board also will cause usb bus can't enter runtime suspend,but if I press power button,the usb bus can enter suspend mode.I guess the driver hav not implemented this function. Alan Stern tell me that Runtime suspend for USB storage devices was added in the 3.14 kernel,but I can't find the patches about USB runtime.Who can help me? I was wrong; the support was added in the 3.10 kernel by these commits: 66311274691e 6c9546675864 c8158819d506 9b21493c4520 6df339a51e3b with bug fixes in these commits: d20ec597cba1 c60855cdb976 10c580e4239d In order to make runtime suspend work, you have to turn off media-change polling. When there's no card in the reader, the system will constantly check to see if a card has been inserted. This checking will prevent the device from entering runtime suspend. Alan Stern -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: USB storage device cause usb bus can't enter runtime suspend
Hi Stern, Thanks your kind support,but how to turn off media-change polling? 在 2014年11月24日 01:00, Alan Stern 写道: On Sun, 23 Nov 2014, liu chunlin wrote: Hi all, AS I known,SDcard use SDIO interface,I need use a sdcard-reader( USB to SDIO)if I want to use sdcard on my board ,but I have try many sdcard-reader without sdcard to connect usb ,all of them will cause usb bus can't enter runtime suspend. and I try to connect a usb storage on my demo board also will cause usb bus can't enter runtime suspend,but if I press power button,the usb bus can enter suspend mode.I guess the driver hav not implemented this function. Alan Stern tell me that Runtime suspend for USB storage devices was added in the 3.14 kernel,but I can't find the patches about USB runtime.Who can help me? I was wrong; the support was added in the 3.10 kernel by these commits: 66311274691e 6c9546675864 c8158819d506 9b21493c4520 6df339a51e3b with bug fixes in these commits: d20ec597cba1 c60855cdb976 10c580e4239d In order to make runtime suspend work, you have to turn off media-change polling. When there's no card in the reader, the system will constantly check to see if a card has been inserted. This checking will prevent the device from entering runtime suspend. Alan Stern -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: USB storage device cause usb bus can't enter runtime suspend
Hi Stern, Thanks your kind support,but how to turn off media-change polling? or may I change the polling time for long time to fixed this bug? 在 2014年11月24日 06:02, tianjulin 写道: Hi Stern, Thanks your kind support,but how to turn off media-change polling? 在 2014年11月24日 01:00, Alan Stern 写道: On Sun, 23 Nov 2014, liu chunlin wrote: Hi all, AS I known,SDcard use SDIO interface,I need use a sdcard-reader( USB to SDIO)if I want to use sdcard on my board ,but I have try many sdcard-reader without sdcard to connect usb ,all of them will cause usb bus can't enter runtime suspend. and I try to connect a usb storage on my demo board also will cause usb bus can't enter runtime suspend,but if I press power button,the usb bus can enter suspend mode.I guess the driver hav not implemented this function. Alan Stern tell me that Runtime suspend for USB storage devices was added in the 3.14 kernel,but I can't find the patches about USB runtime.Who can help me? I was wrong; the support was added in the 3.10 kernel by these commits: 66311274691e 6c9546675864 c8158819d506 9b21493c4520 6df339a51e3b with bug fixes in these commits: d20ec597cba1 c60855cdb976 10c580e4239d In order to make runtime suspend work, you have to turn off media-change polling. When there's no card in the reader, the system will constantly check to see if a card has been inserted. This checking will prevent the device from entering runtime suspend. Alan Stern -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: USB storage device cause usb bus can't enter runtime suspend
Hi Stern, Thanks your kind support,but how to turn off media-change polling? or may I change the polling time for long time to fixed this bug? And Why connect USB storage devices also may cause USB bus can't enter runtime suspend? Hi Stern, Thanks your kind support,but how to turn off media-change polling? or may I change the polling time for long time to fixed this bug? 在 2014年11月24日 06:02, tianjulin 写道: Hi Stern, Thanks your kind support,but how to turn off media-change polling? 在 2014年11月24日 01:00, Alan Stern 写道: On Sun, 23 Nov 2014, liu chunlin wrote: Hi all, AS I known,SDcard use SDIO interface,I need use a sdcard-reader( USB to SDIO)if I want to use sdcard on my board ,but I have try many sdcard-reader without sdcard to connect usb ,all of them will cause usb bus can't enter runtime suspend. and I try to connect a usb storage on my demo board also will cause usb bus can't enter runtime suspend,but if I press power button,the usb bus can enter suspend mode.I guess the driver hav not implemented this function. Alan Stern tell me that Runtime suspend for USB storage devices was added in the 3.14 kernel,but I can't find the patches about USB runtime.Who can help me? I was wrong; the support was added in the 3.10 kernel by these commits: 66311274691e 6c9546675864 c8158819d506 9b21493c4520 6df339a51e3b with bug fixes in these commits: d20ec597cba1 c60855cdb976 10c580e4239d In order to make runtime suspend work, you have to turn off media-change polling. When there's no card in the reader, the system will constantly check to see if a card has been inserted. This checking will prevent the device from entering runtime suspend. Alan Stern -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: USB storage device cause usb bus can't enter runtime suspend
Hi Stern, Thanks your kind support,but how to turn off media-change polling? or may I change the polling time for long time to fixed this bug? If media-change polling prevent the device entering runtime suspend, Why connect USB storage devices and usb mouse also may cause USB bus can't enter runtime suspend? 在 2014年11月24日 01:00, Alan Stern 写道: On Sun, 23 Nov 2014, liu chunlin wrote: Hi all, AS I known,SDcard use SDIO interface,I need use a sdcard-reader( USB to SDIO)if I want to use sdcard on my board ,but I have try many sdcard-reader without sdcard to connect usb ,all of them will cause usb bus can't enter runtime suspend. and I try to connect a usb storage on my demo board also will cause usb bus can't enter runtime suspend,but if I press power button,the usb bus can enter suspend mode.I guess the driver hav not implemented this function. Alan Stern tell me that Runtime suspend for USB storage devices was added in the 3.14 kernel,but I can't find the patches about USB runtime.Who can help me? I was wrong; the support was added in the 3.10 kernel by these commits: 66311274691e 6c9546675864 c8158819d506 9b21493c4520 6df339a51e3b with bug fixes in these commits: d20ec597cba1 c60855cdb976 10c580e4239d In order to make runtime suspend work, you have to turn off media-change polling. When there's no card in the reader, the system will constantly check to see if a card has been inserted. This checking will prevent the device from entering runtime suspend. Alan Stern -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: USB storage device cause usb bus can't enter runtime suspend
Hi Stern, 1:Thanks your kind support,but how to turn off media-change polling? or may I change the polling time for long time to fixed this bug? 2:If media-change polling prevent the device entering runtime suspend, Why connect USB storage devices without operator and usb mouse also may cause USB bus can't enter runtime suspend? 3:I have check my source code,as follows commit have include in my kernel version. 66311274691e 6c9546675864 c8158819d506 9b21493c4520 6df339a51e3b d20ec597cba1 c60855cdb976 10c580e4239d 4:I have try several of kind devices (usb mouse,usb storage,usb-card,etc)on usb bus ,all of them may cause usb bus can't enter runtime suspend. On Sun, 23 Nov 2014, liu chunlin wrote: Hi all, AS I known,SDcard use SDIO interface,I need use a sdcard-reader( USB to SDIO)if I want to use sdcard on my board ,but I have try many sdcard-reader without sdcard to connect usb ,all of them will cause usb bus can't enter runtime suspend. and I try to connect a usb storage on my demo board also will cause usb bus can't enter runtime suspend,but if I press power button,the usb bus can enter suspend mode.I guess the driver hav not implemented this function. Alan Stern tell me that Runtime suspend for USB storage devices was added in the 3.14 kernel,but I can't find the patches about USB runtime.Who can help me? I was wrong; the support was added in the 3.10 kernel by these commits: 66311274691e 6c9546675864 c8158819d506 9b21493c4520 6df339a51e3b with bug fixes in these commits: d20ec597cba1 c60855cdb976 10c580e4239d In order to make runtime suspend work, you have to turn off media-change polling. When there's no card in the reader, the system will constantly check to see if a card has been inserted. This checking will prevent the device from entering runtime suspend. Alan Stern -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html