2010/9/20 Patriarche, Herve <herve.patriarche@xxxxxxxxxxxxx>: > Hello Ming Lei, > > I really wonder if the dma_free_coherent is the root cause: Seems dma_free_coherent is not the root cause, see my comments below. > I got status code -121 after the error. No, you got -121 status code before the warning. > Is it easy to avoid the dma_free_coherent ? If your hcd does not set HCD_LOCAL_MEM, you can avoid the dma_free_coherent. If your usb host controller does require HCD_LOCAL_MEM, you can't avoid it at least now. > Thanks, Herve. > > > root@MM6_160117:/# > root@MM6_160117:/# hub 1-0:1.0: state 7 ports 1 chg 0000 evt 0002 > oxu210hp-ehci oxu210hp-ehci.0: GetStatus port 1 status 001803 POWER > sig=j CSC CONNECT > hub 1-0:1.0: port 1, status 0501, change 0001, 480 Mb/s > hub 1-0:1.0: debounce: port 1: total 100ms stable 100ms status 0x501 > oxu210hp-ehci oxu210hp-ehci.0: port 1 high speed > oxu210hp-ehci oxu210hp-ehci.0: GetStatus port 1 status 8001205 POWER > sig=se0 PE CONNECT >From the log info above, seems your hcd file is below drivers/usb/host/oxu210hp-hcd.c this file in mainline does not set HCD_LOCAL_MEM, I don't know why you said the flag is set for you before. > usb 1-1: new high speed USB device using oxu210hp-ehci and address 2 > oxu210hp-ehci oxu210hp-ehci.0: port 1 high speed > oxu210hp-ehci oxu210hp-ehci.0: GetStatus port 1 status 8001205 POWER > sig=se0 PE CONNECT > usb 1-1: default language 0x0409 > usb 1-1: New USB device found, idVendor=07ab, idProduct=fcf6 > usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3 > usb 1-1: Product: DataBar USB2.0 > usb 1-1: Manufacturer: Freecom > usb 1-1: SerialNumber: 905708280446 > usb 1-1: uevent > usb 1-1: usb_probe_device > usb 1-1: configuration #1 chosen from 1 choice > usb 1-1: adding 1-1:1.0 (config #1, interface 0) > usb 1-1:1.0: uevent > usb-storage 1-1:1.0: usb_probe_interface > usb-storage 1-1:1.0: usb_probe_interface - got id > usb-storage: USB Mass Storage device detected > usb-storage: -- associate_dev > usb-storage: Vendor: 0x07ab, Product: 0xfcf6, Revision: 0x1100 > usb-storage: Interface Subclass: 0x06, Protocol: 0x50 > usb-storage: Transport: Bulk > usb-storage: Protocol: Transparent SCSI > usb-storage: *** thread sleeping. > scsi0 : SCSI emulation for USB Mass Storage devices > usb-storage: device found at 2 > usb-storage: waiting for device to settle before scanning > /data/cubic/wks/Cubic_ltt/build/linux/drivers/usb/core/inode.c: creating > file '002' > usb-storage: usb_stor_control_msg: rq=fe rqtype=a1 value=0000 index=00 > len=1 > usb-storage: GetMaxLUN command result is 1, data is 0 > usb-storage: queuecommand called > usb-storage: *** thread awakened. > usb-storage: Command INQUIRY (6 bytes) > usb-storage: 12 00 00 00 24 00 > usb-storage: Bulk Command S 0x43425355 T 0x1 L 36 F 128 Trg 0 LUN 0 CL 6 > usb-storage: usb_stor_bulk_transfer_buf: xfer 31 bytes > usb-storage: Status code 0; transferred 31/31 > usb-storage: -- transfer complete > usb-storage: Bulk command transfer result=0 > usb-storage: usb_stor_bulk_transfer_sglist: xfer 36 bytes, 1 entries > usb-storage: Status code 0; transferred 36/36 > usb-storage: -- transfer complete > usb-storage: Bulk data transfer result 0x0 > usb-storage: Attempting to get CSW... > usb-storage: usb_stor_bulk_transfer_buf: xfer 13 bytes > usb-storage: Status code 0; transferred 13/13 > usb-storage: -- transfer complete > usb-storage: Bulk status result = 0 > usb-storage: Bulk Status S 0x53425355 T 0x1 R 0 Stat 0x0 > usb-storage: scsi cmd done, result=0x0 > scsi 0:0:0:0: Direct-Access Freecom DataBar USB2.0 1100 PQ: 0 > ANSI: 0 CCS > usb-storage: *** thread sleeping. > usb-storage: queuecommand called > usb-storage: *** thread awakened. > usb-storage: Command TEST_UNIT_READY (6 bytes) > usb-storage: 00 00 00 00 00 00 > usb-storage: Bulk Command S 0x43425355 T 0x2 L 0 F 107 Trg 0 LUN 0 CL 6 > usb-storage: usb_stor_bulk_transfer_buf: xfer 31 bytes > usb-storage: Status code 0; transferred 31/31 > usb-storage: -- transfer complete > usb-storage: Bulk command transfer result=0 > usb-storage: Attempting to get CSW... > usb-storage: usb_stor_bulk_transfer_buf: xfer 13 bytes > usb-storage: Status code 0; transferred 13/13 > usb-storage: -- transfer complete > usb-storage: Bulk status result = 0 > usb-storage: Bulk Status S 0x53425355 T 0x2 R 0 Stat 0x1 > usb-storage: -- transport indicates command failure > usb-storage: Issuing auto-REQUEST_SENSE > usb-storage: Bulk Command S 0x43425355 T 0x3 L 18 F 128 Trg 0 LUN 0 CL 6 > usb-storage: usb_stor_bulk_transfer_buf: xfer 31 bytes > usb-storage: Status code 0; transferred 31/31 > usb-storage: -- transfer complete > usb-storage: Bulk command transfer result=0 > usb-storage: usb_stor_bulk_transfer_sglist: xfer 18 bytes, 1 entries > usb-storage: Status code 0; transferred 18/18 > usb-storage: -- transfer complete > usb-storage: Bulk data transfer result 0x0 > usb-storage: Attempting to get CSW... > usb-storage: usb_stor_bulk_transfer_buf: xfer 13 bytes > usb-storage: Status code 0; transferred 13/13 > usb-storage: -- transfer complete > usb-storage: Bulk status result = 0 > usb-storage: Bulk Status S 0x53425355 T 0x3 R 0 Stat 0x0 > usb-storage: -- Result from auto-sense is 0 > usb-storage: -- code: 0x70, key: 0x6, ASC: 0x28, ASCQ: 0x0 > usb-storage: (Unknown Key): (unknown ASC/ASCQ) > usb-storage: scsi cmd done, result=0x2 > usb-storage: queuecommand called > usb-storage: *** thread sleeping. > usb-storage: *** thread awakened. > usb-storage: Command TEST_UNIT_READY (6 bytes) > usb-storage: 00 00 00 00 00 00 > usb-storage: Bulk Command S 0x43425355 T 0x4 L 0 F 107 Trg 0 LUN 0 CL 6 > usb-storage: usb_stor_bulk_transfer_buf: xfer 31 bytes > usb-storage: Status code 0; transferred 31/31 > usb-storage: -- transfer complete > usb-storage: Bulk command transfer result=0 > usb-storage: Attempting to get CSW... > usb-storage: usb_stor_bulk_transfer_buf: xfer 13 bytes > usb-storage: Status code 0; transferred 13/13 > usb-storage: -- transfer complete > usb-storage: Bulk status result = 0 > usb-storage: Bulk Status S 0x53425355 T 0x4 R 0 Stat 0x0 > usb-storage: scsi cmd done, result=0x0 > usb-storage: queuecommand called > usb-storage: *** thread sleeping. > usb-storage: *** thread awakened. > usb-storage: Command READ_CAPACITY (10 bytes) > usb-storage: 25 00 00 00 00 00 00 00 00 00 > usb-storage: Bulk Command S 0x43425355 T 0x5 L 8 F 107 Trg 0 LUN 0 CL 10 > usb-storage: usb_stor_bulk_transfer_buf: xfer 31 bytes > usb-storage: Status code 0; transferred 31/31 > usb-storage: -- transfer complete > usb-storage: Bulk command transfer result=0 > usb-storage: usb_stor_bulk_transfer_sglist: xfer 8 bytes, 1 entries > usb-storage: Status code 0; transferred 8/8 > usb-storage: -- transfer complete > usb-storage: Bulk data transfer result 0x0 > usb-storage: Attempting to get CSW... > usb-storage: usb_stor_bulk_transfer_buf: xfer 13 bytes > usb-storage: Status code 0; transferred 13/13 > usb-storage: -- transfer complete > usb-storage: Bulk status result = 0 > usb-storage: Bulk Status S 0x53425355 T 0x5 R 0 Stat 0x0 > usb-storage: scsi cmd done, result=0x0 > sd 0:0:0:0: [sda] 1957888 512-byte hardware sectors (1002 MB) > usb-storage: queuecommand called > usb-storage: *** thread sleeping. > usb-storage: *** thread awakened. > usb-storage: Command MODE_SENSE (6 bytes) > usb-storage: 1a 00 3f 00 c0 00 > usb-storage: Bulk Command S 0x43425355 T 0x6 L 192 F 107 Trg 0 LUN 0 CL > 6 > usb-storage: usb_stor_bulk_transfer_buf: xfer 31 bytes > usb-storage: Status code 0; transferred 31/31 > usb-storage: -- transfer complete > usb-storage: Bulk command transfer result=0 > usb-storage: usb_stor_bulk_transfer_sglist: xfer 192 bytes, 1 entries > usb-storage: Status code -121; transferred 68/192 -121 happens, it just means short packet is received from usb device. > usb-storage: -- short read transfer > usb-storage: Bulk data transfer result 0x1 > usb-storage: Attempting to get CSW... > usb-storage: usb_stor_bulk_transfer_buf: xfer 13 bytes > usb-storage: Status code 0; transferred 13/13 > usb-storage: -- transfer complete > usb-storage: Bulk status result = 0 > usb-storage: Bulk Status S 0x53425355 T 0x6 R 0 Stat 0x0 > usb-storage: scsi cmd done, result=0x0 > sd 0:0:0:0: [sda] Write Protect is off > sd 0:0:0:0: [sda] Mode Sense: 43 00 00 00 > sd 0:0:0:0: [sda] Assuming drive cache: write through > usb-storage: queuecommand called > usb-storage: *** thread sleeping. > usb-storage: *** thread awakened. > usb-storage: Command TEST_UNIT_READY (6 bytes) > usb-storage: 00 00 00 00 00 00 > usb-storage: Bulk Command S 0x43425355 T 0x7 L 0 F 107 Trg 0 LUN 0 CL 6 > usb-storage: usb_stor_bulk_transfer_buf: xfer 31 bytes > usb-storage: Status code 0; transferred 31/31 > usb-storage: -- transfer complete > usb-storage: Bulk command transfer result=0 > usb-storage: Attempting to get CSW... > usb-storage: usb_stor_bulk_transfer_buf: xfer 13 bytes > usb-storage: Status code 0; transferred 13/13 > usb-storage: -- transfer complete > usb-storage: Bulk status result = 0 > usb-storage: Bulk Status S 0x53425355 T 0x7 R 0 Stat 0x0 > usb-storage: scsi cmd done, result=0x0 > usb-storage: queuecommand called > usb-storage: *** thread sleeping. > usb-storage: *** thread awakened. > usb-storage: Command ALLOW_MEDIUM_REMOVAL (6 bytes) > usb-storage: 1e 00 00 00 01 00 > usb-storage: Bulk Command S 0x43425355 T 0x8 L 0 F 0 Trg 0 LUN 0 CL 6 > usb-storage: usb_stor_bulk_transfer_buf: xfer 31 bytes > usb-storage: Status code 0; transferred 31/31 > usb-storage: -- transfer complete > usb-storage: Bulk command transfer result=0 > usb-storage: Attempting to get CSW... > usb-storage: usb_stor_bulk_transfer_buf: xfer 13 bytes > usb-storage: Status code 0; transferred 13/13 > usb-storage: -- transfer complete > usb-storage: Bulk status result = 0 > usb-storage: Bulk Status S 0x53425355 T 0x8 R 0 Stat 0x1 > usb-storage: -- transport indicates command failure > usb-storage: Issuing auto-REQUEST_SENSE > usb-storage: Bulk Command S 0x43425355 T 0x9 L 18 F 128 Trg 0 LUN 0 CL 6 > usb-storage: usb_stor_bulk_transfer_buf: xfer 31 bytes > usb-storage: Status code 0; transferred 31/31 > usb-storage: -- transfer complete > usb-storage: Bulk command transfer result=0 > usb-storage: usb_stor_bulk_transfer_sglist: xfer 18 bytes, 1 entries > usb-storage: Status code 0; transferred 18/18 > usb-storage: -- transfer complete > usb-storage: Bulk data transfer result 0x0 > usb-storage: Attempting to get CSW... > usb-storage: usb_stor_bulk_transfer_buf: xfer 13 bytes > usb-storage: Status code 0; transferred 13/13 > usb-storage: -- transfer complete > usb-storage: Bulk status result = 0 > usb-storage: Bulk Status S 0x53425355 T 0x9 R 0 Stat 0x0 > usb-storage: -- Result from auto-sense is 0 > usb-storage: -- code: 0x70, key: 0x5, ASC: 0x24, ASCQ: 0x0 > usb-storage: (Unknown Key): (unknown ASC/ASCQ) > usb-storage: scsi cmd done, result=0x2 > usb-storage: queuecommand called > usb-storage: *** thread sleeping. > usb-storage: *** thread awakened. > usb-storage: Command TEST_UNIT_READY (6 bytes) > usb-storage: 00 00 00 00 00 00 > usb-storage: Bulk Command S 0x43425355 T 0xa L 0 F 0 Trg 0 LUN 0 CL 6 > usb-storage: usb_stor_bulk_transfer_buf: xfer 31 bytes > usb-storage: Status code 0; transferred 31/31 > usb-storage: -- transfer complete > usb-storage: Bulk command transfer result=0 > usb-storage: Attempting to get CSW... > usb-storage: usb_stor_bulk_transfer_buf: xfer 13 bytes > usb-storage: Status code 0; transferred 13/13 > usb-storage: -- transfer complete > usb-storage: Bulk status result = 0 > usb-storage: Bulk Status S 0x53425355 T 0xa R 0 Stat 0x0 > usb-storage: scsi cmd done, result=0x0 > usb-storage: queuecommand called > usb-storage: *** thread sleeping. > usb-storage: *** thread awakened. > usb-storage: Command READ_CAPACITY (10 bytes) > usb-storage: 25 00 00 00 00 00 00 00 00 00 > usb-storage: Bulk Command S 0x43425355 T 0xb L 8 F 128 Trg 0 LUN 0 CL 10 > usb-storage: usb_stor_bulk_transfer_buf: xfer 31 bytes > usb-storage: Status code 0; transferred 31/31 > usb-storage: -- transfer complete > usb-storage: Bulk command transfer result=0 > usb-storage: usb_stor_bulk_transfer_sglist: xfer 8 bytes, 1 entries > usb-storage: Status code 0; transferred 8/8 > usb-storage: -- transfer complete > usb-storage: Bulk data transfer result 0x0 > usb-storage: Attempting to get CSW... > usb-storage: usb_stor_bulk_transfer_buf: xfer 13 bytes > usb-storage: Status code 0; transferred 13/13 > usb-storage: -- transfer complete > usb-storage: Bulk status result = 0 > usb-storage: Bulk Status S 0x53425355 T 0xb R 0 Stat 0x0 > usb-storage: scsi cmd done, result=0x0 > sd 0:0:0:0: [sda] 1957888 512-byte hardware sectors (1002 MB) > usb-storage: queuecommand called > usb-storage: *** thread sleeping. > usb-storage: *** thread awakened. > usb-storage: Command MODE_SENSE (6 bytes) > usb-storage: 1a 00 3f 00 c0 00 > usb-storage: Bulk Command S 0x43425355 T 0xc L 192 F 107 Trg 0 LUN 0 CL > 6 > usb-storage: usb_stor_bulk_transfer_buf: xfer 31 bytes > usb-storage: Status code 0; transferred 31/31 > usb-storage: -- transfer complete > usb-storage: Bulk command transfer result=0 > usb-storage: usb_stor_bulk_transfer_sglist: xfer 192 bytes, 1 entries > usb-storage: Status code -121; transferred 68/192 -121 > usb-storage: -- short read transfer > usb-storage: Bulk data transfer result 0x1 > usb-storage: Attempting to get CSW... > usb-storage: usb_stor_bulk_transfer_buf: xfer 13 bytes > usb-storage: Status code 0; transferred 13/13 > usb-storage: -- transfer complete > usb-storage: Bulk status result = 0 > usb-storage: Bulk Status S 0x53425355 T 0xc R 0 Stat 0x0 > usb-storage: scsi cmd done, result=0x0 > sd 0:0:0:0: [sda] Write Protect is off > sd 0:0:0:0: [sda] Mode Sense: 43 00 00 00 > sd 0:0:0:0: [sda] Assuming drive cache: write through > sda:<7>usb-storage: queuecommand called > usb-storage: *** thread sleeping. > usb-storage: *** thread awakened. > usb-storage: Command READ_10 (10 bytes) > usb-storage: 28 00 00 00 00 00 00 00 08 00 > usb-storage: Bulk Command S 0x43425355 T 0xd L 4096 F 0 Trg 0 LUN 0 CL > 10 > usb-storage: usb_stor_bulk_transfer_buf: xfer 31 bytes > usb-storage: Status code 0; transferred 31/31 > usb-storage: -- transfer complete > usb-storage: Bulk command transfer result=0 > usb-storage: usb_stor_bulk_transfer_sglist: xfer 4096 bytes, 1 entries > dma_free_coherent :irqs_disabled... NOK !!!!!! dma coherent warning > usb-storage: Status code -121; transferred 13/4096 > usb-storage: -- short read transfer > usb-storage: Bulk data transfer result 0x1 > usb-storage: Attempting to get CSW... > usb-storage: usb_stor_bulk_transfer_buf: xfer 13 bytes > > root@MM6_160117:/# > root@MM6_160117:/# > root@MM6_160117:/# > root@MM6_160117:/# > root@MM6_160117:/# > root@MM6_160117:/# > root@MM6_160117:/# > root@MM6_160117:/# Here there is a long time before the abort > root@MM6_160117:/# > root@MM6_160117:/# > root@MM6_160117:/# > root@MM6_160117:/# usb-storage: command_abort called > usb-storage: usb_stor_stop_transport called > usb-storage: -- cancelling URB > usb-storage: Status code -104; transferred 0/13 > usb-storage: -- transfer cancelled > usb-storage: Bulk status result = 4 > usb-storage: -- command was aborted > > > >>-----Original Message----- >>From: Ming Lei [mailto:tom.leiming@xxxxxxxxx] >>Sent: Friday, September 17, 2010 4:59 PM >>To: Patriarche, Herve >>Cc: linux-usb >>Subject: Re: USB: free coherent buffer into atomic context >> >>2010/9/17 Patriarche, Herve <herve.patriarche@xxxxxxxxxxxxx>: >>> Hi, >>> >>> I confirmed this is due to dma_free_coherent after an xfer >>transfer complete. >>> Do you know if this is fixed in a release after 2.6.27 ? >> >>No, there is still the warning even for the latest 2.6.36-rc4. >> >>>>-----Original Message----- >>>>From: Patriarche, Herve >>>>Sent: Friday, September 17, 2010 10:11 AM >>>>To: Ming Lei >>>>Cc: linux-usb >>>>Subject: RE: USB: free coherent buffer into atomic context >>>> >>>>Hi Lei Ming, >>>> >>>>I confirmed, HCD_LOCAL_MEM flag is on. >>>>I sometimes get a reset before the WARN so perhaps it is the root >>>>cause, I will check. >> >>I don't think the warning may be the root cause for the reset. >> >>The warning only means dma_free_coherent is called with irq disabled. >>It is not very difficult to fix the warning in usb hcd, but I >>need to know why the WARN_ON below is added into dma_free_coherent. >> >> WARN_ON(irqs_disabled()); >> >>Anyone know the reason? >> >>-- >>Lei Ming >> > -- Lei Ming -- 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