From patchwork Fri Jan 22 07:01:11 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Lamparter X-Patchwork-Id: 74486 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.2) with ESMTP id o0M70wOg020204 for ; Fri, 22 Jan 2010 07:00:58 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751846Ab0AVHAy (ORCPT ); Fri, 22 Jan 2010 02:00:54 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751844Ab0AVHAx (ORCPT ); Fri, 22 Jan 2010 02:00:53 -0500 Received: from mail-bw0-f222.google.com ([209.85.218.222]:58957 "EHLO mail-bw0-f222.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751819Ab0AVHAx (ORCPT ); Fri, 22 Jan 2010 02:00:53 -0500 Received: by bwz22 with SMTP id 22so865756bwz.25 for ; Thu, 21 Jan 2010 23:00:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:received:subject:from:to:cc :date:mime-version:content-type:content-transfer-encoding:message-id; bh=RuwcOESkjr06W4IsBCFzjJ4jEIVMTREp+qIw3w+3/a8=; b=k0gfv+c4IK/9W9fn9Vu7H07rS8Cag8A42Yfcr5DhXLCuJez/5jNumntpH/sUGeYkdv /h5tA1Ir40VNuF0YNfO1jUh3XIkpo4SQdiM+RY29OBD+ZXdQ40Nnxb8hU8NGnMvbbE4T VKYLPoDF+YI3/GMtyUARk65XuWBnTq+ECxyb4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=subject:from:to:cc:date:mime-version:content-type :content-transfer-encoding:message-id; b=v9V5UAbGsVCW9QV9Fu8iV0pjqetjudmSJnPDWohSrnY7Jg0h1BIV2E1FLxbA1vborX 9wvPtZrK+k91Bx1KYEx1CWQ0FavQ+t8GlsOB4g2g6vE0HjivUCUDt8XATiYZpyrpYevj a6w92EngH4nIumDoJKQMjq5zjaT3mvWmcxZhM= Received: by 10.204.144.86 with SMTP id y22mr1394957bku.43.1264143650717; Thu, 21 Jan 2010 23:00:50 -0800 (PST) Received: from debian64.daheim (p5B16C55A.dip.t-dialin.net [91.22.197.90]) by mx.google.com with ESMTPS id 13sm813881bwz.6.2010.01.21.23.00.49 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 21 Jan 2010 23:00:49 -0800 (PST) Received: from debian64.daheim ([192.168.0.4] helo=debian64.localnet ident=chuck) by debian64.daheim with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1NYDW7-0002D8-VL; Fri, 22 Jan 2010 08:01:16 +0100 Subject: [PATCH] p54pci: revise tx locking From: Christian Lamparter To: linux-wireless@vger.kernel.org Cc: linville@tuxdriver.com Date: Fri, 22 Jan 2010 08:01:11 +0100 MIME-Version: 1.0 Message-Id: <201001220801.11689.chunkeey@googlemail.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org diff --git a/drivers/net/wireless/p54/p54pci.c b/drivers/net/wireless/p54/p54pci.c index acc78e7..abf104e 100644 --- a/drivers/net/wireless/p54/p54pci.c +++ b/drivers/net/wireless/p54/p54pci.c @@ -238,7 +238,6 @@ static void p54p_check_tx_ring(struct ieee80211_hw *dev, u32 *index, int ring_index, struct p54p_desc *ring, u32 ring_limit, struct sk_buff **tx_buf) { - unsigned long flags; struct p54p_priv *priv = dev->priv; struct p54p_ring_control *ring_control = priv->ring_control; struct p54p_desc *desc; @@ -249,7 +248,6 @@ static void p54p_check_tx_ring(struct ieee80211_hw *dev, u32 *index, (*index) = idx = le32_to_cpu(ring_control->device_idx[1]); idx %= ring_limit; - spin_lock_irqsave(&priv->lock, flags); while (i != idx) { desc = &ring[i]; @@ -264,16 +262,12 @@ static void p54p_check_tx_ring(struct ieee80211_hw *dev, u32 *index, desc->len = 0; desc->flags = 0; - if (skb && FREE_AFTER_TX(skb)) { - spin_unlock_irqrestore(&priv->lock, flags); + if (skb && FREE_AFTER_TX(skb)) p54_free_skb(dev, skb); - spin_lock_irqsave(&priv->lock, flags); - } i++; i %= ring_limit; } - spin_unlock_irqrestore(&priv->lock, flags); } static void p54p_tasklet(unsigned long dev_id) @@ -306,7 +300,6 @@ static irqreturn_t p54p_interrupt(int irq, void *dev_id) struct p54p_priv *priv = dev->priv; __le32 reg; - spin_lock(&priv->lock); reg = P54P_READ(int_ident); if (unlikely(reg == cpu_to_le32(0xFFFFFFFF))) { goto out; @@ -321,15 +314,14 @@ static irqreturn_t p54p_interrupt(int irq, void *dev_id) complete(&priv->boot_comp); out: - spin_unlock(&priv->lock); return reg ? IRQ_HANDLED : IRQ_NONE; } static void p54p_tx(struct ieee80211_hw *dev, struct sk_buff *skb) { + unsigned long flags; struct p54p_priv *priv = dev->priv; struct p54p_ring_control *ring_control = priv->ring_control; - unsigned long flags; struct p54p_desc *desc; dma_addr_t mapping; u32 device_idx, idx, i; @@ -370,14 +362,14 @@ static void p54p_stop(struct ieee80211_hw *dev) unsigned int i; struct p54p_desc *desc; - tasklet_kill(&priv->tasklet); - P54P_WRITE(int_enable, cpu_to_le32(0)); P54P_READ(int_enable); udelay(10); free_irq(priv->pdev->irq, dev); + tasklet_kill(&priv->tasklet); + P54P_WRITE(dev_int, cpu_to_le32(ISL38XX_DEV_INT_RESET)); for (i = 0; i < ARRAY_SIZE(priv->rx_buf_data); i++) {