Re: Kernel 3.16.0 USB crash
Ok, thank you Hans. When I connect my external USB disk I've 30 seconds before my laptop freezes: with top command I cannot view nothing: no abnormal cpu usage, no any strange memory usage. If I remove disk before 30 seconds my HP EliteBook 850G1 keeps working as usual. Can I use these 30 seconds to extract some informations that help to determine what's the problem? How? /var/log/syslog and dmesg haven't any messages. System lock is complete: also key CAPS LOCK does not work anymore. I've tried without X: when computer locks 3 lines appear on console that are not registered on syslog, I've copied them on paper. [ 1200.352042] IP: [] _raw_spin_lock_irqsave+ 0x01f/0x060 [ 1200.352045] PGD 0 [ 1200.352048] Oops: 0002 [#1] SMP Ciao, Claudio 2014-08-22 20:26 GMT+02:00 Hans de Goede : >... > There is no need to try my patch, since the descriptors already limit > qdepth to 32. No idea what is going on here then. -- 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: [PATCH v2 2/3] usb: Add LED trigger for USB host activity
Hi Bryan, thanks for the review. See some comments below. On Sat, Aug 23 2014, Bryan Wu wrote: > On Fri, Aug 22, 2014 at 5:08 PM, Michal Sojka wrote: >> With this patch, USB host activity can be signaled by blinking a LED. >> >> This should work with all host controllers. Tested only with musb. >> >> Signed-off-by: Michal Sojka >> --- >> drivers/usb/core/Kconfig | 9 + >> drivers/usb/core/Makefile | 1 + >> drivers/usb/core/hcd.c| 2 ++ >> drivers/usb/core/led.c| 38 ++ >> include/linux/usb/hcd.h | 6 ++ >> 5 files changed, 56 insertions(+) >> create mode 100644 drivers/usb/core/led.c >> >> diff --git a/drivers/usb/core/Kconfig b/drivers/usb/core/Kconfig >> index 1060657..8295f65 100644 >> --- a/drivers/usb/core/Kconfig >> +++ b/drivers/usb/core/Kconfig >> @@ -90,3 +90,12 @@ config USB_OTG_FSM >> Implements OTG Finite State Machine as specified in On-The-Go >> and Embedded Host Supplement to the USB Revision 2.0 Specification. >> >> +config USB_HOST_LED >> + bool "USB Host LED Trigger" >> + depends on LEDS_CLASS >> + select LEDS_TRIGGERS >> + help >> + This option adds a LED trigger for USB host controllers. >> + >> + Say Y here if you are working on a system with led-class supported >> + LEDs and you want to use them as USB host activity indicators. >> diff --git a/drivers/usb/core/Makefile b/drivers/usb/core/Makefile >> index 2f6f932..324c8c9 100644 >> --- a/drivers/usb/core/Makefile >> +++ b/drivers/usb/core/Makefile >> @@ -9,5 +9,6 @@ usbcore-y += port.o >> >> usbcore-$(CONFIG_PCI) += hcd-pci.o >> usbcore-$(CONFIG_ACPI) += usb-acpi.o >> +usbcore-$(CONFIG_USB_HOST_LED) += led.o >> >> obj-$(CONFIG_USB) += usbcore.o >> diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c >> index 487abcf..46d9f3a 100644 >> --- a/drivers/usb/core/hcd.c >> +++ b/drivers/usb/core/hcd.c >> @@ -1664,6 +1664,8 @@ static void __usb_hcd_giveback_urb(struct urb *urb) >> usbmon_urb_complete(&hcd->self, urb, status); >> usb_anchor_suspend_wakeups(anchor); >> usb_unanchor_urb(urb); >> + if (status == 0) >> + usb_hcd_led_activity(); >> >> /* pass ownership to the completion handler */ >> urb->status = status; >> diff --git a/drivers/usb/core/led.c b/drivers/usb/core/led.c >> new file mode 100644 >> index 000..49ff76c >> --- /dev/null >> +++ b/drivers/usb/core/led.c >> @@ -0,0 +1,38 @@ >> +/* >> + * LED Trigger for USB Host Activity >> + * >> + * Copyright 2014 Michal Sojka >> + * >> + * This program is free software; you can redistribute it and/or modify >> + * it under the terms of the GNU General Public License version 2 as >> + * published by the Free Software Foundation. >> + * >> + */ >> + >> +#include >> +#include >> +#include >> +#include >> +#include >> + >> +#define BLINK_DELAY 30 >> + >> +DEFINE_LED_TRIGGER(ledtrig_usb_hcd); > > Add one more trigger named ledtrig_usb_gadget > >> +static unsigned long usb_hcd_blink_delay = BLINK_DELAY; >> + >> +void usb_hcd_led_activity(void) > > Give an input parameter like emum usb_led_event. > USB_LED_EVENT_HOST = 0 > USB_LED_EVENT_GADGET = 1 > > >> +{ > > Add case for USB_LED_EVENT_HOST: >> + led_trigger_blink_oneshot(ledtrig_usb_hcd, >> + &usb_hcd_blink_delay, >> &usb_hcd_blink_delay, 0); > > Add case for USB_LED_EVENT_GADGET: > led_trigger_blink_oneshot(ledtrig_usb_gadget, > &usb_gadget_blink_delay, > &usb_gadget_blink_delay, 0); > >> +} >> + >> +int __init ledtrig_usb_hcd_init(void) >> +{ >> + led_trigger_register_simple("usb-host", &ledtrig_usb_hcd); > register one more trigger for gadget. This way, the code will be full of #ifdefs. Is the following really what you want? If you want to have it without #ifdefs, then I don't think it is a good idea to offer users the usb-gadget trigger on systems without usb gadget support. #define BLINK_DELAY 30 static unsigned long usb_blink_delay = BLINK_DELAY; enum usb_led_event { USB_LED_EVENT_HOST = 0, USB_LED_EVENT_GADGET = 1, }; #ifdef CONFIG_USB_GADGET_LED DEFINE_LED_TRIGGER(ledtrig_usbgadget); #endif #ifdef CONFIG_USB_HOST_LED DEFINE_LED_TRIGGER(ledtrig_usb_hcd); #endif void usb_led_activity(enum usb_led_event ev) { struct led_trigger *trig; switch (ev) { #ifdef CONFIG_USB_GADGET_LED case USB_LED_EVENT_GADGET: trig = ledtrig_usb_gadget; break; #endif #ifdef CONFIG_USB_HOST_LED case USB_LED_EVENT_HOST: trig = ledtrig_usb_hcd; break; #endif default:; } led_trigger_blink_oneshot(trig, &usb_blink_delay, &usb_blink_delay, 0); } EXPORT_SYMBOL(usb_led_activity); int __init ledtrig_usb_init(void) { #ifdef CONFIG_USB_GADGET_LED led_trigger_register_simple("usb-gadget", &ledtrig_usbgadget); #endif #ifdef CONFIG_USB_HOST_LED led_trigger_reg
Re: Kernel 3.16.0 USB crash
I must make a correction to what I said earlier: on kernel 3.16.1 if I use a normal micro USB cable (not USB 3.0 one) I can mount my disk (with uas module) BUT it not works properly. My computer does not freeze but I obtain same kernel error Aug 23 12:03:42 hp850ssd kernel: [ 49.041091] usb 2-3.4: New USB device found, idVendor=152d, idProduct=0567 Aug 23 12:03:42 hp850ssd kernel: [ 49.041095] usb 2-3.4: New USB device strings: Mfr=10, Product=11, SerialNumber=5 Aug 23 12:03:42 hp850ssd kernel: [ 49.041098] usb 2-3.4: Product: USB to ATA/ATAPI Bridge Aug 23 12:03:42 hp850ssd kernel: [ 49.041099] usb 2-3.4: Manufacturer: JMicron Aug 23 12:03:42 hp850ssd kernel: [ 49.041101] usb 2-3.4: SerialNumber: 152D00539000 Aug 23 12:03:43 hp850ssd kernel: [ 49.562449] usbcore: registered new interface driver usb-storage Aug 23 12:03:43 hp850ssd kernel: [ 49.567258] scsi2 : uas Aug 23 12:03:43 hp850ssd kernel: [ 49.567591] usbcore: registered new interface driver uas Aug 23 12:03:47 hp850ssd kernel: [ 53.566515] scsi 2:0:0:0: Direct-Access JMicron Generic 0100 PQ: 0 ANSI: 6 Aug 23 12:03:47 hp850ssd kernel: [ 53.567449] sd 2:0:0:0: Attached scsi generic sg1 type 0 Aug 23 12:03:47 hp850ssd kernel: [ 53.567544] sd 2:0:0:0: [sdb] 976773168 512-byte logical blocks: (500 GB/465 GiB) Aug 23 12:03:47 hp850ssd kernel: [ 53.567547] sd 2:0:0:0: [sdb] 4096-byte physical blocks Aug 23 12:03:47 hp850ssd kernel: [ 53.568326] sd 2:0:0:0: [sdb] Write Protect is off Aug 23 12:03:47 hp850ssd kernel: [ 53.568329] sd 2:0:0:0: [sdb] Mode Sense: 67 00 10 08 Aug 23 12:03:47 hp850ssd kernel: [ 53.568662] sd 2:0:0:0: [sdb] Write cache: enabled, read cache: enabled, supports DPO and FUA Aug 23 12:03:47 hp850ssd kernel: [ 53.613054] sdb: sdb1 Aug 23 12:03:47 hp850ssd kernel: [ 53.614845] sd 2:0:0:0: [sdb] Attached SCSI disk Aug 23 12:03:47 hp850ssd udisksd[3189]: Mounted /dev/sdb1 at /media/b0/HP850G1-external on behalf of uid 1000 Aug 23 12:03:47 hp850ssd kernel: [ 53.868635] EXT4-fs (sdb1): recovery complete Aug 23 12:03:47 hp850ssd kernel: [ 53.868640] EXT4-fs (sdb1): mounted filesystem with ordered data mode. Opts: (null) Aug 23 12:04:18 hp850ssd kernel: [ 84.793627] sd 2:0:0:0: [sdb] uas_eh_abort_handler 88023c242900 tag 32, inflight: CMD Aug 23 12:04:21 hp850ssd kernel: [ 87.790971] scsi host2: uas_eh_task_mgmt: ABORT TASK timed out Aug 23 12:05:08 hp850ssd kernel: [ 134.726718] BUG: unable to handle kernel paging request at 08e809a6 Aug 23 12:05:08 hp850ssd kernel: [ 134.726750] IP: [] uas_log_cmd_state+0x35/0x340 [uas] Aug 23 12:05:08 hp850ssd kernel: [ 134.726776] PGD 0 Aug 23 12:05:08 hp850ssd kernel: [ 134.726785] Oops: [#1] SMP Aug 23 12:05:08 hp850ssd kernel: [ 134.726800] Modules linked in: uas usb_storage hid_generic hidp hid nvram vmnet(OE) parport_pc vmw_vsock_vmci_transport vsock vmw_vmci vmmon(OE) ctr ccm btusb uvcvideo videobuf2_vmalloc videobuf2_memops videobuf2_core v4l2_common videodev media joydev arc4 intel_rapl x86_pkg_temp_thermal intel_powerclamp coretemp kvm_intel kvm hp_wmi crct10dif_pclmul sparse_keymap crc32_pclmul rfcomm bnep ghash_clmulni_intel aesni_intel bluetooth 6lowpan_iphc aes_x86_64 lrw gf128mul glue_helper ablk_helper iwlmvm cryptd mac80211 snd_seq_midi snd_hda_codec_idt snd_seq_midi_event snd_hda_codec_generic serio_raw snd_hda_codec_hdmi radeon i915 iwlwifi snd_hda_intel wmi snd_hda_controller snd_rawmidi snd_hda_codec snd_seq snd_hwdep snd_seq_device hp_wireless ttm lpc_ich intel_smartconnect drm_kms_helper hp_accel drm snd_pcm video i2c_algo_bit lis3lv02d input_polldev tpm_infineon rtsx_pci_ms memstick snd_timer cfg80211 snd soundcore mei_me binfmt_misc mac_hid mei ppdev lp parport rtsx_pci_sdmmc psmouse e1000e ahci ptp rtsx_pci libahci pps_core [last unloaded: vmnet] Aug 23 12:05:08 hp850ssd kernel: [ 134.727231] CPU: 3 PID: 5010 Comm: scsi_eh_2 Tainted: GW OE 3.16.1-031601-generic #201408140014 Aug 23 12:05:08 hp850ssd kernel: [ 134.727264] Hardware name: Hewlett-Packard HP EliteBook 850 G1/198F, BIOS L71 Ver. 01.12 06/25/2014 Aug 23 12:05:08 hp850ssd kernel: [ 134.727295] task: 8801f3a40a20 ti: 880096964000 task.ti: 880096964000 Aug 23 12:05:08 hp850ssd kernel: [ 134.727321] RIP: 0010:[] [] uas_log_cmd_state+0x35/0x340 [uas] Aug 23 12:05:08 hp850ssd kernel: [ 134.727354] RSP: 0018:880096967b98 EFLAGS: 00010082 Aug 23 12:05:08 hp850ssd kernel: [ 134.727373] RAX: 88024a41e850 RBX: 88024a41e830 RCX: c09fe720 Aug 23 12:05:08 hp850ssd kernel: [ 134.727398] RDX: 4a41e828 RSI: c09fe720 RDI: 88024a41e718 Aug 23 12:05:08 hp850ssd kernel: [ 134.727422] RBP: 880096967c88 R08: 000a R09: 0490 Aug 23 12:05:08 hp850ssd kernel: [ 134.727446] R10: R11: 048f R12: 88024a41e730 Aug 23 12:05:08 hp850ssd kernel: [ 134.727471] R13: 0008 R14: 88024a41e818 R15: 08e808e6 Aug 23 12:05:08 hp85
usb device stop probe after some times of EPROTO error
1.In which case will i get EPROTO during commuicate with usb device, i called usb_bulk_msg in my usb_drv 2.while i continue plug and pull the usb device a few times because of EPROTO and some times (errno=110) error , the usb device is not probed, nothing print in dmesg. can anyone help me, tell me the reason, thanks. -- 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 device stop probe after some times of EPROTO error
On Sat, Aug 23, 2014 at 11:37:28PM +0800, peter li wrote: > 1.In which case will i get EPROTO during commuicate with usb device, i > called usb_bulk_msg in my usb_drv What driver is this? > 2.while i continue plug and pull the usb device a few times because of > EPROTO and some times (errno=110) error , the usb device is not probed, > nothing print in dmesg. Sounds like a broken device, is the firmware crashed in it? Does the device see the USB connection? thanks, greg k-h -- 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
USB-UART device from Exar Co. not working with cdc_acm but usbserial
Hi, I've been trying to get this device work in linux Mint Qiana (3.13.0-24-generic) without success. The XR21V1414 is a multiport USB-UART device. (0x04e2:0x1414) (The driver provided "Vizzini" causes system crash due a improper initialization of tty_port) http://www.exar.com/common/content/default.aspx?id=10296 The cdc_acm driver creates the proper ttyACMx but there's no communication with the device. The only way I could get functional devices was with # rmmod cdc_acm # modprobe usbserial vendor=0x04e2 product=0x1414 And there's where I got the message from dmesg that I should contact to get a proper driver for my device. Thank you for your hard work, I hope this help to more people like me in the future. This is the output from lsusb, tell me if you need more information Bus 001 Device 015: ID 04e2:1414 Exar Corp. Device Descriptor: bLength18 bDescriptorType 1 bcdUSB 2.00 bDeviceClass 239 Miscellaneous Device bDeviceSubClass 2 ? bDeviceProtocol 1 Interface Association bMaxPacketSize064 idVendor 0x04e2 Exar Corp. idProduct 0x1414 bcdDevice0.03 iManufacturer 0 iProduct0 iSerial 0 bNumConfigurations 1 Configuration Descriptor: bLength 9 bDescriptorType 2 wTotalLength 273 bNumInterfaces 8 bConfigurationValue 1 iConfiguration 0 bmAttributes 0xc0 Self Powered MaxPower 94mA Interface Association: bLength 8 bDescriptorType11 bFirstInterface 0 bInterfaceCount 2 bFunctionClass 2 Communications bFunctionSubClass 2 Abstract (modem) bFunctionProtocol 0 None iFunction 0 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber0 bAlternateSetting 0 bNumEndpoints 1 bInterfaceClass 2 Communications bInterfaceSubClass 2 Abstract (modem) bInterfaceProtocol 1 AT-commands (v.25ter) iInterface 0 CDC Header: bcdCDC 1.10 CDC ACM: bmCapabilities 0x06 sends break line coding and serial state CDC Union: bMasterInterface0 bSlaveInterface 1 CDC Call Management: bmCapabilities 0x01 call management bDataInterface 1 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x85 EP 5 IN bmAttributes3 Transfer TypeInterrupt Synch Type None Usage Type Data wMaxPacketSize 0x0040 1x 64 bytes bInterval 2 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber1 bAlternateSetting 0 bNumEndpoints 2 bInterfaceClass10 CDC Data bInterfaceSubClass 0 Unused bInterfaceProtocol 0 iInterface 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x01 EP 1 OUT bmAttributes2 Transfer TypeBulk Synch Type None Usage Type Data wMaxPacketSize 0x0040 1x 64 bytes bInterval 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes2 Transfer TypeBulk Synch Type None Usage Type Data wMaxPacketSize 0x0040 1x 64 bytes bInterval 0 Interface Association: bLength 8 bDescriptorType11 bFirstInterface 2 bInterfaceCount 2 bFunctionClass 2 Communications bFunctionSubClass 2 Abstract (modem) bFunctionProtocol 0 None iFunction 0 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber2 bAlternateSetting 0 bNumEndpoints 1 bInterfaceClass 2 Communications bInterfaceSubClass 2 Abstract (modem) bInterfaceProtocol 1 AT-commands (v.25ter) iInterface 0 CDC Header: bcdCDC 1.10 CDC ACM: bmCapabilities 0x06 sends break line coding and serial state CDC Union: bMasterInte
[PATCH 5/7] wusb: delete double assignment
From: Julia Lawall Delete successive assignments to the same location. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @@ expression i; @@ *i = ...; i = ...; // Signed-off-by: Julia Lawall --- The patches in this series do not depend on each other. drivers/usb/wusbcore/crypto.c |2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/usb/wusbcore/crypto.c b/drivers/usb/wusbcore/crypto.c index 9a95b2d..50ce80d 100644 --- a/drivers/usb/wusbcore/crypto.c +++ b/drivers/usb/wusbcore/crypto.c @@ -222,8 +222,6 @@ static int wusb_ccm_mac(struct crypto_blkcipher *tfm_cbc, WARN_ON(sizeof(ax) != sizeof(struct aes_ccm_block)); result = -ENOMEM; - zero_padding = sizeof(struct aes_ccm_block) - - blen % sizeof(struct aes_ccm_block); zero_padding = blen % sizeof(struct aes_ccm_block); if (zero_padding) zero_padding = sizeof(struct aes_ccm_block) - zero_padding; -- 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
[PATCH 0/7] delete double assignment
These patches fix cases where there are two adjacent assignments to the same location. In practice, many such occurrences appear to be intentional, eg to initialize volatile memory, but these cases do not seem to fall into that category. The complete semantic match that finds these problems is as follows: // @r@ expression i,f; position p1,p2; @@ ( i = <+...f(...)...+>; | i |= <+...f(...)...+>; | i &= <+...f(...)...+>; | i += <+...f(...)...+>; | i -= <+...f(...)...+>; | i *= <+...f(...)...+>; | i /= <+...f(...)...+>; | i %= <+...f(...)...+>; | i ^= <+...f(...)...+>; | i <<= <+...f(...)...+>; | i >>= <+...f(...)...+>; | i@p1 = ...; | i@p1 |= ...; | i@p1 &= ...; | i@p1 += ...; | i@p1 -= ...; | i@p1 *= ...; | i@p1 /= ...; | i@p1 %= ...; | i@p1 ^= ...; | i@p1 <<= ...; | i@p1 >>= ...; | i@p1 ++; | ++i@p1; | i@p1 --; | --i@p1; ) ( i = <+...i...+>; | i = <+...f(...)...+>; | i@p2 = ...; ) @@ expression i,j,f; position r.p1,r.p2; @@ ( (<+...i@p1...+>); ) ( (<+...\(j++\|++j\|j--\|--j\|f(...)\)...+>) = ...; | *i@p2 = ...; ) // -- 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
[PATCH] usb: gadget: udc: use USB API functions rather than constants
This patch introduces the use of the functions usb_endpoint_type and usb_endpoint_num. The Coccinelle semantic patch that makes these changes is as follows: @@ struct usb_endpoint_descriptor *epd; @@ - (epd->bEndpointAddress & \(USB_ENDPOINT_NUMBER_MASK\|0x0f\)) + usb_endpoint_num(epd) @@ struct usb_endpoint_descriptor *epd; @@ - (epd->bmAttributes & \(USB_ENDPOINT_XFERTYPE_MASK\|3\)) + usb_endpoint_type(epd) Signed-off-by: Himangi Saraogi Acked-by: Julia Lawall --- drivers/usb/gadget/udc/r8a66597-udc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/usb/gadget/udc/r8a66597-udc.c b/drivers/usb/gadget/udc/r8a66597-udc.c index 4600842..22a5880 100644 --- a/drivers/usb/gadget/udc/r8a66597-udc.c +++ b/drivers/usb/gadget/udc/r8a66597-udc.c @@ -430,7 +430,7 @@ static void r8a66597_ep_setting(struct r8a66597 *r8a66597, ep->pipenum = pipenum; ep->ep.maxpacket = usb_endpoint_maxp(desc); r8a66597->pipenum2ep[pipenum] = ep; - r8a66597->epaddr2ep[desc->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK] + r8a66597->epaddr2ep[usb_endpoint_num(desc)] = ep; INIT_LIST_HEAD(&ep->queue); } @@ -464,7 +464,7 @@ static int alloc_pipe_config(struct r8a66597_ep *ep, if (ep->pipenum)/* already allocated pipe */ return 0; - switch (desc->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) { + switch (usb_endpoint_type(desc)) { case USB_ENDPOINT_XFER_BULK: if (r8a66597->bulk >= R8A66597_MAX_NUM_BULK) { if (r8a66597->isochronous >= R8A66597_MAX_NUM_ISOC) { @@ -509,7 +509,7 @@ static int alloc_pipe_config(struct r8a66597_ep *ep, } ep->type = info.type; - info.epnum = desc->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK; + info.epnum = usb_endpoint_num(desc); info.maxpacket = usb_endpoint_maxp(desc); info.interval = desc->bInterval; if (desc->bEndpointAddress & USB_ENDPOINT_DIR_MASK) -- 1.9.1 -- 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