From patchwork Thu Mar 3 18:45:16 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivo van Doorn X-Patchwork-Id: 607011 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p23Imj2r021009 for ; Thu, 3 Mar 2011 18:49:20 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758701Ab1CCStJ (ORCPT ); Thu, 3 Mar 2011 13:49:09 -0500 Received: from mail-wy0-f174.google.com ([74.125.82.174]:35605 "EHLO mail-wy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758699Ab1CCStI (ORCPT ); Thu, 3 Mar 2011 13:49:08 -0500 Received: by mail-wy0-f174.google.com with SMTP id 36so1356532wyg.19 for ; Thu, 03 Mar 2011 10:49:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:subject:date:user-agent:cc:references :in-reply-to:mime-version:content-type:content-transfer-encoding :message-id; bh=Xr+22q/LXUiYBHvmnMI0j3wEh81gm7qYC671HJkPyC0=; b=T22LT2Pfz7CvSlsKxKRoXSBN42OZAwr2c+p4zQo8ooIoH4XAOqUZTbNBQMyPS3pVWU XpN2g8GrUvIgBgFbm1lk77wYZYJF1AyTRrtfMzOtqQnxF5+O6kNwbAz+GMNYxzw4tc21 Cl/uTK1jqu6SuKtN2Duo3cbA47RSXC+ow2ehk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:date:user-agent:cc:references:in-reply-to :mime-version:content-type:content-transfer-encoding:message-id; b=dVuDLmEudoNHrebN8hB6+krey0wpVyEfSO+KMmLCnJkmB/QVCT4jfkdPZM5ZIjbf3Z R0I1VUdz+q+pNaYbhHZiAEKmTZkhCmbFSDsVN9F5hM9nWvjp8zVgvY408U05XQnehuGI 39GaxVmKWalqwHoTapzfchaNDksNLzWkNGmXw= Received: by 10.216.46.193 with SMTP id r43mr948371web.20.1299178148094; Thu, 03 Mar 2011 10:49:08 -0800 (PST) Received: from localhost.localdomain (g121037.upc-g.chello.nl [80.57.121.37]) by mx.google.com with ESMTPS id j49sm738659wer.14.2011.03.03.10.49.00 (version=SSLv3 cipher=OTHER); Thu, 03 Mar 2011 10:49:04 -0800 (PST) From: Ivo van Doorn To: "John W. Linville" Subject: [PATCH 14/19] rt2x00: Revise irqmask locking for PCI devices Date: Thu, 3 Mar 2011 19:45:16 +0100 User-Agent: KMail/1.13.5 (Linux/2.6.32.26-175.fc12.x86_64; KDE/4.4.5; x86_64; ; ) Cc: linux-wireless@vger.kernel.org, users@rt2x00.serialmonkey.com References: <201103031938.56423.IvDoorn@gmail.com> <201103031944.33950.IvDoorn@gmail.com> <201103031944.54527.IvDoorn@gmail.com> In-Reply-To: <201103031944.54527.IvDoorn@gmail.com> MIME-Version: 1.0 Message-Id: <201103031945.17614.IvDoorn@gmail.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Thu, 03 Mar 2011 18:49:20 +0000 (UTC) diff --git a/drivers/net/wireless/rt2x00/rt2400pci.c b/drivers/net/wireless/rt2x00/rt2400pci.c index 9016c00..80f4988 100644 --- a/drivers/net/wireless/rt2x00/rt2400pci.c +++ b/drivers/net/wireless/rt2x00/rt2400pci.c @@ -1317,27 +1317,25 @@ static void rt2400pci_txdone(struct rt2x00_dev *rt2x00dev, static void rt2400pci_enable_interrupt(struct rt2x00_dev *rt2x00dev, struct rt2x00_field32 irq_field) { - unsigned long flags; u32 reg; /* * Enable a single interrupt. The interrupt mask register * access needs locking. */ - spin_lock_irqsave(&rt2x00dev->irqmask_lock, flags); + spin_lock_irq(&rt2x00dev->irqmask_lock); rt2x00pci_register_read(rt2x00dev, CSR8, ®); rt2x00_set_field32(®, irq_field, 0); rt2x00pci_register_write(rt2x00dev, CSR8, reg); - spin_unlock_irqrestore(&rt2x00dev->irqmask_lock, flags); + spin_unlock_irq(&rt2x00dev->irqmask_lock); } static void rt2400pci_txstatus_tasklet(unsigned long data) { struct rt2x00_dev *rt2x00dev = (struct rt2x00_dev *)data; u32 reg; - unsigned long flags; /* * Handle all tx queues. @@ -1349,7 +1347,7 @@ static void rt2400pci_txstatus_tasklet(unsigned long data) /* * Enable all TXDONE interrupts again. */ - spin_lock_irqsave(&rt2x00dev->irqmask_lock, flags); + spin_lock_irq(&rt2x00dev->irqmask_lock); rt2x00pci_register_read(rt2x00dev, CSR8, ®); rt2x00_set_field32(®, CSR8_TXDONE_TXRING, 0); @@ -1357,7 +1355,7 @@ static void rt2400pci_txstatus_tasklet(unsigned long data) rt2x00_set_field32(®, CSR8_TXDONE_PRIORING, 0); rt2x00pci_register_write(rt2x00dev, CSR8, reg); - spin_unlock_irqrestore(&rt2x00dev->irqmask_lock, flags); + spin_unlock_irq(&rt2x00dev->irqmask_lock); } static void rt2400pci_tbtt_tasklet(unsigned long data) @@ -1378,7 +1376,6 @@ static irqreturn_t rt2400pci_interrupt(int irq, void *dev_instance) { struct rt2x00_dev *rt2x00dev = dev_instance; u32 reg, mask; - unsigned long flags; /* * Get the interrupt sources & saved to local variable. @@ -1420,13 +1417,13 @@ static irqreturn_t rt2400pci_interrupt(int irq, void *dev_instance) * Disable all interrupts for which a tasklet was scheduled right now, * the tasklet will reenable the appropriate interrupts. */ - spin_lock_irqsave(&rt2x00dev->irqmask_lock, flags); + spin_lock(&rt2x00dev->irqmask_lock); rt2x00pci_register_read(rt2x00dev, CSR8, ®); reg |= mask; rt2x00pci_register_write(rt2x00dev, CSR8, reg); - spin_unlock_irqrestore(&rt2x00dev->irqmask_lock, flags); + spin_unlock(&rt2x00dev->irqmask_lock); diff --git a/drivers/net/wireless/rt2x00/rt2500pci.c b/drivers/net/wireless/rt2x00/rt2500pci.c index 0fbc18c..635f804 100644 --- a/drivers/net/wireless/rt2x00/rt2500pci.c +++ b/drivers/net/wireless/rt2x00/rt2500pci.c @@ -1449,27 +1449,25 @@ static void rt2500pci_txdone(struct rt2x00_dev *rt2x00dev, static void rt2500pci_enable_interrupt(struct rt2x00_dev *rt2x00dev, struct rt2x00_field32 irq_field) { - unsigned long flags; u32 reg; /* * Enable a single interrupt. The interrupt mask register * access needs locking. */ - spin_lock_irqsave(&rt2x00dev->irqmask_lock, flags); + spin_lock_irq(&rt2x00dev->irqmask_lock); rt2x00pci_register_read(rt2x00dev, CSR8, ®); rt2x00_set_field32(®, irq_field, 0); rt2x00pci_register_write(rt2x00dev, CSR8, reg); - spin_unlock_irqrestore(&rt2x00dev->irqmask_lock, flags); + spin_unlock_irq(&rt2x00dev->irqmask_lock); } static void rt2500pci_txstatus_tasklet(unsigned long data) { struct rt2x00_dev *rt2x00dev = (struct rt2x00_dev *)data; u32 reg; - unsigned long flags; /* * Handle all tx queues. @@ -1481,7 +1479,7 @@ static void rt2500pci_txstatus_tasklet(unsigned long data) /* * Enable all TXDONE interrupts again. */ - spin_lock_irqsave(&rt2x00dev->irqmask_lock, flags); + spin_lock_irq(&rt2x00dev->irqmask_lock); rt2x00pci_register_read(rt2x00dev, CSR8, ®); rt2x00_set_field32(®, CSR8_TXDONE_TXRING, 0); @@ -1489,7 +1487,7 @@ static void rt2500pci_txstatus_tasklet(unsigned long data) rt2x00_set_field32(®, CSR8_TXDONE_PRIORING, 0); rt2x00pci_register_write(rt2x00dev, CSR8, reg); - spin_unlock_irqrestore(&rt2x00dev->irqmask_lock, flags); + spin_unlock_irq(&rt2x00dev->irqmask_lock); } static void rt2500pci_tbtt_tasklet(unsigned long data) @@ -1510,7 +1508,6 @@ static irqreturn_t rt2500pci_interrupt(int irq, void *dev_instance) { struct rt2x00_dev *rt2x00dev = dev_instance; u32 reg, mask; - unsigned long flags; /* * Get the interrupt sources & saved to local variable. @@ -1552,13 +1549,13 @@ static irqreturn_t rt2500pci_interrupt(int irq, void *dev_instance) * Disable all interrupts for which a tasklet was scheduled right now, * the tasklet will reenable the appropriate interrupts. */ - spin_lock_irqsave(&rt2x00dev->irqmask_lock, flags); + spin_lock(&rt2x00dev->irqmask_lock); rt2x00pci_register_read(rt2x00dev, CSR8, ®); reg |= mask; rt2x00pci_register_write(rt2x00dev, CSR8, reg); - spin_unlock_irqrestore(&rt2x00dev->irqmask_lock, flags); + spin_unlock(&rt2x00dev->irqmask_lock); return IRQ_HANDLED; } diff --git a/drivers/net/wireless/rt2x00/rt2800pci.c b/drivers/net/wireless/rt2x00/rt2800pci.c index 1b5753b..7e610f6 100644 --- a/drivers/net/wireless/rt2x00/rt2800pci.c +++ b/drivers/net/wireless/rt2x00/rt2800pci.c @@ -765,18 +765,17 @@ static void rt2800pci_txdone(struct rt2x00_dev *rt2x00dev) static void rt2800pci_enable_interrupt(struct rt2x00_dev *rt2x00dev, struct rt2x00_field32 irq_field) { - unsigned long flags; u32 reg; /* * Enable a single interrupt. The interrupt mask register * access needs locking. */ - spin_lock_irqsave(&rt2x00dev->irqmask_lock, flags); + spin_lock_irq(&rt2x00dev->irqmask_lock); rt2800_register_read(rt2x00dev, INT_MASK_CSR, ®); rt2x00_set_field32(®, irq_field, 1); rt2800_register_write(rt2x00dev, INT_MASK_CSR, reg); - spin_unlock_irqrestore(&rt2x00dev->irqmask_lock, flags); + spin_unlock_irq(&rt2x00dev->irqmask_lock); } static void rt2800pci_txstatus_tasklet(unsigned long data) @@ -862,7 +861,6 @@ static irqreturn_t rt2800pci_interrupt(int irq, void *dev_instance) { struct rt2x00_dev *rt2x00dev = dev_instance; u32 reg, mask; - unsigned long flags; /* Read status and ACK all interrupts */ rt2800_register_read(rt2x00dev, INT_SOURCE_CSR, ®); @@ -905,11 +903,11 @@ static irqreturn_t rt2800pci_interrupt(int irq, void *dev_instance) * Disable all interrupts for which a tasklet was scheduled right now, * the tasklet will reenable the appropriate interrupts. */ - spin_lock_irqsave(&rt2x00dev->irqmask_lock, flags); + spin_lock(&rt2x00dev->irqmask_lock); rt2800_register_read(rt2x00dev, INT_MASK_CSR, ®); reg &= mask; rt2800_register_write(rt2x00dev, INT_MASK_CSR, reg); - spin_unlock_irqrestore(&rt2x00dev->irqmask_lock, flags); + spin_unlock(&rt2x00dev->irqmask_lock); return IRQ_HANDLED; } diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c index 1eb59ee..86eba7f 100644 --- a/drivers/net/wireless/rt2x00/rt61pci.c +++ b/drivers/net/wireless/rt2x00/rt61pci.c @@ -2255,39 +2255,37 @@ static void rt61pci_wakeup(struct rt2x00_dev *rt2x00dev) static void rt61pci_enable_interrupt(struct rt2x00_dev *rt2x00dev, struct rt2x00_field32 irq_field) { - unsigned long flags; u32 reg; /* * Enable a single interrupt. The interrupt mask register * access needs locking. */ - spin_lock_irqsave(&rt2x00dev->irqmask_lock, flags); + spin_lock_irq(&rt2x00dev->irqmask_lock); rt2x00pci_register_read(rt2x00dev, INT_MASK_CSR, ®); rt2x00_set_field32(®, irq_field, 0); rt2x00pci_register_write(rt2x00dev, INT_MASK_CSR, reg); - spin_unlock_irqrestore(&rt2x00dev->irqmask_lock, flags); + spin_unlock_irq(&rt2x00dev->irqmask_lock); } static void rt61pci_enable_mcu_interrupt(struct rt2x00_dev *rt2x00dev, struct rt2x00_field32 irq_field) { - unsigned long flags; u32 reg; /* * Enable a single MCU interrupt. The interrupt mask register * access needs locking. */ - spin_lock_irqsave(&rt2x00dev->irqmask_lock, flags); + spin_lock_irq(&rt2x00dev->irqmask_lock); rt2x00pci_register_read(rt2x00dev, MCU_INT_MASK_CSR, ®); rt2x00_set_field32(®, irq_field, 0); rt2x00pci_register_write(rt2x00dev, MCU_INT_MASK_CSR, reg); - spin_unlock_irqrestore(&rt2x00dev->irqmask_lock, flags); + spin_unlock_irq(&rt2x00dev->irqmask_lock); } static void rt61pci_txstatus_tasklet(unsigned long data) @@ -2325,7 +2323,6 @@ static irqreturn_t rt61pci_interrupt(int irq, void *dev_instance) struct rt2x00_dev *rt2x00dev = dev_instance; u32 reg_mcu, mask_mcu; u32 reg, mask; - unsigned long flags; /* * Get the interrupt sources & saved to local variable. @@ -2370,7 +2367,7 @@ static irqreturn_t rt61pci_interrupt(int irq, void *dev_instance) * Disable all interrupts for which a tasklet was scheduled right now, * the tasklet will reenable the appropriate interrupts. */ - spin_lock_irqsave(&rt2x00dev->irqmask_lock, flags); + spin_lock(&rt2x00dev->irqmask_lock); rt2x00pci_register_read(rt2x00dev, INT_MASK_CSR, ®); reg |= mask; @@ -2380,7 +2377,7 @@ static irqreturn_t rt61pci_interrupt(int irq, void *dev_instance) reg |= mask_mcu; rt2x00pci_register_write(rt2x00dev, MCU_INT_MASK_CSR, reg); - spin_unlock_irqrestore(&rt2x00dev->irqmask_lock, flags); + spin_unlock(&rt2x00dev->irqmask_lock); return IRQ_HANDLED; }