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. root@MM6_160117:/# root@MM6_160117:/# usb 1-1: new high speed USB device using oxu210hp-ehci and address 3 usb 1-1: New USB device found, idVendor=1307, idProduct=0165 usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3 usb 1-1: Product: USB Mass Storage Device usb 1-1: Manufacturer: USBest Technology usb 1-1: SerialNumber: 000000000000B0 usb 1-1: configuration #1 chosen from 1 choice scsi2 : SCSI emulation for USB Mass Storage devices scsi 2:0:0:0: Direct-Access 2009-07-22 0.00 PQ: 0 ANSI: 2 sd 2:0:0:0: [sdb] 7897088 512-byte hardware sectors (4043 MB) sd 2:0:0:0: [sdb] Write Protect is off sd 2:0:0:0: [sdb] Assuming drive cache: write through usb 1-1: reset high speed USB device using oxu210hp-ehci and address 3 sd 2:0:0:0: [sdb] 7897088 512-byte hardware sectors (4043 MB) sd 2:0:0:0: [sdb] Write Protect is off sd 2:0:0:0: [sdb] Assuming drive cache: write through sdb:<4>------------[ cut here ]------------ WARNING: at /data/cubic/wks/Cubic_ltt/build/linux/arch/arm/mm/consistent.c:368 dma_free_coherent+0x2e8/0x354() Modules linked in: cfbfillrect cfbimgblt cfbcopyarea pxafb slhc ppp_generic crc_ccitt ppp_async usbserial sierra [<c02b7b10>] (dump_stack+0x0/0x14) from [<c003dae0>] (warn_on_slowpath+0x4c/0x84) [<c003da94>] (warn_on_slowpath+0x0/0x84) from [<c002ae6c>] (dma_free_coherent+0x2e8/0x354) r6:00001004 r5:c0361700 r4:d0886000 [<c002ab84>] (dma_free_coherent+0x0/0x354) from [<c02098b0>] (hcd_buffer_free+0x5c/0x98) [<c0209854>] (hcd_buffer_free+0x0/0x98) from [<c02032b8>] (hcd_free_coherent+0x64/0x8c) r5:d0886000 r4:cf905400 [<c0203254>] (hcd_free_coherent+0x0/0x8c) from [<c02033c4>] (unmap_urb_for_dma+0xe4/0xe8) [<c02032e0>] (unmap_urb_for_dma+0x0/0xe8) from [<c0203408>] (usb_hcd_giveback_urb+0x40/0xd0) r5:00000000 r4:cfad1e80 [<c02033c8>] (usb_hcd_giveback_urb+0x0/0xd0) from [<c0211dd4>] (ehci_urb_done+0xac/0x12c) r5:00000000 r4:cf905400 [<c0211d28>] (ehci_urb_done+0x0/0x12c) from [<c0212ae8>] (qh_completions+0x3d0/0x458) r9:cf9054c0 r8:d0880180 r7:ffffff8d r6:ffffff8d r5:d08810c0 r4:d08810c0 [<c0212718>] (qh_completions+0x0/0x458) from [<c0215538>] (ehci_work+0xa4/0xa60) [<c0215494>] (ehci_work+0x0/0xa60) from [<c02169cc>] (ehci_irq+0x1d4/0x1f4) [<c02167f8>] (ehci_irq+0x0/0x1f4) from [<c02031ec>] (usb_hcd_irq+0x44/0xac) [<c02031a8>] (usb_hcd_irq+0x0/0xac) from [<c006beac>] (handle_IRQ_event+0xbc/0x190) r5:00000000 r4:cf9e3220 [<c006bdf0>] (handle_IRQ_event+0x0/0x190) from [<c006d5f4>] (handle_edge_irq+0xe4/0x1dc) r9:c0379a94 r8:c03be09c r7:00000073 r6:cf9e3220 r5:c0365304 r4:c035a000 [<c006d510>] (handle_edge_irq+0x0/0x1dc) from [<c002f07c>] (pxa_gpio_demux_handler+0xa8/0xd8) r9:c0379a94 r8:c035bee0 r7:c03639dc r6:f6e00000 r5:00000000 r4:00000033 [<c002efd4>] (pxa_gpio_demux_handler+0x0/0xd8) from [<c0023044>] (__exception_text_start+0x44/0x5c) [<c0023000>] (__exception_text_start+0x0/0x5c) from [<c00239a4>] (__irq_svc+0x44/0xe4) Exception stack(0xc035bf40 to 0xc035bf88) bf40: 00000001 cf8e3200 00000000 60000013 c0025620 c035a000 c0025620 c03798e4 bf60: a001b5e4 69056827 a001b5b0 c035bf94 c035bf98 c035bf88 c0025678 c0025684 bf80: 60000013 ffffffff r7:00000002 r6:00000400 r5:c035bf74 r4:ffffffff [<c0025620>] (default_idle+0x0/0x6c) from [<c00255ec>] (cpu_idle+0x48/0x7c) [<c00255a4>] (cpu_idle+0x0/0x7c) from [<c02b6038>] (rest_init+0x74/0x88) r7:c035e538 r6:c001cdb0 r5:c03798a0 r4:c035a000 [<c02b5fc4>] (rest_init+0x0/0x88) from [<c0008984>] (start_kernel+0x228/0x29c) r5:c03798a0 r4:c03be5e0 [<c000875c>] (start_kernel+0x0/0x29c) from [<a0008034>] (0xa0008034) ---[ end trace 0ab00bbccf43493d ]--- sd 2:0:0:0: [sdb] Attached SCSI removable disk Thanks, Herve. >-----Original Message----- >From: Ming Lei [mailto:tom.leiming@xxxxxxxxx] >Sent: Friday, September 17, 2010 6:09 AM >To: Patriarche, Herve >Cc: linux-usb >Subject: Re: USB: free coherent buffer into atomic context > >CC linux-usb > >2010/9/17 Patriarche, Herve <herve.patriarche@xxxxxxxxxxxxx>: >> Hi Tom, >> >> I am currently working on a quasi EHCI driver on linux 2.6.27 and I >> currently got similar Warning as you get into usb test : >> http://www.spinics.net/lists/linux-usb/msg34223.html >> I wonder if you have any advice to fix it ? > >I guess your ehci driver may have the flag HCD_LOCAL_MEM set. >Could you confirm this? > >There is really a issue in hcd of usbcore, which may cause >the warning if the flag HCD_LOCAL_MEM is set. > >> >> , Member of Technical Staff, Wind River >> >> direct +33 4 76 23 45 94 mobile +33 6 70 23 10 68 fax >+33 4 76 >> 23 45 >> 99 >> >> >> >> >> root@MM6_160117:/# usb 1-1: new high speed USB device using >> oxu210hp-ehci and address 2 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: >> configuration #1 chosen from 1 choice scsi0 : SCSI emulation for USB >> Mass Storage devices scsi 0:0:0:0: Direct-Access Freecom > DataBar >> USB2.0 1100 PQ: 0 ANSI: 0 CCS sd 0:0:0:0: [sda] 1957888 512-byte >> hardware sectors (1002 MB) sd 0:0:0:0: [sda] Write Protect is off sd >> 0:0:0:0: [sda] Assuming drive cache: write through usb 1-1: >reset high >> speed USB device using oxu210hp-ehci and address 2 sd 0:0:0:0: [sda] >> 1957888 512-byte hardware sectors (1002 MB) sd 0:0:0:0: [sda] Write >> Protect is off sd 0:0:0:0: [sda] Assuming drive cache: write through >> sda:<4>------------[ cut here ]------------ >> WARNING: at >> /data/cubic/wks/Cubic_ltt/build/linux/arch/arm/mm/consistent.c:368 >> dma_free_coherent+0x2e8/0x354() >> Modules linked in: cfbfillrect cfbimgblt cfbcopyarea pxafb slhc >> ppp_generic crc_ccitt ppp_async usbserial sierra [<c02b7ad4>] >> (dump_stack+0x0/0x14) from [<c003dae0>] >> (warn_on_slowpath+0x4c/0x84) >> [<c003da94>] (warn_on_slowpath+0x0/0x84) from [<c002ae6c>] >> (dma_free_coherent+0x2e8/0x354) >> r6:00001004 r5:c0361700 r4:d0886000 >> [<c002ab84>] (dma_free_coherent+0x0/0x354) from [<c0209874>] >> (hcd_buffer_free+0x5c/0x98) >> [<c0209818>] (hcd_buffer_free+0x0/0x98) from [<c02032b8>] >> (hcd_free_coherent+0x64/0x8c) >> r5:d0886000 r4:cf905400 >> [<c0203254>] (hcd_free_coherent+0x0/0x8c) from [<c02033c4>] >> (unmap_urb_for_dma+0xe4/0xe8) >> [<c02032e0>] (unmap_urb_for_dma+0x0/0xe8) from [<c0203408>] >> (usb_hcd_giveback_urb+0x40/0xd0) >> r5:00000000 r4:cf9fd480 >> [<c02033c8>] (usb_hcd_giveback_urb+0x0/0xd0) from [<c0211d98>] >> (ehci_urb_done+0xac/0x12c) >> r5:00000000 r4:cf905400 >> [<c0211cec>] (ehci_urb_done+0x0/0x12c) from [<c0212aac>] >> (qh_completions+0x3d0/0x458) >> r9:cf9054c0 r8:d0880180 r7:ffffff8d r6:ffffff8d r5:d0881240 >> r4:d0881240 [<c02126dc>] (qh_completions+0x0/0x458) from [<c02154fc>] >> (ehci_work+0xa4/0xa60) >> [<c0215458>] (ehci_work+0x0/0xa60) from [<c0216990>] >> (ehci_irq+0x1d4/0x1f4) [<c02167bc>] (ehci_irq+0x0/0x1f4) from >> [<c02031ec>] (usb_hcd_irq+0x44/0xac) [<c02031a8>] >> (usb_hcd_irq+0x0/0xac) from [<c006beac>] >> (handle_IRQ_event+0xbc/0x190) >> r5:00000000 r4:cf9e3220 >> [<c006bdf0>] (handle_IRQ_event+0x0/0x190) from [<c006d5f4>] >> (handle_edge_irq+0xe4/0x1dc) >> r9:c0379a94 r8:c03be09c r7:00000073 r6:cf9e3220 r5:c0365304 >> r4:cfaee000 [<c006d510>] (handle_edge_irq+0x0/0x1dc) from >[<c002f07c>] >> (pxa_gpio_demux_handler+0xa8/0xd8) >> r9:c0379a94 r8:cfaeff50 r7:c03639dc r6:f6e00000 r5:00000000 >> r4:00000033 >> [<c002efd4>] (pxa_gpio_demux_handler+0x0/0xd8) from [<c0023044>] >> (__exception_text_start+0x44/0x5c) >> [<c0023000>] (__exception_text_start+0x0/0x5c) from [<c0023bec>] >> (__irq_usr+0x4c/0xe0) >> Exception stack(0xcfaeffb0 to 0xcfaefff8) >> ffa0: 00000006 2a00d792 00000006 >> 2a00d792 >> ffc0: 00000190 00000000 2a012f48 00000000 2a010228 2a014c48 00000000 >> 000000be >> ffe0: 2a010374 bef95618 2a0025e0 400e7fd0 20000010 ffffffff >> r7:00000001 r6:00000400 r5:00000000 r4:ffffffff ---[ end trace >> fa47280d47db3eae ]--- >> sda1 >> sd 0:0:0:0: [sda] Attached SCSI removable disk > > > >-- >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