I'm trying to write a driver for the OXU210 PCI evaluation board, integrating it into the EHCI subsystem (see the patch below). It's still WIP, for now only the SPH host controller is supported (no OTG). Because this host controller can only access its own small SRAM area I'm using the HCD_LOCAL_MEM flag and dma_declare_coherent_memory() to enforce "local" memory utilization. The first issue I've found is that the controller seems to have problems with unaliged memory accesses, so I applied a patch to the core HCD code to remove the put/get_unaligned() stuff. After that something started to work, devices (mass storage, usbs-serial, keyboard devices, etc.) are correctly recognized, but there're still some issues. More exactly, bulk transfers don't seem to complete successfully very often. For example when I connect a USB drive I get this from dmesg: [75662.865306] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver [75662.865311] ehci_hcd: block sizes: qh 104 qtd 96 itd 192 sitd 96 [75662.870457] ehci_hcd 0000:00:0b.1: PCI INT B -> Link[APCL] -> GSI 20 (level, low) -> IRQ 20 [75662.870483] ehci_hcd 0000:00:0b.1: setting latency timer to 64 [75662.870486] ehci_hcd 0000:00:0b.1: EHCI Host Controller [75662.870506] drivers/usb/core/inode.c: creating file 'devices' [75662.870511] drivers/usb/core/inode.c: creating file '001' [75662.871452] ehci_hcd 0000:00:0b.1: new USB bus registered, assigned bus number 1 [75662.871464] ehci_hcd 0000:00:0b.1: reset hcs_params 0x101888 dbg=1 cc=1 pcc=8 !ppc ports=8 [75662.871474] ehci_hcd 0000:00:0b.1: reset portroute 0 0 0 0 0 0 0 0 [75662.871477] ehci_hcd 0000:00:0b.1: reset hcc_params a086 caching frame 256/512/1024 park [75662.871500] ehci_hcd 0000:00:0b.1: park 0 [75662.871507] ehci_hcd 0000:00:0b.1: debug port 1 [75662.871511] ehci_hcd 0000:00:0b.1: reset command 080b02 park=3 ithresh=8 period=1024 Reset HALT [75662.871520] ehci_hcd 0000:00:0b.1: cache line size of 32 is not supported [75662.871523] ehci_hcd 0000:00:0b.1: supports USB remote wakeup [75662.871543] ehci_hcd 0000:00:0b.1: irq 20, io mem 0xfe02e000 [75662.871547] ehci_hcd 0000:00:0b.1: reset command 080b02 park=3 ithresh=8 period=1024 Reset HALT [75662.871555] ehci_hcd 0000:00:0b.1: init command 010009 (park)=0 ithresh=1 period=256 RUN [75662.890026] ehci_hcd 0000:00:0b.1: USB 2.0 started, EHCI 1.00 [75662.890061] usb usb1: default language 0x0409 [75662.890069] usb usb1: udev 1, busnum 1, minor = 0 [75662.890071] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002 [75662.890074] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1 [75662.890077] usb usb1: Product: EHCI Host Controller [75662.890079] usb usb1: Manufacturer: Linux 2.6.35-rc3+ ehci_hcd [75662.890081] usb usb1: SerialNumber: 0000:00:0b.1 [75662.890624] usb usb1: usb_probe_device [75662.890628] usb usb1: configuration #1 chosen from 1 choice [75662.890640] usb usb1: adding 1-0:1.0 (config #1, interface 0) [75662.890715] hub 1-0:1.0: usb_probe_interface [75662.890718] hub 1-0:1.0: usb_probe_interface - got id [75662.890720] hub 1-0:1.0: USB hub found [75662.890726] hub 1-0:1.0: 8 ports detected [75662.890728] hub 1-0:1.0: standalone hub [75662.890730] hub 1-0:1.0: no power switching (usb 1.0) [75662.890732] hub 1-0:1.0: individual port over-current protection [75662.890735] hub 1-0:1.0: power on to power good time: 20ms [75662.890739] hub 1-0:1.0: local power source is good [75662.890742] hub 1-0:1.0: trying to enable port power on non-switchable hub [75662.890775] drivers/usb/core/inode.c: creating file '001' [75662.902556] oxu210hp-ehci 0000:04:09.0: PCI INT A -> Link[APC2] -> GSI 17 (level, low) -> IRQ 17 [75662.902567] oxu210hp-ehci 0000:04:09.0: IRQ resource 17 [75662.902605] oxu210hp-ehci 0000:04:09.0: device ID 21000100 [75662.902608] oxu210hp-ehci 0000:04:09.0: found device 2100 128-pin LQFP (0000:0000) [75662.902613] oxu210hp-ehci 0000:04:09.0: EV-OXU210-PCI EHCI Host Controller [75662.902626] drivers/usb/core/inode.c: creating file '002' [75662.903463] oxu210hp-ehci 0000:04:09.0: new USB bus registered, assigned bus number 2 [75662.903471] initializing SPH controller [75662.903476] oxu210hp-ehci 0000:04:09.0: reset hcs_params 0x10011 dbg=0 ind cc=0 pcc=0 ordered ports=1 [75662.903481] oxu210hp-ehci 0000:04:09.0: reset hcc_params 0006 thresh 0 uframes 256/512/1024 park [75662.904377] oxu210hp-ehci 0000:04:09.0: park 0 [75662.904385] oxu210hp-ehci 0000:04:09.0: reset command 080b02 park=3 ithresh=8 period=1024 Reset HALT [75662.904392] oxu210hp-ehci 0000:04:09.0: ...powerup ports... [75662.930021] oxu210hp-ehci 0000:04:09.0: MWI active [75662.930024] oxu210hp-ehci 0000:04:09.0: supports USB remote wakeup [75662.930045] oxu210hp-ehci 0000:04:09.0: irq 17, io mem 0xfdbc0000 [75662.930050] oxu210hp-ehci 0000:04:09.0: reset command 080b02 park=3 ithresh=8 period=1024 Reset HALT [75662.930060] oxu210hp-ehci 0000:04:09.0: init command 010009 (park)=0 ithresh=1 period=256 RUN [75662.950019] oxu210hp-ehci 0000:04:09.0: USB 0.0 started, EHCI 1.00 [75662.950046] usb usb2: default language 0x0409 [75662.950054] usb usb2: udev 1, busnum 2, minor = 128 [75662.950056] usb usb2: New USB device found, idVendor=1d6b, idProduct=0002 [75662.950059] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1 [75662.950062] usb usb2: Product: EV-OXU210-PCI EHCI Host Controller [75662.950064] usb usb2: Manufacturer: Linux 2.6.35-rc3+ ehci_hcd [75662.950066] usb usb2: SerialNumber: oxu210hp_sph [75662.950134] usb usb2: usb_probe_device [75662.950137] usb usb2: configuration #1 chosen from 1 choice [75662.950146] usb usb2: adding 2-0:1.0 (config #1, interface 0) [75662.950168] hub 2-0:1.0: usb_probe_interface [75662.950170] hub 2-0:1.0: usb_probe_interface - got id [75662.950172] hub 2-0:1.0: USB hub found [75662.950177] hub 2-0:1.0: 1 port detected [75662.950179] hub 2-0:1.0: standalone hub [75662.950181] hub 2-0:1.0: individual port power switching [75662.950183] hub 2-0:1.0: individual port over-current protection [75662.950185] hub 2-0:1.0: Single TT [75662.950187] hub 2-0:1.0: TT requires at most 8 FS bit times (666 ns) [75662.950189] hub 2-0:1.0: power on to power good time: 20ms [75662.950194] hub 2-0:1.0: local power source is good [75662.950196] hub 2-0:1.0: enabling power on all ports [75662.950213] drivers/usb/core/inode.c: creating file '001' [75662.950236] oxu210hp-ehci 0000:04:09.0: devices enabled and running [75662.950244] oxu210hp-ehci 0000:04:09.0: irq status 0084 PCD [75662.990028] ehci_hcd 0000:00:0b.1: GetStatus port 1 status 001000 POWER sig=se0 [75662.990036] ehci_hcd 0000:00:0b.1: GetStatus port 2 status 001000 POWER sig=se0 [75662.990042] ehci_hcd 0000:00:0b.1: GetStatus port 3 status 001000 POWER sig=se0 [75662.990047] ehci_hcd 0000:00:0b.1: GetStatus port 4 status 001000 POWER sig=se0 [75662.990052] ehci_hcd 0000:00:0b.1: GetStatus port 5 status 001000 POWER sig=se0 [75662.990057] ehci_hcd 0000:00:0b.1: GetStatus port 6 status 001000 POWER sig=se0 [75662.990062] ehci_hcd 0000:00:0b.1: GetStatus port 7 status 001000 POWER sig=se0 [75662.990067] ehci_hcd 0000:00:0b.1: GetStatus port 8 status 001000 POWER sig=se0 [75662.990076] hub 1-0:1.0: state 7 ports 8 chg 0000 evt 0000 [75663.050020] oxu210hp-ehci 0000:04:09.0: GetStatus port 1 status 001803 POWER sig=j CSC CONNECT [75663.050025] hub 2-0:1.0: port 1: status 0101 change 0001 [75663.150017] hub 2-0:1.0: state 7 ports 1 chg 0002 evt 0000 [75663.150023] oxu210hp-ehci 0000:04:09.0: GetStatus port 1 status 001801 POWER sig=j CONNECT [75663.150027] hub 2-0:1.0: port 1, status 0101, change 0000, 12 Mb/s [75663.150037] oxu210hp-ehci 0000:04:09.0: port 1 reset [75663.205042] oxu210hp-ehci 0000:04:09.0: irq status 008c FLR PCD [75663.210021] oxu210hp-ehci 0000:04:09.0: GetStatus port 1 status 001805 POWER sig=j PE CONNECT [75663.270019] usb 2-1: new full speed USB device using oxu210hp-ehci and address 2 [75663.270531] oxu210hp-ehci 0000:04:09.0: submit_async 1 urb ffff88007cb81d80 ep0out len 64, qtd ffffc900065a1060 [qh (null)] [75663.272069] oxu210hp-ehci 0000:04:09.0: irq status 48089 Async FLR INT [75663.272122] oxu210hp-ehci 0000:04:09.0: ehci_urb_done 1 urb ffff88007cb81d80 ep0in status 0 len 8/64 [75663.272160] oxu210hp-ehci 0000:04:09.0: port 1 reset [75663.290072] oxu210hp-ehci 0000:04:09.0: irq status 480a8 Async IAA FLR [75663.327166] oxu210hp-ehci 0000:04:09.0: irq status 4808c Async FLR PCD [75663.330018] oxu210hp-ehci 0000:04:09.0: GetStatus port 1 status 001805 POWER sig=j PE CONNECT [75663.390047] oxu210hp-ehci 0000:04:09.0: submit_async 1 urb ffff88007cb81d80 ep0out len 0, qtd ffffc900065a1120 [qh ffff88007bc68400] [75663.392073] oxu210hp-ehci 0000:04:09.0: irq status 48089 Async FLR INT [75663.392107] oxu210hp-ehci 0000:04:09.0: ehci_urb_done 1 urb ffff88007cb81d80 ep0out status 0 len 0/0 [75663.392131] oxu210hp-ehci 0000:04:09.0: irq status 480a8 Async IAA FLR [75663.420013] usb 2-1: ep0 maxpacket = 8 [75663.420064] oxu210hp-ehci 0000:04:09.0: submit_async 1 urb ffff88007cb81d80 ep0out len 18, qtd ffffc900065a1120 [qh (null)] [75663.421075] oxu210hp-ehci 0000:04:09.0: irq status 48089 Async FLR INT [75663.421126] oxu210hp-ehci 0000:04:09.0: ehci_urb_done 1 urb ffff88007cb81d80 ep0in status 0 len 18/18 [75663.421201] oxu210hp-ehci 0000:04:09.0: submit_async 1 urb ffff88007cb81d80 ep0out len 9, qtd ffffc900065a1060 [qh ffff88007bc68400] [75663.422074] oxu210hp-ehci 0000:04:09.0: irq status 48089 Async FLR INT [75663.422124] oxu210hp-ehci 0000:04:09.0: ehci_urb_done 1 urb ffff88007cb81d80 ep0in status 0 len 9/9 [75663.422194] oxu210hp-ehci 0000:04:09.0: submit_async 1 urb ffff88007cb81d80 ep0out len 32, qtd ffffc900065a1180 [qh ffff88007bc68400] [75663.423073] oxu210hp-ehci 0000:04:09.0: irq status 48089 Async FLR INT [75663.423123] oxu210hp-ehci 0000:04:09.0: ehci_urb_done 1 urb ffff88007cb81d80 ep0in status 0 len 32/32 [75663.423416] oxu210hp-ehci 0000:04:09.0: submit_async 1 urb ffff88007cb81d80 ep0out len 255, qtd ffffc900065a1120 [qh ffff88007bc68400] [75663.424072] oxu210hp-ehci 0000:04:09.0: irq status 48089 Async FLR INT [75663.424124] oxu210hp-ehci 0000:04:09.0: ehci_urb_done 1 urb ffff88007cb81d80 ep0in status 0 len 128/255 [75663.424210] usb 2-1: default language 0x0000 [75663.424259] oxu210hp-ehci 0000:04:09.0: submit_async 1 urb ffff88007cb81d80 ep0out len 255, qtd ffffc900065a1060 [qh ffff88007bc68400] [75663.425071] oxu210hp-ehci 0000:04:09.0: irq status 48089 Async FLR INT [75663.425123] oxu210hp-ehci 0000:04:09.0: ehci_urb_done 1 urb ffff88007cb81d80 ep0in status 0 len 124/255 [75663.425257] oxu210hp-ehci 0000:04:09.0: submit_async 1 urb ffff88007cb81d80 ep0out len 255, qtd ffffc900065a1180 [qh ffff88007bc68400] [75663.426070] oxu210hp-ehci 0000:04:09.0: irq status 48089 Async FLR INT [75663.426122] oxu210hp-ehci 0000:04:09.0: ehci_urb_done 1 urb ffff88007cb81d80 ep0in status 0 len 124/255 [75663.426255] oxu210hp-ehci 0000:04:09.0: submit_async 1 urb ffff88007cb81d80 ep0out len 255, qtd ffffc900065a1120 [qh ffff88007bc68400] [75663.427069] oxu210hp-ehci 0000:04:09.0: irq status 48089 Async FLR INT [75663.427121] oxu210hp-ehci 0000:04:09.0: ehci_urb_done 1 urb ffff88007cb81d80 ep0in status 0 len 92/255 [75663.427208] usb 2-1: udev 2, busnum 2, minor = 129 [75663.427211] usb 2-1: New USB device found, idVendor=05dc, idProduct=0080 [75663.427213] usb 2-1: New USB device strings: Mfr=1, Product=1, SerialNumber=2 [75663.427216] usb 2-1: Product: LEXR PLUG DRIVE [75663.427218] usb 2-1: Manufacturer: LEXR PLUG DRIVE [75663.427220] usb 2-1: SerialNumber: F106290203100519AA 0000000000000000000000000 [75663.427774] usb 2-1: usb_probe_device [75663.427778] usb 2-1: configuration #1 chosen from 1 choice [75663.427814] oxu210hp-ehci 0000:04:09.0: submit_async 1 urb ffff88007babc480 ep0out len 0, qtd ffffc900065a1060 [qh ffff88007bc68400] [75663.428071] oxu210hp-ehci 0000:04:09.0: irq status 48089 Async FLR INT [75663.428106] oxu210hp-ehci 0000:04:09.0: ehci_urb_done 1 urb ffff88007babc480 ep0out status 0 len 0/0 [75663.428131] usb 2-1: adding 2-1:1.0 (config #1, interface 0) [75663.428196] oxu210hp-ehci 0000:04:09.0: submit_async 1 urb ffff88007aafd780 ep0out len 255, qtd ffffc900065a10c0 [qh ffff88007bc68400] [75663.429071] oxu210hp-ehci 0000:04:09.0: irq status 48089 Async FLR INT [75663.429125] oxu210hp-ehci 0000:04:09.0: ehci_urb_done 1 urb ffff88007aafd780 ep0in status 0 len 124/255 [75663.429253] usb-storage 2-1:1.0: usb_probe_interface [75663.429259] usb-storage 2-1:1.0: usb_probe_interface - got id [75663.429262] usb-storage: USB Mass Storage device detected [75663.429365] usb-storage: -- associate_dev [75663.429368] usb-storage: Vendor: 0x05dc, Product: 0x0080, Revision: 0x0001 [75663.429370] usb-storage: Interface Subclass: 0x06, Protocol: 0x50 [75663.429379] usb-storage: Transport: Bulk [75663.429381] usb-storage: Protocol: Transparent SCSI [75663.429402] scsi38 : usb-storage 2-1:1.0 [75663.429495] usb-storage: *** thread sleeping. [75663.429522] drivers/usb/core/inode.c: creating file '002' [75663.429542] hub 2-0:1.0: state 7 ports 1 chg 0000 evt 0002 [75663.429550] oxu210hp-ehci 0000:04:09.0: GetStatus port 1 status 001805 POWER sig=j PE CONNECT [75663.440082] oxu210hp-ehci 0000:04:09.0: irq status 480a8 Async IAA FLR [75663.449757] usb-storage 2-1:1.0: device found [75663.449762] usb-storage 2-1:1.0: waiting for device to settle before scanning [75664.440019] usb-storage: usb_stor_control_msg: rq=fe rqtype=a1 value=0000 index=00 len=1 [75664.440070] oxu210hp-ehci 0000:04:09.0: submit_async 1 urb ffff88007be06b40 ep0out len 1, qtd ffffc900065a1180 [qh ffff88007bc68400] [75664.442112] oxu210hp-ehci 0000:04:09.0: irq status 48089 Async FLR INT [75664.442163] oxu210hp-ehci 0000:04:09.0: ehci_urb_done 1 urb ffff88007be06b40 ep0in status 0 len 1/1 [75664.442180] usb-storage: GetMaxLUN command result is 1, data is 0 [75664.442214] usb-storage 2-1:1.0: scan complete [75664.442268] usb-storage: queuecommand called [75664.442273] usb-storage: *** thread awakened. [75664.442275] usb-storage: Command INQUIRY (6 bytes) [75664.442277] usb-storage: 12 00 00 00 24 00 [75664.442293] usb-storage: Bulk Command S 0x43425355 T 0x1 L 36 F 0 Trg 0 LUN 0 CL 0 [75664.442296] usb-storage: usb_stor_bulk_transfer_buf: xfer 31 bytes [75664.442311] oxu210hp-ehci 0000:04:09.0: submit_async 1 urb ffff88007be06b40 ep3out len 31, qtd ffffc900065a1060 [qh (null)] [75664.443109] oxu210hp-ehci 0000:04:09.0: irq status 48089 Async FLR INT [75664.443128] oxu210hp-ehci 0000:04:09.0: ehci_urb_done 1 urb ffff88007be06b40 ep3out status 0 len 31/31 [75664.443137] usb-storage: Status code 0; transferred 31/31 [75664.443139] usb-storage: -- transfer complete [75664.443140] usb-storage: Bulk command transfer result=0 [75664.443143] usb-storage: usb_stor_bulk_transfer_sglist: xfer 36 bytes, 1 entries [75664.443165] oxu210hp-ehci 0000:04:09.0: submit_async 1 urb ffff88007bd23600 ep2in len 36, qtd ffffc900065a1120 [qh (null)] [75664.444108] oxu210hp-ehci 0000:04:09.0: irq status 48089 Async FLR INT [75664.444126] oxu210hp-ehci 0000:04:09.0: ehci_urb_done 1 urb ffff88007bd23600 ep2in status 0 len 36/36 [75664.444153] usb-storage: Status code 0; transferred 36/36 [75664.444155] usb-storage: -- transfer complete [75664.444156] usb-storage: Bulk data transfer result 0x0 [75664.444158] usb-storage: Attempting to get CSW... [75664.444160] usb-storage: usb_stor_bulk_transfer_buf: xfer 13 bytes [75664.444176] oxu210hp-ehci 0000:04:09.0: submit_async 1 urb ffff88007be06b40 ep2in len 13, qtd ffffc900065a10c0 [qh ffff88007bd22e80] [75664.460114] oxu210hp-ehci 0000:04:09.0: irq status 4a0a8 Async Recl IAA FLR [75664.480114] oxu210hp-ehci 0000:04:09.0: irq status 4a0a8 Async Recl IAA FLR ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ No reply from the device? (or not the expected one?) In any case everything stop working from here. [75685.120017] usb-storage: command_abort called [75685.120022] usb-storage: usb_stor_stop_transport called [75685.120024] usb-storage: -- cancelling URB [75685.120039] oxu210hp-ehci 0000:04:09.0: irq status 480a8 Async IAA FLR [75685.120052] usb usb2: clear tt buffer port 1, a2 ep2 t800d8d80 [75685.120066] oxu210hp-ehci 0000:04:09.0: ehci_urb_done 1 urb ffff88007be06b40 ep2in status -115 len 0/13 [75685.120082] usb-storage: Status code -104; transferred 0/13 [75685.120084] usb-storage: -- transfer cancelled [75685.120085] usb-storage: Bulk status result = 4 [75685.120087] usb-storage: -- command was aborted [75685.120090] usb-storage: usb_stor_pre_reset [75685.120102] oxu210hp-ehci 0000:04:09.0: port 1 reset [75685.175107] oxu210hp-ehci 0000:04:09.0: irq status 4008c FLR PCD [75685.175119] hub 2-0:1.0: state 7 ports 1 chg 0000 evt 0002 [75685.180019] oxu210hp-ehci 0000:04:09.0: GetStatus port 1 status 001805 POWER sig=j PE CONNECT [75685.240019] usb 2-1: reset full speed USB device using oxu210hp-ehci and address 2 [75685.240071] oxu210hp-ehci 0000:04:09.0: submit_async 1 urb ffff88007b0330c0 ep0out len 64, qtd ffffc900065a1180 [qh (null)] [75685.241843] oxu210hp-ehci 0000:04:09.0: irq status 48089 Async FLR INT [75685.241896] oxu210hp-ehci 0000:04:09.0: ehci_urb_done 1 urb ffff88007b0330c0 ep0in status 0 len 8/64 [75685.241934] oxu210hp-ehci 0000:04:09.0: port 1 reset [75685.260022] oxu210hp-ehci 0000:04:09.0: irq status 480a8 Async IAA FLR [75685.296939] oxu210hp-ehci 0000:04:09.0: irq status 4808c Async FLR PCD [75685.296947] hub 2-0:1.0: state 7 ports 1 chg 0000 evt 0002 [75685.300017] oxu210hp-ehci 0000:04:09.0: GetStatus port 1 status 001805 POWER sig=j PE CONNECT [75685.360047] oxu210hp-ehci 0000:04:09.0: submit_async 1 urb ffff88007b033480 ep0out len 0, qtd ffffc900065a11e0 [qh ffff88007bd22400] [75685.361847] oxu210hp-ehci 0000:04:09.0: irq status 48089 Async FLR INT [75685.361882] oxu210hp-ehci 0000:04:09.0: ehci_urb_done 1 urb ffff88007b033480 ep0out status 0 len 0/0 [75685.361905] oxu210hp-ehci 0000:04:09.0: irq status 480a8 Async IAA FLR [75685.390014] usb 2-1: ep0 maxpacket = 8 [75685.390064] oxu210hp-ehci 0000:04:09.0: submit_async 1 urb ffff88007b033480 ep0out len 18, qtd ffffc900065a11e0 [qh (null)] [75685.390850] oxu210hp-ehci 0000:04:09.0: irq status 48089 Async FLR INT [75685.390900] oxu210hp-ehci 0000:04:09.0: ehci_urb_done 1 urb ffff88007b033480 ep0in status 0 len 18/18 [75685.390974] oxu210hp-ehci 0000:04:09.0: submit_async 1 urb ffff88007b033480 ep0out len 32, qtd ffffc900065a1180 [qh ffff88007bd22400] [75685.391848] oxu210hp-ehci 0000:04:09.0: irq status 48089 Async FLR INT [75685.391898] oxu210hp-ehci 0000:04:09.0: ehci_urb_done 1 urb ffff88007b033480 ep0in status 0 len 32/32 [75685.391974] oxu210hp-ehci 0000:04:09.0: submit_async 1 urb ffff88007b033480 ep0out len 255, qtd ffffc900065a1240 [qh ffff88007bd22400] [75685.392847] oxu210hp-ehci 0000:04:09.0: irq status 48089 Async FLR INT [75685.392899] oxu210hp-ehci 0000:04:09.0: ehci_urb_done 1 urb ffff88007b033480 ep0in status 0 len 92/255 [75685.393015] oxu210hp-ehci 0000:04:09.0: submit_async 1 urb ffff88007b033480 ep0out len 0, qtd ffffc900065a11e0 [qh ffff88007bd22400] [75685.393846] oxu210hp-ehci 0000:04:09.0: irq status 48089 Async FLR INT [75685.393880] oxu210hp-ehci 0000:04:09.0: ehci_urb_done 1 urb ffff88007b033480 ep0out status 0 len 0/0 [75685.393900] usb-storage: usb_stor_post_reset [75685.393903] usb-storage: usb_reset_device returns 0 [75685.393905] usb-storage: scsi command aborted [75685.393908] usb-storage: *** thread sleeping. [75685.393912] usb-storage: queuecommand called [75685.393915] usb-storage: *** thread awakened. [75685.393918] usb-storage: Command TEST_UNIT_READY (6 bytes) [75685.393919] usb-storage: 00 00 00 00 00 00 [75685.393936] usb-storage: Bulk Command S 0x43425355 T 0x2 L 0 F 0 Trg 0 LUN 0 CL 0 [75685.393938] usb-storage: usb_stor_bulk_transfer_buf: xfer 31 bytes [75685.393952] oxu210hp-ehci 0000:04:09.0: submit_async 1 urb ffff88007be06b40 ep3out len 31, qtd ffffc900065a1060 [qh (null)] [75685.394845] oxu210hp-ehci 0000:04:09.0: irq status 48089 Async FLR INT [75685.394864] oxu210hp-ehci 0000:04:09.0: ehci_urb_done 1 urb ffff88007be06b40 ep3out status 0 len 31/31 [75685.394872] usb-storage: Status code 0; transferred 31/31 [75685.394874] usb-storage: -- transfer complete [75685.394875] usb-storage: Bulk command transfer result=0 [75685.394877] usb-storage: Attempting to get CSW... [75685.394879] usb-storage: usb_stor_bulk_transfer_buf: xfer 13 bytes [75685.394894] oxu210hp-ehci 0000:04:09.0: submit_async 1 urb ffff88007be06b40 ep2in len 13, qtd ffffc900065a10c0 [qh (null)] [75685.395844] oxu210hp-ehci 0000:04:09.0: irq status 48089 Async FLR INT [75685.395863] oxu210hp-ehci 0000:04:09.0: ehci_urb_done 1 urb ffff88007be06b40 ep2in status 0 len 13/13 [75685.395871] usb-storage: Status code 0; transferred 13/13 [75685.395873] usb-storage: -- transfer complete [75685.395874] usb-storage: Bulk status result = 0 [75685.395880] usb-storage: Bulk Status S 0x53425355 T 0x2 R 0 Stat 0x0 [75685.395886] usb-storage: scsi cmd done, result=0x0 [75685.395889] usb-storage: *** thread sleeping. [75685.395899] usb-storage: queuecommand called [75685.395903] usb-storage: *** thread awakened. [75685.395906] usb-storage: Command INQUIRY (6 bytes) [75685.395907] usb-storage: 12 00 00 00 24 00 [75685.395923] usb-storage: Bulk Command S 0x43425355 T 0x3 L 36 F 0 Trg 0 LUN 0 CL 0 [75685.395926] usb-storage: usb_stor_bulk_transfer_buf: xfer 31 bytes [75685.395940] oxu210hp-ehci 0000:04:09.0: submit_async 1 urb ffff88007be06b40 ep3out len 31, qtd ffffc900065a1120 [qh ffff88007bd22c80] [75685.396843] oxu210hp-ehci 0000:04:09.0: irq status 48089 Async FLR INT [75685.396861] oxu210hp-ehci 0000:04:09.0: ehci_urb_done 1 urb ffff88007be06b40 ep3out status 0 len 31/31 [75685.396869] usb-storage: Status code 0; transferred 31/31 [75685.396871] usb-storage: -- transfer complete [75685.396873] usb-storage: Bulk command transfer result=0 [75685.396875] usb-storage: usb_stor_bulk_transfer_sglist: xfer 36 bytes, 1 entries [75685.396897] oxu210hp-ehci 0000:04:09.0: submit_async 1 urb ffff88007b033480 ep2in len 36, qtd ffffc900065a1060 [qh ffff88007bd22e80] [75685.397842] oxu210hp-ehci 0000:04:09.0: irq status 48089 Async FLR INT [75685.397860] oxu210hp-ehci 0000:04:09.0: ehci_urb_done 1 urb ffff88007b033480 ep2in status 0 len 36/36 [75685.397886] usb-storage: Status code 0; transferred 36/36 [75685.397888] usb-storage: -- transfer complete [75685.397890] usb-storage: Bulk data transfer result 0x0 [75685.397892] usb-storage: Attempting to get CSW... [75685.397894] usb-storage: usb_stor_bulk_transfer_buf: xfer 13 bytes [75685.397909] oxu210hp-ehci 0000:04:09.0: submit_async 1 urb ffff88007be06b40 ep2in len 13, qtd ffffc900065a10c0 [qh ffff88007bd22e80] [75685.410851] oxu210hp-ehci 0000:04:09.0: irq status 4a0a8 Async Recl IAA FLR [75685.430851] oxu210hp-ehci 0000:04:09.0: irq status 4a0a8 Async Recl IAA FLR [75706.080018] usb-storage: command_abort called [75706.080022] usb-storage: usb_stor_stop_transport called [75706.080024] usb-storage: -- cancelling URB [75706.080044] oxu210hp-ehci 0000:04:09.0: irq status 480a8 Async IAA FLR [75706.080057] usb usb2: clear tt buffer port 1, a2 ep2 t000d8d80 [75706.080071] oxu210hp-ehci 0000:04:09.0: ehci_urb_done 1 urb ffff88007be06b40 ep2in status -115 len 0/13 [75706.080087] usb-storage: Status code -104; transferred 0/13 [75706.080089] usb-storage: -- transfer cancelled [75706.080091] usb-storage: Bulk status result = 4 [75706.080092] usb-storage: -- command was aborted [75706.080096] usb-storage: usb_stor_pre_reset [75706.080108] oxu210hp-ehci 0000:04:09.0: port 1 reset [75706.135113] oxu210hp-ehci 0000:04:09.0: irq status 4008c FLR PCD [75706.135125] hub 2-0:1.0: state 7 ports 1 chg 0000 evt 0002 [75706.140019] oxu210hp-ehci 0000:04:09.0: GetStatus port 1 status 001805 POWER sig=j PE CONNECT [75706.200018] usb 2-1: reset full speed USB device using oxu210hp-ehci and address 2 [75706.200071] oxu210hp-ehci 0000:04:09.0: submit_async 1 urb ffff88007b3df6c0 ep0out len 64, qtd ffffc900065a11e0 [qh (null)] [75706.201582] oxu210hp-ehci 0000:04:09.0: irq status 48089 Async FLR INT [75706.201635] oxu210hp-ehci 0000:04:09.0: ehci_urb_done 1 urb ffff88007b3df6c0 ep0in status 0 len 8/64 [75706.201673] oxu210hp-ehci 0000:04:09.0: port 1 reset [75706.220022] oxu210hp-ehci 0000:04:09.0: irq status 480a8 Async IAA FLR [75706.256678] oxu210hp-ehci 0000:04:09.0: irq status 4808c Async FLR PCD [75706.256687] hub 2-0:1.0: state 7 ports 1 chg 0000 evt 0002 [75706.260018] oxu210hp-ehci 0000:04:09.0: GetStatus port 1 status 001805 POWER sig=j PE CONNECT [75706.320047] oxu210hp-ehci 0000:04:09.0: submit_async 1 urb ffff88007b3df6c0 ep0out len 0, qtd ffffc900065a1240 [qh ffff88007bd22400] [75706.321586] oxu210hp-ehci 0000:04:09.0: irq status 48089 Async FLR INT [75706.321621] oxu210hp-ehci 0000:04:09.0: ehci_urb_done 1 urb ffff88007b3df6c0 ep0out status 0 len 0/0 [75706.321644] oxu210hp-ehci 0000:04:09.0: irq status 480a8 Async IAA FLR [75706.350014] usb 2-1: ep0 maxpacket = 8 [75706.350064] oxu210hp-ehci 0000:04:09.0: submit_async 1 urb ffff88007b3df6c0 ep0out len 18, qtd ffffc900065a1240 [qh (null)] [75706.350589] oxu210hp-ehci 0000:04:09.0: irq status 48089 Async FLR INT [75706.350639] oxu210hp-ehci 0000:04:09.0: ehci_urb_done 1 urb ffff88007b3df6c0 ep0in status 0 len 18/18 [75706.350713] oxu210hp-ehci 0000:04:09.0: submit_async 1 urb ffff88007b3df6c0 ep0out len 32, qtd ffffc900065a11e0 [qh ffff88007bd22400] [75706.351587] oxu210hp-ehci 0000:04:09.0: irq status 48089 Async FLR INT [75706.351637] oxu210hp-ehci 0000:04:09.0: ehci_urb_done 1 urb ffff88007b3df6c0 ep0in status 0 len 32/32 [75706.351713] oxu210hp-ehci 0000:04:09.0: submit_async 1 urb ffff88007b3df6c0 ep0out len 255, qtd ffffc900065a1180 [qh ffff88007bd22400] [75706.352586] oxu210hp-ehci 0000:04:09.0: irq status 48089 Async FLR INT [75706.352638] oxu210hp-ehci 0000:04:09.0: ehci_urb_done 1 urb ffff88007b3df6c0 ep0in status 0 len 92/255 [75706.352754] oxu210hp-ehci 0000:04:09.0: submit_async 1 urb ffff88007b3df6c0 ep0out len 0, qtd ffffc900065a1240 [qh ffff88007bd22400] [75706.353585] oxu210hp-ehci 0000:04:09.0: irq status 48089 Async FLR INT [75706.353620] oxu210hp-ehci 0000:04:09.0: ehci_urb_done 1 urb ffff88007b3df6c0 ep0out status 0 len 0/0 [75706.353640] usb-storage: usb_stor_post_reset [75706.353642] usb-storage: usb_reset_device returns 0 [75706.353644] usb-storage: scsi command aborted [75706.353647] usb-storage: *** thread sleeping. [75706.353651] usb-storage: queuecommand called [75706.353654] usb-storage: *** thread awakened. [75706.353657] usb-storage: Command TEST_UNIT_READY (6 bytes) [75706.353658] usb-storage: 00 00 00 00 00 00 [75706.353675] usb-storage: Bulk Command S 0x43425355 T 0x4 L 0 F 0 Trg 0 LUN 0 CL 0 [75706.353677] usb-storage: usb_stor_bulk_transfer_buf: xfer 31 bytes [75706.353691] oxu210hp-ehci 0000:04:09.0: submit_async 1 urb ffff88007be06b40 ep3out len 31, qtd ffffc900065a1120 [qh (null)] [75706.354584] oxu210hp-ehci 0000:04:09.0: irq status 48089 Async FLR INT [75706.354603] oxu210hp-ehci 0000:04:09.0: ehci_urb_done 1 urb ffff88007be06b40 ep3out status 0 len 31/31 [75706.354611] usb-storage: Status code 0; transferred 31/31 [75706.354613] usb-storage: -- transfer complete [75706.354614] usb-storage: Bulk command transfer result=0 [75706.354616] usb-storage: Attempting to get CSW... [75706.354618] usb-storage: usb_stor_bulk_transfer_buf: xfer 13 bytes [75706.354633] oxu210hp-ehci 0000:04:09.0: submit_async 1 urb ffff88007be06b40 ep2in len 13, qtd ffffc900065a10c0 [qh (null)] [75706.355583] oxu210hp-ehci 0000:04:09.0: irq status 48089 Async FLR INT [75706.355602] oxu210hp-ehci 0000:04:09.0: ehci_urb_done 1 urb ffff88007be06b40 ep2in status 0 len 13/13 [75706.355610] usb-storage: Status code 0; transferred 13/13 [75706.355612] usb-storage: -- transfer complete [75706.355613] usb-storage: Bulk status result = 0 [75706.355620] usb-storage: Bulk Status S 0x53425355 T 0x4 R 0 Stat 0x0 [75706.355625] usb-storage: scsi cmd done, result=0x0 [75706.355627] usb-storage: *** thread sleeping. [75706.355639] usb-storage: queuecommand called [75706.355643] usb-storage: *** thread awakened. [75706.355645] usb-storage: Command INQUIRY (6 bytes) [75706.355647] usb-storage: 12 00 00 00 24 00 [75706.355663] usb-storage: Bulk Command S 0x43425355 T 0x5 L 36 F 0 Trg 0 LUN 0 CL 0 [75706.355665] usb-storage: usb_stor_bulk_transfer_buf: xfer 31 bytes [75706.355679] oxu210hp-ehci 0000:04:09.0: submit_async 1 urb ffff88007be06b40 ep3out len 31, qtd ffffc900065a1060 [qh ffff88007bd22c80] [75706.356582] oxu210hp-ehci 0000:04:09.0: irq status 48089 Async FLR INT [75706.356600] oxu210hp-ehci 0000:04:09.0: ehci_urb_done 1 urb ffff88007be06b40 ep3out status 0 len 31/31 [75706.356608] usb-storage: Status code 0; transferred 31/31 [75706.356610] usb-storage: -- transfer complete [75706.356612] usb-storage: Bulk command transfer result=0 [75706.356614] usb-storage: usb_stor_bulk_transfer_sglist: xfer 36 bytes, 1 entries [75706.356636] oxu210hp-ehci 0000:04:09.0: submit_async 1 urb ffff88007b3df6c0 ep2in len 36, qtd ffffc900065a1120 [qh ffff88007bd22e80] [75706.357581] oxu210hp-ehci 0000:04:09.0: irq status 48089 Async FLR INT [75706.357599] oxu210hp-ehci 0000:04:09.0: ehci_urb_done 1 urb ffff88007b3df6c0 ep2in status 0 len 36/36 [75706.357625] usb-storage: Status code 0; transferred 36/36 [75706.357627] usb-storage: -- transfer complete [75706.357629] usb-storage: Bulk data transfer result 0x0 [75706.357631] usb-storage: Attempting to get CSW... [75706.357632] usb-storage: usb_stor_bulk_transfer_buf: xfer 13 bytes [75706.357648] oxu210hp-ehci 0000:04:09.0: submit_async 1 urb ffff88007be06b40 ep2in len 13, qtd ffffc900065a10c0 [qh ffff88007bd22e80] [75706.370591] oxu210hp-ehci 0000:04:09.0: irq status 4a0a8 Async Recl IAA FLR [75706.390591] oxu210hp-ehci 0000:04:09.0: irq status 4a0a8 Async Recl IAA FLR [75727.120018] usb-storage: command_abort called [75727.120023] usb-storage: usb_stor_stop_transport called [75727.120024] usb-storage: -- cancelling URB [75727.120040] oxu210hp-ehci 0000:04:09.0: irq status 480a8 Async IAA FLR [75727.120053] usb usb2: clear tt buffer port 1, a2 ep2 t000d8d80 [75727.120067] oxu210hp-ehci 0000:04:09.0: ehci_urb_done 1 urb ffff88007be06b40 ep2in status -115 len 0/13 [75727.120083] usb-storage: Status code -104; transferred 0/13 [75727.120085] usb-storage: -- transfer cancelled [75727.120087] usb-storage: Bulk status result = 4 [75727.120088] usb-storage: -- command was aborted [75727.120091] usb-storage: usb_stor_pre_reset [75727.120103] oxu210hp-ehci 0000:04:09.0: port 1 reset [75727.175109] oxu210hp-ehci 0000:04:09.0: irq status 4008c FLR PCD [75727.175121] hub 2-0:1.0: state 7 ports 1 chg 0000 evt 0002 [75727.180019] oxu210hp-ehci 0000:04:09.0: GetStatus port 1 status 001805 POWER sig=j PE CONNECT [75727.240018] usb 2-1: reset full speed USB device using oxu210hp-ehci and address 2 [75727.240071] oxu210hp-ehci 0000:04:09.0: submit_async 1 urb ffff88007b049780 ep0out len 64, qtd ffffc900065a1240 [qh (null)] [75727.241325] oxu210hp-ehci 0000:04:09.0: irq status 48089 Async FLR INT [75727.241377] oxu210hp-ehci 0000:04:09.0: ehci_urb_done 1 urb ffff88007b049780 ep0in status 0 len 8/64 [75727.241416] oxu210hp-ehci 0000:04:09.0: port 1 reset [75727.260022] oxu210hp-ehci 0000:04:09.0: irq status 480a8 Async IAA FLR [75727.296421] oxu210hp-ehci 0000:04:09.0: irq status 4808c Async FLR PCD [75727.296430] hub 2-0:1.0: state 7 ports 1 chg 0000 evt 0002 [75727.300017] oxu210hp-ehci 0000:04:09.0: GetStatus port 1 status 001805 POWER sig=j PE CONNECT [75727.360050] oxu210hp-ehci 0000:04:09.0: submit_async 1 urb ffff88007b37e780 ep0out len 0, qtd ffffc900065a1180 [qh ffff88007bd22400] [75727.361328] oxu210hp-ehci 0000:04:09.0: irq status 48089 Async FLR INT [75727.361363] oxu210hp-ehci 0000:04:09.0: ehci_urb_done 1 urb ffff88007b37e780 ep0out status 0 len 0/0 [75727.361387] oxu210hp-ehci 0000:04:09.0: irq status 480a8 Async IAA FLR [75727.390014] usb 2-1: ep0 maxpacket = 8 [75727.390065] oxu210hp-ehci 0000:04:09.0: submit_async 1 urb ffff88007b37e780 ep0out len 18, qtd ffffc900065a1180 [qh (null)] [75727.391330] oxu210hp-ehci 0000:04:09.0: irq status 48089 Async FLR INT [75727.391380] oxu210hp-ehci 0000:04:09.0: ehci_urb_done 1 urb ffff88007b37e780 ep0in status 0 len 18/18 [75727.391454] oxu210hp-ehci 0000:04:09.0: submit_async 1 urb ffff88007b37e780 ep0out len 32, qtd ffffc900065a1240 [qh ffff88007bd22400] [75727.392328] oxu210hp-ehci 0000:04:09.0: irq status 48089 Async FLR INT [75727.392379] oxu210hp-ehci 0000:04:09.0: ehci_urb_done 1 urb ffff88007b37e780 ep0in status 0 len 32/32 [75727.392454] oxu210hp-ehci 0000:04:09.0: submit_async 1 urb ffff88007b37e780 ep0out len 255, qtd ffffc900065a11e0 [qh ffff88007bd22400] [75727.393328] oxu210hp-ehci 0000:04:09.0: irq status 48089 Async FLR INT [75727.393380] oxu210hp-ehci 0000:04:09.0: ehci_urb_done 1 urb ffff88007b37e780 ep0in status 0 len 92/255 [75727.393495] oxu210hp-ehci 0000:04:09.0: submit_async 1 urb ffff88007b37e780 ep0out len 0, qtd ffffc900065a1180 [qh ffff88007bd22400] [75727.394327] oxu210hp-ehci 0000:04:09.0: irq status 48089 Async FLR INT [75727.394361] oxu210hp-ehci 0000:04:09.0: ehci_urb_done 1 urb ffff88007b37e780 ep0out status 0 len 0/0 [75727.394381] usb-storage: usb_stor_post_reset [75727.394384] usb-storage: usb_reset_device returns 0 [75727.394386] usb-storage: scsi command aborted [75727.394389] usb-storage: *** thread sleeping. [75727.394393] usb-storage: queuecommand called [75727.394397] usb-storage: *** thread awakened. [75727.394399] usb-storage: Command TEST_UNIT_READY (6 bytes) [75727.394401] usb-storage: 00 00 00 00 00 00 [75727.394417] usb-storage: Bulk Command S 0x43425355 T 0x6 L 0 F 0 Trg 0 LUN 0 CL 0 [75727.394420] usb-storage: usb_stor_bulk_transfer_buf: xfer 31 bytes [75727.394434] oxu210hp-ehci 0000:04:09.0: submit_async 1 urb ffff88007be06b40 ep3out len 31, qtd ffffc900065a1060 [qh (null)] [75727.395325] oxu210hp-ehci 0000:04:09.0: irq status 48089 Async FLR INT [75727.395344] oxu210hp-ehci 0000:04:09.0: ehci_urb_done 1 urb ffff88007be06b40 ep3out status 0 len 31/31 [75727.395352] usb-storage: Status code 0; transferred 31/31 [75727.395354] usb-storage: -- transfer complete [75727.395356] usb-storage: Bulk command transfer result=0 [75727.395358] usb-storage: Attempting to get CSW... [75727.395360] usb-storage: usb_stor_bulk_transfer_buf: xfer 13 bytes [75727.395375] oxu210hp-ehci 0000:04:09.0: submit_async 1 urb ffff88007be06b40 ep2in len 13, qtd ffffc900065a10c0 [qh (null)] [75727.396324] oxu210hp-ehci 0000:04:09.0: irq status 48089 Async FLR INT [75727.396343] oxu210hp-ehci 0000:04:09.0: ehci_urb_done 1 urb ffff88007be06b40 ep2in status 0 len 13/13 [75727.396351] usb-storage: Status code 0; transferred 13/13 [75727.396353] usb-storage: -- transfer complete [75727.396354] usb-storage: Bulk status result = 0 [75727.396361] usb-storage: Bulk Status S 0x53425355 T 0x6 R 0 Stat 0x0 [75727.396366] usb-storage: scsi cmd done, result=0x0 [75727.396368] usb-storage: *** thread sleeping. [75727.396380] usb-storage: queuecommand called [75727.396384] usb-storage: *** thread awakened. [75727.396386] usb-storage: Command INQUIRY (6 bytes) [75727.396388] usb-storage: 12 00 00 00 24 00 [75727.396404] usb-storage: Bulk Command S 0x43425355 T 0x7 L 36 F 0 Trg 0 LUN 0 CL 0 [75727.396406] usb-storage: usb_stor_bulk_transfer_buf: xfer 31 bytes [75727.396420] oxu210hp-ehci 0000:04:09.0: submit_async 1 urb ffff88007be06b40 ep3out len 31, qtd ffffc900065a1120 [qh ffff88007bd22c80] [75727.397324] oxu210hp-ehci 0000:04:09.0: irq status 48089 Async FLR INT [75727.397342] oxu210hp-ehci 0000:04:09.0: ehci_urb_done 1 urb ffff88007be06b40 ep3out status 0 len 31/31 [75727.397350] usb-storage: Status code 0; transferred 31/31 [75727.397352] usb-storage: -- transfer complete [75727.397354] usb-storage: Bulk command transfer result=0 [75727.397356] usb-storage: usb_stor_bulk_transfer_sglist: xfer 36 bytes, 1 entries [75727.397378] oxu210hp-ehci 0000:04:09.0: submit_async 1 urb ffff88007b37e780 ep2in len 36, qtd ffffc900065a1060 [qh ffff88007bd22e80] [75727.398322] oxu210hp-ehci 0000:04:09.0: irq status 48089 Async FLR INT [75727.398341] oxu210hp-ehci 0000:04:09.0: ehci_urb_done 1 urb ffff88007b37e780 ep2in status 0 len 36/36 [75727.398367] usb-storage: Status code 0; transferred 36/36 [75727.398368] usb-storage: -- transfer complete [75727.398370] usb-storage: Bulk data transfer result 0x0 [75727.398372] usb-storage: Attempting to get CSW... [75727.398374] usb-storage: usb_stor_bulk_transfer_buf: xfer 13 bytes [75727.398389] oxu210hp-ehci 0000:04:09.0: submit_async 1 urb ffff88007be06b40 ep2in len 13, qtd ffffc900065a10c0 [qh ffff88007bd22e80] [75727.410333] oxu210hp-ehci 0000:04:09.0: irq status 4a0a8 Async Recl IAA FLR [75727.430333] oxu210hp-ehci 0000:04:09.0: irq status 4a0a8 Async Recl IAA FLR [75748.080017] usb-storage: command_abort called [75748.080022] usb-storage: usb_stor_stop_transport called [75748.080024] usb-storage: -- cancelling URB [75748.080063] oxu210hp-ehci 0000:04:09.0: irq status 480a8 Async IAA FLR [75748.080076] usb usb2: clear tt buffer port 1, a2 ep2 t000d8d80 [75748.080091] oxu210hp-ehci 0000:04:09.0: ehci_urb_done 1 urb ffff88007be06b40 ep2in status -115 len 0/13 [75748.080106] usb-storage: Status code -104; transferred 0/13 [75748.080107] usb-storage: -- transfer cancelled [75748.080109] usb-storage: Bulk status result = 4 [75748.080111] usb-storage: -- command was aborted [75748.080114] usb-storage: usb_stor_pre_reset [75748.080127] oxu210hp-ehci 0000:04:09.0: port 1 reset [75748.135132] oxu210hp-ehci 0000:04:09.0: irq status 4008c FLR PCD [75748.135144] hub 2-0:1.0: state 7 ports 1 chg 0000 evt 0002 [75748.140020] oxu210hp-ehci 0000:04:09.0: GetStatus port 1 status 001805 POWER sig=j PE CONNECT [75748.200018] usb 2-1: reset full speed USB device using oxu210hp-ehci and address 2 [75748.200071] oxu210hp-ehci 0000:04:09.0: submit_async 1 urb ffff88007b37e540 ep0out len 64, qtd ffffc900065a1180 [qh (null)] [75748.202064] oxu210hp-ehci 0000:04:09.0: irq status 48089 Async FLR INT [75748.202116] oxu210hp-ehci 0000:04:09.0: ehci_urb_done 1 urb ffff88007b37e540 ep0in status 0 len 8/64 [75748.202154] oxu210hp-ehci 0000:04:09.0: port 1 reset [75748.220067] oxu210hp-ehci 0000:04:09.0: irq status 480a8 Async IAA FLR [75748.257159] oxu210hp-ehci 0000:04:09.0: irq status 4808c Async FLR PCD [75748.257168] hub 2-0:1.0: state 7 ports 1 chg 0000 evt 0002 [75748.260018] oxu210hp-ehci 0000:04:09.0: GetStatus port 1 status 001805 POWER sig=j PE CONNECT [75748.320048] oxu210hp-ehci 0000:04:09.0: submit_async 1 urb ffff88007b37e900 ep0out len 0, qtd ffffc900065a11e0 [qh ffff88007bd22400] [75748.322068] oxu210hp-ehci 0000:04:09.0: irq status 48089 Async FLR INT [75748.322102] oxu210hp-ehci 0000:04:09.0: ehci_urb_done 1 urb ffff88007b37e900 ep0out status 0 len 0/0 [75748.322125] oxu210hp-ehci 0000:04:09.0: irq status 480a8 Async IAA FLR [75748.350014] usb 2-1: ep0 maxpacket = 8 [75748.350064] oxu210hp-ehci 0000:04:09.0: submit_async 1 urb ffff88007b37e900 ep0out len 18, qtd ffffc900065a11e0 [qh (null)] [75748.351070] oxu210hp-ehci 0000:04:09.0: irq status 48089 Async FLR INT [75748.351120] oxu210hp-ehci 0000:04:09.0: ehci_urb_done 1 urb ffff88007b37e900 ep0in status 0 len 18/18 [75748.351194] oxu210hp-ehci 0000:04:09.0: submit_async 1 urb ffff88007b37e900 ep0out len 32, qtd ffffc900065a1180 [qh ffff88007bd22400] [75748.352068] oxu210hp-ehci 0000:04:09.0: irq status 48089 Async FLR INT [75748.352119] oxu210hp-ehci 0000:04:09.0: ehci_urb_done 1 urb ffff88007b37e900 ep0in status 0 len 32/32 [75748.352194] oxu210hp-ehci 0000:04:09.0: submit_async 1 urb ffff88007b37e900 ep0out len 255, qtd ffffc900065a1240 [qh ffff88007bd22400] [75748.353068] oxu210hp-ehci 0000:04:09.0: irq status 48089 Async FLR INT [75748.353120] oxu210hp-ehci 0000:04:09.0: ehci_urb_done 1 urb ffff88007b37e900 ep0in status 0 len 92/255 [75748.353236] oxu210hp-ehci 0000:04:09.0: submit_async 1 urb ffff88007b37e900 ep0out len 0, qtd ffffc900065a11e0 [qh ffff88007bd22400] [75748.354067] oxu210hp-ehci 0000:04:09.0: irq status 48089 Async FLR INT [75748.354101] oxu210hp-ehci 0000:04:09.0: ehci_urb_done 1 urb ffff88007b37e900 ep0out status 0 len 0/0 [75748.354121] usb-storage: usb_stor_post_reset [75748.354124] usb-storage: usb_reset_device returns 0 [75748.354126] usb-storage: scsi command aborted [75748.354129] usb-storage: *** thread sleeping. [75748.354133] usb-storage: queuecommand called [75748.354136] usb-storage: *** thread awakened. [75748.354138] usb-storage: Command TEST_UNIT_READY (6 bytes) [75748.354140] usb-storage: 00 00 00 00 00 00 [75748.354156] usb-storage: Bulk Command S 0x43425355 T 0x8 L 0 F 0 Trg 0 LUN 0 CL 0 [75748.354159] usb-storage: usb_stor_bulk_transfer_buf: xfer 31 bytes [75748.354173] oxu210hp-ehci 0000:04:09.0: submit_async 1 urb ffff88007be06b40 ep3out len 31, qtd ffffc900065a1120 [qh (null)] [75748.355065] oxu210hp-ehci 0000:04:09.0: irq status 48089 Async FLR INT [75748.355084] oxu210hp-ehci 0000:04:09.0: ehci_urb_done 1 urb ffff88007be06b40 ep3out status 0 len 31/31 [75748.355092] usb-storage: Status code 0; transferred 31/31 [75748.355094] usb-storage: -- transfer complete [75748.355096] usb-storage: Bulk command transfer result=0 [75748.355097] usb-storage: Attempting to get CSW... [75748.355100] usb-storage: usb_stor_bulk_transfer_buf: xfer 13 bytes [75748.355115] oxu210hp-ehci 0000:04:09.0: submit_async 1 urb ffff88007be06b40 ep2in len 13, qtd ffffc900065a10c0 [qh (null)] [75748.356065] oxu210hp-ehci 0000:04:09.0: irq status 48089 Async FLR INT [75748.356083] oxu210hp-ehci 0000:04:09.0: ehci_urb_done 1 urb ffff88007be06b40 ep2in status 0 len 13/13 [75748.356091] usb-storage: Status code 0; transferred 13/13 [75748.356093] usb-storage: -- transfer complete [75748.356095] usb-storage: Bulk status result = 0 [75748.356101] usb-storage: Bulk Status S 0x53425355 T 0x8 R 0 Stat 0x0 [75748.356106] usb-storage: scsi cmd done, result=0x0 [75748.356108] usb-storage: *** thread sleeping. [75748.356185] usb-storage: queuecommand called [75748.356190] usb-storage: *** thread awakened. [75748.356192] usb-storage: Bad target number (1:0) [75748.356194] usb-storage: scsi cmd done, result=0x40000 [75748.356197] usb-storage: *** thread sleeping. [75748.356232] usb-storage: queuecommand called [75748.356236] usb-storage: *** thread awakened. [75748.356238] usb-storage: Bad target number (2:0) [75748.356240] usb-storage: scsi cmd done, result=0x40000 [75748.356242] usb-storage: *** thread sleeping. [75748.356275] usb-storage: queuecommand called [75748.356279] usb-storage: *** thread awakened. [75748.356281] usb-storage: Bad target number (3:0) [75748.356283] usb-storage: scsi cmd done, result=0x40000 [75748.356285] usb-storage: *** thread sleeping. [75748.356317] usb-storage: queuecommand called [75748.356321] usb-storage: *** thread awakened. [75748.356323] usb-storage: Bad target number (4:0) [75748.356324] usb-storage: scsi cmd done, result=0x40000 [75748.356327] usb-storage: *** thread sleeping. [75748.356358] usb-storage: queuecommand called [75748.356362] usb-storage: *** thread awakened. [75748.356364] usb-storage: Bad target number (5:0) [75748.356366] usb-storage: scsi cmd done, result=0x40000 [75748.356368] usb-storage: *** thread sleeping. [75748.356399] usb-storage: queuecommand called [75748.356403] usb-storage: *** thread awakened. [75748.356405] usb-storage: Bad target number (6:0) [75748.356407] usb-storage: scsi cmd done, result=0x40000 [75748.356410] usb-storage: *** thread sleeping. [75748.356441] usb-storage: queuecommand called [75748.356445] usb-storage: *** thread awakened. [75748.356447] usb-storage: Bad target number (7:0) [75748.356449] usb-storage: scsi cmd done, result=0x40000 [75748.356451] usb-storage: *** thread sleeping. [75748.370073] oxu210hp-ehci 0000:04:09.0: irq status 480a8 Async IAA FLR [75748.390074] oxu210hp-ehci 0000:04:09.0: irq status 480a8 Async IAA FLR [75748.410075] oxu210hp-ehci 0000:04:09.0: irq status 480a8 Async IAA FLR And this is the output of usbmon: $ sudo cat /sys/kernel/debug/usb/usbmon/2u ffff88007bf5a480 3000995316 C Ii:2:001:1 0:2048 1 = 02 ffff88007bf5a480 3000995328 S Ii:2:001:1 -115:2048 4 < ffff88007b85c540 3000995339 S Ci:2:001:0 s a3 00 0000 0001 0004 4 < ffff88007b85c540 3000995349 C Ci:2:001:0 0 4 = 01010100 ffff88007b85c540 3000995353 S Co:2:001:0 s 23 01 0010 0001 0000 0 ffff88007b85c540 3000995358 C Co:2:001:0 0 0 ffff88007b85c540 3000995364 S Ci:2:001:0 s a3 00 0000 0001 0004 4 < ffff88007b85c540 3000995372 C Ci:2:001:0 0 4 = 01010000 ffff88007b85c180 3001033247 S Ci:2:001:0 s a3 00 0000 0001 0004 4 < ffff88007b85c180 3001033259 C Ci:2:001:0 0 4 = 01010000 ffff88007b85c9c0 3001073247 S Ci:2:001:0 s a3 00 0000 0001 0004 4 < ffff88007b85c9c0 3001073256 C Ci:2:001:0 0 4 = 01010000 ffff88007b85c240 3001113247 S Ci:2:001:0 s a3 00 0000 0001 0004 4 < ffff88007b85c240 3001113256 C Ci:2:001:0 0 4 = 01010000 ffff88007b85c0c0 3001153246 S Ci:2:001:0 s a3 00 0000 0001 0004 4 < ffff88007b85c0c0 3001153256 C Ci:2:001:0 0 4 = 01010000 ffff88007b85c0c0 3001153267 S Co:2:001:0 s 23 03 0004 0001 0000 0 ffff88007b85c0c0 3001153275 C Co:2:001:0 0 0 ffff88007bf5a480 3001208288 C Ii:2:001:1 0:2048 1 = 02 ffff88007bf5a480 3001208291 S Ii:2:001:1 -115:2048 4 < ffff88007b85cf00 3001213248 S Ci:2:001:0 s a3 00 0000 0001 0004 4 < ffff88007b85cf00 3001213258 C Ci:2:001:0 0 4 = 03010000 ffff88007b85c840 3001273247 S Co:2:001:0 s 23 01 0014 0001 0000 0 ffff88007b85c840 3001273253 C Co:2:001:0 0 0 ffff88007b85c840 3001273261 S Ci:2:000:0 s 80 06 0100 0000 0040 64 < ffff88007b85c840 3001275106 C Ci:2:000:0 0 8 = 12011001 00000008 ffff88007b85c840 3001275116 S Co:2:001:0 s 23 03 0004 0001 0000 0 ffff88007b85c840 3001275123 C Co:2:001:0 0 0 ffff88007bf5a480 3001330136 C Ii:2:001:1 0:2048 1 = 02 ffff88007bf5a480 3001330139 S Ii:2:001:1 -115:2048 4 < ffff88007aacd9c0 3001333248 S Ci:2:001:0 s a3 00 0000 0001 0004 4 < ffff88007aacd9c0 3001333258 C Ci:2:001:0 0 4 = 03010000 ffff88007aacd6c0 3001393247 S Co:2:001:0 s 23 01 0014 0001 0000 0 ffff88007aacd6c0 3001393252 C Co:2:001:0 0 0 ffff88007aacd6c0 3001393256 S Co:2:000:0 s 00 05 0002 0000 0000 0 ffff88007aacd6c0 3001395070 C Co:2:000:0 0 0 ffff88007aacda80 3001423251 S Ci:2:002:0 s 80 06 0100 0000 0012 18 < ffff88007aacda80 3001424098 C Ci:2:002:0 0 18 = 12011001 00000008 dc058000 01000101 0201 ffff88007aacda80 3001424120 S Ci:2:002:0 s 80 06 0200 0000 0009 9 < ffff88007aacda80 3001425095 C Ci:2:002:0 0 9 = 09022000 01010080 2d ffff88007aacda80 3001425112 S Ci:2:002:0 s 80 06 0200 0000 0020 32 < ffff88007aacda80 3001426100 C Ci:2:002:0 0 32 = 09022000 01010080 2d090400 00020806 50010705 82024000 00070503 02400000 ffff88007aacda80 3001426123 S Ci:2:002:0 s 80 06 0300 0000 00ff 255 < ffff88007aacda80 3001427160 C Ci:2:002:0 0 128 = 04030000 20034c00 45005800 52002000 50004c00 55004700 20004400 52004900 ffff88007aacda80 3001427183 S Ci:2:002:0 s 80 06 0301 0000 00ff 255 < ffff88007aacda80 3001428160 C Ci:2:002:0 0 124 = 20034c00 45005800 52002000 50004c00 55004700 20004400 52004900 56004500 ffff88007aacda80 3001428181 S Ci:2:002:0 s 80 06 0301 0000 00ff 255 < ffff88007aacda80 3001429160 C Ci:2:002:0 0 124 = 20034c00 45005800 52002000 50004c00 55004700 20004400 52004900 56004500 ffff88007aacda80 3001429180 S Ci:2:002:0 s 80 06 0302 0000 00ff 255 < ffff88007aacda80 3001430160 C Ci:2:002:0 0 92 = 5c034600 31003000 36003200 39003000 32003000 33003100 30003000 35003100 ffff88007bf0e0c0 3001430739 S Co:2:002:0 s 00 09 0001 0000 0000 0 ffff88007bf0e0c0 3001431076 C Co:2:002:0 0 0 ffff88007bf0e6c0 3001431123 S Ci:2:002:0 s 80 06 0301 0000 00ff 255 < ffff88007bf0e6c0 3001432168 C Ci:2:002:0 0 124 = 20034c00 45005800 52002000 50004c00 55004700 20004400 52004900 56004500 ffff88007aaef9c0 3001432526 S Ci:2:001:0 s a3 00 0000 0001 0004 4 < ffff88007aaef9c0 3001432537 C Ci:2:001:0 0 4 = 03010000 ffff88007bcdbb40 3002443257 S Ci:2:002:0 s a1 fe 0000 0000 0001 1 < ffff88007bcdbb40 3002445126 C Ci:2:002:0 0 1 = 00 ffff88007bcdbb40 3002445266 S Bo:2:002:3 -115 31 = 55534243 01000000 24000000 00000012 00000024 00000000 00000000 000000 ffff88007bcdbb40 3002446085 C Bo:2:002:3 0 31 > ffff88007bf5aa80 3002446111 S Bi:2:002:2 -115 36 < ffff88007bf5aa80 3002447103 C Bi:2:002:2 0 36 = 00800101 1f000000 4c455841 52202020 4a554d50 44524956 45202020 20202020 ffff88007bcdbb40 3002447133 S Bi:2:002:2 -115 13 < ffff88007bcdbb40 3023693307 C Bi:2:002:2 -104 0 ffff88007bb6ec00 3023693362 S Co:2:001:0 s 23 03 0004 0001 0000 0 ffff88007bb6ec00 3023693372 C Co:2:001:0 0 0 ffff88007bf5a480 3023748385 C Ii:2:001:1 0:2048 1 = 02 ffff88007bf5a480 3023748390 S Ii:2:001:1 -115:2048 4 < ffff88007bb6e900 3023753250 S Ci:2:001:0 s a3 00 0000 0001 0004 4 < ffff88007bb6e900 3023753261 C Ci:2:001:0 0 4 = 03010000 ffff88007bb6e0c0 3023813248 S Co:2:001:0 s 23 01 0014 0001 0000 0 ffff88007bb6e0c0 3023813254 C Co:2:001:0 0 0 ffff88007bb6e0c0 3023813263 S Ci:2:000:0 s 80 06 0100 0000 0040 64 < ffff88007bb6e0c0 3023814905 C Ci:2:000:0 0 8 = 12011001 00000008 ffff88007bb6e0c0 3023814923 S Co:2:001:0 s 23 03 0004 0001 0000 0 ffff88007bb6e0c0 3023814931 C Co:2:001:0 0 0 ffff88007bf5a480 3023869942 C Ii:2:001:1 0:2048 1 = 02 ffff88007bf5a480 3023869947 S Ii:2:001:1 -115:2048 4 < ffff88007bb6e3c0 3023873251 S Ci:2:001:0 s a3 00 0000 0001 0004 4 < ffff88007bb6e3c0 3023873261 C Ci:2:001:0 0 4 = 03010000 ffff88007bb6e480 3023933247 S Co:2:001:0 s 23 01 0014 0001 0000 0 ffff88007bb6e480 3023933253 C Co:2:001:0 0 0 ffff88007bb6e480 3023933257 S Co:2:000:0 s 00 05 0002 0000 0000 0 ffff88007bb6e480 3023934869 C Co:2:000:0 0 0 ffff88007bb6e9c0 3023963251 S Ci:2:002:0 s 80 06 0100 0000 0012 18 < ffff88007bb6e9c0 3023963897 C Ci:2:002:0 0 18 = 12011001 00000008 dc058000 01000101 0201 ffff88007bb6e9c0 3023963917 S Ci:2:002:0 s 80 06 0200 0000 0020 32 < ffff88007bb6e9c0 3023964898 C Ci:2:002:0 0 32 = 09022000 01010080 2d090400 00020806 50010705 82024000 00070503 02400000 ffff88007bb6e9c0 3023964920 S Ci:2:002:0 s 80 06 0302 0000 00ff 255 < ffff88007bb6e9c0 3023965959 C Ci:2:002:0 0 92 = 5c034600 31003000 36003200 39003000 32003000 33003100 30003000 35003100 ffff88007bb6e9c0 3023965980 S Co:2:002:0 s 00 09 0001 0000 0000 0 ffff88007bb6e9c0 3023966870 C Co:2:002:0 0 0 ffff88007bcdbb40 3023966935 S Bo:2:002:3 -115 31 = 55534243 02000000 00000000 00000000 00000000 00000000 00000000 000000 ffff88007bcdbb40 3023967848 C Bo:2:002:3 0 31 > ffff88007bcdbb40 3023967873 S Bi:2:002:2 -115 13 < ffff88007bcdbb40 3023968848 C Bi:2:002:2 0 13 = 55534253 02000000 00000000 00 ffff88007bcdbb40 3023968933 S Bo:2:002:3 -115 31 = 55534243 03000000 24000000 00000012 00000024 00000000 00000000 000000 ffff88007bcdbb40 3023969848 C Bo:2:002:3 0 31 > ffff88007bb6e9c0 3023969873 S Bi:2:002:2 -115 36 < ffff88007bb6e9c0 3023970866 C Bi:2:002:2 0 36 = 00800101 1f000000 4c455841 52202020 4a554d50 44524956 45202020 20202020 ffff88007bcdbb40 3023970895 S Bi:2:002:2 -115 13 < Any idea or suggestion that could help me to debug this problem is welcome... Thanks in advance, -Andrea Signed-off-by: Andrea Righi <arighi@xxxxxxxxxxx> --- arch/x86/Kconfig | 2 +- drivers/usb/core/hcd.c | 37 +++-- drivers/usb/host/Kconfig | 10 + drivers/usb/host/ehci-hcd.c | 26 +++- drivers/usb/host/ehci-oxu210hp.c | 363 ++++++++++++++++++++++++++++++++++++++ drivers/usb/host/ehci-oxu210hp.h | 70 ++++++++ 7 files changed, 502 insertions(+), 22 deletions(-) diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index dcb0593..2396776 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -43,7 +43,7 @@ config X86 select HAVE_KVM select HAVE_ARCH_KGDB select HAVE_ARCH_TRACEHOOK - select HAVE_GENERIC_DMA_COHERENT if X86_32 + select HAVE_GENERIC_DMA_COHERENT select HAVE_EFFICIENT_UNALIGNED_ACCESS select USER_STACKTRACE_SUPPORT select HAVE_REGS_AND_STACK_ACCESS_API diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c index 12742f1..51fd1c5 100644 --- a/drivers/usb/core/hcd.c +++ b/drivers/usb/core/hcd.c @@ -1212,28 +1212,32 @@ EXPORT_SYMBOL_GPL(usb_hcd_unlink_urb_from_ep); * */ +#define HCD_COHERENT_CHUNK sizeof(void *) static int hcd_alloc_coherent(struct usb_bus *bus, gfp_t mem_flags, dma_addr_t *dma_handle, void **vaddr_handle, size_t size, enum dma_data_direction dir) { unsigned char *vaddr; + size_t size2; - vaddr = hcd_buffer_alloc(bus, size + sizeof(vaddr), - mem_flags, dma_handle); + /* + * Store the address of the original buffer at the end of the + * newly-allocated dma buffer, so that it can be put back when + * the dma buffer is deallocated. + * + * Avoid unaligned accesses (which some buses can't handle) by rounding + * up to a multiple of HCD_COHERENT_CHUNK. + */ + size2 = HCD_COHERENT_CHUNK * + DIV_ROUND_UP(size + sizeof(vaddr), HCD_COHERENT_CHUNK); + vaddr = hcd_buffer_alloc(bus, size2, mem_flags, dma_handle); + + BUG_ON(*vaddr_handle == NULL); if (!vaddr) return -ENOMEM; - /* - * Store the virtual address of the buffer at the end - * of the allocated dma buffer. The size of the buffer - * may be uneven so use unaligned functions instead - * of just rounding up. It makes sense to optimize for - * memory footprint over access speed since the amount - * of memory available for dma may be limited. - */ - put_unaligned((unsigned long)*vaddr_handle, - (unsigned long *)(vaddr + size)); + *(void **)(vaddr + size2 - sizeof(vaddr)) = *vaddr_handle; if (dir == DMA_TO_DEVICE) memcpy(vaddr, *vaddr_handle, size); @@ -1247,17 +1251,22 @@ static void hcd_free_coherent(struct usb_bus *bus, dma_addr_t *dma_handle, enum dma_data_direction dir) { unsigned char *vaddr = *vaddr_handle; + size_t size2; - vaddr = (void *)get_unaligned((unsigned long *)(vaddr + size)); + size2 = HCD_COHERENT_CHUNK * + DIV_ROUND_UP(size + sizeof(vaddr), HCD_COHERENT_CHUNK); + vaddr = *(void **)(vaddr + size2 - sizeof(vaddr)); + BUG_ON(vaddr == NULL); if (dir == DMA_FROM_DEVICE) memcpy(vaddr, *vaddr_handle, size); - hcd_buffer_free(bus, size + sizeof(vaddr), *vaddr_handle, *dma_handle); + hcd_buffer_free(bus, size2, *vaddr_handle, *dma_handle); *vaddr_handle = vaddr; *dma_handle = 0; } +#undef HCD_COHERENT_SIZE static void unmap_urb_for_dma(struct usb_hcd *hcd, struct urb *urb) { diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig index f865be2..1668a5c 100644 --- a/drivers/usb/host/Kconfig +++ b/drivers/usb/host/Kconfig @@ -137,6 +137,16 @@ config USB_W90X900_EHCI ---help--- Enables support for the W90X900 USB controller +config USB_EHCI_OXU210HP_PCI + bool "EHCI based EV-OXU210HP-PCI HCD support (EXPERIMENTAL)" + depends on PCI && USB_EHCI_HCD && EXPERIMENTAL + default n + ---help--- + The EV-OXU210HP-PCI is an USB host/OTG/device controller. Enable this + option if you have this evaluation board connected to the PCI bus. + + If unsure, say N. + config USB_OXU210HP_HCD tristate "OXU210HP HCD support" depends on USB diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c index a3ef2a9..96b3879 100644 --- a/drivers/usb/host/ehci-hcd.c +++ b/drivers/usb/host/ehci-hcd.c @@ -65,8 +65,8 @@ static const char hcd_name [] = "ehci_hcd"; -#undef VERBOSE_DEBUG -#undef EHCI_URB_TRACE +#define VERBOSE_DEBUG +#define EHCI_URB_TRACE #ifdef DEBUG #define EHCI_STATS @@ -1103,6 +1103,11 @@ MODULE_LICENSE ("GPL"); #define PCI_DRIVER ehci_pci_driver #endif +#ifdef CONFIG_USB_EHCI_OXU210HP_PCI +#include "ehci-oxu210hp.c" +#define OXU210HP_DRIVER oxu210hp_ehci_driver +#endif + #ifdef CONFIG_USB_EHCI_FSL #include "ehci-fsl.c" #define PLATFORM_DRIVER ehci_fsl_driver @@ -1160,7 +1165,7 @@ MODULE_LICENSE ("GPL"); #if !defined(PCI_DRIVER) && !defined(PLATFORM_DRIVER) && \ !defined(PS3_SYSTEM_BUS_DRIVER) && !defined(OF_PLATFORM_DRIVER) && \ - !defined(XILINX_OF_PLATFORM_DRIVER) + !defined(XILINX_OF_PLATFORM_DRIVER) && !defined(OXU210HP_DRIVER) #error "missing bus glue for ehci-hcd" #endif @@ -1220,10 +1225,20 @@ static int __init ehci_hcd_init(void) if (retval < 0) goto clean4; #endif + +#ifdef OXU210HP_DRIVER + retval = pci_register_driver(&oxu210_pci_driver); + if (retval < 0) + goto clean5; +#endif return retval; +#ifdef OXU210HP_DRIVER + /* pci_unregister_driver(&oxu210_pci_driver); */ +clean5: +#endif #ifdef XILINX_OF_PLATFORM_DRIVER - /* of_unregister_platform_driver(&XILINX_OF_PLATFORM_DRIVER); */ + of_unregister_platform_driver(&XILINX_OF_PLATFORM_DRIVER); clean4: #endif #ifdef OF_PLATFORM_DRIVER @@ -1254,6 +1269,9 @@ module_init(ehci_hcd_init); static void __exit ehci_hcd_cleanup(void) { +#ifdef OXU210HP_DRIVER + pci_unregister_driver(&oxu210_pci_driver); +#endif #ifdef XILINX_OF_PLATFORM_DRIVER of_unregister_platform_driver(&XILINX_OF_PLATFORM_DRIVER); #endif diff --git a/drivers/usb/host/ehci-oxu210hp.c b/drivers/usb/host/ehci-oxu210hp.c new file mode 100644 index 0000000..c9117d9 --- /dev/null +++ b/drivers/usb/host/ehci-oxu210hp.c @@ -0,0 +1,363 @@ +/* + * EV-OXU210-PCI EHCI Host Controller Driver + * + * Copyright (c) 2010 Andrea Righi <arighi@xxxxxxxxxxx> + * + * Part of this code is based on the OXU210HP-HCD driver by Rodolfo Giometti + * <giometti@xxxxxxxx> and EHCI-OXU210HP by Amit Walambe + * <amit.walambe@xxxxxxxxxxxx>. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include <linux/irq.h> +#include <linux/pci.h> +#include <linux/types.h> +#include <asm-generic/dma-coherent.h> + +#include "ehci-oxu210hp.h" + +/* OXU210 PCI definitions */ +#define OXU210_PCI_VENDOR_ID 0x192e +#define OXU210_PCI_DEVICE_ID 0x032b +#define OXU210_PCI_BAR 3 +#define OXU210_MEM_SIZE 0x20000 + +#define OXU_STARTUP_CONFIG 0x00000b7c + +static int oxu210hp_reset(struct usb_hcd *hcd) +{ + struct ehci_hcd *ehci = hcd_to_ehci(hcd); + struct pci_dev *pdev = to_pci_dev(hcd->self.controller); + int ret; + + printk(KERN_INFO "initializing SPH controller\n"); + + ehci->caps = hcd->regs + OXU_SPH_CAP_OFFSET; + ehci->regs = hcd->regs + OXU_SPH_CAP_OFFSET + HC_LENGTH(ehci_readl(ehci, + &ehci->caps->hc_capbase)); + dbg_hcs_params(ehci, "reset"); + dbg_hcc_params(ehci, "reset"); + + /* Cache this readonly data: minimize chip reads */ + ehci->hcs_params = ehci_readl(ehci, &ehci->caps->hcs_params); + + ret = ehci_halt(ehci); + if (ret) + return ret; + ret = ehci_init(hcd); + if (ret) + return ret; + + /* Avoid scatter-gather communications */ + hcd->self.sg_tablesize = 0; + + /* Serial Bus Release Number is at PCI 0x60 offset */ + pci_read_config_byte(pdev, 0x60, &ehci->sbrn); + + hcd->has_tt = 1; + tdi_reset(ehci); + + ehci_reset(ehci); + ehci_port_power(ehci, 1); + if (!pci_set_mwi(pdev)) + ehci_dbg(ehci, "MWI active\n"); + return ret; +} + +static const struct hc_driver oxu210hp_ehci_hc_driver = { + .description = hcd_name, + .product_desc = "EV-OXU210-PCI EHCI Host Controller", + .hcd_priv_size = sizeof(struct ehci_hcd), + + /* generic hardware linkage */ + .irq = ehci_irq, + .flags = HCD_MEMORY | HCD_LOCAL_MEM | HCD_USB2, + + /* basic lifecycle operations */ + .reset = oxu210hp_reset, + .start = ehci_run, + .stop = ehci_stop, + .shutdown = ehci_shutdown, + + /* managing i/o requests and associated device resources */ + .urb_enqueue = ehci_urb_enqueue, + .urb_dequeue = ehci_urb_dequeue, + .endpoint_disable = ehci_endpoint_disable, + .endpoint_reset = ehci_endpoint_reset, + + /* scheduling support */ + .get_frame_number = ehci_get_frame, + + /* root hub support */ + .hub_status_data = ehci_hub_status_data, + .hub_control = ehci_hub_control, +#if defined(CONFIG_PM) + .bus_suspend = ehci_bus_suspend, + .bus_resume = ehci_bus_resume, +#endif + .relinquish_port = ehci_relinquish_port, + .port_handed_over = ehci_port_handed_over, + + .clear_tt_buffer_complete = ehci_clear_tt_buffer_complete, +}; + +static struct usb_hcd *oxu210hp_create(struct pci_dev *pdev, + unsigned long memstart, unsigned long memlen, + void *base, int irq) +{ + struct device *dev = &pdev->dev; + struct usb_hcd *hcd; + int ret; + + /* Set endian mode and host mode */ + writel(OXU_CM_HOST_ONLY | OXU_ES_LITTLE | OXU_VBPS, + base + OXU_SPH_CORE_OFFSET + OXU_USBMODE); + hcd = usb_create_hcd(&oxu210hp_ehci_hc_driver, dev, "oxu210hp_sph"); + if (!hcd) + return ERR_PTR(-ENOMEM); + + hcd->rsrc_start = memstart; + hcd->rsrc_len = memlen; + hcd->regs = base; + hcd->irq = irq; + hcd->state = HC_STATE_HALT; + + ret = usb_add_hcd(hcd, irq, IRQF_SHARED); + if (ret < 0) + return ERR_PTR(ret); + return hcd; +} + +static void oxu210hp_configuration(struct pci_dev *pdev, void *base) +{ + u32 reg; + + /* Initialize top level registers */ + writel(OXU_STARTUP_CONFIG, base + OXU_HOSTIFCONFIG); + writel(OXU_SRESET, base + OXU_SOFTRESET); + writel(OXU_STARTUP_CONFIG, base + OXU_HOSTIFCONFIG); + + reg = readl(base + OXU_PIOBURSTREADCTRL); + writel(reg | 0x40, base + OXU_PIOBURSTREADCTRL); + + writel(OXU_SPHPOEN | OXU_OVRCCURPUPDEN | OXU_COMPARATOR | OXU_ASO_OP, + base + OXU_ASO); + + reg = readl(base + OXU_CLKCTRL_SET); + writel(reg | OXU_SYSCLKEN | OXU_USBOTGCLKEN, base + OXU_CLKCTRL_SET); + + /* Clear all top interrupt enable */ + writel(0xff, base + OXU_CHIPIRQEN_CLR); + + /* Clear all top interrupt status */ + writel(0xff, base + OXU_CHIPIRQSTATUS); + + /* Enable all needed top interrupt except OTG SPH core */ + writel(OXU_USBSPHLPWUI | OXU_USBOTGLPWUI, base + OXU_CHIPIRQEN_SET); +} + +static int oxu210hp_verify_id(struct pci_dev *pdev, void *base) +{ + const char *bo[] = { + "reserved", + "128-pin LQFP", + "84-pin TFBGA", + "reserved", + }; + u32 id; + + /* Read controller signature register to find a match */ + id = readl(base + OXU_DEVICEID); + dev_info(&pdev->dev, "device ID %x\n", id); + if ((id & OXU_REV_MASK) != (OXU_REV_2100 << OXU_REV_SHIFT)) + return -ENODEV; + dev_info(&pdev->dev, "found device %x %s (%04x:%04x)\n", + id >> OXU_REV_SHIFT, + bo[(id & OXU_BO_MASK) >> OXU_BO_SHIFT], + (id & OXU_MAJ_REV_MASK) >> OXU_MAJ_REV_SHIFT, + (id & OXU_MIN_REV_MASK) >> OXU_MIN_REV_SHIFT); + return 0; +} + +static int oxu210hp_init(struct pci_dev *pdev, + unsigned long memstart, unsigned long memlen, + void *base, int irq) +{ + struct usb_hcd *hcd = pci_get_drvdata(pdev); + int ret; + + oxu210hp_configuration(pdev, base); + + ret = oxu210hp_verify_id(pdev, base); + if (ret) { + dev_err(&pdev->dev, "no device found!\n"); + return -ENODEV; + } + + /* Create the SPH host controller */ + hcd = oxu210hp_create(pdev, memstart, memlen, base, irq); + if (IS_ERR(hcd)) { + dev_err(&pdev->dev, "could not create SPH controller!\n"); + return PTR_ERR(hcd); + } + pci_set_drvdata(pdev, hcd); + + writel(readl(base + OXU_CHIPIRQEN_SET) | OXU_USBSPHI | OXU_USBOTGI, + base + OXU_CHIPIRQEN_SET); + return 0; +} + +static int +oxu210hp_ehci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) +{ + void __iomem *base; + unsigned long memstart, memlen; + int ret = 0; + + ret = pci_enable_device(pdev); + if (ret < 0) { + dev_err(&pdev->dev, "could not enable device\n"); + return ret; + } + if (!(pci_resource_flags(pdev, OXU210_PCI_BAR) & IORESOURCE_MEM)) { + dev_err(&pdev->dev, + "region #%d not an MMIO resource\n", + OXU210_PCI_BAR); + ret = -ENODEV; + goto err_out_disable; + } + memlen = pci_resource_len(pdev, OXU210_PCI_BAR); + if (memlen < OXU210_MEM_SIZE) { + dev_err(&pdev->dev, "invalid PCI region size\n"); + ret = -ENODEV; + goto err_out_disable; + } + ret = pci_request_regions(pdev, "oxu210hp-ehci"); + if (ret < 0) { + dev_err(&pdev->dev, "could not request regions\n"); + goto err_out_disable; + } + ret = set_irq_type(pdev->irq, IRQF_TRIGGER_FALLING); + if (ret < 0) { + dev_err(&pdev->dev, "error setting irq type\n"); + ret = -EFAULT; + goto err_out_release; + } + dev_info(&pdev->dev, "IRQ resource %d\n", pdev->irq); + memstart = pci_resource_start(pdev, OXU210_PCI_BAR); + + /* + * OXU210 memory map + * + * Block Address Size + * ----------------------------------------- + * Host interface 0x0000 1KB + * USB OTG regs 0x0400 1KB + * USB SPH regs 0x0800 1KB + * Reserved 0x0c00 1KB + * Memory expansion 0x1000 12KB + * Reserved 0x4000 32KB + * Memory expansion 0xc000 8KB + * Static RAM 0xe000 72KB + */ + base = ioremap(memstart, OXU_REG_SIZE); + if (!base) { + dev_err(&pdev->dev, "could not remap MMIO\n"); + ret = -EIO; + goto err_out_release; + } + if (!dma_declare_coherent_memory(&pdev->dev, + memstart + OXU_SRAM_OFFSET, /* bus address */ + memstart + OXU_SRAM_OFFSET, /* device address */ + OXU_SRAM_SIZE, /* size */ + DMA_MEMORY_MAP | DMA_MEMORY_EXCLUSIVE)) { + dev_err(&pdev->dev, + "could not declare DMA coherent memory\n"); + ret = -ENXIO; + goto err_out_iounmap; + } + + /* prevent usb-core allocating system DMA pages */ + pdev->dev.dma_mask = NULL; + + /* Initialize OXU210 chipset */ + ret = oxu210hp_init(pdev, memstart, OXU_REG_SIZE, base, pdev->irq); + if (ret < 0) { + dev_dbg(&pdev->dev, "cannot init USB devices\n"); + goto err_out_dma; + } + dev_info(&pdev->dev, "devices enabled and running\n"); +out: + return ret; + +err_out_dma: + dma_release_declared_memory(&pdev->dev); +err_out_iounmap: + iounmap(base); +err_out_release: + pci_release_regions(pdev); +err_out_disable: + pci_disable_device(pdev); + goto out; +} + +static void oxu210hp_ehci_remove(struct pci_dev *pdev) +{ + struct usb_hcd *hcd; + + hcd = pci_get_drvdata(pdev); + if (!hcd) + return; + + usb_remove_hcd(hcd); + iounmap(hcd->regs); + pci_release_regions(pdev); + dma_release_declared_memory(&pdev->dev); + + dev_set_drvdata(&pdev->dev, NULL); + usb_put_hcd(hcd); + + pci_disable_device(pdev); +} + +static void oxu210hp_ehci_shutdown(struct pci_dev *pdev) +{ + struct usb_hcd *hcd; + + hcd = pci_get_drvdata(pdev); + if (!hcd) + return; + if (hcd->driver->shutdown) + hcd->driver->shutdown(hcd); +} + +MODULE_ALIAS("oxu210hp-ehci"); + +static struct pci_device_id oxu210hp_pci_table[] = { + { PCI_DEVICE(OXU210_PCI_VENDOR_ID, OXU210_PCI_DEVICE_ID), 0, 0, + (unsigned long)&oxu210hp_ehci_hc_driver}, + { }, +}; +MODULE_DEVICE_TABLE(pci, oxu210hp_pci_table); + +static struct pci_driver oxu210_pci_driver = { + .name = "oxu210hp-ehci", + .id_table = oxu210hp_pci_table, + + .probe = oxu210hp_ehci_probe, + .remove = oxu210hp_ehci_remove, + .shutdown = oxu210hp_ehci_shutdown, +}; diff --git a/drivers/usb/host/ehci-oxu210hp.h b/drivers/usb/host/ehci-oxu210hp.h new file mode 100644 index 0000000..edaf380 --- /dev/null +++ b/drivers/usb/host/ehci-oxu210hp.h @@ -0,0 +1,70 @@ +#ifndef EHCI_OXU210HP_H +#define EHCI_OXU210HP_H + +/* + * OXU210 registers and values definition + */ + +#define OXU_DEVICEID 0x00 + #define OXU_REV_MASK 0xffff0000 + #define OXU_REV_SHIFT 16 + #define OXU_REV_2100 0x2100 + #define OXU_BO_SHIFT 8 + #define OXU_BO_MASK (0x3 << OXU_BO_SHIFT) + #define OXU_MAJ_REV_SHIFT 4 + #define OXU_MAJ_REV_MASK (0xf << OXU_MAJ_REV_SHIFT) + #define OXU_MIN_REV_SHIFT 0 + #define OXU_MIN_REV_MASK (0xf << OXU_MIN_REV_SHIFT) +#define OXU_HOSTIFCONFIG 0x04 +#define OXU_SOFTRESET 0x08 + #define OXU_SRESET (1 << 0) + +#define OXU_PIOBURSTREADCTRL 0x0C + +#define OXU_CHIPIRQSTATUS 0x10 +#define OXU_CHIPIRQEN_SET 0x14 +#define OXU_CHIPIRQEN_CLR 0x18 + #define OXU_USBSPHLPWUI 0x00000080 + #define OXU_USBOTGLPWUI 0x00000040 + #define OXU_USBSPHI 0x00000002 + #define OXU_USBOTGI 0x00000001 + +#define OXU_CLKCTRL_SET 0x1C + #define OXU_SYSCLKEN 0x00000008 + #define OXU_USBSPHCLKEN 0x00000002 + #define OXU_USBOTGCLKEN 0x00000001 + +#define OXU_ASO 0x68 + #define OXU_SPHPOEN 0x00000100 + #define OXU_OVRCCURPUPDEN 0x00000800 + #define OXU_ASO_OP (1 << 10) + #define OXU_COMPARATOR 0x000004000 + +#define OXU_USBMODE 0x1A8 + #define OXU_VBPS 0x00000020 + #define OXU_ES_LITTLE 0x00000000 + #define OXU_CM_HOST_ONLY 0x00000003 + +/* + * OXU210HP memory organization + */ + +#define OXU_OTG_CORE_OFFSET 0x00400 +#define OXU_OTG_CAP_OFFSET (OXU_OTG_CORE_OFFSET + 0x100) +#define OXU_SPH_CORE_OFFSET 0x00800 +#define OXU_SPH_CAP_OFFSET (OXU_SPH_CORE_OFFSET + 0x100) + +/* + * Register space is limited to the first 4KB of the first 32KB memory section: + * Chip, GPIO, slave DMA & mailbox registers. + */ +#define OXU_REG_OFFSET 0x1000 +#define OXU_REG_SIZE 0x1000 + +#define OXU_SRAM_OFFSET 0xe000 +#define OXU_SRAM_END 0x20000 +#define OXU_SRAM_SIZE (OXU_SRAM_END - OXU_SRAM_OFFSET) + +#include <linux/oxu210hp.h> + +#endif /* EHCI_OXU210HP_H */ -- 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