I am trying to get a USB printer to work in a Linux domU. I am using Xen 3.0.3 and the Xen Linux kernel 2.6.16.40. I have hidden the USB controller''s PCI devices from dom0 and exported them to domU, and build the domU kernel with the necessary device support. When I boot the xenU kernel, it lists an error from the USB printer class code that allocating a write buffer failed. This is an 8k buffer, and I have checked that it''s not a real out-of-memory issue by feeding the domU more and more memory. Digging in a bit, it appears that the code is allocating a DMA buffer. Could this be encountering a code path that got replaced by Xen architecture code, code that in this case isn''t working as expected? Has anyone gotten a USB printer to work in a Linux domU? If so, could you tell me what needs to be done to make this work? Here are the errors I''m getting: PCI: Enabling device 0000:00:1f.4 (0000 -> 0001) PCI: Setting latency timer of device 0000:00:1f.4 to 64 uhci_hcd 0000:00:1f.4: UHCI Host Controller uhci_hcd 0000:00:1f.4: new USB bus registered, assigned bus number 2 uhci_hcd 0000:00:1f.4: irq 10, io base 0x0000e800 usb usb2: configuration #1 chosen from 1 choice hub 2-0:1.0: USB hub found hub 2-0:1.0: 2 ports detected usb 1-2: new full speed USB device using uhci_hcd and address 2 usb 1-2: configuration #1 chosen from 1 choice hub 1-2:1.0: USB hub found hub 1-2:1.0: 4 ports detected usb 1-2.2: new full speed USB device using uhci_hcd and address 3 usb 1-2.2: configuration #1 chosen from 1 choice usb 1-2.3: new full speed USB device using uhci_hcd and address 4 usb 1-2.3: configuration #1 chosen from 1 choice usb 1-2.4: new full speed USB device using uhci_hcd and address 5 usb 1-2.4: configuration #1 chosen from 1 choice drivers/usb/class/usblp.c: out of memory for write buf usblp: probe of 1-2.3:1.0 failed with error -5 drivers/usb/class/usblp.c: out of memory for write buf usblp: probe of 1-2.4:1.0 failed with error -5 usbcore: registered new driver usblp drivers/usb/class/usblp.c: v0.13: USB Printer Device Class driver Thanks, -Craig _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Yves-gaël Chény
2007-Mar-26 09:28 UTC
Re: [Xen-users] USB printer not working in a Linux domU
you''have better to share your printer with a cups in dom0 cheers Yves-Gaël Chény Craig Metz a écrit :> I am trying to get a USB printer to work in a Linux domU. I am using Xen > 3.0.3 and the Xen Linux kernel 2.6.16.40. I have hidden the USB controller''s > PCI devices from dom0 and exported them to domU, and build the domU kernel > with the necessary device support. When I boot the xenU kernel, it lists an > error from the USB printer class code that allocating a write buffer failed. > This is an 8k buffer, and I have checked that it''s not a real out-of-memory > issue by feeding the domU more and more memory. Digging in a bit, it appears > that the code is allocating a DMA buffer. > > Could this be encountering a code path that got replaced by Xen > architecture code, code that in this case isn''t working as expected? > > Has anyone gotten a USB printer to work in a Linux domU? If so, could you > tell me what needs to be done to make this work? > > Here are the errors I''m getting: > > PCI: Enabling device 0000:00:1f.4 (0000 -> 0001) > PCI: Setting latency timer of device 0000:00:1f.4 to 64 > uhci_hcd 0000:00:1f.4: UHCI Host Controller > uhci_hcd 0000:00:1f.4: new USB bus registered, assigned bus number 2 > uhci_hcd 0000:00:1f.4: irq 10, io base 0x0000e800 > usb usb2: configuration #1 chosen from 1 choice > hub 2-0:1.0: USB hub found > hub 2-0:1.0: 2 ports detected > usb 1-2: new full speed USB device using uhci_hcd and address 2 > usb 1-2: configuration #1 chosen from 1 choice > hub 1-2:1.0: USB hub found > hub 1-2:1.0: 4 ports detected > usb 1-2.2: new full speed USB device using uhci_hcd and address 3 > usb 1-2.2: configuration #1 chosen from 1 choice > usb 1-2.3: new full speed USB device using uhci_hcd and address 4 > usb 1-2.3: configuration #1 chosen from 1 choice > usb 1-2.4: new full speed USB device using uhci_hcd and address 5 > usb 1-2.4: configuration #1 chosen from 1 choice > drivers/usb/class/usblp.c: out of memory for write buf > usblp: probe of 1-2.3:1.0 failed with error -5 > drivers/usb/class/usblp.c: out of memory for write buf > usblp: probe of 1-2.4:1.0 failed with error -5 > usbcore: registered new driver usblp > drivers/usb/class/usblp.c: v0.13: USB Printer Device Class driver > > Thanks, > > -Craig > > _______________________________________________ > Xen-users mailing list > Xen-users@lists.xensource.com > http://lists.xensource.com/xen-users > >-- Yves-Gaël Chény Responsable développements techniques Responsable Achats techniques Responsable RH technique 261 route de Clisson 44230 St Sébastien sur Loire Tel : 02 40 97 62 67 - 08 73 77 24 91 http://www.tranquilitsystems.com/ yves-gael.cheny@tranquil-it-systems.fr Tranquil IT Systems . SAS 37 000 ¤ _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
Patrick Scharrenberg
2007-Mar-26 16:56 UTC
Re: [Xen-users] USB printer not working in a Linux domU
Hi> I am trying to get a USB printer to work in a Linux domU.I got the same error and am discussing this in xen-devel. Right now there''s a workaround: in "drivers/usb/class/usblp.c" lower the value of "USBLP_BUF_SIZE" from 8192 to 4096, remove the .o-files and rebuild. This should work. Patrick _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users
In message <4607FB20.2020309@web.de>, you write:>Hi >> I am trying to get a USB printer to work in a Linux domU. >I got the same error and am discussing this in xen-devel. > >Right now there''s a workaround: >in "drivers/usb/class/usblp.c" lower the value of "USBLP_BUF_SIZE" from >8192 to 4096, remove the .o-files and rebuild. >This should work.Thanks - I found the same work-around myself doing some debugging. Why is Xen unable to correctly do the order=1 allocation behind this code path? I also tried a USB scanner (sane-backends w/libusb) in this domU. When you try to actually scan, it throws up a DMA error and kernel oops. Much more seriously broken than the print problem. It looks to me like there are some real Xen problems behind these two, and the Xen developers could improve the code''s quality by debugging these cases. I tried to file a bug report with XenSource, but their new account sign-up never got back to me. -Craig _______________________________________________ Xen-users mailing list Xen-users@lists.xensource.com http://lists.xensource.com/xen-users