Re: [PATCH 1/6] drivers:usb:host:xhci.h Removing xhci_hcd from argument
On Sat, 17 Aug 2013, Kumar Gaurav wrote: On Saturday 17 August 2013 12:30 AM, Greg KH wrote: On Sat, Aug 17, 2013 at 12:18:42AM +0530, Kumar Gaurav wrote: Removed struct xhci_hcd from xhci_readl fucntion as it's no more in use. --- drivers/usb/host/xhci.h |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.hthe index c338741..7cf0e41 100644 --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h @@ -1598,8 +1598,7 @@ static inline struct usb_hcd *xhci_to_hcd(struct xhci_hcd *xhci) /* TODO: copied from ehci.h - can be refactored? */ /* xHCI spec says all registers are little endian */ -static inline unsigned int xhci_readl(const struct xhci_hcd *xhci, - __le32 __iomem *regs) +static inline unsigned int xhci_readl(__le32 __iomem *regs) And you broke the build :( Sorry, that's not ok. greg k-h I'm writing patch to change function definition along with changes in program files where this function is called. After changing all files i built the module and it compiled as well. There were 6 files which were using xhci_read. I fixed all the calls and compiled. Am i missing anything? Please suggest then i'll send patches again I haven't followed along in detail, but I think Greg wants one patch that fixes both the definition and all of the calls, and not one patch for each file. julia -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: octeon-usb and dwc2 in staging are for the same hw
On 08/17/2013 01:18 AM, Aaro Koskinen wrote: Looking more into this (and after a failed testing attempt), I don't think we can simply delete octeon-usb if we want to keep supporting Octeon: there's also Octeon-specific registers of which the driver needs to take care of before/while using DWC2 HW block. So migration to DWC2 is not simply a driver change, we would still need some kind of octeon-hcd glue for for it. I guess we should start converting octeon-usb to reuse code from DWC2, but this won't happen overnight. If you look at musb / dwc3 they both have glue code around the USB IP core. Sebastian -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 1/3] of: add vendor prefix for Mentor Graphics
On 08/17/2013 12:52 AM, Stephen Warren wrote: On 08/15/2013 07:13 AM, Sebastian Andrzej Siewior wrote: This prefix is currently used for the musb driver. diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor-prefixes.txt +mg Mentor Graphics It's slightly short; I would have preferred mentor I think. but I guess it's fine. I see that both values are already used though: arch/arm/boot/dts/am33xx.dtsi:375: compatible = mg,musbmhdrc; arch/arm/boot/dts/am33xx.dtsi:430: compatible = mg,musbmhdrc; arch/arm/boot/dts/dbx5x0.dtsi:181: mentor,musb; Should both be documented? Should the bindings for those devices be unified on one vendor prefix, with the old one perhaps still documented as deprecated depending on how long it's been around? I wasn't aware of the dbx5x0 mentor,usb binding. As far as the am33xx is concerned, it has been prepared for the next merge window and can be changed. However the mentor,usb binding isn't documented either. It is added in addition to stericsson,db8500-musb. The way the musb core works is that you require a glue layer. That means the mentor,musb binding isn't used by a driver either. I modeled the binding after the current driver design where you have a platform device around the mentor device. So the am335x usb device gets probed and creates a platform device for the musb device. The binding as-it isn't used either, it is just there not have a node without a compatible property. Not I see that there is a dr_mode property which I could use instead the old ti,port-mode. Sebastian -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: [PATCH v2 0/8] Common Clock Framework support for Samsung S3C64xx
Tomasz Figa wrote: [...] Basically, this series looks good to me, but I'm not sure how this should be handled because of dependency with PWM cleanup and clk stuff in clk tree now... Patches 1-3 can go into the clk tree. 4-6 should go through their respective trees. It looks like version 2 of patch 2/8 has been applied by mistake, breaking compilation (and operation) of the clock driver added in patch 3/8. Ugh. My mistake. Happens. Thanks for fast response. Sorry for late ;-) Could you please fix this up? Thanks in advance. This is a little tricky since I published the clk-next-s3c64xx branch as a stable branch for Samsung which I think has been merged to the Samsung tree already. Right, this somewhat limits our options. Although I'm not really sure whether Kukjin already has pushed it to his public tree. Yeah, I already did sort out in my local but not public tree because of some problem. So what are the options? One option is to create a fixup patch that just manages the delta between V2 and V3. I can then add this to the top of clk-next-s3c64xx and re-merge it into clk-next. Then the Samsung tree will need to re-merge that dependency branch. Well, I can make a convert PLL65xx to new registration method patch, that would be basically the delta. If this could be merged before patch 7/8, no regression would be introduced. Do you have a better idea? Not really. Maybe let's ask Kukjin whether he has already merged it to his tree. Kukjin, have you? OK, if new branch is ready, I will replace with that or if re-merge is required, I will. Either way, I'm fine and can handle. Mike, let me know your choice :-) Thanks, Kukjin -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 5/6] for fixing xhci_readl call in xhci_hub.c after removing xhci_hcd from function definition
Wait what? Why did we break the build in the first place? regards, dan carpenter -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: I: Sierra.c USB Serial Driver FAQ/Feature Request
Hi, On Thu, Aug 15, 2013 at 03:31:40PM -0500, Dan Williams wrote: On Thu, 2013-08-15 at 10:47 -0500, Peter Hyman wrote: On 08/15/2013 09:47 AM, Dan Williams wrote: On Thu, 2013-08-15 at 11:02 +0200, Bjørn Mork wrote: Peter Hyman p...@peterhyman.com writes: On 08/14/2013 01:42 PM, Bjørn Mork wrote: snip... Great! And if you can snoop on Windows trying to figure out how to switch the modes, then that would also help. I believe Wireshark with usbpcap is the current state-of-the-art USB sniffer for Windows: http://desowin.org/usbpcap/ Bjørn Detailed files attached. Anyone mind sending those files over to me? Dan snip... Please download AC250U_lsusb_pcap.tar.bz2 from: https://app.box.com/s/6sln7t1na4pz6ij7ggpc The modem is speaking Sierra's proprietary CnS protocol. This is a proprietary protocol for which no public documentation has been released, and so we'd have to reverse-engineer the specific commands being used to switch the modem between 3G and 4G mode. This is actually not true. Sierra released a document titled CDMA 1xEV-DO CnS Reference under a Creative Commons license. It has since disappeared from the Internet, but private copies exist. ;) There are a large number of specifics not covered by this document, but it does cover the basics of speaking CnS. Actually, I recall you mentioning this document here: http://blogs.gnome.org/dcbw/2010/04/15/mobile-broadband-and-qualcomm-proprietary-protocols/ I can post the document somewhere if it would be helpful. It's only 279KB. Thanks, Forest -- Forest Bond http://www.alittletooquiet.net http://www.rapidrollout.com -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH V5 6/6] USB: OHCI: make ohci-s3c2410 a separate driver
Hi Manjunath, On Monday 12 of August 2013 12:17:00 Manjunath Goudar wrote: Separate the Samsung OHCI S3C24xx/S3C64xx host controller driver from ohci-hcd host code so that it can be built as a separate driver module.This work is part of enabling multi-platform kernels on ARM;it would be nice to have in 3.12. Signed-off-by: Manjunath Goudar manjunath.gou...@linaro.org Signed-off-by: Deepak Saxena dsax...@linaro.org Acked-by: Alan Stern st...@rowland.harvard.edu Cc: Arnd Bergmann a...@arndb.de Cc: Greg KH g...@kroah.com Cc: linux-usb@vger.kernel.org V2: -Set non-standard fields in ohci_s3c2410_hc_driver manually, rather than relying on an expanded struct ohci_driver_overrides. -Save orig_ohci_hub_control and orig_ohci_hub_status_data rather than relying on ohci_hub_control and hub_status_data being exported. V3: -Kconfig wrong parentheses discription fixed. -ohci_setup() has been removed because it is called in .reset member of the ohci_hc_driver structure. V4: - Removed extra space before the '='. - Moved /* forward definitions */ line before the declarations of functions. V5: - String s3c is replaced by s3c2410. --- drivers/usb/host/Kconfig|8 +++ drivers/usb/host/Makefile |1 + drivers/usb/host/ohci-hcd.c | 18 -- drivers/usb/host/ohci-s3c2410.c | 128 +-- 4 files changed, 66 insertions(+), 89 deletions(-) diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig index 693560a..ac7df55 100644 --- a/drivers/usb/host/Kconfig +++ b/drivers/usb/host/Kconfig @@ -390,6 +390,14 @@ config USB_OHCI_HCD_SPEAR Enables support for the on-chip OHCI controller on ST SPEAr chips. +config USB_OHCI_HCD_S3C2410 +tristate OHCI support for Samsung S3C24xx/S3C64xx SoC series +depends on USB_OHCI_HCD (ARCH_S3C24XX || ARCH_S3C64XX) +default y +---help--- + Enables support for the on-chip OHCI controller on + S3C24xx/S3C64xx chips. + config USB_OHCI_HCD_AT91 tristate Support for Atmel on-chip OHCI USB controller depends on USB_OHCI_HCD ARCH_AT91 diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile index a0ac663..cc5beaf 100644 --- a/drivers/usb/host/Makefile +++ b/drivers/usb/host/Makefile @@ -49,6 +49,7 @@ obj-$(CONFIG_USB_OHCI_HCD_OMAP1)+= ohci-omap.o obj-$(CONFIG_USB_OHCI_HCD_OMAP3) += ohci-omap3.o obj-$(CONFIG_USB_OHCI_HCD_SPEAR) += ohci-spear.o obj-$(CONFIG_USB_OHCI_HCD_AT91) += ohci-at91.o +obj-$(CONFIG_USB_OHCI_HCD_S3C2410) += ohci-s3c2410.o obj-$(CONFIG_USB_UHCI_HCD) += uhci-hcd.o obj-$(CONFIG_USB_FHCI_HCD) += fhci.o diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c index b48c892..b69a49e 100644 --- a/drivers/usb/host/ohci-hcd.c +++ b/drivers/usb/host/ohci-hcd.c @@ -1177,11 +1177,6 @@ MODULE_LICENSE (GPL); #define SA_DRIVERohci_hcd_sa_driver #endif -#if defined(CONFIG_ARCH_S3C24XX) || defined(CONFIG_ARCH_S3C64XX) -#include ohci-s3c2410.c -#define S3C2410_PLATFORM_DRIVER ohci_hcd_s3c2410_driver -#endif - #if defined(CONFIG_PXA27x) || defined(CONFIG_PXA3xx) #include ohci-pxa27x.c #define PLATFORM_DRIVER ohci_hcd_pxa27x_driver @@ -1293,12 +1288,6 @@ static int __init ohci_hcd_mod_init(void) goto error_tmio; #endif -#ifdef S3C2410_PLATFORM_DRIVER - retval = platform_driver_register(S3C2410_PLATFORM_DRIVER); - if (retval 0) - goto error_s3c2410; -#endif - #ifdef EP93XX_PLATFORM_DRIVER retval = platform_driver_register(EP93XX_PLATFORM_DRIVER); if (retval 0) @@ -1332,10 +1321,6 @@ static int __init ohci_hcd_mod_init(void) platform_driver_unregister(EP93XX_PLATFORM_DRIVER); error_ep93xx: #endif -#ifdef S3C2410_PLATFORM_DRIVER - platform_driver_unregister(S3C2410_PLATFORM_DRIVER); - error_s3c2410: -#endif #ifdef TMIO_OHCI_DRIVER platform_driver_unregister(TMIO_OHCI_DRIVER); error_tmio: @@ -1382,9 +1367,6 @@ static void __exit ohci_hcd_mod_exit(void) #ifdef EP93XX_PLATFORM_DRIVER platform_driver_unregister(EP93XX_PLATFORM_DRIVER); #endif -#ifdef S3C2410_PLATFORM_DRIVER - platform_driver_unregister(S3C2410_PLATFORM_DRIVER); -#endif #ifdef TMIO_OHCI_DRIVER platform_driver_unregister(TMIO_OHCI_DRIVER); #endif diff --git a/drivers/usb/host/ohci-s3c2410.c b/drivers/usb/host/ohci-s3c2410.c index e125770..61f9aea 100644 --- a/drivers/usb/host/ohci-s3c2410.c +++ b/drivers/usb/host/ohci-s3c2410.c @@ -19,19 +19,36 @@ * This file is licenced under the GPL. */ -#include linux/platform_device.h #include linux/clk.h +#include linux/io.h +#include linux/kernel.h +#include linux/module.h +#include linux/platform_device.h #include linux/platform_data/usb-ohci-s3c2410.h +#include linux/usb.h +#include linux/usb/hcd.h
Re: octeon-usb and dwc2 in staging are for the same hw
On Fri, Aug 16, 2013 at 08:02:27PM -0700, Greg KH wrote: dcw2 already supports different boards/systems, so perhaps there's a way to tie your board into that? It doesn't get very far: External DMA Mode not supported dwc2_hcd_init() FAILED, returning -22 A. -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[Bug] [Sony VAIO SVT15117CXS] USB 2.0 ports not working with any USB device
Issue similar to Ming Lei post of June 26th 2013 USB 2.0 ports appear to operate correctly in 2.6.33 and 2.6.39 but not after going to 3.1 See detailed log in below link: https://bugs.launchpad.net/bugs/1210858 Thank you -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 5/6] for fixing xhci_readl call in xhci_hub.c after removing xhci_hcd from function definition
On Fri, Aug 16, 2013 at 12:24:34PM -0700, Sarah Sharp wrote: In general, please keep the short descriptions of your patches (which turn into the subject lines of your mails) limited to around 55 characters. 55 is a very austere limit. I've been telling people 72 character the same as email. `git citool` has a fixed width of 75 characters so that's what I normally use in practice. regards, dan carpenter -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v1 02/49] USB: sg: prepare for enabling irq in complete()
Complete() will be run with interrupt enabled, so change to spin_lock_irqsave(). Cc: Alan Stern st...@rowland.harvard.edu Signed-off-by: Ming Lei ming@canonical.com --- drivers/usb/core/message.c |5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c index 82927e1..8bba734 100644 --- a/drivers/usb/core/message.c +++ b/drivers/usb/core/message.c @@ -266,8 +266,9 @@ static void sg_complete(struct urb *urb) { struct usb_sg_request *io = urb-context; int status = urb-status; + unsigned long flags; - spin_lock(io-lock); + spin_lock_irqsave(io-lock, flags); /* In 2.5 we require hcds' endpoint queues not to progress after fault * reports, until the completion callback (this!) returns. That lets @@ -326,7 +327,7 @@ static void sg_complete(struct urb *urb) if (!io-count) complete(io-complete); - spin_unlock(io-lock); + spin_unlock_irqrestore(io-lock, flags); } -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v1 00/49] USB: prepare for enabling irq in complete()
Hi, As we are going to run URB-complete() in tasklet context[1][2], and hard interrupt may be enabled when running URB completion handler[3], so we might need to disable interrupt when acquiring one lock in the completion handler for the below reasons: - URB-complete() holds a subsystem wide lock which may be acquired in another hard irq context, and the subsystem wide lock is acquired by spin_lock()/read_lock()/write_lock() in complete() - URB-complete() holds a private lock with spin_lock()/read_lock()/write_lock() but driver may export APIs to make other drivers acquire the same private lock in its interrupt handler. For the sake of safety and making the change simple, this patch set converts all spin_lock()/read_lock()/write_lock() in completion handler path into their irqsave version mechanically. But if you are sure the above two cases do not happen in your driver, please let me know and I can drop the unnecessary change. Also if you find some conversions are missed, also please let me know so that I can add it in the next round. [1], USB: URB documentation: claim complete() will be run with IRQs enabled https://git.kernel.org/cgit/linux/kernel/git/gregkh/usb.git/commit/?h=usb-nextid=85721d45261c4be684730c7509a59daa6cda30d8 [2], USB: HCD: support giveback of URB in tasklet context https://git.kernel.org/cgit/linux/kernel/git/gregkh/usb.git/commit/?h=usb-nextid=94dfd7edfd5c9b605caf7b562de7a813d216e011 [3], http://marc.info/?l=linux-usbm=137286330626363w=2 V1: - rename patchset title - add missed changes on 'usb_skeleon and usb sg lib' - remove several sound usb drivers which have been done via sound tree - some patch style fix - replace snd_pcm_stream_lock with snd_pcm_stream_lock_irqsave for related a/v drivers Cc: linux-in...@vger.kernel.org Cc: linux-blueto...@vger.kernel.org Cc: net...@vger.kernel.org Cc: linux-wirel...@vger.kernel.org Cc: linux-me...@vger.kernel.org Cc: alsa-de...@alsa-project.org drivers/bluetooth/bfusb.c | 12 drivers/bluetooth/btusb.c |5 ++-- drivers/hid/usbhid/hid-core.c |5 ++-- drivers/input/misc/cm109.c| 10 --- drivers/isdn/hardware/mISDN/hfcsusb.c | 36 --- drivers/media/dvb-core/dvb_demux.c| 17 +++ drivers/media/usb/cx231xx/cx231xx-audio.c | 10 --- drivers/media/usb/cx231xx/cx231xx-core.c | 10 --- drivers/media/usb/cx231xx/cx231xx-vbi.c |5 ++-- drivers/media/usb/em28xx/em28xx-audio.c |5 ++-- drivers/media/usb/em28xx/em28xx-core.c|5 ++-- drivers/media/usb/sn9c102/sn9c102_core.c |7 +++-- drivers/media/usb/tlg2300/pd-alsa.c |5 ++-- drivers/media/usb/tlg2300/pd-video.c |5 ++-- drivers/media/usb/tm6000/tm6000-video.c |5 ++-- drivers/net/usb/cdc-phonet.c |5 ++-- drivers/net/usb/hso.c | 38 ++--- drivers/net/usb/kaweth.c |7 +++-- drivers/net/usb/rtl8150.c |5 ++-- drivers/net/wireless/ath/ath9k/hif_usb.c | 29 ++- drivers/net/wireless/ath/ath9k/htc_drv_txrx.c |9 +++--- drivers/net/wireless/ath/ath9k/wmi.c | 11 +++ drivers/net/wireless/ath/carl9170/rx.c|5 ++-- drivers/net/wireless/libertas/if_usb.c|5 ++-- drivers/net/wireless/libertas_tf/if_usb.c |6 ++-- drivers/net/wireless/zd1211rw/zd_usb.c| 21 -- drivers/staging/bcm/InterfaceRx.c |5 ++-- drivers/staging/btmtk_usb/btmtk_usb.c |5 ++-- drivers/staging/ced1401/usb1401.c | 35 --- drivers/staging/vt6656/usbpipe.c |9 +++--- drivers/usb/class/cdc-wdm.c | 16 +++ drivers/usb/class/usblp.c | 10 --- drivers/usb/core/devio.c |5 ++-- drivers/usb/core/message.c|5 ++-- drivers/usb/misc/adutux.c | 10 --- drivers/usb/misc/iowarrior.c |5 ++-- drivers/usb/misc/ldusb.c |7 +++-- drivers/usb/misc/legousbtower.c |6 ++-- drivers/usb/misc/usbtest.c| 10 --- drivers/usb/misc/uss720.c |7 - drivers/usb/serial/cyberjack.c| 15 ++ drivers/usb/serial/digi_acceleport.c | 23 --- drivers/usb/serial/io_edgeport.c | 14 + drivers/usb/serial/io_ti.c|5 ++-- drivers/usb/serial/mos7720.c |5 ++-- drivers/usb/serial/mos7840.c |5 ++-- drivers/usb/serial/quatech2.c |5 ++-- drivers/usb/serial/sierra.c |9 +++---
[PATCH v1 04/49] USB: cdc-wdm: prepare for enabling irq in complete()
Complete() will be run with interrupt enabled, so change to spin_lock_irqsave(). Cc: Oliver Neukum oli...@neukum.org Signed-off-by: Ming Lei ming@canonical.com --- drivers/usb/class/cdc-wdm.c | 16 ++-- 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/drivers/usb/class/cdc-wdm.c b/drivers/usb/class/cdc-wdm.c index d3318a0..a54bbb2 100644 --- a/drivers/usb/class/cdc-wdm.c +++ b/drivers/usb/class/cdc-wdm.c @@ -143,10 +143,12 @@ found: static void wdm_out_callback(struct urb *urb) { struct wdm_device *desc; + unsigned long flags; + desc = urb-context; - spin_lock(desc-iuspin); + spin_lock_irqsave(desc-iuspin, flags); desc-werr = urb-status; - spin_unlock(desc-iuspin); + spin_unlock_irqrestore(desc-iuspin, flags); kfree(desc-outbuf); desc-outbuf = NULL; clear_bit(WDM_IN_USE, desc-flags); @@ -158,8 +160,9 @@ static void wdm_in_callback(struct urb *urb) struct wdm_device *desc = urb-context; int status = urb-status; int length = urb-actual_length; + unsigned long flags; - spin_lock(desc-iuspin); + spin_lock_irqsave(desc-iuspin, flags); clear_bit(WDM_RESPONDING, desc-flags); if (status) { @@ -203,7 +206,7 @@ skip_error: wake_up(desc-wait); set_bit(WDM_READ, desc-flags); - spin_unlock(desc-iuspin); + spin_unlock_irqrestore(desc-iuspin, flags); } static void wdm_int_callback(struct urb *urb) @@ -213,6 +216,7 @@ static void wdm_int_callback(struct urb *urb) int status = urb-status; struct wdm_device *desc; struct usb_cdc_notification *dr; + unsigned long flags; desc = urb-context; dr = (struct usb_cdc_notification *)desc-sbuf; @@ -261,7 +265,7 @@ static void wdm_int_callback(struct urb *urb) goto exit; } - spin_lock(desc-iuspin); + spin_lock_irqsave(desc-iuspin, flags); clear_bit(WDM_READ, desc-flags); responding = test_and_set_bit(WDM_RESPONDING, desc-flags); if (!responding !test_bit(WDM_DISCONNECTING, desc-flags) @@ -270,7 +274,7 @@ static void wdm_int_callback(struct urb *urb) dev_dbg(desc-intf-dev, %s: usb_submit_urb %d, __func__, rv); } - spin_unlock(desc-iuspin); + spin_unlock_irqrestore(desc-iuspin, flags); if (rv 0) { clear_bit(WDM_RESPONDING, desc-flags); if (rv == -EPERM) -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v1 01/49] USB: skeleton: prepare for enabling irq in complete()
Complete() will be run with interrupt enabled, so change to spin_lock_irqsave(). Signed-off-by: Ming Lei ming@canonical.com --- drivers/usb/usb-skeleton.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/usb/usb-skeleton.c b/drivers/usb/usb-skeleton.c index ff97652..1743006 100644 --- a/drivers/usb/usb-skeleton.c +++ b/drivers/usb/usb-skeleton.c @@ -164,10 +164,11 @@ static int skel_flush(struct file *file, fl_owner_t id) static void skel_read_bulk_callback(struct urb *urb) { struct usb_skel *dev; + unsigned long flags; dev = urb-context; - spin_lock(dev-err_lock); + spin_lock_irqsave(dev-err_lock, flags); /* sync/async unlink faults aren't errors */ if (urb-status) { if (!(urb-status == -ENOENT || @@ -182,7 +183,7 @@ static void skel_read_bulk_callback(struct urb *urb) dev-bulk_in_filled = urb-actual_length; } dev-ongoing_read = 0; - spin_unlock(dev-err_lock); + spin_unlock_irqrestore(dev-err_lock, flags); wake_up_interruptible(dev-bulk_in_wait); } @@ -341,6 +342,8 @@ static void skel_write_bulk_callback(struct urb *urb) /* sync/async unlink faults aren't errors */ if (urb-status) { + unsigned long flags; + if (!(urb-status == -ENOENT || urb-status == -ECONNRESET || urb-status == -ESHUTDOWN)) @@ -348,9 +351,9 @@ static void skel_write_bulk_callback(struct urb *urb) %s - nonzero write bulk status received: %d\n, __func__, urb-status); - spin_lock(dev-err_lock); + spin_lock_irqsave(dev-err_lock, flags); dev-errors = urb-status; - spin_unlock(dev-err_lock); + spin_unlock_irqrestore(dev-err_lock, flags); } /* free up our allocated buffer */ -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v1 03/49] USB: devio: prepare for enabling irq in complete()
Complete() will be run with interrupt enabled, so change to spin_lock_irqsave(). Cc: Alan Stern st...@rowland.harvard.edu Signed-off-by: Ming Lei ming@canonical.com --- drivers/usb/core/devio.c |5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c index 737e3c1..826289c 100644 --- a/drivers/usb/core/devio.c +++ b/drivers/usb/core/devio.c @@ -495,8 +495,9 @@ static void async_completed(struct urb *urb) u32 secid = 0; const struct cred *cred = NULL; int signr; + unsigned long flags; - spin_lock(ps-lock); + spin_lock_irqsave(ps-lock, flags); list_move_tail(as-asynclist, ps-async_completed); as-status = urb-status; signr = as-signr; @@ -518,7 +519,7 @@ static void async_completed(struct urb *urb) if (as-status 0 as-bulk_addr as-status != -ECONNRESET as-status != -ENOENT) cancel_bulk_urbs(ps, as-bulk_addr); - spin_unlock(ps-lock); + spin_unlock_irqrestore(ps-lock, flags); if (signr) { kill_pid_info_as_cred(sinfo.si_signo, sinfo, pid, cred, secid); -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v1 07/49] USB: misc: uss720: prepare for enabling irq in complete()
Complete() will be run with interrupt enabled, so prepare for the comming change. Signed-off-by: Ming Lei ming@canonical.com --- drivers/usb/misc/uss720.c |7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/usb/misc/uss720.c b/drivers/usb/misc/uss720.c index 40ef40a..b2e76fa 100644 --- a/drivers/usb/misc/uss720.c +++ b/drivers/usb/misc/uss720.c @@ -132,8 +132,13 @@ static void async_complete(struct urb *urb) (unsigned int)priv-reg[6]); #endif /* if nAck interrupts are enabled and we have an interrupt, call the interrupt procedure */ - if (rq-reg[2] rq-reg[1] 0x10 pp) + if (rq-reg[2] rq-reg[1] 0x10 pp) { + unsigned long flags; + + local_irq_save(flags); parport_generic_irq(pp); + local_irq_restore(flags); + } } complete(rq-compl); kref_put(rq-ref_count, destroy_async); -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v1 05/49] USB: usblp: prepare for enabling irq in complete()
Complete() will be run with interrupt enabled, so change to spin_lock_irqsave(). Signed-off-by: Pete Zaitcev zait...@kotori.zaitcev.us Signed-off-by: Ming Lei ming@canonical.com --- drivers/usb/class/usblp.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/usb/class/usblp.c b/drivers/usb/class/usblp.c index d4c47d5..04163d8 100644 --- a/drivers/usb/class/usblp.c +++ b/drivers/usb/class/usblp.c @@ -297,6 +297,7 @@ static void usblp_bulk_read(struct urb *urb) { struct usblp *usblp = urb-context; int status = urb-status; + unsigned long flags; if (usblp-present usblp-used) { if (status) @@ -304,14 +305,14 @@ static void usblp_bulk_read(struct urb *urb) nonzero read bulk status received: %d\n, usblp-minor, status); } - spin_lock(usblp-lock); + spin_lock_irqsave(usblp-lock, flags); if (status 0) usblp-rstatus = status; else usblp-rstatus = urb-actual_length; usblp-rcomplete = 1; wake_up(usblp-rwait); - spin_unlock(usblp-lock); + spin_unlock_irqrestore(usblp-lock, flags); usb_free_urb(urb); } @@ -320,6 +321,7 @@ static void usblp_bulk_write(struct urb *urb) { struct usblp *usblp = urb-context; int status = urb-status; + unsigned long flags; if (usblp-present usblp-used) { if (status) @@ -327,7 +329,7 @@ static void usblp_bulk_write(struct urb *urb) nonzero write bulk status received: %d\n, usblp-minor, status); } - spin_lock(usblp-lock); + spin_lock_irqsave(usblp-lock, flags); if (status 0) usblp-wstatus = status; else @@ -335,7 +337,7 @@ static void usblp_bulk_write(struct urb *urb) usblp-no_paper = 0; usblp-wcomplete = 1; wake_up(usblp-wwait); - spin_unlock(usblp-lock); + spin_unlock_irqrestore(usblp-lock, flags); usb_free_urb(urb); } -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v1 06/49] USB: adutux: prepare for enabling irq in complete()
Complete() will be run with interrupt enabled, so change to spin_lock_irqsave(). Cc: Lisa Nguyen l...@xenapiadmin.com Signed-off-by: Ming Lei ming@canonical.com --- drivers/usb/misc/adutux.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/usb/misc/adutux.c b/drivers/usb/misc/adutux.c index 3eaa83f..a30efb8 100644 --- a/drivers/usb/misc/adutux.c +++ b/drivers/usb/misc/adutux.c @@ -159,11 +159,12 @@ static void adu_interrupt_in_callback(struct urb *urb) { struct adu_device *dev = urb-context; int status = urb-status; + unsigned long flags; adu_debug_data(dev-udev-dev, __func__, urb-actual_length, urb-transfer_buffer); - spin_lock(dev-buflock); + spin_lock_irqsave(dev-buflock, flags); if (status != 0) { if ((status != -ENOENT) (status != -ECONNRESET) @@ -194,7 +195,7 @@ static void adu_interrupt_in_callback(struct urb *urb) exit: dev-read_urb_finished = 1; - spin_unlock(dev-buflock); + spin_unlock_irqrestore(dev-buflock, flags); /* always wake up so we recover from errors */ wake_up_interruptible(dev-read_wait); } @@ -203,6 +204,7 @@ static void adu_interrupt_out_callback(struct urb *urb) { struct adu_device *dev = urb-context; int status = urb-status; + unsigned long flags; adu_debug_data(dev-udev-dev, __func__, urb-actual_length, urb-transfer_buffer); @@ -217,10 +219,10 @@ static void adu_interrupt_out_callback(struct urb *urb) return; } - spin_lock(dev-buflock); + spin_lock_irqsave(dev-buflock, flags); dev-out_urb_finished = 1; wake_up(dev-write_wait); - spin_unlock(dev-buflock); + spin_unlock_irqrestore(dev-buflock, flags); } static int adu_open(struct inode *inode, struct file *file) -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v1 08/49] USB: iowarrior: prepare for enabling irq in complete()
Complete() will be run with interrupt enabled, so change to spin_lock_irqsave(). Signed-off-by: Ming Lei ming@canonical.com --- drivers/usb/misc/iowarrior.c |5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/usb/misc/iowarrior.c b/drivers/usb/misc/iowarrior.c index d36f34e..010ed6d 100644 --- a/drivers/usb/misc/iowarrior.c +++ b/drivers/usb/misc/iowarrior.c @@ -162,6 +162,7 @@ static void iowarrior_callback(struct urb *urb) int offset; int status = urb-status; int retval; + unsigned long flags; switch (status) { case 0: @@ -175,7 +176,7 @@ static void iowarrior_callback(struct urb *urb) goto exit; } - spin_lock(dev-intr_idx_lock); + spin_lock_irqsave(dev-intr_idx_lock, flags); intr_idx = atomic_read(dev-intr_idx); /* aux_idx become previous intr_idx */ aux_idx = (intr_idx == 0) ? (MAX_INTERRUPT_BUFFER - 1) : (intr_idx - 1); @@ -211,7 +212,7 @@ static void iowarrior_callback(struct urb *urb) *(dev-read_queue + offset + (dev-report_size)) = dev-serial_number++; atomic_set(dev-intr_idx, aux_idx); - spin_unlock(dev-intr_idx_lock); + spin_unlock_irqrestore(dev-intr_idx_lock, flags); /* tell the blocking read about the new data */ wake_up_interruptible(dev-read_wait); -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v1 14/49] USB: serial: io_edgeport: prepare for enabling irq in complete()
Complete() will be run with interrupt enabled, so change to spin_lock_irqsave(). Cc: Johan Hovold jhov...@gmail.com Signed-off-by: Ming Lei ming@canonical.com --- drivers/usb/serial/io_edgeport.c | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/usb/serial/io_edgeport.c b/drivers/usb/serial/io_edgeport.c index c91481d..b9eeec6 100644 --- a/drivers/usb/serial/io_edgeport.c +++ b/drivers/usb/serial/io_edgeport.c @@ -567,6 +567,7 @@ static void edge_interrupt_callback(struct urb *urb) int portNumber; int result; int status = urb-status; + unsigned long flags; switch (status) { case 0: @@ -592,7 +593,7 @@ static void edge_interrupt_callback(struct urb *urb) if (length 1) { bytes_avail = data[0] | (data[1] 8); if (bytes_avail) { - spin_lock(edge_serial-es_lock); + spin_lock_irqsave(edge_serial-es_lock, flags); edge_serial-rxBytesAvail += bytes_avail; dev_dbg(dev, %s - bytes_avail=%d, rxBytesAvail=%d, read_in_progress=%d\n, @@ -615,7 +616,7 @@ static void edge_interrupt_callback(struct urb *urb) edge_serial-read_in_progress = false; } } - spin_unlock(edge_serial-es_lock); + spin_unlock_irqrestore(edge_serial-es_lock, flags); } } /* grab the txcredits for the ports if available */ @@ -628,9 +629,9 @@ static void edge_interrupt_callback(struct urb *urb) port = edge_serial-serial-port[portNumber]; edge_port = usb_get_serial_port_data(port); if (edge_port-open) { - spin_lock(edge_port-ep_lock); + spin_lock_irqsave(edge_port-ep_lock, flags); edge_port-txCredits += txCredits; - spin_unlock(edge_port-ep_lock); + spin_unlock_irqrestore(edge_port-ep_lock, flags); dev_dbg(dev, %s - txcredits for port%d = %d\n, __func__, portNumber, edge_port-txCredits); @@ -671,6 +672,7 @@ static void edge_bulk_in_callback(struct urb *urb) int retval; __u16 raw_data_length; int status = urb-status; + unsigned long flags; if (status) { dev_dbg(urb-dev-dev, %s - nonzero read bulk status received: %d\n, @@ -690,7 +692,7 @@ static void edge_bulk_in_callback(struct urb *urb) usb_serial_debug_data(dev, __func__, raw_data_length, data); - spin_lock(edge_serial-es_lock); + spin_lock_irqsave(edge_serial-es_lock, flags); /* decrement our rxBytes available by the number that we just got */ edge_serial-rxBytesAvail -= raw_data_length; @@ -714,7 +716,7 @@ static void edge_bulk_in_callback(struct urb *urb) edge_serial-read_in_progress = false; } - spin_unlock(edge_serial-es_lock); + spin_unlock_irqrestore(edge_serial-es_lock, flags); } -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v1 16/49] USB: serial: mos7720: prepare for enabling irq in complete()
Complete() will be run with interrupt enabled, so change to spin_lock_irqsave(). Cc: Johan Hovold jhov...@gmail.com Signed-off-by: Ming Lei ming@canonical.com --- drivers/usb/serial/mos7720.c |5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/usb/serial/mos7720.c b/drivers/usb/serial/mos7720.c index b013001..44b5e62 100644 --- a/drivers/usb/serial/mos7720.c +++ b/drivers/usb/serial/mos7720.c @@ -340,14 +340,15 @@ static void async_complete(struct urb *urb) { struct urbtracker *urbtrack = urb-context; int status = urb-status; + unsigned long flags; if (unlikely(status)) dev_dbg(urb-dev-dev, %s - nonzero urb status received: %d\n, __func__, status); /* remove the urbtracker from the active_urbs list */ - spin_lock(urbtrack-mos_parport-listlock); + spin_lock_irqsave(urbtrack-mos_parport-listlock, flags); list_del(urbtrack-urblist_entry); - spin_unlock(urbtrack-mos_parport-listlock); + spin_unlock_irqrestore(urbtrack-mos_parport-listlock, flags); kref_put(urbtrack-ref_count, destroy_urbtracker); } -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v1 15/49] USB: serial: io_ti: prepare for enabling irq in complete()
Complete() will be run with interrupt enabled, so change to spin_lock_irqsave(). Cc: Johan Hovold jhov...@gmail.com Signed-off-by: Ming Lei ming@canonical.com --- drivers/usb/serial/io_ti.c |5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/usb/serial/io_ti.c b/drivers/usb/serial/io_ti.c index 9c18f59..a481414 100644 --- a/drivers/usb/serial/io_ti.c +++ b/drivers/usb/serial/io_ti.c @@ -1612,6 +1612,7 @@ static void edge_bulk_in_callback(struct urb *urb) int retval = 0; int port_number; int status = urb-status; + unsigned long flags; switch (status) { case 0: @@ -1660,13 +1661,13 @@ static void edge_bulk_in_callback(struct urb *urb) exit: /* continue read unless stopped */ - spin_lock(edge_port-ep_lock); + spin_lock_irqsave(edge_port-ep_lock, flags); if (edge_port-ep_read_urb_state == EDGE_READ_URB_RUNNING) retval = usb_submit_urb(urb, GFP_ATOMIC); else if (edge_port-ep_read_urb_state == EDGE_READ_URB_STOPPING) edge_port-ep_read_urb_state = EDGE_READ_URB_STOPPED; - spin_unlock(edge_port-ep_lock); + spin_unlock_irqrestore(edge_port-ep_lock, flags); if (retval) dev_err(dev, %s - usb_submit_urb failed with result %d\n, __func__, retval); } -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v1 17/49] USB: serial: mos77840: prepare for enabling irq in complete()
Complete() will be run with interrupt enabled, so change to spin_lock_irqsave(). Cc: Johan Hovold jhov...@gmail.com Signed-off-by: Ming Lei ming@canonical.com --- drivers/usb/serial/mos7840.c |5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/usb/serial/mos7840.c b/drivers/usb/serial/mos7840.c index fdf9535..762dad4 100644 --- a/drivers/usb/serial/mos7840.c +++ b/drivers/usb/serial/mos7840.c @@ -807,17 +807,18 @@ static void mos7840_bulk_out_data_callback(struct urb *urb) struct usb_serial_port *port; int status = urb-status; int i; + unsigned long flags; mos7840_port = urb-context; port = mos7840_port-port; - spin_lock(mos7840_port-pool_lock); + spin_lock_irqsave(mos7840_port-pool_lock, flags); for (i = 0; i NUM_URBS; i++) { if (urb == mos7840_port-write_urb_pool[i]) { mos7840_port-busy[i] = 0; break; } } - spin_unlock(mos7840_port-pool_lock); + spin_unlock_irqrestore(mos7840_port-pool_lock, flags); if (status) { dev_dbg(port-dev, nonzero write bulk status received:%d\n, status); -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v1 12/49] USB: serial: cyberjack: prepare for enabling irq in complete()
Complete() will be run with interrupt enabled, so change to spin_lock_irqsave(). Cc: Matthias Bruestle and Harald Welte supp...@reiner-sct.com Signed-off-by: Ming Lei ming@canonical.com --- drivers/usb/serial/cyberjack.c | 15 +-- 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/drivers/usb/serial/cyberjack.c b/drivers/usb/serial/cyberjack.c index 7814262..0ab0957 100644 --- a/drivers/usb/serial/cyberjack.c +++ b/drivers/usb/serial/cyberjack.c @@ -271,11 +271,12 @@ static void cyberjack_read_int_callback(struct urb *urb) /* React only to interrupts signaling a bulk_in transfer */ if (urb-actual_length == 4 data[0] == 0x01) { short old_rdtodo; + unsigned long flags; /* This is a announcement of coming bulk_ins. */ unsigned short size = ((unsigned short)data[3]8)+data[2]+3; - spin_lock(priv-lock); + spin_lock_irqsave(priv-lock, flags); old_rdtodo = priv-rdtodo; @@ -290,7 +291,7 @@ static void cyberjack_read_int_callback(struct urb *urb) dev_dbg(dev, %s - rdtodo: %d\n, __func__, priv-rdtodo); - spin_unlock(priv-lock); + spin_unlock_irqrestore(priv-lock, flags); if (!old_rdtodo) { result = usb_submit_urb(port-read_urb, GFP_ATOMIC); @@ -317,6 +318,7 @@ static void cyberjack_read_bulk_callback(struct urb *urb) short todo; int result; int status = urb-status; + unsigned long flags; usb_serial_debug_data(dev, __func__, urb-actual_length, data); if (status) { @@ -330,7 +332,7 @@ static void cyberjack_read_bulk_callback(struct urb *urb) tty_flip_buffer_push(port-port); } - spin_lock(priv-lock); + spin_lock_irqsave(priv-lock, flags); /* Reduce urbs to do by one. */ priv-rdtodo -= urb-actual_length; @@ -339,7 +341,7 @@ static void cyberjack_read_bulk_callback(struct urb *urb) priv-rdtodo = 0; todo = priv-rdtodo; - spin_unlock(priv-lock); + spin_unlock_irqrestore(priv-lock, flags); dev_dbg(dev, %s - rdtodo: %d\n, __func__, todo); @@ -359,6 +361,7 @@ static void cyberjack_write_bulk_callback(struct urb *urb) struct cyberjack_private *priv = usb_get_serial_port_data(port); struct device *dev = port-dev; int status = urb-status; + unsigned long flags; set_bit(0, port-write_urbs_free); if (status) { @@ -367,7 +370,7 @@ static void cyberjack_write_bulk_callback(struct urb *urb) return; } - spin_lock(priv-lock); + spin_lock_irqsave(priv-lock, flags); /* only do something if we have more data to send */ if (priv-wrfilled) { @@ -411,7 +414,7 @@ static void cyberjack_write_bulk_callback(struct urb *urb) } exit: - spin_unlock(priv-lock); + spin_unlock_irqrestore(priv-lock, flags); usb_serial_port_softint(port); } -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v1 10/49] USB: legousbtower: prepare for enabling irq in complete()
Complete() will be run with interrupt enabled, so change to spin_lock_irqsave(). Cc: Juergen Stuber starb...@users.sourceforge.net Signed-off-by: Ming Lei ming@canonical.com --- drivers/usb/misc/legousbtower.c |6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/usb/misc/legousbtower.c b/drivers/usb/misc/legousbtower.c index eb37c95..d1bc420 100644 --- a/drivers/usb/misc/legousbtower.c +++ b/drivers/usb/misc/legousbtower.c @@ -739,7 +739,9 @@ static void tower_interrupt_in_callback (struct urb *urb) } if (urb-actual_length 0) { - spin_lock (dev-read_buffer_lock); + unsigned long flags; + + spin_lock_irqsave(dev-read_buffer_lock, flags); if (dev-read_buffer_length + urb-actual_length read_buffer_size) { memcpy (dev-read_buffer + dev-read_buffer_length, dev-interrupt_in_buffer, @@ -752,7 +754,7 @@ static void tower_interrupt_in_callback (struct urb *urb) pr_warn(read_buffer overflow, %d bytes dropped\n, urb-actual_length); } - spin_unlock (dev-read_buffer_lock); + spin_unlock_irqrestore(dev-read_buffer_lock, flags); } resubmit: -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v1 09/49] USB: ldusb: prepare for enabling irq in complete()
Complete() will be run with interrupt enabled, so change to spin_lock_irqsave(). Signed-off-by: Ming Lei ming@canonical.com --- drivers/usb/misc/ldusb.c |7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/usb/misc/ldusb.c b/drivers/usb/misc/ldusb.c index b1d5953..76ab55a 100644 --- a/drivers/usb/misc/ldusb.c +++ b/drivers/usb/misc/ldusb.c @@ -236,6 +236,7 @@ static void ld_usb_interrupt_in_callback(struct urb *urb) unsigned int next_ring_head; int status = urb-status; int retval; + unsigned long flags; if (status) { if (status == -ENOENT || @@ -246,12 +247,12 @@ static void ld_usb_interrupt_in_callback(struct urb *urb) dev_dbg(dev-intf-dev, %s: nonzero status received: %d\n, __func__, status); - spin_lock(dev-rbsl); + spin_lock_irqsave(dev-rbsl, flags); goto resubmit; /* maybe we can recover */ } } - spin_lock(dev-rbsl); + spin_lock_irqsave(dev-rbsl, flags); if (urb-actual_length 0) { next_ring_head = (dev-ring_head+1) % ring_buffer_size; if (next_ring_head != dev-ring_tail) { @@ -280,7 +281,7 @@ resubmit: dev-buffer_overflow = 1; } } - spin_unlock(dev-rbsl); + spin_unlock_irqrestore(dev-rbsl, flags); exit: dev-interrupt_in_done = 1; wake_up_interruptible(dev-read_wait); -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v1 13/49] USB: serial: digi_acceleportldusb: prepare for enabling irq in complete()
Complete() will be run with interrupt enabled, so change to spin_lock_irqsave(). Cc: Peter Berger pber...@brimson.com Cc: Al Borchers alborch...@steinerpoint.com Signed-off-by: Ming Lei ming@canonical.com --- drivers/usb/serial/digi_acceleport.c | 23 +-- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/drivers/usb/serial/digi_acceleport.c b/drivers/usb/serial/digi_acceleport.c index 19b467f..95b1959 100644 --- a/drivers/usb/serial/digi_acceleport.c +++ b/drivers/usb/serial/digi_acceleport.c @@ -988,6 +988,7 @@ static void digi_write_bulk_callback(struct urb *urb) struct digi_serial *serial_priv; int ret = 0; int status = urb-status; + unsigned long flags; /* port and serial sanity check */ if (port == NULL || (priv = usb_get_serial_port_data(port)) == NULL) { @@ -1006,15 +1007,15 @@ static void digi_write_bulk_callback(struct urb *urb) /* handle oob callback */ if (priv-dp_port_num == serial_priv-ds_oob_port_num) { dev_dbg(port-dev, digi_write_bulk_callback: oob callback\n); - spin_lock(priv-dp_port_lock); + spin_lock_irqsave(priv-dp_port_lock, flags); priv-dp_write_urb_in_use = 0; wake_up_interruptible(port-write_wait); - spin_unlock(priv-dp_port_lock); + spin_unlock_irqrestore(priv-dp_port_lock, flags); return; } /* try to send any buffered data on this port */ - spin_lock(priv-dp_port_lock); + spin_lock_irqsave(priv-dp_port_lock, flags); priv-dp_write_urb_in_use = 0; if (priv-dp_out_buf_len 0) { *((unsigned char *)(port-write_urb-transfer_buffer)) @@ -1037,7 +1038,7 @@ static void digi_write_bulk_callback(struct urb *urb) /* lost the race in write_chan(). */ schedule_work(priv-dp_wakeup_work); - spin_unlock(priv-dp_port_lock); + spin_unlock_irqrestore(priv-dp_port_lock, flags); if (ret ret != -EPERM) dev_err_console(port, %s: usb_submit_urb failed, ret=%d, port=%d\n, @@ -1388,6 +1389,7 @@ static int digi_read_inb_callback(struct urb *urb) unsigned char *data = ((unsigned char *)urb-transfer_buffer) + 3; int flag, throttled; int status = urb-status; + unsigned long flags; /* do not process callbacks on closed ports */ /* but do continue the read chain */ @@ -1404,7 +1406,7 @@ static int digi_read_inb_callback(struct urb *urb) return -1; } - spin_lock(priv-dp_port_lock); + spin_lock_irqsave(priv-dp_port_lock, flags); /* check for throttle; if set, do not resubmit read urb */ /* indicate the read chain needs to be restarted on unthrottle */ @@ -1438,7 +1440,7 @@ static int digi_read_inb_callback(struct urb *urb) tty_flip_buffer_push(port-port); } } - spin_unlock(priv-dp_port_lock); + spin_unlock_irqrestore(priv-dp_port_lock, flags); if (opcode == DIGI_CMD_RECEIVE_DISABLE) dev_dbg(port-dev, %s: got RECEIVE_DISABLE\n, __func__); @@ -1469,6 +1471,7 @@ static int digi_read_oob_callback(struct urb *urb) int opcode, line, status, val; int i; unsigned int rts; + unsigned long flags; /* handle each oob command */ for (i = 0; i urb-actual_length - 3;) { @@ -1496,7 +1499,7 @@ static int digi_read_oob_callback(struct urb *urb) rts = tty-termios.c_cflag CRTSCTS; if (tty opcode == DIGI_CMD_READ_INPUT_SIGNALS) { - spin_lock(priv-dp_port_lock); + spin_lock_irqsave(priv-dp_port_lock, flags); /* convert from digi flags to termiox flags */ if (val DIGI_READ_INPUT_SIGNALS_CTS) { priv-dp_modem_signals |= TIOCM_CTS; @@ -1524,12 +1527,12 @@ static int digi_read_oob_callback(struct urb *urb) else priv-dp_modem_signals = ~TIOCM_CD; - spin_unlock(priv-dp_port_lock); + spin_unlock_irqrestore(priv-dp_port_lock, flags); } else if (opcode == DIGI_CMD_TRANSMIT_IDLE) { - spin_lock(priv-dp_port_lock); + spin_lock_irqsave(priv-dp_port_lock, flags); priv-dp_transmit_idle = 1; wake_up_interruptible(priv-dp_transmit_idle_wait); - spin_unlock(priv-dp_port_lock); + spin_unlock_irqrestore(priv-dp_port_lock, flags); } else if (opcode == DIGI_CMD_IFLUSH_FIFO) { wake_up_interruptible(priv-dp_flush_wait); } -- 1.7.9.5 -- To unsubscribe from this list: send the
[PATCH v1 18/49] USB: serial: quatech2: prepare for enabling irq in complete()
Complete() will be run with interrupt enabled, so change to spin_lock_irqsave(). Cc: Johan Hovold jhov...@gmail.com Signed-off-by: Ming Lei ming@canonical.com --- drivers/usb/serial/quatech2.c |5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/usb/serial/quatech2.c b/drivers/usb/serial/quatech2.c index a24d59a..4daa5c9 100644 --- a/drivers/usb/serial/quatech2.c +++ b/drivers/usb/serial/quatech2.c @@ -632,16 +632,17 @@ static void qt2_write_bulk_callback(struct urb *urb) { struct usb_serial_port *port; struct qt2_port_private *port_priv; + unsigned long flags; port = urb-context; port_priv = usb_get_serial_port_data(port); - spin_lock(port_priv-urb_lock); + spin_lock_irqsave(port_priv-urb_lock, flags); port_priv-urb_in_use = false; usb_serial_port_softint(port); - spin_unlock(port_priv-urb_lock); + spin_unlock_irqrestore(port_priv-urb_lock, flags); } -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v1 11/49] USB: usbtest: prepare for enabling irq in complete()
Complete() will be run with interrupt enabled, so change to spin_lock_irqsave(). Signed-off-by: Ming Lei ming@canonical.com --- drivers/usb/misc/usbtest.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/usb/misc/usbtest.c b/drivers/usb/misc/usbtest.c index aa28ac8..14277f8 100644 --- a/drivers/usb/misc/usbtest.c +++ b/drivers/usb/misc/usbtest.c @@ -804,11 +804,12 @@ static void ctrl_complete(struct urb *urb) struct usb_ctrlrequest *reqp; struct subcase *subcase; int status = urb-status; + unsigned long flags; reqp = (struct usb_ctrlrequest *)urb-setup_packet; subcase = container_of(reqp, struct subcase, setup); - spin_lock(ctx-lock); + spin_lock_irqsave(ctx-lock, flags); ctx-count--; ctx-pending--; @@ -907,7 +908,7 @@ error: /* signal completion when nothing's queued */ if (ctx-pending == 0) complete(ctx-complete); - spin_unlock(ctx-lock); + spin_unlock_irqrestore(ctx-lock, flags); } static int @@ -1551,8 +1552,9 @@ struct iso_context { static void iso_callback(struct urb *urb) { struct iso_context *ctx = urb-context; + unsigned long flags; - spin_lock(ctx-lock); + spin_lock_irqsave(ctx-lock, flags); ctx-count--; ctx-packet_count += urb-number_of_packets; @@ -1592,7 +1594,7 @@ static void iso_callback(struct urb *urb) complete(ctx-done); } done: - spin_unlock(ctx-lock); + spin_unlock_irqrestore(ctx-lock, flags); } static struct urb *iso_alloc_urb( -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v1 20/49] USB: serial: symbolserial: prepare for enabling irq in complete()
Complete() will be run with interrupt enabled, so change to spin_lock_irqsave(). Cc: Johan Hovold jhov...@gmail.com Signed-off-by: Ming Lei ming@canonical.com --- drivers/usb/serial/symbolserial.c |5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/usb/serial/symbolserial.c b/drivers/usb/serial/symbolserial.c index 9b16489..b4f5cbe 100644 --- a/drivers/usb/serial/symbolserial.c +++ b/drivers/usb/serial/symbolserial.c @@ -41,6 +41,7 @@ static void symbol_int_callback(struct urb *urb) int status = urb-status; int result; int data_length; + unsigned long flags; switch (status) { case 0: @@ -81,7 +82,7 @@ static void symbol_int_callback(struct urb *urb) } exit: - spin_lock(priv-lock); + spin_lock_irqsave(priv-lock, flags); /* Continue trying to always read if we should */ if (!priv-throttled) { @@ -92,7 +93,7 @@ exit: __func__, result); } else priv-actually_throttled = true; - spin_unlock(priv-lock); + spin_unlock_irqrestore(priv-lock, flags); } static int symbol_open(struct tty_struct *tty, struct usb_serial_port *port) -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v1 22/49] USB: serial: usb_wwan: prepare for enabling irq in complete()
Complete() will be run with interrupt enabled, so change to spin_lock_irqsave(). Cc: Johan Hovold jhov...@gmail.com Signed-off-by: Ming Lei ming@canonical.com --- drivers/usb/serial/usb_wwan.c |5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/usb/serial/usb_wwan.c b/drivers/usb/serial/usb_wwan.c index 8536578..92c9fa2 100644 --- a/drivers/usb/serial/usb_wwan.c +++ b/drivers/usb/serial/usb_wwan.c @@ -312,6 +312,7 @@ static void usb_wwan_outdat_callback(struct urb *urb) struct usb_wwan_port_private *portdata; struct usb_wwan_intf_private *intfdata; int i; + unsigned long flags; port = urb-context; intfdata = port-serial-private; @@ -319,9 +320,9 @@ static void usb_wwan_outdat_callback(struct urb *urb) usb_serial_port_softint(port); usb_autopm_put_interface_async(port-serial-interface); portdata = usb_get_serial_port_data(port); - spin_lock(intfdata-susp_lock); + spin_lock_irqsave(intfdata-susp_lock, flags); intfdata-in_flight--; - spin_unlock(intfdata-susp_lock); + spin_unlock_irqrestore(intfdata-susp_lock, flags); for (i = 0; i N_OUT_URB; ++i) { if (portdata-out_urbs[i] == urb) { -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v1 21/49] USB: serial: ti_usb_3410_5052: prepare for enabling irq in complete()
Complete() will be run with interrupt enabled, so change to spin_lock_irqsave(). Cc: Johan Hovold jhov...@gmail.com Signed-off-by: Ming Lei ming@canonical.com --- drivers/usb/serial/ti_usb_3410_5052.c |9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial/ti_usb_3410_5052.c index 760b785..e955ee7 100644 --- a/drivers/usb/serial/ti_usb_3410_5052.c +++ b/drivers/usb/serial/ti_usb_3410_5052.c @@ -1013,6 +1013,7 @@ static void ti_bulk_in_callback(struct urb *urb) struct device *dev = urb-dev-dev; int status = urb-status; int retval = 0; + unsigned long flags; switch (status) { case 0: @@ -1046,20 +1047,20 @@ static void ti_bulk_in_callback(struct urb *urb) __func__); else ti_recv(port, urb-transfer_buffer, urb-actual_length); - spin_lock(tport-tp_lock); + spin_lock_irqsave(tport-tp_lock, flags); port-icount.rx += urb-actual_length; - spin_unlock(tport-tp_lock); + spin_unlock_irqrestore(tport-tp_lock, flags); } exit: /* continue to read unless stopping */ - spin_lock(tport-tp_lock); + spin_lock_irqsave(tport-tp_lock, flags); if (tport-tp_read_urb_state == TI_READ_URB_RUNNING) retval = usb_submit_urb(urb, GFP_ATOMIC); else if (tport-tp_read_urb_state == TI_READ_URB_STOPPING) tport-tp_read_urb_state = TI_READ_URB_STOPPED; - spin_unlock(tport-tp_lock); + spin_unlock_irqrestore(tport-tp_lock, flags); if (retval) dev_err(dev, %s - resubmit read urb failed, %d\n, __func__, retval); -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v1 19/49] USB: serial: sierra: prepare for enabling irq in complete()
Complete() will be run with interrupt enabled, so change to spin_lock_irqsave(). Cc: Johan Hovold jhov...@gmail.com Signed-off-by: Ming Lei ming@canonical.com --- drivers/usb/serial/sierra.c |9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/usb/serial/sierra.c b/drivers/usb/serial/sierra.c index de958c5..e79b6ad 100644 --- a/drivers/usb/serial/sierra.c +++ b/drivers/usb/serial/sierra.c @@ -433,6 +433,7 @@ static void sierra_outdat_callback(struct urb *urb) struct sierra_port_private *portdata = usb_get_serial_port_data(port); struct sierra_intf_private *intfdata; int status = urb-status; + unsigned long flags; intfdata = port-serial-private; @@ -443,12 +444,12 @@ static void sierra_outdat_callback(struct urb *urb) dev_dbg(port-dev, %s - nonzero write bulk status received: %d\n, __func__, status); - spin_lock(portdata-lock); + spin_lock_irqsave(portdata-lock, flags); --portdata-outstanding_urbs; - spin_unlock(portdata-lock); - spin_lock(intfdata-susp_lock); + spin_unlock_irqrestore(portdata-lock, flags); + spin_lock_irqsave(intfdata-susp_lock, flags); --intfdata-in_flight; - spin_unlock(intfdata-susp_lock); + spin_unlock_irqrestore(intfdata-susp_lock, flags); usb_serial_port_softint(port); } -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v1 23/49] hid: usbhid: prepare for enabling irq in complete()
Complete() will be run with interrupt enabled, so change to spin_lock_irqsave(). Cc: Jiri Kosina jkos...@suse.cz Cc: linux-in...@vger.kernel.org Signed-off-by: Ming Lei ming@canonical.com --- drivers/hid/usbhid/hid-core.c |5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c index bd38cdf..2445fd6 100644 --- a/drivers/hid/usbhid/hid-core.c +++ b/drivers/hid/usbhid/hid-core.c @@ -489,8 +489,9 @@ static void hid_ctrl(struct urb *urb) struct hid_device *hid = urb-context; struct usbhid_device *usbhid = hid-driver_data; int unplug = 0, status = urb-status; + unsigned long flags; - spin_lock(usbhid-lock); + spin_lock_irqsave(usbhid-lock, flags); switch (status) { case 0: /* success */ @@ -525,7 +526,7 @@ static void hid_ctrl(struct urb *urb) } clear_bit(HID_CTRL_RUNNING, usbhid-iofl); - spin_unlock(usbhid-lock); + spin_unlock_irqrestore(usbhid-lock, flags); usb_autopm_put_interface_async(usbhid-intf); wake_up(usbhid-wait); } -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v1 25/49] BT: bfusb: prepare for enabling irq in complete()
Complete() will be run with interrupt enabled, so change to read_lock_irqsave(). Cc: Marcel Holtmann mar...@holtmann.org Cc: Gustavo Padovan gust...@padovan.org Cc: Johan Hedberg johan.hedb...@gmail.com Cc: linux-blueto...@vger.kernel.org Signed-off-by: Ming Lei ming@canonical.com --- drivers/bluetooth/bfusb.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/bluetooth/bfusb.c b/drivers/bluetooth/bfusb.c index 995aee9..2e93501 100644 --- a/drivers/bluetooth/bfusb.c +++ b/drivers/bluetooth/bfusb.c @@ -186,6 +186,7 @@ static void bfusb_tx_complete(struct urb *urb) { struct sk_buff *skb = (struct sk_buff *) urb-context; struct bfusb_data *data = (struct bfusb_data *) skb-dev; + unsigned long flags; BT_DBG(bfusb %p urb %p skb %p len %d, data, urb, skb, skb-len); @@ -199,14 +200,14 @@ static void bfusb_tx_complete(struct urb *urb) else data-hdev-stat.err_tx++; - read_lock(data-lock); + read_lock_irqsave(data-lock, flags); skb_unlink(skb, data-pending_q); skb_queue_tail(data-completed_q, skb); bfusb_tx_wakeup(data); - read_unlock(data-lock); + read_unlock_irqrestore(data-lock, flags); } @@ -347,10 +348,11 @@ static void bfusb_rx_complete(struct urb *urb) unsigned char *buf = urb-transfer_buffer; int count = urb-actual_length; int err, hdr, len; + unsigned long flags; BT_DBG(bfusb %p urb %p skb %p len %d, data, urb, skb, skb-len); - read_lock(data-lock); + read_lock_irqsave(data-lock, flags); if (!test_bit(HCI_RUNNING, data-hdev-flags)) goto unlock; @@ -392,7 +394,7 @@ static void bfusb_rx_complete(struct urb *urb) bfusb_rx_submit(data, urb); - read_unlock(data-lock); + read_unlock_irqrestore(data-lock, flags); return; @@ -406,7 +408,7 @@ resubmit: } unlock: - read_unlock(data-lock); + read_unlock_irqrestore(data-lock, flags); } static int bfusb_open(struct hci_dev *hdev) -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v1 26/49] input: cm109: prepare for enabling irq in complete()
Complete() will be run with interrupt enabled, so change to spin_lock_irqsave(). Cc: Dmitry Torokhov dmitry.torok...@gmail.com Cc: linux-in...@vger.kernel.org Signed-off-by: Ming Lei ming@canonical.com --- drivers/input/misc/cm109.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/input/misc/cm109.c b/drivers/input/misc/cm109.c index 082684e..cac4e37 100644 --- a/drivers/input/misc/cm109.c +++ b/drivers/input/misc/cm109.c @@ -340,6 +340,7 @@ static void cm109_urb_irq_callback(struct urb *urb) struct cm109_dev *dev = urb-context; const int status = urb-status; int error; + unsigned long flags; dev_dbg(dev-intf-dev, ### URB IRQ: [0x%02x 0x%02x 0x%02x 0x%02x] keybit=0x%02x\n, dev-irq_data-byte[0], @@ -379,7 +380,7 @@ static void cm109_urb_irq_callback(struct urb *urb) out: - spin_lock(dev-ctl_submit_lock); + spin_lock_irqsave(dev-ctl_submit_lock, flags); dev-irq_urb_pending = 0; @@ -403,7 +404,7 @@ static void cm109_urb_irq_callback(struct urb *urb) __func__, error); } - spin_unlock(dev-ctl_submit_lock); + spin_unlock_irqrestore(dev-ctl_submit_lock, flags); } static void cm109_urb_ctl_callback(struct urb *urb) @@ -411,6 +412,7 @@ static void cm109_urb_ctl_callback(struct urb *urb) struct cm109_dev *dev = urb-context; const int status = urb-status; int error; + unsigned long flags; dev_dbg(dev-intf-dev, ### URB CTL: [0x%02x 0x%02x 0x%02x 0x%02x]\n, dev-ctl_data-byte[0], @@ -421,7 +423,7 @@ static void cm109_urb_ctl_callback(struct urb *urb) if (status) dev_err(dev-intf-dev, %s: urb status %d\n, __func__, status); - spin_lock(dev-ctl_submit_lock); + spin_lock_irqsave(dev-ctl_submit_lock, flags); dev-ctl_urb_pending = 0; @@ -442,7 +444,7 @@ static void cm109_urb_ctl_callback(struct urb *urb) } } - spin_unlock(dev-ctl_submit_lock); + spin_unlock_irqrestore(dev-ctl_submit_lock, flags); } static void cm109_toggle_buzzer_async(struct cm109_dev *dev) -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v1 28/49] USBNET: cdc-phonet: prepare for enabling irq in complete()
Complete() will be run with interrupt enabled, so change to spin_lock_irqsave(). Cc: net...@vger.kernel.org Signed-off-by: Ming Lei ming@canonical.com --- drivers/net/usb/cdc-phonet.c |5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/usb/cdc-phonet.c b/drivers/net/usb/cdc-phonet.c index 7d78669..413ec32 100644 --- a/drivers/net/usb/cdc-phonet.c +++ b/drivers/net/usb/cdc-phonet.c @@ -99,6 +99,7 @@ static void tx_complete(struct urb *req) struct net_device *dev = skb-dev; struct usbpn_dev *pnd = netdev_priv(dev); int status = req-status; + unsigned long flags; switch (status) { case 0: @@ -115,10 +116,10 @@ static void tx_complete(struct urb *req) } dev-stats.tx_packets++; - spin_lock(pnd-tx_lock); + spin_lock_irqsave(pnd-tx_lock, flags); pnd-tx_queue--; netif_wake_queue(dev); - spin_unlock(pnd-tx_lock); + spin_unlock_irqrestore(pnd-tx_lock, flags); dev_kfree_skb_any(skb); usb_free_urb(req); -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v1 30/49] USBNET: kaweth: prepare for enabling irq in complete()
Complete() will be run with interrupt enabled, so change to spin_lock_irqsave(). Cc: net...@vger.kernel.org Signed-off-by: Ming Lei ming@canonical.com --- drivers/net/usb/kaweth.c |7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/net/usb/kaweth.c b/drivers/net/usb/kaweth.c index afb117c..4addbbf 100644 --- a/drivers/net/usb/kaweth.c +++ b/drivers/net/usb/kaweth.c @@ -598,6 +598,7 @@ static void kaweth_usb_receive(struct urb *urb) struct kaweth_device *kaweth = urb-context; struct net_device *net = kaweth-net; int status = urb-status; + unsigned long flags; int count = urb-actual_length; int count2 = urb-transfer_buffer_length; @@ -630,12 +631,12 @@ static void kaweth_usb_receive(struct urb *urb) kaweth-stats.rx_errors++; dev_dbg(dev, Status was -EOVERFLOW.\n); } - spin_lock(kaweth-device_lock); + spin_lock_irqsave(kaweth-device_lock, flags); if (IS_BLOCKED(kaweth-status)) { - spin_unlock(kaweth-device_lock); + spin_unlock_irqrestore(kaweth-device_lock, flags); return; } - spin_unlock(kaweth-device_lock); + spin_unlock_irqrestore(kaweth-device_lock, flags); if(status status != -EREMOTEIO count != 1) { dev_err(kaweth-intf-dev, -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v1 29/49] USBNET: hso: prepare for enabling irq in complete()
Complete() will be run with interrupt enabled, so change to spin_lock_irqsave(). Cc: net...@vger.kernel.org Signed-off-by: Ming Lei ming@canonical.com --- drivers/net/usb/hso.c | 38 ++ 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c index cba1d46..c865441 100644 --- a/drivers/net/usb/hso.c +++ b/drivers/net/usb/hso.c @@ -1008,6 +1008,7 @@ static void read_bulk_callback(struct urb *urb) struct net_device *net; int result; int status = urb-status; + unsigned long flags; /* is al ok? (Filip: Who's Al ?) */ if (status) { @@ -1036,11 +1037,11 @@ static void read_bulk_callback(struct urb *urb) if (urb-actual_length) { /* Handle the IP stream, add header and push it onto network * stack if the packet is complete. */ - spin_lock(odev-net_lock); + spin_lock_irqsave(odev-net_lock, flags); packetizeRx(odev, urb-transfer_buffer, urb-actual_length, (urb-transfer_buffer_length urb-actual_length) ? 1 : 0); - spin_unlock(odev-net_lock); + spin_unlock_irqrestore(odev-net_lock, flags); } /* We are done with this URB, resubmit it. Prep the USB to wait for @@ -1201,6 +1202,7 @@ static void hso_std_serial_read_bulk_callback(struct urb *urb) { struct hso_serial *serial = urb-context; int status = urb-status; + unsigned long flags; /* sanity check */ if (!serial) { @@ -1223,17 +1225,17 @@ static void hso_std_serial_read_bulk_callback(struct urb *urb) if (serial-parent-port_spec HSO_INFO_CRC_BUG) fix_crc_bug(urb, serial-in_endp-wMaxPacketSize); /* Valid data, handle RX data */ - spin_lock(serial-serial_lock); + spin_lock_irqsave(serial-serial_lock, flags); serial-rx_urb_filled[hso_urb_to_index(serial, urb)] = 1; put_rxbuf_data_and_resubmit_bulk_urb(serial); - spin_unlock(serial-serial_lock); + spin_unlock_irqrestore(serial-serial_lock, flags); } else if (status == -ENOENT || status == -ECONNRESET) { /* Unlinked - check for throttled port. */ D2(Port %d, successfully unlinked urb, serial-minor); - spin_lock(serial-serial_lock); + spin_lock_irqsave(serial-serial_lock, flags); serial-rx_urb_filled[hso_urb_to_index(serial, urb)] = 0; hso_resubmit_rx_bulk_urb(serial, urb); - spin_unlock(serial-serial_lock); + spin_unlock_irqrestore(serial-serial_lock, flags); } else { D2(Port %d, status = %d for read urb, serial-minor, status); return; @@ -1510,12 +1512,13 @@ static void tiocmget_intr_callback(struct urb *urb) DUMP(serial_state_notification, sizeof(struct hso_serial_state_notification)); } else { + unsigned long flags; UART_state_bitmap = le16_to_cpu(serial_state_notification- UART_state_bitmap); prev_UART_state_bitmap = tiocmget-prev_UART_state_bitmap; icount = tiocmget-icount; - spin_lock(serial-serial_lock); + spin_lock_irqsave(serial-serial_lock, flags); if ((UART_state_bitmap B_OVERRUN) != (prev_UART_state_bitmap B_OVERRUN)) icount-parity++; @@ -1538,7 +1541,7 @@ static void tiocmget_intr_callback(struct urb *urb) (prev_UART_state_bitmap B_RX_CARRIER)) icount-dcd++; tiocmget-prev_UART_state_bitmap = UART_state_bitmap; - spin_unlock(serial-serial_lock); + spin_unlock_irqrestore(serial-serial_lock, flags); tiocmget-intr_completed = 1; wake_up_interruptible(tiocmget-waitq); } @@ -1883,8 +1886,9 @@ static void intr_callback(struct urb *urb) serial = get_serial_by_shared_int_and_type(shared_int, (1 i)); if (serial != NULL) { + unsigned long flags; D1(Pending read interrupt on port %d\n, i); - spin_lock(serial-serial_lock); + spin_lock_irqsave(serial-serial_lock, flags); if (serial-rx_state == RX_IDLE serial-port.count 0) { /* Setup and send a ctrl req read on @@ -1898,7 +1902,7 @@ static void intr_callback(struct urb *urb)
[PATCH v1 27/49] ISDN: hfcsusb: prepare for enabling irq in complete()
Complete() will be run with interrupt enabled, so change to spin_lock_irqsave(). Cc: Karsten Keil i...@linux-pingi.de Cc: David S. Miller da...@davemloft.net Cc: net...@vger.kernel.org Signed-off-by: Ming Lei ming@canonical.com --- drivers/isdn/hardware/mISDN/hfcsusb.c | 36 ++--- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/drivers/isdn/hardware/mISDN/hfcsusb.c b/drivers/isdn/hardware/mISDN/hfcsusb.c index 114f3bc..082f9e0 100644 --- a/drivers/isdn/hardware/mISDN/hfcsusb.c +++ b/drivers/isdn/hardware/mISDN/hfcsusb.c @@ -819,6 +819,7 @@ hfcsusb_rx_frame(struct usb_fifo *fifo, __u8 *data, unsigned int len, int fifon = fifo-fifonum; int i; int hdlc = 0; + unsigned long flags; if (debug DBG_HFC_CALL_TRACE) printk(KERN_DEBUG %s: %s: fifo(%i) len(%i) @@ -835,7 +836,7 @@ hfcsusb_rx_frame(struct usb_fifo *fifo, __u8 *data, unsigned int len, return; } - spin_lock(hw-lock); + spin_lock_irqsave(hw-lock, flags); if (fifo-dch) { rx_skb = fifo-dch-rx_skb; maxlen = fifo-dch-maxlen; @@ -844,7 +845,7 @@ hfcsusb_rx_frame(struct usb_fifo *fifo, __u8 *data, unsigned int len, if (fifo-bch) { if (test_bit(FLG_RX_OFF, fifo-bch-Flags)) { fifo-bch-dropcnt += len; - spin_unlock(hw-lock); + spin_unlock_irqrestore(hw-lock, flags); return; } maxlen = bchannel_get_rxbuf(fifo-bch, len); @@ -854,7 +855,7 @@ hfcsusb_rx_frame(struct usb_fifo *fifo, __u8 *data, unsigned int len, skb_trim(rx_skb, 0); pr_warning(%s.B%d: No bufferspace for %d bytes\n, hw-name, fifo-bch-nr, len); - spin_unlock(hw-lock); + spin_unlock_irqrestore(hw-lock, flags); return; } maxlen = fifo-bch-maxlen; @@ -878,7 +879,7 @@ hfcsusb_rx_frame(struct usb_fifo *fifo, __u8 *data, unsigned int len, } else { printk(KERN_DEBUG %s: %s: No mem for rx_skb\n, hw-name, __func__); - spin_unlock(hw-lock); + spin_unlock_irqrestore(hw-lock, flags); return; } } @@ -888,7 +889,7 @@ hfcsusb_rx_frame(struct usb_fifo *fifo, __u8 *data, unsigned int len, for fifo(%d) HFCUSB_D_RX\n, hw-name, __func__, fifon); skb_trim(rx_skb, 0); - spin_unlock(hw-lock); + spin_unlock_irqrestore(hw-lock, flags); return; } } @@ -942,7 +943,7 @@ hfcsusb_rx_frame(struct usb_fifo *fifo, __u8 *data, unsigned int len, /* deliver transparent data to layer2 */ recv_Bchannel(fifo-bch, MISDN_ID_ANY, false); } - spin_unlock(hw-lock); + spin_unlock_irqrestore(hw-lock, flags); } static void @@ -979,18 +980,19 @@ rx_iso_complete(struct urb *urb) __u8 *buf; static __u8 eof[8]; __u8 s0_state; + unsigned long flags; fifon = fifo-fifonum; status = urb-status; - spin_lock(hw-lock); + spin_lock_irqsave(hw-lock, flags); if (fifo-stop_gracefull) { fifo-stop_gracefull = 0; fifo-active = 0; - spin_unlock(hw-lock); + spin_unlock_irqrestore(hw-lock, flags); return; } - spin_unlock(hw-lock); + spin_unlock_irqrestore(hw-lock, flags); /* * ISO transfer only partially completed, @@ -1096,15 +1098,16 @@ rx_int_complete(struct urb *urb) struct usb_fifo *fifo = (struct usb_fifo *) urb-context; struct hfcsusb *hw = fifo-hw; static __u8 eof[8]; + unsigned long flags; - spin_lock(hw-lock); + spin_lock_irqsave(hw-lock, flags); if (fifo-stop_gracefull) { fifo-stop_gracefull = 0; fifo-active = 0; - spin_unlock(hw-lock); + spin_unlock_irqrestore(hw-lock, flags); return; } - spin_unlock(hw-lock); + spin_unlock_irqrestore(hw-lock, flags); fifon = fifo-fifonum; if ((!fifo-active) || (urb-status)) { @@ -1172,12 +1175,13 @@ tx_iso_complete(struct urb *urb) int *tx_idx; int frame_complete, fifon, status, fillempty = 0; __u8 threshbit, *p; + unsigned long flags; - spin_lock(hw-lock); + spin_lock_irqsave(hw-lock, flags); if
[PATCH v1 31/49] USBNET: rtl8150: prepare for enabling irq in complete()
Complete() will be run with interrupt enabled, so change to spin_lock_irqsave(). Cc: net...@vger.kernel.org Signed-off-by: Ming Lei ming@canonical.com --- drivers/net/usb/rtl8150.c |5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/usb/rtl8150.c b/drivers/net/usb/rtl8150.c index 6cbdac6..199e0fb 100644 --- a/drivers/net/usb/rtl8150.c +++ b/drivers/net/usb/rtl8150.c @@ -372,6 +372,7 @@ static void read_bulk_callback(struct urb *urb) u16 rx_stat; int status = urb-status; int result; + unsigned long flags; dev = urb-context; if (!dev) @@ -413,9 +414,9 @@ static void read_bulk_callback(struct urb *urb) netdev-stats.rx_packets++; netdev-stats.rx_bytes += pkt_len; - spin_lock(dev-rx_pool_lock); + spin_lock_irqsave(dev-rx_pool_lock, flags); skb = pull_skb(dev); - spin_unlock(dev-rx_pool_lock); + spin_unlock_irqrestore(dev-rx_pool_lock, flags); if (!skb) goto resched; -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v1 32/49] wireless: ath9k: prepare for enabling irq in complete()
Complete() will be run with interrupt enabled, so change to spin_lock_irqsave(). Cc: Luis R. Rodriguez mcg...@qca.qualcomm.com Cc: John W. Linville linvi...@tuxdriver.com Cc: linux-wirel...@vger.kernel.org Cc: net...@vger.kernel.org Signed-off-by: Ming Lei ming@canonical.com --- drivers/net/wireless/ath/ath9k/hif_usb.c | 29 ++--- drivers/net/wireless/ath/ath9k/htc_drv_txrx.c |9 drivers/net/wireless/ath/ath9k/wmi.c | 11 +- 3 files changed, 27 insertions(+), 22 deletions(-) diff --git a/drivers/net/wireless/ath/ath9k/hif_usb.c b/drivers/net/wireless/ath/ath9k/hif_usb.c index 6d5d716..5efc1f0 100644 --- a/drivers/net/wireless/ath/ath9k/hif_usb.c +++ b/drivers/net/wireless/ath/ath9k/hif_usb.c @@ -136,6 +136,7 @@ static void hif_usb_mgmt_cb(struct urb *urb) struct cmd_buf *cmd = (struct cmd_buf *)urb-context; struct hif_device_usb *hif_dev; bool txok = true; + unsigned long flags; if (!cmd || !cmd-skb || !cmd-hif_dev) return; @@ -155,14 +156,14 @@ static void hif_usb_mgmt_cb(struct urb *urb) * If the URBs are being flushed, no need to complete * this packet. */ - spin_lock(hif_dev-tx.tx_lock); + spin_lock_irqsave(hif_dev-tx.tx_lock, flags); if (hif_dev-tx.flags HIF_USB_TX_FLUSH) { - spin_unlock(hif_dev-tx.tx_lock); + spin_unlock_irqrestore(hif_dev-tx.tx_lock, flags); dev_kfree_skb_any(cmd-skb); kfree(cmd); return; } - spin_unlock(hif_dev-tx.tx_lock); + spin_unlock_irqrestore(hif_dev-tx.tx_lock, flags); break; default: @@ -253,6 +254,7 @@ static void hif_usb_tx_cb(struct urb *urb) struct tx_buf *tx_buf = (struct tx_buf *) urb-context; struct hif_device_usb *hif_dev; bool txok = true; + unsigned long flags; if (!tx_buf || !tx_buf-hif_dev) return; @@ -272,13 +274,13 @@ static void hif_usb_tx_cb(struct urb *urb) * If the URBs are being flushed, no need to add this * URB to the free list. */ - spin_lock(hif_dev-tx.tx_lock); + spin_lock_irqsave(hif_dev-tx.tx_lock, flags); if (hif_dev-tx.flags HIF_USB_TX_FLUSH) { - spin_unlock(hif_dev-tx.tx_lock); + spin_unlock_irqrestore(hif_dev-tx.tx_lock, flags); ath9k_skb_queue_purge(hif_dev, tx_buf-skb_queue); return; } - spin_unlock(hif_dev-tx.tx_lock); + spin_unlock_irqrestore(hif_dev-tx.tx_lock, flags); break; default: @@ -293,13 +295,13 @@ static void hif_usb_tx_cb(struct urb *urb) __skb_queue_head_init(tx_buf-skb_queue); /* Add this TX buffer to the free list */ - spin_lock(hif_dev-tx.tx_lock); + spin_lock_irqsave(hif_dev-tx.tx_lock, flags); list_move_tail(tx_buf-list, hif_dev-tx.tx_buf); hif_dev-tx.tx_buf_cnt++; if (!(hif_dev-tx.flags HIF_USB_TX_STOP)) __hif_usb_tx(hif_dev); /* Check for pending SKBs */ TX_STAT_INC(buf_completed); - spin_unlock(hif_dev-tx.tx_lock); + spin_unlock_irqrestore(hif_dev-tx.tx_lock, flags); } /* TX lock has to be taken */ @@ -530,8 +532,9 @@ static void ath9k_hif_usb_rx_stream(struct hif_device_usb *hif_dev, int rx_remain_len, rx_pkt_len; u16 pool_index = 0; u8 *ptr; + unsigned long flags; - spin_lock(hif_dev-rx_lock); + spin_lock_irqsave(hif_dev-rx_lock, flags); rx_remain_len = hif_dev-rx_remain_len; rx_pkt_len = hif_dev-rx_transfer_len; @@ -559,7 +562,7 @@ static void ath9k_hif_usb_rx_stream(struct hif_device_usb *hif_dev, } } - spin_unlock(hif_dev-rx_lock); + spin_unlock_irqrestore(hif_dev-rx_lock, flags); while (index len) { u16 pkt_len; @@ -585,7 +588,7 @@ static void ath9k_hif_usb_rx_stream(struct hif_device_usb *hif_dev, index = index + 4 + pkt_len + pad_len; if (index MAX_RX_BUF_SIZE) { - spin_lock(hif_dev-rx_lock); + spin_lock_irqsave(hif_dev-rx_lock, flags); hif_dev-rx_remain_len = index - MAX_RX_BUF_SIZE; hif_dev-rx_transfer_len = MAX_RX_BUF_SIZE - chk_idx - 4; @@ -595,7 +598,7 @@ static void ath9k_hif_usb_rx_stream(struct hif_device_usb *hif_dev, if (!nskb) { dev_err(hif_dev-udev-dev, ath9k_htc: RX memory allocation error\n); -
[PATCH v1 35/49] wireless: libertas: prepare for enabling irq in complete()
Complete() will be run with interrupt enabled, so change to spin_lock_irqsave(). Cc: John W. Linville linvi...@tuxdriver.com Cc: libertas-...@lists.infradead.org Cc: linux-wirel...@vger.kernel.org Cc: net...@vger.kernel.org Signed-off-by: Ming Lei ming@canonical.com --- drivers/net/wireless/libertas/if_usb.c |5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/libertas/if_usb.c b/drivers/net/wireless/libertas/if_usb.c index 2798077..f6a8396 100644 --- a/drivers/net/wireless/libertas/if_usb.c +++ b/drivers/net/wireless/libertas/if_usb.c @@ -626,6 +626,7 @@ static inline void process_cmdrequest(int recvlength, uint8_t *recvbuff, struct lbs_private *priv) { u8 i; + unsigned long flags; if (recvlength LBS_CMD_BUFFER_SIZE) { lbs_deb_usbd(cardp-udev-dev, @@ -636,7 +637,7 @@ static inline void process_cmdrequest(int recvlength, uint8_t *recvbuff, BUG_ON(!in_interrupt()); - spin_lock(priv-driver_lock); + spin_lock_irqsave(priv-driver_lock, flags); i = (priv-resp_idx == 0) ? 1 : 0; BUG_ON(priv-resp_len[i]); @@ -646,7 +647,7 @@ static inline void process_cmdrequest(int recvlength, uint8_t *recvbuff, kfree_skb(skb); lbs_notify_command_response(priv, i); - spin_unlock(priv-driver_lock); + spin_unlock_irqrestore(priv-driver_lock, flags); lbs_deb_usbd(cardp-udev-dev, Wake up main thread to handle cmd response\n); -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v1 34/49] wireless: ath: carl9170: prepare for enabling irq in complete()
Complete() will be run with interrupt enabled, so change to spin_lock_irqsave(). Cc: Christian Lamparter chunk...@googlemail.com Cc: John W. Linville linvi...@tuxdriver.com Cc: linux-wirel...@vger.kernel.org Cc: net...@vger.kernel.org Signed-off-by: Ming Lei ming@canonical.com --- drivers/net/wireless/ath/carl9170/rx.c |5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ath/carl9170/rx.c b/drivers/net/wireless/ath/carl9170/rx.c index 4684dd9..61f62a6 100644 --- a/drivers/net/wireless/ath/carl9170/rx.c +++ b/drivers/net/wireless/ath/carl9170/rx.c @@ -129,6 +129,7 @@ static int carl9170_check_sequence(struct ar9170 *ar, unsigned int seq) static void carl9170_cmd_callback(struct ar9170 *ar, u32 len, void *buffer) { + unsigned long flags; /* * Some commands may have a variable response length * and we cannot predict the correct length in advance. @@ -148,7 +149,7 @@ static void carl9170_cmd_callback(struct ar9170 *ar, u32 len, void *buffer) carl9170_restart(ar, CARL9170_RR_INVALID_RSP); } - spin_lock(ar-cmd_lock); + spin_lock_irqsave(ar-cmd_lock, flags); if (ar-readbuf) { if (len = 4) memcpy(ar-readbuf, buffer + 4, len - 4); @@ -156,7 +157,7 @@ static void carl9170_cmd_callback(struct ar9170 *ar, u32 len, void *buffer) ar-readbuf = NULL; } complete(ar-cmd_wait); - spin_unlock(ar-cmd_lock); + spin_unlock_irqrestore(ar-cmd_lock, flags); } void carl9170_handle_command_response(struct ar9170 *ar, void *buf, u32 len) -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v1 33/49] wireless: zd1211rw: prepare for enabling irq in complete()
Complete() will be run with interrupt enabled, so change to spin_lock_irqsave(). Cc: Daniel Drake d...@gentoo.org Cc: Ulrich Kunitz k...@deine-taler.de Cc: John W. Linville linvi...@tuxdriver.com Cc: linux-wirel...@vger.kernel.org Cc: net...@vger.kernel.org Signed-off-by: Ming Lei ming@canonical.com --- drivers/net/wireless/zd1211rw/zd_usb.c | 21 - 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/drivers/net/wireless/zd1211rw/zd_usb.c b/drivers/net/wireless/zd1211rw/zd_usb.c index 7ef0b4a..8169ee0 100644 --- a/drivers/net/wireless/zd1211rw/zd_usb.c +++ b/drivers/net/wireless/zd1211rw/zd_usb.c @@ -372,14 +372,15 @@ static inline void handle_regs_int_override(struct urb *urb) { struct zd_usb *usb = urb-context; struct zd_usb_interrupt *intr = usb-intr; + unsigned long flags; - spin_lock(intr-lock); + spin_lock_irqsave(intr-lock, flags); if (atomic_read(intr-read_regs_enabled)) { atomic_set(intr-read_regs_enabled, 0); intr-read_regs_int_overridden = 1; complete(intr-read_regs.completion); } - spin_unlock(intr-lock); + spin_unlock_irqrestore(intr-lock, flags); } static inline void handle_regs_int(struct urb *urb) @@ -388,9 +389,10 @@ static inline void handle_regs_int(struct urb *urb) struct zd_usb_interrupt *intr = usb-intr; int len; u16 int_num; + unsigned long flags; ZD_ASSERT(in_interrupt()); - spin_lock(intr-lock); + spin_lock_irqsave(intr-lock, flags); int_num = le16_to_cpu(*(__le16 *)(urb-transfer_buffer+2)); if (int_num == CR_INTERRUPT) { @@ -426,7 +428,7 @@ static inline void handle_regs_int(struct urb *urb) } out: - spin_unlock(intr-lock); + spin_unlock_irqrestore(intr-lock, flags); /* CR_INTERRUPT might override read_reg too. */ if (int_num == CR_INTERRUPT atomic_read(intr-read_regs_enabled)) @@ -666,6 +668,7 @@ static void rx_urb_complete(struct urb *urb) struct zd_usb_rx *rx; const u8 *buffer; unsigned int length; + unsigned long flags; switch (urb-status) { case 0: @@ -694,14 +697,14 @@ static void rx_urb_complete(struct urb *urb) /* If there is an old first fragment, we don't care. */ dev_dbg_f(urb_dev(urb), *** first fragment ***\n); ZD_ASSERT(length = ARRAY_SIZE(rx-fragment)); - spin_lock(rx-lock); + spin_lock_irqsave(rx-lock, flags); memcpy(rx-fragment, buffer, length); rx-fragment_length = length; - spin_unlock(rx-lock); + spin_unlock_irqrestore(rx-lock, flags); goto resubmit; } - spin_lock(rx-lock); + spin_lock_irqsave(rx-lock, flags); if (rx-fragment_length 0) { /* We are on a second fragment, we believe */ ZD_ASSERT(length + rx-fragment_length = @@ -711,9 +714,9 @@ static void rx_urb_complete(struct urb *urb) handle_rx_packet(usb, rx-fragment, rx-fragment_length + length); rx-fragment_length = 0; - spin_unlock(rx-lock); + spin_unlock_irqrestore(rx-lock, flags); } else { - spin_unlock(rx-lock); + spin_unlock_irqrestore(rx-lock, flags); handle_rx_packet(usb, buffer, length); } -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v1 38/49] media: usb: em28xx: prepare for enabling irq in complete()
Complete() will be run with interrupt enabled, so change to spin_lock_irqsave(). Cc: Mauro Carvalho Chehab mche...@redhat.com Cc: linux-me...@vger.kernel.org Reviewed-by: Devin Heitmueller dheitmuel...@kernellabs.com Tested-by: Devin Heitmueller dheitmuel...@kernellabs.com Signed-off-by: Ming Lei ming@canonical.com --- drivers/media/usb/em28xx/em28xx-core.c |5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/media/usb/em28xx/em28xx-core.c b/drivers/media/usb/em28xx/em28xx-core.c index fc157af..0d698f9 100644 --- a/drivers/media/usb/em28xx/em28xx-core.c +++ b/drivers/media/usb/em28xx/em28xx-core.c @@ -941,6 +941,7 @@ static void em28xx_irq_callback(struct urb *urb) { struct em28xx *dev = urb-context; int i; + unsigned long flags; switch (urb-status) { case 0: /* success */ @@ -956,9 +957,9 @@ static void em28xx_irq_callback(struct urb *urb) } /* Copy data from URB */ - spin_lock(dev-slock); + spin_lock_irqsave(dev-slock, flags); dev-usb_ctl.urb_data_copy(dev, urb); - spin_unlock(dev-slock); + spin_unlock_irqrestore(dev-slock, flags); /* Reset urb buffers */ for (i = 0; i urb-number_of_packets; i++) { -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v1 45/49] sound: usb: caiaq: prepare for enabling irq in complete()
Complete() will be run with interrupt enabled, so change to spin_lock_irqsave(). Cc: Jaroslav Kysela pe...@perex.cz Cc: Takashi Iwai ti...@suse.de Cc: alsa-de...@alsa-project.org Acked-by: Daniel Mack zon...@gmail.com Signed-off-by: Ming Lei ming@canonical.com --- sound/usb/caiaq/audio.c |5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sound/usb/caiaq/audio.c b/sound/usb/caiaq/audio.c index 7103b09..e5675ab 100644 --- a/sound/usb/caiaq/audio.c +++ b/sound/usb/caiaq/audio.c @@ -672,10 +672,11 @@ static void read_completed(struct urb *urb) offset += len; if (len 0) { - spin_lock(cdev-spinlock); + unsigned long flags; + spin_lock_irqsave(cdev-spinlock, flags); fill_out_urb(cdev, out, out-iso_frame_desc[outframe]); read_in_urb(cdev, urb, urb-iso_frame_desc[frame]); - spin_unlock(cdev-spinlock); + spin_unlock_irqrestore(cdev-spinlock, flags); check_for_elapsed_periods(cdev, cdev-sub_playback); check_for_elapsed_periods(cdev, cdev-sub_capture); send_it = 1; -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v1 39/49] media: usb: sn9x102: prepare for enabling irq in complete()
Complete() will be run with interrupt enabled, so change to spin_lock_irqsave(). Cc: Mauro Carvalho Chehab mche...@redhat.com Cc: linux-me...@vger.kernel.org Signed-off-by: Ming Lei ming@canonical.com --- drivers/media/usb/sn9c102/sn9c102_core.c |7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/media/usb/sn9c102/sn9c102_core.c b/drivers/media/usb/sn9c102/sn9c102_core.c index 2cb44de..33dc595 100644 --- a/drivers/media/usb/sn9c102/sn9c102_core.c +++ b/drivers/media/usb/sn9c102/sn9c102_core.c @@ -784,12 +784,14 @@ end_of_frame: cam-sensor.pix_format.pixelformat == V4L2_PIX_FMT_JPEG) eof)) { u32 b; + unsigned long flags; b = (*f)-buf.bytesused; (*f)-state = F_DONE; (*f)-buf.sequence= ++cam-frame_count; - spin_lock(cam-queue_lock); + spin_lock_irqsave(cam-queue_lock, + flags); list_move_tail((*f)-frame, cam-outqueue); if (!list_empty(cam-inqueue)) @@ -799,7 +801,8 @@ end_of_frame: frame ); else (*f) = NULL; - spin_unlock(cam-queue_lock); + spin_unlock_irqrestore(cam-queue_lock, + flags); memcpy(cam-sysfs.frame_header, cam-sof.header, soflen); -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v1 43/49] media: usb: em28xx: prepare for enabling irq in complete()
Complete() will be run with interrupt enabled, so add local_irq_save() before acquiring the lock without irqsave(). Cc: Mauro Carvalho Chehab mche...@redhat.com Cc: linux-me...@vger.kernel.org Signed-off-by: Ming Lei ming@canonical.com --- drivers/media/usb/em28xx/em28xx-audio.c |5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/media/usb/em28xx/em28xx-audio.c b/drivers/media/usb/em28xx/em28xx-audio.c index 2fdb66e..7fd1b2a 100644 --- a/drivers/media/usb/em28xx/em28xx-audio.c +++ b/drivers/media/usb/em28xx/em28xx-audio.c @@ -113,6 +113,7 @@ static void em28xx_audio_isocirq(struct urb *urb) stride = runtime-frame_bits 3; for (i = 0; i urb-number_of_packets; i++) { + unsigned long flags; int length = urb-iso_frame_desc[i].actual_length / stride; cp = (unsigned char *)urb-transfer_buffer + @@ -134,7 +135,7 @@ static void em28xx_audio_isocirq(struct urb *urb) length * stride); } - snd_pcm_stream_lock(substream); + snd_pcm_stream_lock_irqsave(substream, flags); dev-adev.hwptr_done_capture += length; if (dev-adev.hwptr_done_capture = @@ -150,7 +151,7 @@ static void em28xx_audio_isocirq(struct urb *urb) period_elapsed = 1; } - snd_pcm_stream_unlock(substream); + snd_pcm_stream_unlock_irqrestore(substream, flags); } if (period_elapsed) snd_pcm_period_elapsed(substream); -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v1 37/49] media: usb: cx231xx: prepare for enabling irq in complete()
Complete() will be run with interrupt enabled, so change to spin_lock_irqsave(). Cc: Mauro Carvalho Chehab mche...@redhat.com Cc: Hans Verkuil hans.verk...@cisco.com Cc: linux-me...@vger.kernel.org Signed-off-by: Ming Lei ming@canonical.com --- drivers/media/usb/cx231xx/cx231xx-audio.c | 10 ++ drivers/media/usb/cx231xx/cx231xx-core.c | 10 ++ drivers/media/usb/cx231xx/cx231xx-vbi.c |5 +++-- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/drivers/media/usb/cx231xx/cx231xx-audio.c b/drivers/media/usb/cx231xx/cx231xx-audio.c index 81a1d97..f6fa0af 100644 --- a/drivers/media/usb/cx231xx/cx231xx-audio.c +++ b/drivers/media/usb/cx231xx/cx231xx-audio.c @@ -136,6 +136,7 @@ static void cx231xx_audio_isocirq(struct urb *urb) stride = runtime-frame_bits 3; for (i = 0; i urb-number_of_packets; i++) { + unsigned long flags; int length = urb-iso_frame_desc[i].actual_length / stride; cp = (unsigned char *)urb-transfer_buffer + @@ -158,7 +159,7 @@ static void cx231xx_audio_isocirq(struct urb *urb) length * stride); } - snd_pcm_stream_lock(substream); + snd_pcm_stream_lock_irqsave(substream, flags); dev-adev.hwptr_done_capture += length; if (dev-adev.hwptr_done_capture = @@ -173,7 +174,7 @@ static void cx231xx_audio_isocirq(struct urb *urb) runtime-period_size; period_elapsed = 1; } - snd_pcm_stream_unlock(substream); + snd_pcm_stream_unlock_irqrestore(substream, flags); } if (period_elapsed) snd_pcm_period_elapsed(substream); @@ -224,6 +225,7 @@ static void cx231xx_audio_bulkirq(struct urb *urb) stride = runtime-frame_bits 3; if (1) { + unsigned long flags; int length = urb-actual_length / stride; cp = (unsigned char *)urb-transfer_buffer; @@ -242,7 +244,7 @@ static void cx231xx_audio_bulkirq(struct urb *urb) length * stride); } - snd_pcm_stream_lock(substream); + snd_pcm_stream_lock_irqsave(substream, flags); dev-adev.hwptr_done_capture += length; if (dev-adev.hwptr_done_capture = @@ -257,7 +259,7 @@ static void cx231xx_audio_bulkirq(struct urb *urb) runtime-period_size; period_elapsed = 1; } - snd_pcm_stream_unlock(substream); + snd_pcm_stream_unlock_irqrestore(substream,flags); } if (period_elapsed) snd_pcm_period_elapsed(substream); diff --git a/drivers/media/usb/cx231xx/cx231xx-core.c b/drivers/media/usb/cx231xx/cx231xx-core.c index 4ba3ce0..593b397 100644 --- a/drivers/media/usb/cx231xx/cx231xx-core.c +++ b/drivers/media/usb/cx231xx/cx231xx-core.c @@ -798,6 +798,7 @@ static void cx231xx_isoc_irq_callback(struct urb *urb) container_of(dma_q, struct cx231xx_video_mode, vidq); struct cx231xx *dev = container_of(vmode, struct cx231xx, video_mode); int i; + unsigned long flags; switch (urb-status) { case 0: /* success */ @@ -813,9 +814,9 @@ static void cx231xx_isoc_irq_callback(struct urb *urb) } /* Copy data from URB */ - spin_lock(dev-video_mode.slock); + spin_lock_irqsave(dev-video_mode.slock, flags); dev-video_mode.isoc_ctl.isoc_copy(dev, urb); - spin_unlock(dev-video_mode.slock); + spin_unlock_irqrestore(dev-video_mode.slock, flags); /* Reset urb buffers */ for (i = 0; i urb-number_of_packets; i++) { @@ -842,6 +843,7 @@ static void cx231xx_bulk_irq_callback(struct urb *urb) struct cx231xx_video_mode *vmode = container_of(dma_q, struct cx231xx_video_mode, vidq); struct cx231xx *dev = container_of(vmode, struct cx231xx, video_mode); + unsigned long flags; switch (urb-status) { case 0: /* success */ @@ -857,9 +859,9 @@ static void cx231xx_bulk_irq_callback(struct urb *urb) } /* Copy data from URB */ - spin_lock(dev-video_mode.slock); + spin_lock_irqsave(dev-video_mode.slock, flags); dev-video_mode.bulk_ctl.bulk_copy(dev, urb); - spin_unlock(dev-video_mode.slock); + spin_unlock_irqrestore(dev-video_mode.slock, flags); /* Reset urb
[PATCH v1 46/49] staging: btmtk_usb: prepare for enabling irq in complete()
Complete() will be run with interrupt enabled, so change to spin_lock_irqsave(). Signed-off-by: Ming Lei ming@canonical.com --- drivers/staging/btmtk_usb/btmtk_usb.c |5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/staging/btmtk_usb/btmtk_usb.c b/drivers/staging/btmtk_usb/btmtk_usb.c index 0e783e8..ea10d4f 100644 --- a/drivers/staging/btmtk_usb/btmtk_usb.c +++ b/drivers/staging/btmtk_usb/btmtk_usb.c @@ -1218,6 +1218,7 @@ static void btmtk_usb_tx_complete(struct urb *urb) struct sk_buff *skb = urb-context; struct hci_dev *hdev = (struct hci_dev *)skb-dev; struct btmtk_usb_data *data = hci_get_drvdata(hdev); + unsigned long flags; BT_DBG(%s: %s urb %p status %d count %d\n, __func__, hdev-name, urb, urb-status, urb-actual_length); @@ -1231,9 +1232,9 @@ static void btmtk_usb_tx_complete(struct urb *urb) hdev-stat.err_tx++; done: - spin_lock(data-txlock); + spin_lock_irqsave(data-txlock, flags); data-tx_in_flight--; - spin_unlock(data-txlock); + spin_unlock_irqrestore(data-txlock, flags); kfree(urb-setup_packet); -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v1 42/49] media: dvb-core: prepare for enabling irq in complete()
Complete() will be run with interrupt enabled, so change to spin_lock_irqsave(). These functions may be called inside URB-complete(), so use spin_lock_irqsave(). Cc: Mauro Carvalho Chehab mche...@redhat.com Cc: linux-me...@vger.kernel.org Signed-off-by: Ming Lei ming@canonical.com --- drivers/media/dvb-core/dvb_demux.c | 17 +++-- 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/drivers/media/dvb-core/dvb_demux.c b/drivers/media/dvb-core/dvb_demux.c index 3485655..58de441 100644 --- a/drivers/media/dvb-core/dvb_demux.c +++ b/drivers/media/dvb-core/dvb_demux.c @@ -476,7 +476,9 @@ static void dvb_dmx_swfilter_packet(struct dvb_demux *demux, const u8 *buf) void dvb_dmx_swfilter_packets(struct dvb_demux *demux, const u8 *buf, size_t count) { - spin_lock(demux-lock); + unsigned long flags; + + spin_lock_irqsave(demux-lock, flags); while (count--) { if (buf[0] == 0x47) @@ -484,7 +486,7 @@ void dvb_dmx_swfilter_packets(struct dvb_demux *demux, const u8 *buf, buf += 188; } - spin_unlock(demux-lock); + spin_unlock_irqrestore(demux-lock, flags); } EXPORT_SYMBOL(dvb_dmx_swfilter_packets); @@ -519,8 +521,9 @@ static inline void _dvb_dmx_swfilter(struct dvb_demux *demux, const u8 *buf, { int p = 0, i, j; const u8 *q; + unsigned long flags; - spin_lock(demux-lock); + spin_lock_irqsave(demux-lock, flags); if (demux-tsbufp) { /* tsbuf[0] is now 0x47. */ i = demux-tsbufp; @@ -564,7 +567,7 @@ static inline void _dvb_dmx_swfilter(struct dvb_demux *demux, const u8 *buf, } bailout: - spin_unlock(demux-lock); + spin_unlock_irqrestore(demux-lock, flags); } void dvb_dmx_swfilter(struct dvb_demux *demux, const u8 *buf, size_t count) @@ -581,11 +584,13 @@ EXPORT_SYMBOL(dvb_dmx_swfilter_204); void dvb_dmx_swfilter_raw(struct dvb_demux *demux, const u8 *buf, size_t count) { - spin_lock(demux-lock); + unsigned long flags; + + spin_lock_irqsave(demux-lock, flags); demux-feed-cb.ts(buf, count, NULL, 0, demux-feed-feed.ts, DMX_OK); - spin_unlock(demux-lock); + spin_unlock_irqrestore(demux-lock, flags); } EXPORT_SYMBOL(dvb_dmx_swfilter_raw); -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v1 36/49] wireless: libertas_tf: prepare for enabling irq in complete()
Complete() will be run with interrupt enabled, so change to spin_lock_irqsave(). Cc: John W. Linville linvi...@tuxdriver.com Cc: libertas-...@lists.infradead.org Cc: linux-wirel...@vger.kernel.org Cc: net...@vger.kernel.org Signed-off-by: Ming Lei ming@canonical.com --- drivers/net/wireless/libertas_tf/if_usb.c |6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/libertas_tf/if_usb.c b/drivers/net/wireless/libertas_tf/if_usb.c index d576dd6..0e9e972 100644 --- a/drivers/net/wireless/libertas_tf/if_usb.c +++ b/drivers/net/wireless/libertas_tf/if_usb.c @@ -610,6 +610,8 @@ static inline void process_cmdrequest(int recvlength, uint8_t *recvbuff, struct if_usb_card *cardp, struct lbtf_private *priv) { + unsigned long flags; + if (recvlength LBS_CMD_BUFFER_SIZE) { lbtf_deb_usbd(cardp-udev-dev, The receive buffer is too large\n); @@ -619,12 +621,12 @@ static inline void process_cmdrequest(int recvlength, uint8_t *recvbuff, BUG_ON(!in_interrupt()); - spin_lock(priv-driver_lock); + spin_lock_irqsave(priv-driver_lock, flags); memcpy(priv-cmd_resp_buff, recvbuff + MESSAGE_HEADER_LEN, recvlength - MESSAGE_HEADER_LEN); kfree_skb(skb); lbtf_cmd_response_rx(priv); - spin_unlock(priv-driver_lock); + spin_unlock_irqrestore(priv-driver_lock, flags); } /** -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v1 41/49] media: usb: tm6000: prepare for enabling irq in complete()
Complete() will be run with interrupt enabled, so change to spin_lock_irqsave(). Cc: Mauro Carvalho Chehab mche...@redhat.com Cc: linux-me...@vger.kernel.org Signed-off-by: Ming Lei ming@canonical.com --- drivers/media/usb/tm6000/tm6000-video.c |5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/media/usb/tm6000/tm6000-video.c b/drivers/media/usb/tm6000/tm6000-video.c index cc1aa14..8bb440f 100644 --- a/drivers/media/usb/tm6000/tm6000-video.c +++ b/drivers/media/usb/tm6000/tm6000-video.c @@ -434,6 +434,7 @@ static void tm6000_irq_callback(struct urb *urb) struct tm6000_dmaqueue *dma_q = urb-context; struct tm6000_core *dev = container_of(dma_q, struct tm6000_core, vidq); int i; + unsigned long flags; switch (urb-status) { case 0: @@ -450,9 +451,9 @@ static void tm6000_irq_callback(struct urb *urb) break; } - spin_lock(dev-slock); + spin_lock_irqsave(dev-slock, flags); tm6000_isoc_copy(urb); - spin_unlock(dev-slock); + spin_unlock_irqrestore(dev-slock, flags); /* Reset urb buffers */ for (i = 0; i urb-number_of_packets; i++) { -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v1 44/49] sound: usb: midi: prepare for enabling irq in complete()
Complete() will be run with interrupt enabled, so change to spin_lock_irqsave(). Cc: Jaroslav Kysela pe...@perex.cz Cc: Takashi Iwai ti...@suse.de Cc: Clemens Ladisch clem...@ladisch.de Cc: alsa-de...@alsa-project.org Signed-off-by: Ming Lei ming@canonical.com --- sound/usb/midi.c |5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sound/usb/midi.c b/sound/usb/midi.c index b901f46..86af276 100644 --- a/sound/usb/midi.c +++ b/sound/usb/midi.c @@ -279,15 +279,16 @@ static void snd_usbmidi_out_urb_complete(struct urb* urb) struct out_urb_context *context = urb-context; struct snd_usb_midi_out_endpoint* ep = context-ep; unsigned int urb_index; + unsigned long flags; - spin_lock(ep-buffer_lock); + spin_lock_irqsave(ep-buffer_lock, flags); urb_index = context - ep-urbs; ep-active_urbs = ~(1 urb_index); if (unlikely(ep-drain_urbs)) { ep-drain_urbs = ~(1 urb_index); wake_up(ep-drain_wait); } - spin_unlock(ep-buffer_lock); + spin_unlock_irqrestore(ep-buffer_lock, flags); if (urb-status 0) { int err = snd_usbmidi_urb_error(urb-status); if (err 0) { -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v1 40/49] media: usb: tlg2300: prepare for enabling irq in complete()
Complete() will be run with interrupt enabled, so change to spin_lock_irqsave(). Cc: Mauro Carvalho Chehab mche...@redhat.com Cc: linux-me...@vger.kernel.org Signed-off-by: Ming Lei ming@canonical.com --- drivers/media/usb/tlg2300/pd-alsa.c |5 +++-- drivers/media/usb/tlg2300/pd-video.c |5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/media/usb/tlg2300/pd-alsa.c b/drivers/media/usb/tlg2300/pd-alsa.c index 3f3e141..65c46a2 100644 --- a/drivers/media/usb/tlg2300/pd-alsa.c +++ b/drivers/media/usb/tlg2300/pd-alsa.c @@ -141,6 +141,7 @@ static inline void handle_audio_data(struct urb *urb, int *period_elapsed) int len = urb-actual_length / stride; unsigned char *cp = urb-transfer_buffer; unsigned int oldptr = pa-rcv_position; + unsigned long flags; if (urb-actual_length == AUDIO_BUF_SIZE - 4) len -= (AUDIO_TRAILER_SIZE / stride); @@ -156,7 +157,7 @@ static inline void handle_audio_data(struct urb *urb, int *period_elapsed) memcpy(runtime-dma_area + oldptr * stride, cp, len * stride); /* update the statas */ - snd_pcm_stream_lock(pa-capture_pcm_substream); + snd_pcm_stream_lock_irqsave(pa-capture_pcm_substream, flags); pa-rcv_position+= len; if (pa-rcv_position = runtime-buffer_size) pa-rcv_position -= runtime-buffer_size; @@ -166,7 +167,7 @@ static inline void handle_audio_data(struct urb *urb, int *period_elapsed) pa-copied_position -= runtime-period_size; *period_elapsed = 1; } - snd_pcm_stream_unlock(pa-capture_pcm_substream); + snd_pcm_stream_unlock_irqrestore(pa-capture_pcm_substream, flags); } static void complete_handler_audio(struct urb *urb) diff --git a/drivers/media/usb/tlg2300/pd-video.c b/drivers/media/usb/tlg2300/pd-video.c index 8df668d..4e5bd07 100644 --- a/drivers/media/usb/tlg2300/pd-video.c +++ b/drivers/media/usb/tlg2300/pd-video.c @@ -151,11 +151,12 @@ static void init_copy(struct video_data *video, bool index) static bool get_frame(struct front_face *front, int *need_init) { struct videobuf_buffer *vb = front-curr_frame; + unsigned long flags; if (vb) return true; - spin_lock(front-queue_lock); + spin_lock_irqsave(front-queue_lock, flags); if (!list_empty(front-active)) { vb = list_entry(front-active.next, struct videobuf_buffer, queue); @@ -164,7 +165,7 @@ static bool get_frame(struct front_face *front, int *need_init) front-curr_frame = vb; list_del_init(vb-queue); } - spin_unlock(front-queue_lock); + spin_unlock_irqrestore(front-queue_lock, flags); return !!vb; } -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v1 48/49] staging: ced1401: prepare for enabling irq in complete()
Complete() will be run with interrupt enabled, so change to spin_lock_irqsave(). Signed-off-by: Ming Lei ming@canonical.com --- drivers/staging/ced1401/usb1401.c | 35 +++ 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/drivers/staging/ced1401/usb1401.c b/drivers/staging/ced1401/usb1401.c index 97c55f9..70d2f43 100644 --- a/drivers/staging/ced1401/usb1401.c +++ b/drivers/staging/ced1401/usb1401.c @@ -265,6 +265,7 @@ static void ced_writechar_callback(struct urb *pUrb) { DEVICE_EXTENSION *pdx = pUrb-context; int nGot = pUrb-actual_length; /* what we transferred */ + unsigned long flags; if (pUrb-status) { /* sync/async unlink faults aren't errors */ if (! @@ -275,24 +276,24 @@ static void ced_writechar_callback(struct urb *pUrb) __func__, pUrb-status); } - spin_lock(pdx-err_lock); + spin_lock_irqsave(pdx-err_lock, flags); pdx-errors = pUrb-status; - spin_unlock(pdx-err_lock); + spin_unlock_irqrestore(pdx-err_lock, flags); nGot = 0; /* and tidy up again if so */ - spin_lock(pdx-charOutLock); /* already at irq level */ + spin_lock_irqsave(pdx-charOutLock, flags);/* already at irq level */ pdx-dwOutBuffGet = 0; /* Reset the output buffer */ pdx-dwOutBuffPut = 0; pdx-dwNumOutput = 0; /* Clear the char count */ pdx-bPipeError[0] = 1; /* Flag an error for later */ pdx-bSendCharsPending = false; /* Allow other threads again */ - spin_unlock(pdx-charOutLock); /* already at irq level */ + spin_unlock_irqrestore(pdx-charOutLock, flags); /* already at irq level */ dev_dbg(pdx-interface-dev, %s - char out done, 0 chars sent, __func__); } else { dev_dbg(pdx-interface-dev, %s - char out done, %d chars sent, __func__, nGot); - spin_lock(pdx-charOutLock); /* already at irq level */ + spin_lock_irqsave(pdx-charOutLock, flags);/* already at irq level */ pdx-dwNumOutput -= nGot; /* Now adjust the char send buffer */ pdx-dwOutBuffGet += nGot; /* to match what we did */ if (pdx-dwOutBuffGet = OUTBUF_SZ) /* Can't do this any earlier as data could be overwritten */ @@ -305,7 +306,7 @@ static void ced_writechar_callback(struct urb *pUrb) unsigned int dwCount = pdx-dwNumOutput;/* maximum to send */ if ((pdx-dwOutBuffGet + dwCount) OUTBUF_SZ) /* does it cross buffer end? */ dwCount = OUTBUF_SZ - pdx-dwOutBuffGet; - spin_unlock(pdx-charOutLock); /* we are done with stuff that changes */ + spin_unlock_irqrestore(pdx-charOutLock, flags); /* we are done with stuff that changes */ memcpy(pdx-pCoherCharOut, pDat, dwCount); /* copy output data to the buffer */ usb_fill_bulk_urb(pdx-pUrbCharOut, pdx-udev, usb_sndbulkpipe(pdx-udev, @@ -318,7 +319,7 @@ static void ced_writechar_callback(struct urb *pUrb) iReturn = usb_submit_urb(pdx-pUrbCharOut, GFP_ATOMIC); dev_dbg(pdx-interface-dev, %s n=%d%s, __func__, dwCount, pDat); - spin_lock(pdx-charOutLock); /* grab lock for errors */ + spin_lock_irqsave(pdx-charOutLock, flags);/* grab lock for errors */ if (iReturn) { pdx-bPipeError[nPipe] = 1; /* Flag an error to be handled later */ pdx-bSendCharsPending = false; /* Allow other threads again */ @@ -329,7 +330,7 @@ static void ced_writechar_callback(struct urb *pUrb) } } else pdx-bSendCharsPending = false; /* Allow other threads again */ - spin_unlock(pdx-charOutLock); /* already at irq level */ + spin_unlock_irqrestore(pdx-charOutLock, flags); /* already at irq level */ } } @@ -505,8 +506,9 @@ static void staged_callback(struct urb *pUrb) unsigned int nGot = pUrb-actual_length;/* what we transferred */ bool bCancel = false; bool bRestartCharInput; /* used at the end */ + unsigned long flags; - spin_lock(pdx-stagedLock);/* stop ReadWriteMem() action while this routine is running */ + spin_lock_irqsave(pdx-stagedLock, flags); /* stop ReadWriteMem() action while this routine is running */
[PATCH v1 47/49] staging: bcm: prepare for enabling irq in complete()
Complete() will be run with interrupt enabled, so change to spin_lock_irqsave(). Signed-off-by: Ming Lei ming@canonical.com --- drivers/staging/bcm/InterfaceRx.c |5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/staging/bcm/InterfaceRx.c b/drivers/staging/bcm/InterfaceRx.c index 26f5bc7..00af901 100644 --- a/drivers/staging/bcm/InterfaceRx.c +++ b/drivers/staging/bcm/InterfaceRx.c @@ -47,6 +47,7 @@ static void read_bulk_callback(struct urb *urb) struct bcm_interface_adapter *psIntfAdapter = pRcb-psIntfAdapter; struct bcm_mini_adapter *Adapter = psIntfAdapter-psAdapter; struct bcm_leader *pLeader = urb-transfer_buffer; + unsigned long flags; if (unlikely(netif_msg_rx_status(Adapter))) pr_info(PFX %s: rx urb status %d length %d\n, @@ -129,9 +130,9 @@ static void read_bulk_callback(struct urb *urb) (sizeof(struct bcm_leader)), pLeader-PLength); skb-len = pLeader-PLength + sizeof(USHORT); - spin_lock(Adapter-control_queue_lock); + spin_lock_irqsave(Adapter-control_queue_lock, flags); ENQUEUEPACKET(Adapter-RxControlHead,Adapter-RxControlTail,skb); - spin_unlock(Adapter-control_queue_lock); + spin_unlock_irqretore(Adapter-control_queue_lock, flags); atomic_inc(Adapter-cntrlpktCnt); wake_up(Adapter-process_rx_cntrlpkt); -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v1 49/49] staging: vt6656: prepare for enabling irq in complete()
Complete() will be run with interrupt enabled, so change to spin_lock_irqsave(). Signed-off-by: Ming Lei ming@canonical.com --- drivers/staging/vt6656/usbpipe.c |9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/staging/vt6656/usbpipe.c b/drivers/staging/vt6656/usbpipe.c index 9b9122d..026c2c9 100644 --- a/drivers/staging/vt6656/usbpipe.c +++ b/drivers/staging/vt6656/usbpipe.c @@ -485,6 +485,7 @@ static void s_nsBulkInUsbIoCompleteRead(struct urb *urb) int bIndicateReceive = false; int bReAllocSkb = false; int status; + unsigned long flags; DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFOs_nsBulkInUsbIoCompleteRead\n); status = urb-status; @@ -515,18 +516,18 @@ static void s_nsBulkInUsbIoCompleteRead(struct urb *urb) STAvUpdateUSBCounter(pDevice-scStatistic.USB_BulkInStat, status); if (bIndicateReceive) { -spin_lock(pDevice-lock); +spin_lock_irqsave(pDevice-lock, flags); if (RXbBulkInProcessData(pDevice, pRCB, bytesRead) == true) bReAllocSkb = true; -spin_unlock(pDevice-lock); +spin_unlock_irqrestore(pDevice-lock, flags); } pRCB-Ref--; if (pRCB-Ref == 0) { DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFORxvFreeNormal %d \n,pDevice-NumRecvFreeList); -spin_lock(pDevice-lock); +spin_lock_irqsave(pDevice-lock, flags); RXvFreeRCB(pRCB, bReAllocSkb); -spin_unlock(pDevice-lock); +spin_unlock_irqrestore(pDevice-lock, flags); } return; -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v1 05/49] USB: usblp: prepare for enabling irq in complete()
On Sun, 18 Aug 2013 00:24:30 +0800 Ming Lei ming@canonical.com wrote: Complete() will be run with interrupt enabled, so change to spin_lock_irqsave(). Signed-off-by: Pete Zaitcev zait...@kotori.zaitcev.us Signed-off-by: Ming Lei ming@canonical.com Still looks good. -- P -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 1/6] drivers:usb:host:xhci.h Removing xhci_hcd from argument
On Saturday 17 August 2013 12:19 PM, Julia Lawall wrote: On Sat, 17 Aug 2013, Kumar Gaurav wrote: On Saturday 17 August 2013 12:30 AM, Greg KH wrote: On Sat, Aug 17, 2013 at 12:18:42AM +0530, Kumar Gaurav wrote: Removed struct xhci_hcd from xhci_readl fucntion as it's no more in use. --- drivers/usb/host/xhci.h |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.hthe index c338741..7cf0e41 100644 --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h @@ -1598,8 +1598,7 @@ static inline struct usb_hcd *xhci_to_hcd(struct xhci_hcd *xhci) /* TODO: copied from ehci.h - can be refactored? */ /* xHCI spec says all registers are little endian */ -static inline unsigned int xhci_readl(const struct xhci_hcd *xhci, - __le32 __iomem *regs) +static inline unsigned int xhci_readl(__le32 __iomem *regs) And you broke the build :( Sorry, that's not ok. greg k-h I'm writing patch to change function definition along with changes in program files where this function is called. After changing all files i built the module and it compiled as well. There were 6 files which were using xhci_read. I fixed all the calls and compiled. Am i missing anything? Please suggest then i'll send patches again I haven't followed along in detail, but I think Greg wants one patch that fixes both the definition and all of the calls, and not one patch for each file. julia yeah i understand that now. I wasn't aware of this before, i thought a series of patch would be required for multiple files. My bad. I'm resending in single patch Regards Kumar gaurav -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: octeon-usb and dwc2 in staging are for the same hw
From: Aaro Koskinen [mailto:aaro.koski...@iki.fi] Sent: Saturday, August 17, 2013 8:39 AM On Fri, Aug 16, 2013 at 08:02:27PM -0700, Greg KH wrote: dcw2 already supports different boards/systems, so perhaps there's a way to tie your board into that? It doesn't get very far: External DMA Mode not supported dwc2_hcd_init() FAILED, returning -22 Hi Greg, all, After taking a look at the Octeon driver, it looks like that controller uses a customized version of the DWC2 core - it has a different DMA engine than the one provided by the standard hardware. So in fact these two drivers are actually not for the same hw. I think it would be very complicated to combine both of these into a common driver. So in my opinion the best solution is to keep both drivers. -- Paul -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v2 3/4] staging: usbip: properly handle -l / --log option
This option is in the long options list, and it's handled in the option processing loop, but the optstring didn't include it. Signed-off-by: Anthony Foiani anthony.foi...@gmail.com --- drivers/staging/usbip/userspace/src/usbip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/usbip/userspace/src/usbip.c b/drivers/staging/usbip/userspace/src/usbip.c index 69ac4b5..b4f299e 100644 --- a/drivers/staging/usbip/userspace/src/usbip.c +++ b/drivers/staging/usbip/userspace/src/usbip.c @@ -152,7 +152,7 @@ int main(int argc, char *argv[]) usbip_use_stderr = 1; opterr = 0; for (;;) { - opt = getopt_long(argc, argv, +dt:, opts, NULL); + opt = getopt_long(argc, argv, +dlt:, opts, NULL); if (opt == -1) break; -- 1.8.1.4 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v2 4/4] staging: usbip: fix up alignment in long options list
Re-align the option lists. Signed-off-by: Anthony Foiani anthony.foi...@gmail.com --- drivers/staging/usbip/userspace/src/usbip.c | 8 drivers/staging/usbip/userspace/src/usbipd.c | 12 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/staging/usbip/userspace/src/usbip.c b/drivers/staging/usbip/userspace/src/usbip.c index b4f299e..04a5f20 100644 --- a/drivers/staging/usbip/userspace/src/usbip.c +++ b/drivers/staging/usbip/userspace/src/usbip.c @@ -139,10 +139,10 @@ static int run_command(const struct command *cmd, int argc, char *argv[]) int main(int argc, char *argv[]) { static const struct option opts[] = { - { debug, no_argument, NULL, 'd' }, - { log, no_argument, NULL, 'l' }, - { tcp-port, required_argument, NULL, 't' }, - { NULL,0, NULL, 0 } + { debug,no_argument, NULL, 'd' }, + { log, no_argument, NULL, 'l' }, + { tcp-port, required_argument, NULL, 't' }, + { NULL, 0, NULL, 0 } }; char *cmd; diff --git a/drivers/staging/usbip/userspace/src/usbipd.c b/drivers/staging/usbip/userspace/src/usbipd.c index c0bb689..1659683 100644 --- a/drivers/staging/usbip/userspace/src/usbipd.c +++ b/drivers/staging/usbip/userspace/src/usbipd.c @@ -560,13 +560,13 @@ static int do_standalone_mode(int daemonize) int main(int argc, char *argv[]) { static const struct option longopts[] = { - { daemon, no_argument, NULL, 'D' }, - { debug, no_argument, NULL, 'd' }, - { pid, optional_argument, NULL, 'P' }, + { daemon, no_argument, NULL, 'D' }, + { debug,no_argument, NULL, 'd' }, + { pid, optional_argument, NULL, 'P' }, { tcp-port, required_argument, NULL, 't' }, - { help,no_argument, NULL, 'h' }, - { version, no_argument, NULL, 'v' }, - { NULL, 0, NULL, 0 } + { help, no_argument, NULL, 'h' }, + { version, no_argument, NULL, 'v' }, + { NULL, 0, NULL, 0 } }; enum { -- 1.8.1.4 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v2 1/4] staging: usbip: add -P / --pid option to save usbipd process id
Introduce option -P / --pid to request that usbipd save its PID to a file while running. Signed-off-by: Anthony Foiani anthony.foi...@gmail.com --- drivers/staging/usbip/userspace/src/usbipd.c | 40 +++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/drivers/staging/usbip/userspace/src/usbipd.c b/drivers/staging/usbip/userspace/src/usbipd.c index 1ecca9d..f31b8b4 100644 --- a/drivers/staging/usbip/userspace/src/usbipd.c +++ b/drivers/staging/usbip/userspace/src/usbipd.c @@ -50,6 +50,8 @@ #define MAIN_LOOP_TIMEOUT 10 +#define DEFAULT_PID_FILE /var/run/ PROGNAME .pid + static const char usbip_version_string[] = PACKAGE_STRING; static const char usbipd_help_string[] = @@ -60,6 +62,10 @@ static const char usbipd_help_string[] = -d, --debug\n Print debugging information.\n \n + -PFILE, --pid FILE\n + Write process id to FILE.\n + If no FILE specified, use DEFAULT_PID_FILE \n + \n -h, --help\n Print this help.\n \n @@ -439,6 +445,31 @@ static void set_signal(void) sigaction(SIGCLD, act, NULL); } +static const char *pid_file; + +static void write_pid_file() +{ + if (pid_file) { + dbg(creating pid file %s, pid_file); + FILE *fp = fopen(pid_file, w); + if (!fp) { + err(pid_file: %s: %d (%s), + pid_file, errno, strerror(errno)); + return; + } + fprintf(fp, %d\n, getpid()); + fclose(fp); + } +} + +static void remove_pid_file() +{ + if (pid_file) { + dbg(removing pid file %s, pid_file); + unlink(pid_file); + } +} + static int do_standalone_mode(int daemonize) { struct addrinfo *ai_head; @@ -465,6 +496,7 @@ static int do_standalone_mode(int daemonize) usbip_use_syslog = 1; } set_signal(); + write_pid_file(); ai_head = do_getaddrinfo(NULL, PF_UNSPEC); if (!ai_head) { @@ -527,6 +559,7 @@ int main(int argc, char *argv[]) static const struct option longopts[] = { { daemon, no_argument, NULL, 'D' }, { debug, no_argument, NULL, 'd' }, + { pid, optional_argument, NULL, 'P' }, { help,no_argument, NULL, 'h' }, { version, no_argument, NULL, 'v' }, { NULL, 0, NULL, 0 } @@ -540,6 +573,7 @@ int main(int argc, char *argv[]) int daemonize = 0; int opt, rc = -1; + pid_file = NULL; usbip_use_stderr = 1; usbip_use_syslog = 0; @@ -549,7 +583,7 @@ int main(int argc, char *argv[]) cmd = cmd_standalone_mode; for (;;) { - opt = getopt_long(argc, argv, Ddhv, longopts, NULL); + opt = getopt_long(argc, argv, DdP::hv, longopts, NULL); if (opt == -1) break; @@ -564,6 +598,9 @@ int main(int argc, char *argv[]) case 'h': cmd = cmd_help; break; + case 'P': + pid_file = optarg ? optarg : DEFAULT_PID_FILE; + break; case 'v': cmd = cmd_version; break; @@ -577,6 +614,7 @@ int main(int argc, char *argv[]) switch (cmd) { case cmd_standalone_mode: rc = do_standalone_mode(daemonize); + remove_pid_file(); break; case cmd_version: printf(PROGNAME (%s)\n, usbip_version_string); -- 1.8.1.4 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH v2 0/4] staging: usbip: minor features and bug fix
In the course of adapting the USBIP tools to our project, I added a few features: * Specify USBIP TCP/IP port number for 'usbip' and 'usbipd' * Request that 'usbipd' write its process id to a file I did some minor cleaning along the way: some checkpatch, later to repair alignments broken while adding new options. Finally, the log option was not properly accepted by 'usbip'. This is based off linux-next commit 1e712b0818569846d6b926ecb6bf32b3dea73609 (which is tag next-20130816) Original thread at these urls: http://markmail.org/thread/6re24e7r443kn2nj http://www.mail-archive.com/linux-usb@vger.kernel.org/msg23959.html Changes from v1 - v2: * Use -t / --tcp-port instead of -p / --port; the 'usbip' command already has a -p option for the usbip port in use. * Make sure that 'usbipd' records its PID *after* daemonizing. * Drop first three patches from v1 (they're already accepted). Anthony Foiani (4): staging: usbip: add -P / --pid option to save usbipd process id staging: usbip: set usbipd server port via -t / --tcp-port option. staging: usbip: properly handle -l / --log option staging: usbip: fix up alignment in long options list drivers/staging/usbip/userspace/src/usbip.c| 15 -- .../staging/usbip/userspace/src/usbip_network.c| 30 .../staging/usbip/userspace/src/usbip_network.h| 5 +- drivers/staging/usbip/userspace/src/usbipd.c | 57 +++--- 4 files changed, 94 insertions(+), 13 deletions(-) -- 1.8.1.4 -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: octeon-usb and dwc2 in staging are for the same hw
On Sat, Aug 17, 2013 at 08:44:18PM +, Paul Zimmerman wrote: From: Aaro Koskinen [mailto:aaro.koski...@iki.fi] Sent: Saturday, August 17, 2013 8:39 AM On Fri, Aug 16, 2013 at 08:02:27PM -0700, Greg KH wrote: dcw2 already supports different boards/systems, so perhaps there's a way to tie your board into that? It doesn't get very far: External DMA Mode not supported dwc2_hcd_init() FAILED, returning -22 Hi Greg, all, After taking a look at the Octeon driver, it looks like that controller uses a customized version of the DWC2 core - it has a different DMA engine than the one provided by the standard hardware. So in fact these two drivers are actually not for the same hw. I think it would be very complicated to combine both of these into a common driver. So in my opinion the best solution is to keep both drivers. Ok, thanks for taking the time to look at it. I guess we will end up with multiple drivers, making it easier for the developers involved :) thanks, greg k-h -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: I: Sierra.c USB Serial Driver FAQ/Feature Request
On 08/17/2013 04:58 PM, Forest Bond wrote: snip... Okay, I published it here: http://www.alittletooquiet.net/media/2131024%20CDMA%20EVDO%20CnS%20Reference.pdf For the record, the document states its license as follows: http://creativecommons.org/licenses/by-nd/3.0/us/ You are free: to Share — to copy, distribute,display, and perform the work Under the following conditions: Attribution. You must attribute the work in the manner specified by the author or licensor (but not in any way that suggests that they endorse you or your use of the work). No Derivative Works. You may not alter, transform, or build upon this work. Thanks, Forest Maybe this will move the ball. We'll see. Thank you. -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[3.11-rc5..] NULL pointer dereference, lockup after XHCI device dropped out
Hi, I hit a BUG followed by a lockup when trying to wipe a new external USB 3.0 1TB 2.5 Western Digital My Passport (WDBBEP0010BBK-EESN) HDD. The following command is used (with sudo): dd if=/dev/zero of=/dev/sdd bs=1M In another shell, I kept sending a USR1 signal to watch progress (maybe not related, but mentioned for completeness): while killall -USR1 dd; do sleep 30; done While doing this over SSH, another KDE session was open with someone playing the Java game Minecraft. I have so far reproduced this lockup three times. The first time, the lock-up occured after: 84838+0 records in 84838+0 records out 88959090688 bytes (89 GB) copied, 789.707 s, 113 MB/s I have no logs from the first lockup. The second time (after a reboot): 388514+1 records in 388514+1 records out 407386685440 bytes (407 GB) copied, 3881.25 s, 105 MB/s The second log part (not third lockup log) below is from this session. I omitted the remaining lines that are printed when the CPU got hung. The third BUG occured 22 minutes (156 GB) after rebooting and running dd and has similar log entries to the previous lock-up. This kernel used the same kernel sources, but with XHCI debugging enabled. No differences were noticable in the console output, other than the missing xHCI xhci_drop_endpoint called with disabled ep message in the new logs. See the first console output below. I have no idea why the USB 3.0 HDD would drop out, but that should not trigger a NULL pointer dereference anyhow. The desktop was running kernel v3.11-rc5-35-gf1d6e17 plus three r8169 patches that are unrelated to this issue and has 24 GB RAM and a i5-2320 CPU. I do not know how to easily reproduce this bug, the current reproduction method described above takes time. One possibly related bug is https://bugzilla.kernel.org/show_bug.cgi?id=51641, but I do not have a panic. Any ideas? If you want me to test something or open a new bug, let me know. Regards, Peter -- === third lockup log === [ 17.724296] usb 6-2: new SuperSpeed USB device number 2 using xhci_hcd [ 17.746522] usb 6-2: Parent hub missing LPM exit latency info. Power management will be impacted. [ 17.759786] usb 6-2: New USB device found, idVendor=1058, idProduct=0748 [ 17.766494] usb 6-2: New USB device strings: Mfr=1, Product=2, SerialNumber=5 [ 17.773628] usb 6-2: Product: My Passport 0748 [ 17.778071] usb 6-2: Manufacturer: Western Digital [ 17.782868] usb 6-2: SerialNumber: 57584231414E35383439 [ 17.790595] usb-storage 6-2:1.0: USB Mass Storage device detected [ 17.796995] scsi9 : usb-storage 6-2:1.0 [ 18.800604] scsi 9:0:0:0: Direct-Access WD My Passport 0748 1022 PQ: 0 ANSI: 6 [ 18.808994] scsi 9:0:0:1: Enclosure WD SES Device 1022 PQ: 0 ANSI: 6 [ 18.817618] sd 9:0:0:0: Attached scsi generic sg4 type 0 [ 18.819416] sd 9:0:0:0: [sdd] Spinning up disk... [ 18.827943] scsi 9:0:0:1: Attached scsi generic sg5 type 13 [ 19.823185] ..ready [ 20.828276] sd 9:0:0:0: [sdd] 1953458176 512-byte logical blocks: (1.00 TB/931 GiB) [ 20.836548] sd 9:0:0:0: [sdd] Write Protect is off [ 20.841352] sd 9:0:0:0: [sdd] Mode Sense: 47 00 10 08 [ 20.847172] sd 9:0:0:0: [sdd] No Caching mode page present [ 20.852674] sd 9:0:0:0: [sdd] Assuming drive cache: write through [ 20.860714] sd 9:0:0:0: [sdd] No Caching mode page present [ 20.866208] sd 9:0:0:0: [sdd] Assuming drive cache: write through [ 20.885996] sdd: unknown partition table [ 20.891706] sd 9:0:0:0: [sdd] No Caching mode page present [ 20.897214] sd 9:0:0:0: [sdd] Assuming drive cache: write through [ 20.903310] sd 9:0:0:0: [sdd] Attached SCSI disk [ 1355.971539] usb 6-2: USB disconnect, device number 2 [ 1385.834230] sd 9:0:0:0: Device offlined - not ready after error recovery [ 1385.842002] sd 9:0:0:0: [sdd] Unhandled error code [ 1385.846811] sd 9:0:0:0: [sdd] [ 1385.849980] Result: hostbyte=DID_NO_CONNECT driverbyte=DRIVER_OK [ 1385.856015] sd 9:0:0:0: [sdd] CDB: [ 1385.859518] Write(10): 2a 00 10 4f eb 00 00 00 f0 00 [ 1385.864748] end_request: I/O error, dev sdd, sector 273672960 [ 1385.870509] quiet_error: 6 callbacks suppressed [ 1385.875047] Buffer I/O error on device sdd, logical block 34209120 [ 1385.881240] lost page write due to I/O error on sdd [ 1385.886144] Buffer I/O error on device sdd, logical block 34209121 [ 1385.892326] lost page write due to I/O error on sdd [ 1385.897221] Buffer I/O error on device sdd, logical block 34209122 [ 1385.903405] lost page write due to I/O error on sdd [ 1385.908290] Buffer I/O error on device sdd, logical block 34209123 [ 1385.914478] lost page write due to I/O error on sdd [ 1385.919372] Buffer I/O error on device sdd, logical block 34209124 [ 1385.925557] lost page write due to I/O error on sdd [ 1385.930448] Buffer I/O error on device sdd, logical block 34209125 [ 1385.936630] lost page write due to I/O error on sdd [ 1385.941530] Buffer I/O error on device sdd, logical
Re: [Bug] [Sony VAIO SVT15117CXS] USB 2.0 ports not working with any USB device
On Sat, 17 Aug 2013, Kevin Archer wrote: Issue similar to Ming Lei post of June 26th 2013 USB 2.0 ports appear to operate correctly in 2.6.33 and 2.6.39 but not after going to 3.1 See detailed log in below link: https://bugs.launchpad.net/bugs/1210858 The log file contains this line: [2.030639] irq 16: nobody cared (try booting with the irqpoll option) Not surprisingly, IRQ 16 is the one used by the EHCI (USB-2) controller. No doubt that's why you were asked to test with the irqpoll option. This problem is most likely caused by some other part of the kernel. It won't be easy to tell which, however. Do any kernel versions work okay? To get more information, run a kernel that was built with CONFIG_USB_DEBUG enabled. Then go to the /sys/kernel/debug/usb/ehci/:00:1a.0 directory and post a copy of the registers file there. In fact, get two copies of that file: one before plugging any device into a USB-2 port, and one while a device is plugged in. Another thing you can try: Run a kernel with CONFIG_DUMMY_IRQ enabled. Do: rmmod ath9k echo :00:1a.0 /sys/bus/pci/drivers/ehci-pci/unbind modprobe dummy-irq irq=16 and see what shows up in the dmesg log. Alan Stern -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH v1 02/49] USB: sg: prepare for enabling irq in complete()
On Sun, 18 Aug 2013, Ming Lei wrote: Complete() will be run with interrupt enabled, so change to spin_lock_irqsave(). Cc: Alan Stern st...@rowland.harvard.edu Signed-off-by: Ming Lei ming@canonical.com --- drivers/usb/core/message.c |5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c index 82927e1..8bba734 100644 --- a/drivers/usb/core/message.c +++ b/drivers/usb/core/message.c @@ -266,8 +266,9 @@ static void sg_complete(struct urb *urb) { struct usb_sg_request *io = urb-context; int status = urb-status; + unsigned long flags; - spin_lock(io-lock); + spin_lock_irqsave(io-lock, flags); /* In 2.5 we require hcds' endpoint queues not to progress after fault * reports, until the completion callback (this!) returns. That lets @@ -326,7 +327,7 @@ static void sg_complete(struct urb *urb) if (!io-count) complete(io-complete); - spin_unlock(io-lock); + spin_unlock_irqrestore(io-lock, flags); } As far as I can see, these don't need to disable interrupts. All they protect against is the code in usb_sg_wait() and usb_sg_cancel(), which both run in process context. But will lockdep complain if they don't disable interrupts? Alan Stern -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[3.11-rc5..] NULL pointer dereference in bdi_writeback_workfn
Forwarding this message to Tejun and Jens, because it concerns a bug in the block layer. Alan Stern -- Forwarded message -- Date: Sun, 18 Aug 2013 00:12:10 +0200 From: Peter Wu lekenst...@gmail.com To: linux-usb@vger.kernel.org, linux-ker...@vger.kernel.org Subject: [3.11-rc5..] NULL pointer dereference, lockup after XHCI device dropped out Hi, I hit a BUG followed by a lockup when trying to wipe a new external USB 3.0 1TB 2.5 Western Digital My Passport (WDBBEP0010BBK-EESN) HDD. The following command is used (with sudo): dd if=/dev/zero of=/dev/sdd bs=1M In another shell, I kept sending a USR1 signal to watch progress (maybe not related, but mentioned for completeness): while killall -USR1 dd; do sleep 30; done While doing this over SSH, another KDE session was open with someone playing the Java game Minecraft. I have so far reproduced this lockup three times. The first time, the lock-up occured after: 84838+0 records in 84838+0 records out 88959090688 bytes (89 GB) copied, 789.707 s, 113 MB/s I have no logs from the first lockup. The second time (after a reboot): 388514+1 records in 388514+1 records out 407386685440 bytes (407 GB) copied, 3881.25 s, 105 MB/s The second log part (not third lockup log) below is from this session. I omitted the remaining lines that are printed when the CPU got hung. The third BUG occured 22 minutes (156 GB) after rebooting and running dd and has similar log entries to the previous lock-up. This kernel used the same kernel sources, but with XHCI debugging enabled. No differences were noticable in the console output, other than the missing xHCI xhci_drop_endpoint called with disabled ep message in the new logs. See the first console output below. I have no idea why the USB 3.0 HDD would drop out, but that should not trigger a NULL pointer dereference anyhow. The desktop was running kernel v3.11-rc5-35-gf1d6e17 plus three r8169 patches that are unrelated to this issue and has 24 GB RAM and a i5-2320 CPU. I do not know how to easily reproduce this bug, the current reproduction method described above takes time. One possibly related bug is https://bugzilla.kernel.org/show_bug.cgi?id=51641, but I do not have a panic. Any ideas? If you want me to test something or open a new bug, let me know. Regards, Peter -- === third lockup log === [ 17.724296] usb 6-2: new SuperSpeed USB device number 2 using xhci_hcd [ 17.746522] usb 6-2: Parent hub missing LPM exit latency info. Power management will be impacted. [ 17.759786] usb 6-2: New USB device found, idVendor=1058, idProduct=0748 [ 17.766494] usb 6-2: New USB device strings: Mfr=1, Product=2, SerialNumber=5 [ 17.773628] usb 6-2: Product: My Passport 0748 [ 17.778071] usb 6-2: Manufacturer: Western Digital [ 17.782868] usb 6-2: SerialNumber: 57584231414E35383439 [ 17.790595] usb-storage 6-2:1.0: USB Mass Storage device detected [ 17.796995] scsi9 : usb-storage 6-2:1.0 [ 18.800604] scsi 9:0:0:0: Direct-Access WD My Passport 0748 1022 PQ: 0 ANSI: 6 [ 18.808994] scsi 9:0:0:1: Enclosure WD SES Device 1022 PQ: 0 ANSI: 6 [ 18.817618] sd 9:0:0:0: Attached scsi generic sg4 type 0 [ 18.819416] sd 9:0:0:0: [sdd] Spinning up disk... [ 18.827943] scsi 9:0:0:1: Attached scsi generic sg5 type 13 [ 19.823185] ..ready [ 20.828276] sd 9:0:0:0: [sdd] 1953458176 512-byte logical blocks: (1.00 TB/931 GiB) [ 20.836548] sd 9:0:0:0: [sdd] Write Protect is off [ 20.841352] sd 9:0:0:0: [sdd] Mode Sense: 47 00 10 08 [ 20.847172] sd 9:0:0:0: [sdd] No Caching mode page present [ 20.852674] sd 9:0:0:0: [sdd] Assuming drive cache: write through [ 20.860714] sd 9:0:0:0: [sdd] No Caching mode page present [ 20.866208] sd 9:0:0:0: [sdd] Assuming drive cache: write through [ 20.885996] sdd: unknown partition table [ 20.891706] sd 9:0:0:0: [sdd] No Caching mode page present [ 20.897214] sd 9:0:0:0: [sdd] Assuming drive cache: write through [ 20.903310] sd 9:0:0:0: [sdd] Attached SCSI disk [ 1355.971539] usb 6-2: USB disconnect, device number 2 [ 1385.834230] sd 9:0:0:0: Device offlined - not ready after error recovery [ 1385.842002] sd 9:0:0:0: [sdd] Unhandled error code [ 1385.846811] sd 9:0:0:0: [sdd] [ 1385.849980] Result: hostbyte=DID_NO_CONNECT driverbyte=DRIVER_OK [ 1385.856015] sd 9:0:0:0: [sdd] CDB: [ 1385.859518] Write(10): 2a 00 10 4f eb 00 00 00 f0 00 [ 1385.864748] end_request: I/O error, dev sdd, sector 273672960 [ 1385.870509] quiet_error: 6 callbacks suppressed [ 1385.875047] Buffer I/O error on device sdd, logical block 34209120 [ 1385.881240] lost page write due to I/O error on sdd [ 1385.886144] Buffer I/O error on device sdd, logical block 34209121 [ 1385.892326] lost page write due to I/O error on sdd [ 1385.897221] Buffer I/O error on device sdd, logical block 34209122 [ 1385.903405] lost page write due to I/O error on sdd [ 1385.908290] Buffer I/O error on device sdd, logical block
Re: [PATCH v1 26/49] input: cm109: prepare for enabling irq in complete()
Hi Ming, On Sun, Aug 18, 2013 at 12:24:51AM +0800, Ming Lei wrote: Complete() will be run with interrupt enabled, so change to spin_lock_irqsave(). I think cm109 needs some love in it's URB handling, but this patch does not change anything, so: Acked-by: Dmitry Torokhov dmitry.torok...@gmail.com Or do you want me to pick it up for my tree? Thanks. -- Dmitry -- To unsubscribe from this list: send the line unsubscribe linux-usb in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html