[linux-usb-devel] TREAT AS URGENT sys
Dear friend, I am Mr. Alexei Zakharenko a personal treasurer to Mikhail Khodorkovsky the Richest man in Russia and owner of the following companies: Chairman CEO: YUKOS OIL (Russian Largest Oil Company) Chairman CEO: Menatep SBP Bank (A well reputable financial institution with its Branches all over the world) SOURCE OF FUNDS: I have a profiling amount in an excess of US$100.5M, which I seek your Partnership in accommodating for me. You will be rewarded with 4% of the total sum for your partnership. Can you be my partner on this? INTRODUCTION OF MY SELF As a personal consultant to him, authority Was handed over to me in transfer of money of an American oil merchant For his last oil deal with my boss Mikhail Khodorkovsky. Already the funds have left the shore of Russia to an European private Bank where the final crediting is expected to be carried out. While I was on the process, My Boss got arrested for his Involvement in politics by financing the leading and opposing political parties (the Union of Right Forces, Led by Boris Nemtsov, and Yabloko, a liberal/social democratic party Led by Gregor Yavlinsky) which poses a treat to President Vladimir Putin Second Tenure as Russian president. You can catch more of the story on this website: http://www.yukos.com http://news.ft.com/cms/4bb9612a-d254-11d8-b661-0e2511c8.html http://www.hoovers.com/yukos/--ID__53700--/free-co-factsheet.xhtml http://www.npr.org/templates/story/story.php?storyId=4105663 http://newsfromrussia.com/main/2003/11/13/51215.html http://news.yahoo.com/news?tmpl=storyu=/ap/20050531/ap_on_bi_ge/russia_khodorkovsky YOUR ROLE: All I need from you is to stand as the beneficiary of the Above quoted Sum and I will re-profile the funds with your name, which will enable The European bank transfer the sum to you. I have decided to use this Sum to relocate to American continent and never to be connected to any Of Mikhail Khodorkovsky conglomerates. As Soon as I confirm your readiness to conclude the transaction with me, I Will provide you with the details. Thank you very much. Regards Alexei Zakharenko (Mr.) - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
Re: [linux-usb-devel] Resubmit [PATCH] pu203 dual controller
-Original Message- From: Jiri Kosina [EMAIL PROTECTED] To: Sam Liddicott [EMAIL PROTECTED] Cc: linux-usb-devel@lists.sourceforge.net; [EMAIL PROTECTED] Sent: 18/05/07 22:00 Subject: Re: Resubmit [PATCH] pu203 dual controller On Fri, 18 May 2007, Sam Liddicott wrote: Cc'ding you guys directly, this patch send on 9 May doesn't seem to be picked up yet. =Hi Sam, = =was I CCed on the original patch? I can't find your mail in =my mailbox ... No. ... It adds the same quirks for the PCS Ltd pu203 as I recently added for the Wisegroup quad controller. I don't exactly know if both quirks are required (for the pu203), but it works for me like this. =Do you actually own the hardware? I would appreciate if you could test =whether really both of the quirks are needed - we don't want to add =unneeded quirks to devices, that would just spread confusion. OK. I'm not sure how to tell if the poll quirk is needed or not. Any tips? =Also, could you please resend the patch with proper =Signed-off-by line? Oh yes, sorry. Thank Sam - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
Re: [linux-usb-devel] Resubmit [PATCH] pu203 dual controller
On Sat, 19 May 2007, Sam Liddicott wrote: Do you actually own the hardware? I would appreciate if you could test whether really both of the quirks are needed - we don't want to add unneeded quirks to devices, that would just spread confusion. OK. I'm not sure how to tell if the poll quirk is needed or not. Any tips? Hi Sam, well there are basically two main things that could happen if the device needs HID_QUIRK_NOGET and we don't set it in hid_blacklist[] - either it could timeout for ~10 seconds during initialization (as it would just drop the Get request), or it could respond with bogus values to Get request, and therefore the subsequent data processing would return bogus values. The common symptom for both cases is - the device just won't work as expected :) =Also, could you please resend the patch with proper =Signed-off-by line? Oh yes, sorry. And also proper Changelog please (i.e. this device has that many input interfaces and so it needs HID_QUIRK_MULTI_INPUT and it acts so and so and therefore needs HID_QUIRK_NOGET). Thanks, -- Jiri Kosina SUSE Labs - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
[linux-usb-devel] 2.6.22-rc2: regression: STD fails with pci_device_suspend(): usb_hcd_pci_suspend+0x0/0x160 [usbcore]() returns -16
This works just fine up to and including 2.6.21. {pts/0}% lspci 00:00.0 Host bridge: ALi Corporation M1644/M1644T Northbridge+Trident (rev 01) 00:01.0 PCI bridge: ALi Corporation PCI to AGP Controller 00:02.0 USB Controller: ALi Corporation USB 1.1 Controller (rev 03) 00:04.0 IDE interface: ALi Corporation M5229 IDE (rev c3) 00:06.0 Multimedia audio controller: ALi Corporation M5451 PCI AC-Link Controller Audio Device (rev 01) 00:07.0 ISA bridge: ALi Corporation M1533/M1535 PCI to ISA Bridge [Aladdin IV/V/V+] 00:08.0 Bridge: ALi Corporation M7101 Power Management Controller [PMU] 00:0a.0 Ethernet controller: Intel Corporation 82557/8/9 [Ethernet Pro 100] (rev 08) 00:10.0 CardBus bridge: Texas Instruments PCI1410 PC card Cardbus Controller (rev 01) 00:11.0 CardBus bridge: Toshiba America Info Systems ToPIC100 PCI to Cardbus Bridge with ZV Support (rev 32) 00:11.1 CardBus bridge: Toshiba America Info Systems ToPIC100 PCI to Cardbus Bridge with ZV Support (rev 32) 00:12.0 System peripheral: Toshiba America Info Systems SD TypA Controller (rev 03) 01:00.0 VGA compatible controller: Trident Microsystems CyberBlade XPAi1 (rev 82) unfortunatelt dmesg got truncated; if required I can rebuild with larger buffer; the part around suspend is swsusp: Marking nosave pages: 0009f000 - 0010 swsusp: Basic memory bitmaps created Stopping tasks ... done. Shrinking memory... done (14553 pages freed) Freed 58212 kbytes in 0.30 seconds (194.04 MB/s) Suspending console(s) sd 0:0:0:0: [sda] Synchronizing SCSI cache pnp: Device 00:09 disabled. ACPI: PCI interrupt for device :00:0a.0 disabled Trying to free already-free IRQ 11 ACPI: PCI interrupt for device :00:06.0 disabled ACPI: Unable to derive IRQ for device :00:04.0 pci_device_suspend(): usb_hcd_pci_suspend+0x0/0x160 [usbcore]() returns -16 suspend_device(): pci_device_suspend+0x0/0x70() returns -16 Could not suspend device :00:02.0: error -16 PM: Writing back config space on device :00:04.0 at offset 1 (was 291, writing 295) ACPI: Unable to derive IRQ for device :00:04.0 ACPI: PCI Interrupt :00:04.0[A]: no GSI ACPI: PCI Interrupt :00:06.0[A] - Link [LNKH] - GSI 11 (level, low) - IRQ 11 ata1.00: ata_hpa_resize 1: sectors = 39070080, hpa_sectors = 39070080 ata1.00: ata_hpa_resize 1: sectors = 39070080, hpa_sectors = 39070080 ata1.00: configured for UDMA/33 sd 0:0:0:0: [sda] 39070080 512-byte hardware sectors (20004 MB) sd 0:0:0:0: [sda] Write Protect is off sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00 sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA PM: Writing back config space on device :00:0a.0 at offset f (was 38080100, writing 3808010b) PM: Writing back config space on device :00:0a.0 at offset 6 (was 0, writing f7d0) PM: Writing back config space on device :00:0a.0 at offset 5 (was 1, writing eb41) PM: Writing back config space on device :00:0a.0 at offset 4 (was 0, writing f7efd000) PM: Writing back config space on device :00:0a.0 at offset 3 (was 0, writing 4008) PM: Writing back config space on device :00:0a.0 at offset 1 (was 290, writing 297) ata2.00: configured for UDMA/33 pnp: Failed to activate device 00:05. pnp: Failed to activate device 00:06. pnp: Device 00:09 activated. sd 0:0:0:0: [sda] Starting disk eth1: PRI 31 variant 2 version 9.48 eth1: NIC 5 variant 2 version 1.02 Restarting tasks ... done. swsusp: Basic memory bitmaps freed input: Power Button (FF) as /class/input/input4 ACPI: Power Button (FF) [PWRF] input: Lid Switch as /class/input/input5 ACPI: Lid Switch [LID] eth1: PRI 31 variant 2 version 9.48 eth1: NIC 5 variant 2 version 1.02 eth1: PRI 31 variant 2 version 9.48 eth1: NIC 5 variant 2 version 1.02 eth1: PRI 31 variant 2 version 9.48 eth1: NIC 5 variant 2 version 1.02 .config: # # Automatically generated make config: don't edit # Linux kernel version: 2.6.22-rc2-cfs-v13 # Sat May 19 12:21:46 2007 # CONFIG_X86_32=y CONFIG_GENERIC_TIME=y CONFIG_CLOCKSOURCE_WATCHDOG=y CONFIG_GENERIC_CLOCKEVENTS=y CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y CONFIG_LOCKDEP_SUPPORT=y CONFIG_STACKTRACE_SUPPORT=y CONFIG_SEMAPHORE_SLEEPERS=y CONFIG_X86=y CONFIG_MMU=y CONFIG_ZONE_DMA=y CONFIG_QUICKLIST=y CONFIG_GENERIC_ISA_DMA=y CONFIG_GENERIC_IOMAP=y CONFIG_GENERIC_BUG=y CONFIG_GENERIC_HWEIGHT=y CONFIG_ARCH_MAY_HAVE_PC_FDC=y CONFIG_DMI=y CONFIG_DEFCONFIG_LIST=/lib/modules/$UNAME_RELEASE/.config # # Code maturity level options # CONFIG_EXPERIMENTAL=y CONFIG_BROKEN_ON_SMP=y CONFIG_INIT_ENV_ARG_LIMIT=32 # # General setup # CONFIG_LOCALVERSION= # CONFIG_LOCALVERSION_AUTO is not set CONFIG_SWAP=y CONFIG_SYSVIPC=y # CONFIG_IPC_NS is not set CONFIG_SYSVIPC_SYSCTL=y CONFIG_POSIX_MQUEUE=y CONFIG_BSD_PROCESS_ACCT=y CONFIG_BSD_PROCESS_ACCT_V3=y # CONFIG_TASKSTATS is not set # CONFIG_UTS_NS is not set CONFIG_AUDIT=y CONFIG_AUDITSYSCALL=y # CONFIG_IKCONFIG is not set CONFIG_LOG_BUF_SHIFT=14 # CONFIG_SYSFS_DEPRECATED is not set
Re: [linux-usb-devel] 2.6.22-rc2: regression: STD fails with pci_device_suspend(): usb_hcd_pci_suspend+0x0/0x160 [usbcore]() returns -16
On Sat, 19 May 2007, Andrey Borzenkov wrote: This works just fine up to and including 2.6.21. unfortunatelt dmesg got truncated; if required I can rebuild with larger buffer; the part around suspend is swsusp: Marking nosave pages: 0009f000 - 0010 swsusp: Basic memory bitmaps created Stopping tasks ... done. Shrinking memory... done (14553 pages freed) Freed 58212 kbytes in 0.30 seconds (194.04 MB/s) Suspending console(s) sd 0:0:0:0: [sda] Synchronizing SCSI cache pnp: Device 00:09 disabled. ACPI: PCI interrupt for device :00:0a.0 disabled Trying to free already-free IRQ 11 ACPI: PCI interrupt for device :00:06.0 disabled ACPI: Unable to derive IRQ for device :00:04.0 pci_device_suspend(): usb_hcd_pci_suspend+0x0/0x160 [usbcore]() returns -16 suspend_device(): pci_device_suspend+0x0/0x70() returns -16 Could not suspend device :00:02.0: error -16 Please turn on CONFIG_USB_DEBUG and post the resulting dmesg log. Alan Stern - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
[linux-usb-devel] usb-make-the-autosuspend-workqueue-thread-freezable.patch
Greg: The patch in $SUBJECT (already in your development tree) fixes a problem with system suspend in 2.6.22-rc1, as described in http://bugzilla.kernel.org/show_bug.cgi?id=8498 (For people on the PM development list, it's worth pointing out that all the patch does is make a particular kernel thread freezable.) Can you please expedite getting it sent up to Linus? Thanks, Alan Stern - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
Re: [linux-usb-devel] Is usb_buffer_alloc a generic URB buffer allocator ? (was Split Bulk Transfers)
On Sat, 19 May 2007, jidong xiao wrote: The length of any entry should be greater than a page?I think only if each buffer's size is divisible by page size, could it start at a page boundary and end at a page boundary. Let's use the word buffer to refer to the region of memory described by the entire scatter-gather list. Let's use the word sub-buffer to refer to that portion of the buffer which is described by a single scatterlist entry. Note that each entry corresponds to a group of pages (or a single page), only part of which might be contained in the sub-buffer. If the sub-buffer begins at the start of the group of pages and ends at the end of the group of pages then its length will indeed be a multiple of the page size. Each sub-buffer (except possibly the first one) will begin at the start of the page group. And each sub-buffer (except possibly the last one) will end at the end of the page group. Another way to describe this is as follows: For each scatterlist entry after the first, we should always have .offset = 0. For each scatterlist entry before the last, we should always have (.offset + .length) is a multiple of the page size. Alan Stern - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
[linux-usb-devel] [PATCH 2/6] Composite gadget driver
From: Ragner Magalhaes [EMAIL PROTECTED] Add linux/usb/composite.h interfaces for composite gadget drivers: - struct usb_function ... grouping one or more interfaces into a function that will often be managed as one unit; - struct usb_composite_driver ... grouping one or more such functions into a gadget driver. - struct usb_composite_dev ... what's managed by the composite driver. There's an implementation library behind the composite_driver which exposes the composite_dev. Separate patches will be updating some gadget drivers to use this new interface. Signed-off-by: David Brownell [EMAIL PROTECTED] --- drivers/usb/gadget/composite.c | 679 drivers/usb/gadget/usbstring.c |2 include/linux/usb/composite.h | 137 include/linux/usb_gadget.h |2 4 files changed, 818 insertions(+), 2 deletions(-) diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c new file mode 100644 index 000..495c660 --- /dev/null +++ b/drivers/usb/gadget/composite.c @@ -0,0 +1,679 @@ +#define DEBUG 1 +// #define VERBOSE + +#include linux/module.h +#include linux/kernel.h +#include linux/delay.h +#include linux/ioport.h +#include linux/sched.h +#include linux/slab.h +#include linux/smp_lock.h +#include linux/errno.h +#include linux/init.h +#include linux/timer.h +#include linux/list.h +#include linux/interrupt.h +#include linux/utsname.h +#include linux/device.h +#include linux/moduleparam.h + +#include asm/byteorder.h +#include asm/system.h +#include asm/unaligned.h + +#include linux/usb_ch9.h +#include linux/usb_gadget.h +#include linux/usb/composite.h + + +#define xprintk(d,level,fmt,args...) \ + dev_printk(level , (d)-gadget-dev , fmt , ## args) + +#ifdef DEBUG +#define DBG(dev,fmt,args...) \ + xprintk(dev , KERN_DEBUG , fmt , ## args) +#else +#define DBG(dev,fmt,args...) \ + do { } while(0) +#endif /* DEBUG */ + +#ifdef VERBOSE +#define VDBG DBG +#else +#define VDBG(dev,fmt,args...) \ + do { } while(0) +#endif /* VERBOSE */ + +#define ERROR(dev,fmt,args...) \ + xprintk(dev , KERN_ERR , fmt , ## args) +#define WARN(dev,fmt,args...) \ + xprintk(dev , KERN_WARNING , fmt , ## args) +#define INFO(dev,fmt,args...) \ + xprintk(dev , KERN_INFO , fmt , ## args) + +/*-*/ + +/* big enough to hold our biggest descriptor */ +#define USB_BUFSIZ 512 + + +static struct usb_composite_driver *composite; + +static inline int is_dualspeed(struct usb_gadget *g) +{ +#ifdef CONFIG_USB_GADGET_DUALSPEED + return g-is_dualspeed; +#else + return 0; +#endif +} + +static inline int is_otg(struct usb_gadget *g) +{ +#ifdef CONFIG_USB_OTG + return g-is_otg; +#else + return 0; +#endif +} + +/*-*/ + +/* To simplify, we expect to have only ONE real configuration, working the + * same no matter what speed it connects with. A given function may expose + * multiple interfaces. Each interface includes its descriptor, plus optional + * class and endpoint descriptors (as usual). + */ + +#defineCONFIG_NUMBER 1 + +static int +config_buf(struct usb_composite_dev *cdev, void *buf, u8 type) +{ + struct usb_config_descriptor*c = buf; + void*next = buf + USB_DT_CONFIG_SIZE; + int len = USB_BUFSIZ - USB_DT_CONFIG_SIZE; + int hs; + struct usb_function *f; + + if (is_dualspeed(cdev-gadget)) { + hs = (cdev-gadget-speed == USB_SPEED_HIGH); + if (type == USB_DT_OTHER_SPEED_CONFIG) + hs = !hs; + } else + hs = 0; + + /* write a config descriptor */ + *c = cdev-config; + c-bLength = USB_DT_CONFIG_SIZE; + c-bDescriptorType = type; + c-bConfigurationValue = CONFIG_NUMBER; + + /* REVISIT some configurations might need other descriptors, +* independent of the interfaces they implement ... notably +* OTG descriptors. +*/ + + /* add each function's descriptors */ + list_for_each_entry (f, composite-functions, function) { + int status; + + status = usb_descriptor_fillbuf(next, len, + hs ? f-hs_descriptors : f-descriptors); + if (status 0) + return status; + len -= status; + next += status; + } + + len = next - buf; + c-wTotalLength = cpu_to_le16(len); + return len; +} + +/*-*/ + +static void composite_reset_config( + struct usb_composite_dev*cdev, + struct usb_ctrlrequest
[linux-usb-devel] [PATCH 3/6] Composite gadget driver upgrade
From: Ragner Magalhaes [EMAIL PROTECTED] Modifications on David Brownell's patch. Some improvements on David Brownell's patch. It adds some functions to Composite Framework as well. Signed-off-by: Felipe Balbi [EMAIL PROTECTED] Signed-off-by: Ragner Magalhaes [EMAIL PROTECTED] --- drivers/usb/gadget/composite.c | 1046 +--- include/linux/usb/composite.h | 169 -- 2 files changed, 861 insertions(+), 354 deletions(-) diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c index 495c660..03d26c7 100644 --- a/drivers/usb/gadget/composite.c +++ b/drivers/usb/gadget/composite.c @@ -1,5 +1,19 @@ +/* + * composite.c -- USB Layer for Composite Gadget Support + * + * This software is distributed under the terms of the GNU General + * Public License (GPL) as published by the Free Software Foundation, + * either version 2 of the License of (at you option) any later version. + * + * Framework that let the gadget driver to work with multiples + * functions together. + */ + +#if 0 #define DEBUG 1 -// #define VERBOSE +#define VERBOSE 1 +#define DUMP_MSGS 1 +#endif #include linux/module.h #include linux/kernel.h @@ -21,10 +35,23 @@ #include asm/system.h #include asm/unaligned.h -#include linux/usb_ch9.h +#include linux/usb/ch9.h +#include linux/usb/cdc.h #include linux/usb_gadget.h #include linux/usb/composite.h +#include gadget_chips.h + +/*-*/ + +#define DRIVER_VERSION April 24th, 2007 +#define DRIVER_DESCRIPTOR Composite Gadget + +static const char shortname[] = composite; + +/*-*/ + +struct usb_composite_dev *cdev; #define xprintk(d,level,fmt,args...) \ dev_printk(level , (d)-gadget-dev , fmt , ## args) @@ -35,6 +62,8 @@ #else #define DBG(dev,fmt,args...) \ do { } while(0) +#undef VERBOSE +#undef DUMP_MSGS #endif /* DEBUG */ #ifdef VERBOSE @@ -54,10 +83,123 @@ /*-*/ /* big enough to hold our biggest descriptor */ -#define USB_BUFSIZ 512 +#define USB_BUFSIZ 256 + +/* An impossibly large value as file_storage */ +#define DELAYED_STATUS (USB_BUFSIZ + 999) + +/* take from zero.c USB OTG Compliance test device */ +#define DRIVER_VENDOR_NUM 0x1a0a +#define DRIVER_PRODUCT_NUM 0xbadd + +static ushort idVendor; +module_param(idVendor, ushort, S_IRUGO); +MODULE_PARM_DESC(idVendor, USB Vendor ID); + +static ushort idProduct; +module_param(idProduct, ushort, S_IRUGO); +MODULE_PARM_DESC(idProduct, USB Product ID); + +static ushort bcdDevice; +module_param(bcdDevice, ushort, S_IRUGO); +MODULE_PARM_DESC(bcdDevice, USB Device version (BCD)); + +static char *iManufacturer; +module_param(iManufacturer, charp, S_IRUGO); +MODULE_PARM_DESC(iManufacturer, USB Manufacturer string); + +static char *iProduct; +module_param(iProduct, charp, S_IRUGO); +MODULE_PARM_DESC(iProduct, USB Product string); +static char *iSerialNumber; +module_param(iSerialNumber, charp, S_IRUGO); +MODULE_PARM_DESC(iSerialNumber, SerialNumber); -static struct usb_composite_driver *composite; +/*-*/ + +/* USB String IDs */ +#define STRING_MANUFACTURER1 +#define STRING_PRODUCT 2 +#define STRING_SERIAL 3 +#define STRING_CONFIG014 +#define STRING_CONFIG025 + +#define CONFIG_NUMBER011 +#define CONFIG_NUMBER022 + +static struct usb_device_descriptor +device_desc = { + .bLength= sizeof device_desc, + .bDescriptorType= USB_DT_DEVICE, + + .bcdUSB = __constant_cpu_to_le16(0x0200), + .bDeviceClass = USB_CLASS_PER_INTERFACE, + + .idVendor = __constant_cpu_to_le16 (DRIVER_VENDOR_NUM), + .idProduct =__constant_cpu_to_le16 (DRIVER_PRODUCT_NUM), + .iManufacturer = STRING_MANUFACTURER, + .iProduct = STRING_PRODUCT, + .iSerialNumber = STRING_SERIAL, +}; + +static struct usb_config_descriptor +config_desc = { + .bLength= sizeof config_desc, + .bDescriptorType= USB_DT_CONFIG, + + /* compute wTotalLength on the fly */ + .bConfigurationValue= CONFIG_NUMBER01, + .iConfiguration = STRING_CONFIG01, + .bmAttributes = USB_CONFIG_ATT_ONE + | USB_CONFIG_ATT_SELFPOWER, + .bMaxPower = 1,/* self-powered */ +}; + +static struct usb_otg_descriptor +otg_descriptor = { + .bLength= sizeof otg_descriptor, + .bDescriptorType= USB_DT_OTG, + + .bmAttributes = USB_OTG_SRP, +}; + +static struct usb_qualifier_descriptor +dev_qualifier = { + .bLength
[linux-usb-devel] [PATCH 4/6] Config USB Composite gadget support
From: Ragner Magalhaes [EMAIL PROTECTED] Kconfig modifications for USB Composite gadget support. Signed-off-by: Felipe Balbi [EMAIL PROTECTED] Signed-off-by: Ragner Magalhaes [EMAIL PROTECTED] --- drivers/usb/gadget/Kconfig | 10 ++ drivers/usb/gadget/Makefile | 12 +--- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig index d4c7a41..fff5650 100644 --- a/drivers/usb/gadget/Kconfig +++ b/drivers/usb/gadget/Kconfig @@ -303,6 +303,16 @@ choice # this first set of drivers all depend on bulk-capable hardware. +config USB_COMPOSITE + tristate Composite Gadget Support + depends on USB_GADGET + help + The Composite Gadget is a gadget driver that allow to work + with multiples gadget functions together. + + This module adds support for File Storage and Ethernet Gadget + to work as Composite Gadget. + config USB_ZERO tristate Gadget Zero (DEVELOPMENT) depends on EXPERIMENTAL diff --git a/drivers/usb/gadget/Makefile b/drivers/usb/gadget/Makefile index 5db1939..bda57e1 100644 --- a/drivers/usb/gadget/Makefile +++ b/drivers/usb/gadget/Makefile @@ -13,22 +13,28 @@ obj-$(CONFIG_USB_FSL_USB2) += fsl_usb2_udc.o # # USB gadget drivers # +ifndef CONFIG_USB_COMPOSITE +GADGET := gadget.o +endif g_zero-objs:= zero.o usbstring.o config.o epautoconf.o -g_ether-objs := ether.o usbstring.o config.o epautoconf.o +g_ether-objs := ether.o usbstring.o config.o epautoconf.o \ + $(GADGET) g_serial-objs := serial.o usbstring.o config.o epautoconf.o g_midi-objs:= gmidi.o usbstring.o config.o epautoconf.o gadgetfs-objs := inode.o g_file_storage-objs:= file_storage.o usbstring.o config.o \ + epautoconf.o $(GADGET) +g_composite-objs := composite.o usbstring.o config.o \ epautoconf.o ifeq ($(CONFIG_USB_ETH_RNDIS),y) g_ether-objs+= rndis.o endif - + obj-$(CONFIG_USB_ZERO) += g_zero.o obj-$(CONFIG_USB_ETH) += g_ether.o obj-$(CONFIG_USB_GADGETFS) += gadgetfs.o obj-$(CONFIG_USB_FILE_STORAGE) += g_file_storage.o obj-$(CONFIG_USB_G_SERIAL) += g_serial.o obj-$(CONFIG_USB_MIDI_GADGET) += g_midi.o - +obj-$(CONFIG_USB_COMPOSITE)+= g_composite.o - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
[linux-usb-devel] [PATCH 5/6] Composite File Storage gadget support
From: Ragner Magalhaes [EMAIL PROTECTED] This patch adds some features that let the file-storage gadget to work as a usb_function module. Signed-off-by: Felipe Balbi [EMAIL PROTECTED] Signed-off-by: Ragner Magalhaes [EMAIL PROTECTED] --- drivers/usb/gadget/file_storage.c | 119 - 1 files changed, 51 insertions(+), 68 deletions(-) diff --git a/drivers/usb/gadget/file_storage.c b/drivers/usb/gadget/file_storage.c index c6b6479..fcaf3b3 100644 --- a/drivers/usb/gadget/file_storage.c +++ b/drivers/usb/gadget/file_storage.c @@ -255,6 +255,7 @@ #include linux/usb/ch9.h #include linux/usb_gadget.h +#include linux/usb/composite.h #include gadget_chips.h @@ -640,6 +641,7 @@ struct fsg_dev { /* lock protects: state, all the req_busy's, and cbbuf_cmnd */ spinlock_t lock; struct usb_gadget *gadget; + struct usb_function *f; /* filesem protects: backing files in use */ struct rw_semaphore filesem; @@ -732,7 +734,7 @@ static void inline set_bulk_out_req_length(struct fsg_dev *fsg, } static struct fsg_dev *the_fsg; -static struct usb_gadget_driverfsg_driver; +static struct usb_function fsg_driver; static voidclose_backing_file(struct lun *curlun); static voidclose_all_backing_files(struct fsg_dev *fsg); @@ -848,7 +850,8 @@ static void inline put_be32(u8 *buf, u32 val) #define STRING_PRODUCT 2 #define STRING_SERIAL 3 #define STRING_CONFIG 4 -#define STRING_INTERFACE 5 + +#define STRING_INTERFACE 6 /* There is only one configuration. */ #defineCONFIG_VALUE1 @@ -1052,9 +1055,10 @@ static struct usb_gadget_strings stringtab = { * and with code managing interfaces and their altsettings. They must * also handle different speeds and other-speed requests. */ -static int populate_config_buf(struct usb_gadget *gadget, +static int populate_config_buf(struct fsg_dev *dev, u8 *buf, u8 type, unsigned index) { + struct usb_gadget *gadget = dev-gadget; #ifdef CONFIG_USB_GADGET_DUALSPEED enum usb_device_speed speed = gadget-speed; #endif @@ -1074,9 +1078,15 @@ static int populate_config_buf(struct usb_gadget *gadget, function = fs_function; /* for now, don't advertise srp-only devices */ - if (!gadget-is_otg) + if (!gadget-is_otg || is_composite()) function++; + if (is_composite()) { + buf += dev-ep0req-length; + len = EP0_BUFSIZE - dev-ep0req-length; + return usb_descriptor_fillbuf(buf, len, function); + } + len = usb_gadget_config_buf(config_desc, buf, EP0_BUFSIZE, function); ((struct usb_config_descriptor *) buf)-bDescriptorType = type; return len; @@ -1125,7 +1135,7 @@ static void raise_exception(struct fsg_dev *fsg, enum fsg_state new_state) static void fsg_disconnect(struct usb_gadget *gadget) { - struct fsg_dev *fsg = get_gadget_data(gadget); + struct fsg_dev *fsg = get_usb_function_data(gadget); DBG(fsg, disconnect or port reset\n); raise_exception(fsg, FSG_STATE_DISCONNECT); @@ -1415,10 +1425,8 @@ static int standard_setup_req(struct fsg_dev *fsg, #ifdef CONFIG_USB_GADGET_DUALSPEED get_config: #endif - value = populate_config_buf(fsg-gadget, - req-buf, - w_value 8, - w_value 0xff); + value = populate_config_buf(fsg, req-buf, + w_value 8, w_value 0xff); break; case USB_DT_STRING: @@ -1479,7 +1487,7 @@ static int standard_setup_req(struct fsg_dev *fsg, break; } VDBG(fsg, get interface\n); - *(u8 *) req-buf = 0; + *(u8 *) req-buf = INTRF_FUNC2COMPOSITE(fsg-f,0); value = 1; break; @@ -1497,13 +1505,16 @@ static int standard_setup_req(struct fsg_dev *fsg, static int fsg_setup(struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl) { - struct fsg_dev *fsg = get_gadget_data(gadget); + struct fsg_dev *fsg = get_usb_function_data(gadget); int rc; - int w_length = le16_to_cpu(ctrl-wLength); ++fsg-ep0_req_tag; // Record arrival of a new request fsg-ep0req-context = NULL; - fsg-ep0req-length = 0; + if (is_composite()) { + fsg-ep0req-complete = ep0_complete; + gadget-ep0-driver_data = fsg; + } + dump_msg(fsg, ep0-setup, (u8 *) ctrl, sizeof(*ctrl)); if
[linux-usb-devel] [PATCH 6/6] Composite Ether gadget support
From: Ragner Magalhaes [EMAIL PROTECTED] This patch adds some features that let the ether gadget to work as a usb_function module. Signed-off-by: Felipe Balbi [EMAIL PROTECTED] Signed-off-by: Ragner Magalhaes [EMAIL PROTECTED] --- drivers/usb/gadget/ether.c | 98 +--- 1 files changed, 47 insertions(+), 51 deletions(-) diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c index 325bf7c..5a6cfd7 100644 --- a/drivers/usb/gadget/ether.c +++ b/drivers/usb/gadget/ether.c @@ -48,6 +48,7 @@ #include linux/usb/ch9.h #include linux/usb/cdc.h #include linux/usb_gadget.h +#include linux/usb/composite.h #include linux/random.h #include linux/netdevice.h @@ -117,6 +118,7 @@ static const char driver_desc [] = DRIVER_DESC; struct eth_dev { spinlock_t lock; struct usb_gadget *gadget; + struct usb_function *f; struct usb_request *req; /* for control responses */ struct usb_request *stat_req; /* for cdc rndis status */ @@ -144,6 +146,8 @@ struct eth_dev { u8 host_mac [ETH_ALEN]; }; +static struct usb_function eth_driver; + /* This version autoconfigures as much as possible at run-time. * * It also ASSUMES a self-powered device, without remote wakeup, @@ -416,14 +420,15 @@ static inline int BITRATE(struct usb_gadget *g) #define STRING_MANUFACTURER1 #define STRING_PRODUCT 2 -#define STRING_ETHADDR 3 -#define STRING_DATA4 -#define STRING_CONTROL 5 +#define STRING_SERIALNUMBER3 +#define STRING_CDC 4 +#define STRING_RNDIS 5 + #define STRING_RNDIS_CONTROL 6 -#define STRING_CDC 7 +#define STRING_DATA7 #define STRING_SUBSET 8 -#define STRING_RNDIS 9 -#define STRING_SERIALNUMBER10 +#define STRING_CONTROL 9 +#define STRING_ETHADDR 10 /* holds our biggest descriptor (or RNDIS response) */ #define USB_BUFSIZ 256 @@ -981,7 +986,7 @@ static struct usb_gadget_stringsstringtab = { * complications: class descriptors, and an altsetting. */ static int -config_buf (enum usb_device_speed speed, +config_buf (struct eth_dev *dev, u8 *buf, u8 type, unsigned index, int is_otg) { @@ -989,7 +994,7 @@ config_buf (enum usb_device_speed speed, const struct usb_config_descriptor *config; const struct usb_descriptor_header **function; #ifdef CONFIG_USB_GADGET_DUALSPEED - int hs = (speed == USB_SPEED_HIGH); + int hs = (dev-gadget-speed == USB_SPEED_HIGH); if (type == USB_DT_OTHER_SPEED_CONFIG) hs = !hs; @@ -1016,9 +1021,16 @@ config_buf (enum usb_device_speed speed, } /* for now, don't advertise srp-only devices */ - if (!is_otg) + if (!is_otg || is_composite()) function++; + if (is_composite()) { + dev-f-config[index] = config; + buf += dev-req-length; + len = USB_BUFSIZ - dev-req-length; + return usb_descriptor_fillbuf(buf, len, function); + } + len = usb_gadget_config_buf (config, buf, USB_BUFSIZ, function); if (len 0) return len; @@ -1369,7 +1381,7 @@ static void rndis_command_complete (struct usb_ep *ep, struct usb_request *req) static int eth_setup (struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl) { - struct eth_dev *dev = get_gadget_data (gadget); + struct eth_dev *dev = get_usb_function_data (gadget); struct usb_request *req = dev-req; int value = -EOPNOTSUPP; u16 wIndex = le16_to_cpu(ctrl-wIndex); @@ -1380,6 +1392,8 @@ eth_setup (struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl) * while config change events may enable network traffic. */ req-complete = eth_setup_complete; + if (is_composite()) + gadget-ep0-driver_data = dev; switch (ctrl-bRequest) { case USB_REQ_GET_DESCRIPTOR: @@ -1405,7 +1419,7 @@ eth_setup (struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl) // FALLTHROUGH #endif /* CONFIG_USB_GADGET_DUALSPEED */ case USB_DT_CONFIG: - value = config_buf (gadget-speed, req-buf, + value = config_buf (dev, req-buf, wValue 8, wValue 0xff, gadget-is_otg); @@ -1520,9 +1534,10 @@ done_set_intf: /* for CDC, iff carrier is on, data interface is active. */ if (rndis_active(dev) || wIndex
[linux-usb-devel] [PATCH 0/6] Composite Gadget Support
The following series implements USB Composite Gadget Support. [PATCH 1/6] USB gadget driver. [PATCH 2/6] Composite gadget driver. [PATCH 3/6] Composite gadget driver upgrade. [PATCH 4/6] Kconfig modifications for USB Composite gadget support. [PATCH 5/6] Composite File Storage gadget support. [PATCH 6/6] Composite Ether gadget support. The Composite Gadget can handle one or two configurations. When the first usb_function modprobe'ed has two configurations the Composite Gadget will have two configurations, for the other functions modprobe'ed after will be used the selected or standard configuration only, their interfaces will be part of the Composite's Configurations. Then exchanging configs in the Composite will only affect the first function. In case the first modprobe'ed function has only one configure, the Composite Gadget WILL have only one configuration. This behavior is useful when modprobe'ing g_ether as the first usb_function due to the RNDIS and CDC Configurations. USB GADGET API CORE |_ Gadget |_ Composite Gadget FUNCTIONS |_ Ether |_ File Storage |_ ... --- Gadget mode --- (gadget)(gadget) | | (ether) (file storge) work as old gadget. --- Composite mode --- (composite gadget) / \ (ether)(file storage) When the ether is modprobe'ed first: (Device Decriptor) /\ (Config 0) (Config 1) (eth config 0 + fsg config) (eth config 1 + fsg config) Device Descriptor: bLength18 bDescriptorType 1 bcdUSB 2.00 bDeviceClass0 (Defined at Interface level) bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize064 idVendor 0x1a0a ... idProduct 0xbadd USB OTG Compliance test device bcdDevice2.08 iManufacturer 1 Linux 2.6.21-omap1-g956f74ab-dirty with omap_udc iProduct2 Composite Gadget iSerial 3 4776623376227 bNumConfigurations 2 OTG Descriptor: bLength 3 bDescriptorType 9 bmAttributes 0x03 SRP (Session Request Protocol) HNP (Host Negotiation Protocol) Configuration Descriptor: bLength 9 bDescriptorType 2 wTotalLength 93 bNumInterfaces 3 bConfigurationValue 1 iConfiguration 4 RNDIS, Self-powered bmAttributes 0xe0 Self Powered Remote Wakeup MaxPower8mA Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber0 bAlternateSetting 0 bNumEndpoints 1 bInterfaceClass 2 Communications bInterfaceSubClass 2 Abstract (modem) bInterfaceProtocol255 Vendor Specific (MSFT RNDIS?) iInterface 6 RNDIS Communications Control CDC Header: bcdCDC 1.10 CDC Call Management: bmCapabilities 0x00 bDataInterface 1 CDC ACM: bmCapabilities 0x00 CDC Union: bMasterInterface0 bSlaveInterface 1 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x83 EP 3 IN bmAttributes3 Transfer TypeInterrupt Synch Type None Usage Type Data wMaxPacketSize 0x0010 1x 16 bytes bInterval 32 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber1 bAlternateSetting 0 bNumEndpoints 2 bInterfaceClass10 CDC Data bInterfaceSubClass 0 Unused bInterfaceProtocol 0 iInterface 7 Ethernet Data Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN bmAttributes2 Transfer TypeBulk Synch Type None Usage Type Data wMaxPacketSize 0x0040 1x 64 bytes bInterval 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x02 EP 2 OUT bmAttributes2 Transfer TypeBulk Synch Type None Usage Type Data wMaxPacketSize 0x0040 1x 64 bytes bInterval 0 Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber2 bAlternateSetting 0 bNumEndpoints
[linux-usb-devel] [PATCH 1/6] USB gadget driver
From: Ragner Magalhaes [EMAIL PROTECTED] Implements support for a gadget function with composite support to work as a single function. Signed-off-by: Ragner Magalhaes [EMAIL PROTECTED] --- drivers/usb/gadget/gadget.c | 283 +++ 1 files changed, 283 insertions(+), 0 deletions(-) diff --git a/drivers/usb/gadget/gadget.c b/drivers/usb/gadget/gadget.c new file mode 100644 index 000..9a4a0e0 --- /dev/null +++ b/drivers/usb/gadget/gadget.c @@ -0,0 +1,283 @@ +/* + * gadget.c -- USB gadget driver. + * + * Copyright (C) 2007 Instituto Nokia de Tecnologia - INdT + * Developed for INdT by Ragner Magalhaes + * Ragner Magalhaes [EMAIL PROTECTED] + * + * This software is distributed under the terms of the GNU General Public + * License (GPL) version 2, as published by the Free Software Foundation. + * + * Implements support for one gadget device with a single function. + */ + +#if 0 +#define DEBUG 1 +#define VERBOSE 1 +#endif + +#include linux/module.h +#include linux/kernel.h +#include linux/delay.h +#include linux/ioport.h +#include linux/sched.h +#include linux/slab.h +#include linux/smp_lock.h +#include linux/errno.h +#include linux/init.h +#include linux/timer.h +#include linux/list.h +#include linux/interrupt.h +#include linux/utsname.h +#include linux/device.h +#include linux/moduleparam.h + +#include asm/byteorder.h +#include asm/system.h +#include asm/unaligned.h + +#include linux/usb/ch9.h +#include linux/usb/cdc.h +#include linux/usb_gadget.h +#include linux/usb/composite.h + +#include gadget_chips.h + +/*-*/ + +#define xprintk(d,level,fmt,args...) \ + dev_printk(level , (d)-gadget-dev , fmt , ## args) + +#ifdef DEBUG +#define DBG(dev,fmt,args...) \ + xprintk(dev , KERN_DEBUG , fmt , ## args) +#else +#define DBG(dev,fmt,args...) \ + do { } while(0) +#endif /* DEBUG */ + +#ifdef VERBOSE +#define VDBG DBG +#else +#define VDBG(dev,fmt,args...) \ + do { } while(0) +#endif /* VERBOSE */ + +#define ERROR(dev,fmt,args...) \ + xprintk(dev , KERN_ERR , fmt , ## args) +#define WARN(dev,fmt,args...) \ + xprintk(dev , KERN_WARNING , fmt , ## args) +#define INFO(dev,fmt,args...) \ + xprintk(dev , KERN_INFO , fmt , ## args) + +/*-*/ + +/* big enough to hold our biggest descriptor */ +#define USB_BUFSIZ 256 + + +struct usb_function*func; + +/*-*/ + +/* An impossibly large value as file_storage */ +#define DELAYED_STATUS (USB_BUFSIZ + 999) + +void usb_func_ep_reset (struct usb_gadget *g, struct usb_function *f) +{ + struct usb_ep *ep; + + list_for_each_entry (ep, g-ep_list, ep_list) { + if (ep-driver_data == f-driver_data) { + usb_ep_disable (ep); + ep-driver_data = NULL; + } + } +} + +static void +free_ep_req(struct usb_ep *ep, struct usb_request *req) +{ + if (req-buf) + kfree (req-buf); + usb_ep_free_request(ep, req); +} + +/*-*/ + +static int +gadget_setup(struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl) +{ + struct usb_gadget_dev *dev = get_gadget_data(gadget); + struct usb_request *req = dev-req; + int value = -EOPNOTSUPP; + u16 w_index = le16_to_cpu(ctrl-wIndex); + u16 w_value = le16_to_cpu(ctrl-wValue); + u16 w_length = le16_to_cpu(ctrl-wLength); + + req-zero = 0; + req-length = 0; + value = dev-func-setup (gadget, ctrl); + + /* respond with data transfer before status phase? */ + if (value = 0 value != DELAYED_STATUS) { + value = min((u16)value, w_length); + req-length = value; + req-zero = value w_length; + + value = usb_ep_queue(gadget-ep0, req, GFP_ATOMIC); + if (value != 0 value != -ESHUTDOWN) { + WARN(dev, error in submission: %s -- %d\n, + (ctrl-bRequestType USB_DIR_IN ? +ep0-in : ep0-out), value); + req-status = 0; + } + } else { + DBG(dev, setup req%02x.%02x v%04x i%04x l%d -- %d\n, + ctrl-bRequestType, ctrl-bRequest, + w_value, w_index, w_length, value); + /* to eliminate compile warnings */ + w_index = w_value = 0; + } + + /* device either stalls (value 0) or reports success */ + return value; +} + +static void +gadget_disconnect(struct usb_gadget
Re: [linux-usb-devel] [Bugme-new] [Bug 8510] New: OHCI constantly attempts suspending root hub on ALi motherboard
On Sat, 19 May 2007 10:08:40 -0700 [EMAIL PROTECTED] wrote: http://bugzilla.kernel.org/show_bug.cgi?id=8510 A regression. Summary: OHCI constantly attempts suspending root hub on ALi motherboard Kernel Version: 2.6.22-rc2 Status: NEW Severity: normal Owner: [EMAIL PROTECTED] Submitter: [EMAIL PROTECTED] Most recent kernel where this bug did *NOT* occur: 2.6.16.20 Distribution: Mandriva, kernel is vanilla kernel.org Hardware Environment: Toshiba Portege 4000 lspci: 00:00.0 Host bridge: ALi Corporation M1644/M1644T Northbridge+Trident (rev 01) 00:01.0 PCI bridge: ALi Corporation PCI to AGP Controller 00:02.0 USB Controller: ALi Corporation USB 1.1 Controller (rev 03) 00:04.0 IDE interface: ALi Corporation M5229 IDE (rev c3) 00:06.0 Multimedia audio controller: ALi Corporation M5451 PCI AC-Link Controller Audio Device (rev 01) 00:07.0 ISA bridge: ALi Corporation M1533/M1535 PCI to ISA Bridge [Aladdin IV/V/V+] 00:08.0 Bridge: ALi Corporation M7101 Power Management Controller [PMU] 00:0a.0 Ethernet controller: Intel Corporation 82557/8/9 [Ethernet Pro 100] (rev 08) 00:10.0 CardBus bridge: Texas Instruments PCI1410 PC card Cardbus Controller (rev 01) 00:11.0 CardBus bridge: Toshiba America Info Systems ToPIC100 PCI to Cardbus Bridge with ZV Support (rev 32) 00:11.1 CardBus bridge: Toshiba America Info Systems ToPIC100 PCI to Cardbus Bridge with ZV Support (rev 32) 00:12.0 System peripheral: Toshiba America Info Systems SD TypA Controller (rev 03) 01:00.0 VGA compatible controller: Trident Microsystems CyberBlade XPAi1 (rev 82) Software Environment: swsusp Problem Description: Kernel constantly tries suspend root hub which fails on this motherboard. Initially it also output messages to dmesg every second; now message is no more output but as debug shows kernel still constantly tries failed attepts. Workaround is to disable wakeup via sysfs; it was suggested that proper fix is to blacklist the drievr. As far as I an tell neccessary infrastructure is now available. Problem history: Initial submission: http://marc.info/?t=11506441731r=1w=2 Later regression: http://marc.info/?t=11635377482r=1w=2 Patch for the regression: http://marc.info/?t=11635397071r=1w=2 Steps to reproduce: Enable USB_DEBUG and check dmesg/syslog: hub 1-0:1.0: hub_suspend ohci_hcd :00:02.0: suspend root hub usb usb1: usb auto-suspend usb usb1: usb resume usb usb1: finish resume hub 1-0:1.0: hub_resume ohci_hcd :00:02.0: wakeup root hub hub 1-0:1.0: state 7 ports 3 chg evt ohci_hcd :00:02.0: auto-stop root hub ohci_hcd :00:02.0: auto-wakeup root hub ohci_hcd :00:02.0: auto-stop root hub ohci_hcd :00:02.0: auto-wakeup root hub every second dmesg and .config attached --- You are receiving this mail because: --- You are on the CC list for the bug, or are watching someone who is. - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
[linux-usb-devel] patch usb-remove-short-initial-timeout-for-device-descriptor-fetch.patch added to gregkh-2.6 tree
This is a note to let you know that I've just added the patch titled Subject: USB: remove short initial timeout for device descriptor fetch to my gregkh-2.6 tree. Its filename is usb-remove-short-initial-timeout-for-device-descriptor-fetch.patch This tree can be found at http://www.kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/patches/ From [EMAIL PROTECTED] Fri May 11 07:19:08 2007 Date: Fri, 11 May 2007 10:19:04 -0400 (EDT) From: Alan Stern [EMAIL PROTECTED] To: Greg KH [EMAIL PROTECTED] cc: [EMAIL PROTECTED], USB development list linux-usb-devel@lists.sourceforge.net Subject: USB: remove short initial timeout for device descriptor fetch Message-ID: [EMAIL PROTECTED] This patch (as905) removes a micro-optimization from the hub port initialization code. Previously we had been using a short timeout on the first attempt the read the device descriptor; now we will use the standard timeout length. It's not clear that the short timeout ever provided any benefit. And now we know of one case where it actually hurts: The device can't meet the short timeout and then it gets terminally confused. This fixes Bugzilla #8444. Signed-off-by: Alan Stern [EMAIL PROTECTED] Signed-off-by: Greg Kroah-Hartman [EMAIL PROTECTED] --- drivers/usb/core/hub.c | 13 - 1 file changed, 4 insertions(+), 9 deletions(-) --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c @@ -2131,14 +2131,9 @@ hub_port_init (struct usb_hub *hub, stru continue; } - /* Use a short timeout the first time through, -* so that recalcitrant full-speed devices with -* 8- or 16-byte ep0-maxpackets won't slow things -* down tremendously by NAKing the unexpectedly -* early status stage. Also, retry on all errors; -* some devices are flakey. -* 255 is for WUSB devices, we actually need to use 512. -* WUSB1.0[4.8.1]. + /* Retry on all errors; some devices are flakey. +* 255 is for WUSB devices, we actually need to use +* 512 (WUSB1.0[4.8.1]). */ for (j = 0; j 3; ++j) { buf-bMaxPacketSize0 = 0; @@ -2146,7 +2141,7 @@ hub_port_init (struct usb_hub *hub, stru USB_REQ_GET_DESCRIPTOR, USB_DIR_IN, USB_DT_DEVICE 8, 0, buf, GET_DESCRIPTOR_BUFSIZE, - (i ? USB_CTRL_GET_TIMEOUT : 1000)); + USB_CTRL_GET_TIMEOUT); switch (buf-bMaxPacketSize0) { case 8: case 16: case 32: case 64: case 255: if (buf-bDescriptorType == Patches currently in gregkh-2.6 which might be from [EMAIL PROTECTED] are driver/ida-implement-idr-based-id-allocator.patch driver/idr-fix-obscure-bug-in-allocation-path.patch driver/idr-separate-out-idr_mark_full.patch driver/sysfs-kill-unnecessary-attribute-owner.patch driver/driver-core-make-devt_attr-and-uevent_attr-static.patch driver/sysfs-consolidate-sysfs_dirent-creation-functions.patch driver/sysfs-add-sysfs_dirent-s_name.patch driver/sysfs-make-sysfs_dirent-s_element-a-union.patch driver/sysfs-add-sysfs_dirent-s_parent.patch driver/sysfs-allocate-inode-number-using-ida.patch driver/sysfs-kill-attribute-file-orphaning.patch driver/sysfs-fix-error-handling-in-binattr-write.patch driver/sysfs-flatten-and-fix-sysfs_rename_dir-error-handling.patch driver/sysfs-flatten-cleanup-paths-in-sysfs_add_link-and-create_dir.patch driver/sysfs-implement-bin_buffer.patch driver/sysfs-implement-kobj_sysfs_assoc_lock.patch driver/sysfs-implement-sysfs_dirent-active-reference-and-immediate-disconnect.patch driver/sysfs-make-sysfs_put-ignore-null-sd.patch driver/sysfs-move-release_sysfs_dirent-to-dir.c.patch driver/sysfs-reimplement-syfs_drop_dentry.patch driver/sysfs-reimplement-symlink-using-sysfs_dirent-tree.patch driver/sysfs-separate-out-sysfs_attach_dentry.patch usb/usb-interface-pm-state.patch usb/usb-remove-unneeded-warn_on.patch usb/usb-implement-pm-freeze-and-prethaw.patch usb/usb-make-the-autosuspend-workqueue-thread-freezable.patch usb/usb-more-autosuspend-timer-stuff.patch usb/usb-move-bus_suspend-and-bus_resume-method-calls.patch usb/usb-set-the-correct-interrupt-interval-in-usb_bulk_msg.patch usb/usb-don-t-unsuspend-for-a-new-connection.patch usb/usb-make-hub-driver-s-release-more-robust.patch usb/ehci-fix-problem-with-bios-handoff.patch usb/usb-fix-race-between-autosuspend-and-unregister-for-root-hubs.patch usb/usb-remove-locktree-routine-from-the-hub-driver.patch
Re: [linux-usb-devel] usb-make-the-autosuspend-workqueue-thread-freezable.patch
On Sat, May 19, 2007 at 11:16:44AM -0400, Alan Stern wrote: Greg: The patch in $SUBJECT (already in your development tree) fixes a problem with system suspend in 2.6.22-rc1, as described in http://bugzilla.kernel.org/show_bug.cgi?id=8498 (For people on the PM development list, it's worth pointing out that all the patch does is make a particular kernel thread freezable.) Can you please expedite getting it sent up to Linus? Will do, I have a number of USB bugfixes to go to Linus, just been traveling too much. Next week I'll be able to get to it... thanks, greg k-h - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
Re: [linux-usb-devel] New USB stack on FreeBSD w/Linux emulation layer coming
On Thu, 17 May 2007 17:37:22 -0700, David Brownell [EMAIL PROTECTED] wrote: As it happens, USB callbacks cannot be interrupted. That's a somewhat artificial restriction; in theory there's no reason we couldn't allow interrupts. Do you remember why we're doing this? I did not touch that part since the attempt to keep usb-lock across the callback (read: years back). [...] I understand the points a-c above. The question is, why do we do local_irq_save across the URB callback? It seems to be completely non-functional. Where is that done? The HCDs just seem to call usb_hcd_giveback_urb() after dropping their internal spinlock (except the u132 one, which has always been kind of dubious and acts unmaintained). And that routine doesn't do a local_irq_save. Absolutely right, I'm being an idiot here. I think I looked at root hub code in the rush to the FreedomHEC preparations. We do not have local_irq_save in the giveback routine. So, when Alan wrote USB callbacks cannot be interrupted, he meant normal no-reentrancy guarantees, and not that the interrupts are disabled. -- Pete - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
Re: [linux-usb-devel] Problems with /pub/linux/kernel/people/gregkh/gregkh-2.6
On Fri, May 18, 2007 at 10:40:13AM -0400, Alan Stern wrote: Greg: It looks like your development directory has gotten a little out of sync with itself. Look at this sublisting: gregkh-01-driver/17-May-2007 14:55- gregkh-02-i2c/ 10-May-2007 14:41- gregkh-02-pci/ 17-May-2007 14:56- gregkh-03-pci/ 10-May-2007 14:41- gregkh-03-usb/ 17-May-2007 14:56- gregkh-04-driver-class/ 17-May-2007 14:56- gregkh-04-usb/ 10-May-2007 14:41- gregkh-05-driver-class/ 10-May-2007 14:41- Apparently adding or removing i2c threw all the higher numbers off by one. Ugh, that was caused by an old script on my laptop that wasn't synced up with my main script repo. Thanks for letting me know, it should be fixed soon, as soon as the master.kernel.org sync catches back up. greg k-h - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
Re: [linux-usb-devel] [Bugme-new] [Bug 8510] New: OHCI constantly attempts suspending root hub on ALi motherboard
On Saturday 19 May 2007, Andrew Morton wrote: On Sat, 19 May 2007 10:08:40 -0700 [EMAIL PROTECTED] wrote: http://bugzilla.kernel.org/show_bug.cgi?id=8510 A regression. From 2.6.16, yes... this has been around for a while, but nobody came up with a patch. I suggest someone with the hardware just provide an update to the drivers/usb/host/ohci-pci.c file using the PCI_DEVICE(PCI_VENDOR_ID_ITE, 0x8152), quirk table entry as a model. - Dave Problem Description: Kernel constantly tries suspend root hub which fails on this motherboard. Initially it also output messages to dmesg every second; now message is no more output but as debug shows kernel still constantly tries failed attepts. Workaround is to disable wakeup via sysfs; it was suggested that proper fix is to blacklist the drievr. As far as I an tell neccessary infrastructure is now available. - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
Re: [linux-usb-devel] [Bugme-new] [Bug 8510] New: OHCI constantly attempts suspending root hub on ALi motherboard
On Saturday 19 May 2007, David Brownell wrote: On Saturday 19 May 2007, Andrew Morton wrote: On Sat, 19 May 2007 10:08:40 -0700 [EMAIL PROTECTED] wrote: http://bugzilla.kernel.org/show_bug.cgi?id=8510 A regression. From 2.6.16, yes... this has been around for a while, but nobody came up with a patch. I suggest someone with the hardware just provide an update to the drivers/usb/host/ohci-pci.c file using the PCI_DEVICE(PCI_VENDOR_ID_ITE, 0x8152), quirk table entry as a model. Grr, better yet: find out why the existing quirk entry for this particular laptop doesn't trigger. - Dave Problem Description: Kernel constantly tries suspend root hub which fails on this motherboard. Initially it also output messages to dmesg every second; now message is no more output but as debug shows kernel still constantly tries failed attepts. Workaround is to disable wakeup via sysfs; it was suggested that proper fix is to blacklist the drievr. As far as I an tell neccessary infrastructure is now available. - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
Re: [linux-usb-devel] New USB stack on FreeBSD w/Linux emulation layer coming
On Saturday 19 May 2007, Pete Zaitcev wrote: On Thu, 17 May 2007 17:37:22 -0700, David Brownell [EMAIL PROTECTED] wrote: As it happens, USB callbacks cannot be interrupted. That's a somewhat artificial restriction; in theory there's no reason we couldn't allow interrupts. Do you remember why we're doing this? I did not touch that part since the attempt to keep usb-lock across the callback (read: years back). [...] I understand the points a-c above. The question is, why do we do local_irq_save across the URB callback? It seems to be completely non-functional. Where is that done? The HCDs just seem to call usb_hcd_giveback_urb() after dropping their internal spinlock (except the u132 one, which has always been kind of dubious and acts unmaintained). And that routine doesn't do a local_irq_save. Absolutely right, I'm being an idiot here. I think I looked at root hub code in the rush to the FreedomHEC preparations. We do not have local_irq_save in the giveback routine. So, when Alan wrote USB callbacks cannot be interrupted, he meant normal no-reentrancy guarantees, and not that the interrupts are disabled. And by normal no-reentrancy you mean the normal guarantee that each IRQ handler won't be re-entered while it's running. I observe that we don't register PCI IRQ handlers with IRQF_DISABLED, so it's possible that some *other* IRQ happens while it's running; but most of the non-PCI irq handlers are registered with that flag set. That seems potentially buglike to me; it's legit for any IRQ handler to submit an URB. Which would then cause them to try grabbing the spinlock held by the HCD's IRQ handler, if that other IRQ handler happened to fire when the HCD's IRQ handler was running. So maybe we should always register with IRQF_DISABLED, unattractive though that could be in terms of latencies ... or, somehow try to define a rule whereby URBs can't be submitted in certain IRQ contexts. - Dave - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
Re: [linux-usb-devel] [Bugme-new] [Bug 8510] New: OHCI constantly attempts suspending root hub on ALi motherboard
On Sunday 20 May 2007, David Brownell wrote: On Saturday 19 May 2007, David Brownell wrote: On Saturday 19 May 2007, Andrew Morton wrote: On Sat, 19 May 2007 10:08:40 -0700 [EMAIL PROTECTED] wrote: http://bugzilla.kernel.org/show_bug.cgi?id=8510 A regression. From 2.6.16, yes... this has been around for a while, but nobody came up with a patch. I suggest someone with the hardware just provide an update to the drivers/usb/host/ohci-pci.c file using the PCI_DEVICE(PCI_VENDOR_ID_ITE, 0x8152), quirk table entry as a model. Grr, better yet: find out why the existing quirk entry for this particular laptop doesn't trigger. Because it is usig wrong subvendor. Runtime tested: ohci_hcd: 2006 August 04 USB 1.1 'Open' Host Controller (OHCI) Driver ohci_hcd: block sizes: ed 64 td 64 ACPI: PCI Interrupt :00:02.0[A] - Link [LNKG] - GSI 11 (level, low) - IRQ 11 ohci_hcd :00:02.0: OHCI Host Controller /home/bor/src/linux-git/drivers/usb/core/inode.c: creating file 'devices' /home/bor/src/linux-git/drivers/usb/core/inode.c: creating file '001' ohci_hcd :00:02.0: new USB bus registered, assigned bus number 1 ohci_hcd :00:02.0: created debug files ohci_hcd :00:02.0: irq 11, io mem 0xf7eff000 ohci_hcd :00:02.0: enabling initreset quirk ohci_hcd :00:02.0: OHCI controller state ohci_hcd :00:02.0: OHCI 1.0, NO legacy support registers ohci_hcd :00:02.0: control 0x083 HCFS=operational CBSR=3 ohci_hcd :00:02.0: cmdstatus 0x0 SOC=0 ohci_hcd :00:02.0: intrstatus 0x0044 RHSC SF ohci_hcd :00:02.0: intrenable 0x800a MIE RD WDH ohci_hcd :00:02.0: hcca frame #0003 ohci_hcd :00:02.0: roothub.a 01000203 POTPGT=1 NPS NDP=3(3) ohci_hcd :00:02.0: roothub.b PPCM= DR= ohci_hcd :00:02.0: roothub.status 8000 DRWE ohci_hcd :00:02.0: roothub.portstatus [0] 0x0100 PPS ohci_hcd :00:02.0: roothub.portstatus [1] 0x0100 PPS ohci_hcd :00:02.0: roothub.portstatus [2] 0x0100 PPS usb usb1: default language 0x0409 usb usb1: new device strings: Mfr=3, Product=2, SerialNumber=1 usb usb1: Product: OHCI Host Controller usb usb1: Manufacturer: Linux 2.6.22-rc2-cfs-v13-1avb ohci_hcd usb usb1: SerialNumber: :00:02.0 usb usb1: uevent usb usb1: usb_probe_device usb usb1: configuration #1 chosen from 1 choice usb usb1: adding 1-0:1.0 (config #1, interface 0) usb 1-0:1.0: uevent usb 1-0:1.0: uevent hub 1-0:1.0: usb_probe_interface hub 1-0:1.0: usb_probe_interface - got id hub 1-0:1.0: USB hub found hub 1-0:1.0: 3 ports detected hub 1-0:1.0: standalone hub hub 1-0:1.0: no power switching (usb 1.0) hub 1-0:1.0: global over-current protection hub 1-0:1.0: power on to power good time: 2ms hub 1-0:1.0: local power source is good hub 1-0:1.0: no over-current condition exists hub 1-0:1.0: trying to enable port power on non-switchable hub hub 1-0:1.0: state 7 ports 3 chg evt /home/bor/src/linux-git/drivers/usb/core/inode.c: creating file '001' usb usb1: remote wakeup needed for autosuspend --- Subject: [PATCH] Fix USB OHCI Subvendor for Toshiba Portege 4000 From: Andrey Borzenkov [EMAIL PROTECTED] For Portege 4000 Subvendor is 1179 (PCI_VENDOR_ID_TOSHIBA) not 0x102f (PCI_VENDOR_ID_TOSHIBA_2) 00:02.0 USB Controller [0c03]: ALi Corporation USB 1.1 Controller [10b9:5237] (rev 03) (prog-if 10 [OHCI]) Subsystem: Toshiba America Info Systems Unknown device [1179:0004] Flags: bus master, medium devsel, latency 64, IRQ 11 Memory at f7eff000 (32-bit, non-prefetchable) [size=4K] Capabilities: access denied Signed-off-by: Andrey Borzenkov [EMAIL PROTECTED] --- drivers/usb/host/ohci-pci.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/usb/host/ohci-pci.c b/drivers/usb/host/ohci-pci.c index 7970560..ca62cb5 100644 --- a/drivers/usb/host/ohci-pci.c +++ b/drivers/usb/host/ohci-pci.c @@ -137,7 +137,7 @@ static const struct pci_device_id ohci_pci_quirks[] = { /* Toshiba portege 4000 */ .vendor = PCI_VENDOR_ID_AL, .device = 0x5237, - .subvendor = PCI_VENDOR_ID_TOSHIBA_2, + .subvendor = PCI_VENDOR_ID_TOSHIBA, .subdevice = 0x0004, .driver_data= (unsigned long) broken_suspend, }, - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
Re: [linux-usb-devel] New USB stack on FreeBSD w/Linux emulation layer coming
On Sat, 19 May 2007, David Brownell wrote: Absolutely right, I'm being an idiot here. I think I looked at root hub code in the rush to the FreedomHEC preparations. We do not have local_irq_save in the giveback routine. So, when Alan wrote USB callbacks cannot be interrupted, he meant normal no-reentrancy guarantees, and not that the interrupts are disabled. No, I really meant that interrupts are disabled. It's possible that I was wrong... And by normal no-reentrancy you mean the normal guarantee that each IRQ handler won't be re-entered while it's running. I observe that we don't register PCI IRQ handlers with IRQF_DISABLED, so it's possible that some *other* IRQ happens while it's running; but most of the non-PCI irq handlers are registered with that flag set. That seems potentially buglike to me; it's legit for any IRQ handler to submit an URB. Which would then cause them to try grabbing the spinlock held by the HCD's IRQ handler, if that other IRQ handler happened to fire when the HCD's IRQ handler was running. So maybe we should always register with IRQF_DISABLED, unattractive though that could be in terms of latencies ... or, somehow try to define a rule whereby URBs can't be submitted in certain IRQ contexts. Or better still, always acquire the HCD's spinlock with spin_lock_irqsave(). That's what uhci-hcd does, even though ehci-hcd and ohci-hcd don't. Of course, if we don't use IRQF_DISABLED then we would have to verify that none of the callbacks rely on interrupts being disabled. Alan Stern - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
Re: [linux-usb-devel] [Bugme-new] [Bug 8510] New: OHCI constantly attempts suspending root hub on ALi motherboard
On Sun, 20 May 2007, Andrey Borzenkov wrote: On Sunday 20 May 2007, David Brownell wrote: On Saturday 19 May 2007, David Brownell wrote: On Saturday 19 May 2007, Andrew Morton wrote: On Sat, 19 May 2007 10:08:40 -0700 [EMAIL PROTECTED] wrote: http://bugzilla.kernel.org/show_bug.cgi?id=8510 A regression. From 2.6.16, yes... this has been around for a while, but nobody came up with a patch. I suggest someone with the hardware just provide an update to the drivers/usb/host/ohci-pci.c file using the PCI_DEVICE(PCI_VENDOR_ID_ITE, 0x8152), quirk table entry as a model. Grr, better yet: find out why the existing quirk entry for this particular laptop doesn't trigger. Because it is usig wrong subvendor. Runtime tested: Does this fix the regression described in your email 2.6.22-rc2: regression: STD fails with pci_device_suspend(): usb_hcd_pci_suspend+0x0/0x160 [usbcore]() returns -16 ? Alan Stern - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
Re: [linux-usb-devel] New USB stack on FreeBSD w/Linux emulation layer coming
On Saturday 19 May 2007, Alan Stern wrote: On Sat, 19 May 2007, David Brownell wrote: Absolutely right, I'm being an idiot here. I think I looked at root hub code in the rush to the FreedomHEC preparations. We do not have local_irq_save in the giveback routine. So, when Alan wrote USB callbacks cannot be interrupted, he meant normal no-reentrancy guarantees, and not that the interrupts are disabled. No, I really meant that interrupts are disabled. It's possible that I was wrong... And by normal no-reentrancy you mean the normal guarantee that each IRQ handler won't be re-entered while it's running. I observe that we don't register PCI IRQ handlers with IRQF_DISABLED, so it's possible that some *other* IRQ happens while it's running; but most of the non-PCI irq handlers are registered with that flag set. That seems potentially buglike to me; it's legit for any IRQ handler to submit an URB. Which would then cause them to try grabbing the spinlock held by the HCD's IRQ handler, if that other IRQ handler happened to fire when the HCD's IRQ handler was running. So maybe we should always register with IRQF_DISABLED, unattractive though that could be in terms of latencies ... or, somehow try to define a rule whereby URBs can't be submitted in certain IRQ contexts. Or better still, always acquire the HCD's spinlock with spin_lock_irqsave(). That's what uhci-hcd does, even though ehci-hcd and ohci-hcd don't. That's because they were written to assume IRQF_DISABLED was set. I don't know when that irq request mode was changed. Of course, if we don't use IRQF_DISABLED then we would have to verify that none of the callbacks rely on interrupts being disabled. AFAIK they've always been allowed to assume that. - Dave - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
Re: [linux-usb-devel] [Bugme-new] [Bug 8510] New: OHCI constantly attempts suspending root hub on ALi motherboard
On Sunday 20 May 2007, Alan Stern wrote: On Sun, 20 May 2007, Andrey Borzenkov wrote: On Sunday 20 May 2007, David Brownell wrote: On Saturday 19 May 2007, David Brownell wrote: On Saturday 19 May 2007, Andrew Morton wrote: On Sat, 19 May 2007 10:08:40 -0700 [EMAIL PROTECTED] wrote: http://bugzilla.kernel.org/show_bug.cgi?id=8510 A regression. From 2.6.16, yes... this has been around for a while, but nobody came up with a patch. I suggest someone with the hardware just provide an update to the drivers/usb/host/ohci-pci.c file using the PCI_DEVICE(PCI_VENDOR_ID_ITE, 0x8152), quirk table entry as a model. Grr, better yet: find out why the existing quirk entry for this particular laptop doesn't trigger. Because it is usig wrong subvendor. Runtime tested: Does this fix the regression described in your email 2.6.22-rc2: regression: STD fails with pci_device_suspend(): usb_hcd_pci_suspend+0x0/0x160 [usbcore]() returns -16 ? No. Unfortunately. Here is dmesg with patch and USB_DEBUG swsusp: Marking nosave pages: 0009f000 - 0010 swsusp: Basic memory bitmaps created Stopping tasks ... done. Shrinking memory... done (61536 pages freed) Freed 246144 kbytes in 1.99 seconds (123.69 MB/s) Suspending console(s) hub 1-0:1.0: hub_suspend ohci_hcd :00:02.0: suspend root hub usb usb1: usb suspend usb usb1: usb resume usb usb1: finish resume hub 1-0:1.0: hub_resume ohci_hcd :00:02.0: wakeup root hub sd 0:0:0:0: [sda] Synchronizing SCSI cache pnp: Device 00:09 disabled. Trying to free already-free IRQ 11 ACPI: PCI interrupt for device :00:06.0 disabled ACPI: Unable to derive IRQ for device :00:04.0 pci_device_suspend(): usb_hcd_pci_suspend+0x0/0x230 [usbcore]() returns -16 suspend_device(): pci_device_suspend+0x0/0x70() returns -16 Could not suspend device :00:02.0: error -16 PM: Writing back config space on device :00:04.0 at offset 1 (was 291, writing 295) ACPI: Unable to derive IRQ for device :00:04.0 ACPI: PCI Interrupt :00:04.0[A]: no GSI ACPI: PCI Interrupt :00:06.0[A] - Link [LNKH] - GSI 11 (level, low) - IRQ 11 ata1.00: ata_hpa_resize 1: sectors = 39070080, hpa_sectors = 39070080 ata1.00: ata_hpa_resize 1: sectors = 39070080, hpa_sectors = 39070080 ata1.00: configured for UDMA/33 sd 0:0:0:0: [sda] 39070080 512-byte hardware sectors (20004 MB) sd 0:0:0:0: [sda] Write Protect is off sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00 sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA PM: Writing back config space on device :00:0a.0 at offset f (was 38080100, writing 3808010b) PM: Writing back config space on device :00:0a.0 at offset 6 (was 0, writing f7d0) PM: Writing back config space on device :00:0a.0 at offset 5 (was 1, writing eb41) PM: Writing back config space on device :00:0a.0 at offset 4 (was 0, writing f7efd000) PM: Writing back config space on device :00:0a.0 at offset 3 (was 0, writing 4008) PM: Writing back config space on device :00:0a.0 at offset 1 (was 290, writing 297) ata2.00: configured for UDMA/33 pnp: Failed to activate device 00:05. pnp: Failed to activate device 00:06. pnp: Device 00:09 activated. sd 0:0:0:0: [sda] Starting disk eth1: PRI 31 variant 2 version 9.48 eth1: NIC 5 variant 2 version 1.02 Restarting tasks ... 7hub 1-0:1.0: state 7 ports 3 chg evt usb usb1: remote wakeup needed for autosuspend done. swsusp: Basic memory bitmaps freed input: Power Button (FF) as /class/input/input8 ACPI: Power Button (FF) [PWRF] input: Lid Switch as /class/input/input9 ACPI: Lid Switch [LID] eth1: PRI 31 variant 2 version 9.48 eth1: NIC 5 variant 2 version 1.02 eth1: PRI 31 variant 2 version 9.48 eth1: NIC 5 variant 2 version 1.02 eth1: PRI 31 variant 2 version 9.48 eth1: NIC 5 variant 2 version 1.02 - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ ___ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
[linux-usb-devel] SAĞLIĞINIZ SİZİN İÇİN ÖNEMLİYSE..
TAM KAPSAMLI CHECK-UP KAMPANYASI SAÐLIÐINIZ Description: Binary data - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/___ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel