Skip to contentSkip to conversation

out of dma-memory when using usblp-module in driverdomain

DISCUSSION Patrick Scharrenberg 2 participants 3 messages Mar 25, 2007 – Apr 10, 2007

lore
Share & tools
lore
#0 lore raw

Hi!

I tried attaching an usb-printer to an usb-port of a driver-domain. On loading the module usblp I get the following error:

/usr/src/xen/xen-unstable.hg/linux-2.6.18-xen/drivers/usb/class/usblp.c:
out of memory for write buf
usblp: probe of 2-1:1.0 failed with error -5

I figured out, that reducing USBLP_BUF_SIZE (usb/class/usblp.c) form 8192 to some smaller value, e.g. 4096 it works fine, but that's just a workaround.

USBLP_BUF_SIZE is used to "usb_buffer_alloc" (usb/core/usb.c) dma memory:

Quoted 1 line

From usb.c:

usb_buffer_alloc - allocate dma-consistent buffer for
URB_NO_xxx_DMA_MAP

but here I'm out..

cheers
~patrick

#1 lore raw
Quoted 12 lines
Quoted 1 line
Quoted 1 line

Patrick Scharrenberg <[email protected]> 25.03.07 16:29 >>>

I tried attaching an usb-printer to an usb-port of a driver-domain. On loading the module usblp I get the following error:

/usr/src/xen/xen-unstable.hg/linux-2.6.18-xen/drivers/usb/class/usblp.c:
out of memory for write buf
usblp: probe of 2-1:1.0 failed with error -5

I figured out, that reducing USBLP_BUF_SIZE (usb/class/usblp.c) form 8192 to some smaller value, e.g. 4096 it works fine, but that's just a workaround.

Quoted 7 lines

USBLP_BUF_SIZE is used to "usb_buffer_alloc" (usb/core/usb.c) dma memory:

Quoted 1 line

From usb.c:

usb_buffer_alloc - allocate dma-consistent buffer for
URB_NO_xxx_DMA_MAP

but here I'm out..

Probably you're just suffering from domains without any I/O memory ranges assigned not being permitted to have multi-page contiguous memory ranges assigned? If not, do you force swiotlb on in the domain? And what resources does the USB HC require?

Jan

#2 lore raw

Hi Jan!

I'm sorry for not replying for such a long time after asking questions. :-)

Quoted 10 lines
Quoted 10 lines

I figured out, that reducing USBLP_BUF_SIZE (usb/class/usblp.c) form 8192 to some smaller value, e.g. 4096 it works fine, but that's just a workaround.

USBLP_BUF_SIZE is used to "usb_buffer_alloc" (usb/core/usb.c) dma memory:

Quoted 1 line

From usb.c:

usb_buffer_alloc - allocate dma-consistent buffer for
URB_NO_xxx_DMA_MAP

Quoted 6 lines
Quoted 2 lines

but here I'm out..

Probably you're just suffering from domains without any I/O memory ranges assigned not being permitted to have multi-page contiguous memory ranges assigned?

I added the usb-controllers as quirky devices, like xen told me to do:

(usb

      (pci_ids
         ('1106:3038')
      )

      (pci_config_space_fields
         ('000000c0:2:00000000'
          '000000f0:2:00000000'
          '000000f8:2:00000000'
          '00000084:2:00000000')
        
      )

)

Quoted 3 lines

If not, do you force swiotlb on in the domain? And what resources does the USB HC require?

Honestly I have no clue if I'm forcing it!
In the kernel-config I have "CONFIG_SWIOTLB=y"

Please see attaches "lspci" for resource-view (or is there a better way, to see more information?) I'm just using usb-controllers 0., 0.1 and 0.3 because 0.2 shares its irq with another device and is not working in domU.

I hope we can isolate the problem a bit more now.

Please contact me for more information. (I'm now online again and can answer much faster! :-) )

Thanks
Patrick

lspci -vvvn

00:10.0 0c03: 1106:3038 (rev a0) (prog-if 00 [UHCI])
Subsystem: 1462:7253
Control: I/O- Mem- BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR-
Interrupt: pin A routed to IRQ 20
Region 4: I/O ports at f900 [disabled] [size=32]
Capabilities: [80] Power Management version 2
Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=375mA PME(D0+,D1+,D2+,D3hot+,D3cold+)
Status: D0 PME-Enable- DSel=0 DScale=0 PME-

00:10.1 0c03: 1106:3038 (rev a0) (prog-if 00 [UHCI])
Subsystem: 1462:7253
Control: I/O- Mem- BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR-
Interrupt: pin B routed to IRQ 19
Region 4: I/O ports at f800 [disabled] [size=32]
Capabilities: [80] Power Management version 2
Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=375mA PME(D0+,D1+,D2+,D3hot+,D3cold+)
Status: D0 PME-Enable- DSel=0 DScale=0 PME-

00:10.2 0c03: 1106:3038 (rev a0) (prog-if 00 [UHCI])
Subsystem: 1462:7253
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR-
Latency: 64, Cache Line Size: 32 bytes
Interrupt: pin C routed to IRQ 21
Region 4: I/O ports at f700 [size=32]
Capabilities: [80] Power Management version 2
Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=375mA PME(D0+,D1+,D2+,D3hot+,D3cold+)
Status: D0 PME-Enable- DSel=0 DScale=0 PME-

00:10.3 0c03: 1106:3038 (rev a0) (prog-if 00 [UHCI])
Subsystem: 1462:7253
Control: I/O- Mem- BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B-
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR-
Interrupt: pin D routed to IRQ 18
Region 4: I/O ports at f600 [disabled] [size=32]
Capabilities: [80] Power Management version 2
Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=375mA PME(D0+,D1+,D2+,D3hot+,D3cold+)
Status: D0 PME-Enable- DSel=0 DScale=0 PME-

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel