Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp5116902ybh; Wed, 7 Aug 2019 00:44:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqwbo3sJWQi5XmR4eTmLnY1q+VMdgbK0X+jFa2Ce714Ht01YeW6ca4Zl2TNFISwRbYQCYmco X-Received: by 2002:a17:902:a504:: with SMTP id s4mr6826904plq.117.1565163883940; Wed, 07 Aug 2019 00:44:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565163883; cv=none; d=google.com; s=arc-20160816; b=DsJBV9B4W1XNVksDMrLba+F0DEAGRcyifmQyKlBkLgbgAWXQ8Wn6SP6+cu3262uUUh 9O9rLw6hf5zD6OKTrmZNzF/lhsymx7k5bx4Rkif1C+oH6wIp6OIJusdwpFvQ+UXThY3g QPPy/ojBIxlVF3xLbcNAGoao6zNGFnlDqkVlrMnMuDwom1yRTkfB8cBSI7uON/EH65Ad O6GE7f6BM7ExMCNSiJD4ToNNAabOhN5QQcM5VnWE9hz+SBHLQemgnEsjFyDb0aDKAEc7 /NttmzSrOYcF5yI/A2rjS1WrJ1XS/gVczewBveQCsyEWr9tR7RvNLHPJntdw1tuJob/X pyVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:message-id:date:subject:cc:from :dkim-signature; bh=xyR+lCbovY7DSpuUffdnrpU/87Hr2gUcwjUISUwCLJw=; b=TZym3YLrcm+fsb+jA/DHXKM8v2qV/cTZF4wJ+yU50zDe5xk2WK0afK24vD3uplYY86 vXc3nkmJv5XArujOycp07lM5YXrrRH8Qx0JfoIAIKGkj1Hh70YEZ7uN0giOxEsHO9nxO A37AKFptxbZlVLnPk/QyURitZJ82DXFsiDAWdJCMS9o8Hs2l2dbqp7W7ennnBF5t4TJv DFmAfYzTIKOFIfx3Ax+Ts4A5O3PLUTrc5sYGiS0Iy2zv7e81kg5QGo2g2i+yxOQhW+xn zG4rkULNgehhaV5DFZc/+Kix/r+ETKSN74tXblJYkcnPsjuyZJn7kVs9P1F/Cwhz2QyR TMOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b="TW3Gk/9L"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 14si49595874pgy.255.2019.08.07.00.44.28; Wed, 07 Aug 2019 00:44:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b="TW3Gk/9L"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387450AbfHGHnL (ORCPT + 99 others); Wed, 7 Aug 2019 03:43:11 -0400 Received: from mail-pl1-f195.google.com ([209.85.214.195]:43217 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727190AbfHGHnL (ORCPT ); Wed, 7 Aug 2019 03:43:11 -0400 Received: by mail-pl1-f195.google.com with SMTP id 4so32472187pld.10; Wed, 07 Aug 2019 00:43:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=xyR+lCbovY7DSpuUffdnrpU/87Hr2gUcwjUISUwCLJw=; b=TW3Gk/9LpD+OFs4lahdlhV3I4MGtLWKreblCOq+Yo+EDbQ871srDL6vRjTPnvwgnrN PeKcjrsnqECNYvuYzY0+6PlVfSyU9xYfJe16uFdkPVJ0Uxb7iz/vvv8QkvWVoSC0Mort FVASEPQ6CdYeS6QWKvMQLaQIbsKGb0eJBom2KFxSf2IDl4gLeFVjnxZnczS5hXMXX5zI r221oZAfChl8ebIdqbDCyS5MczleMi+RS0AFUdLsAkvnvTmB34bk7JbplGWG7gld/PiE EK1MUM6m5G7hcvOHAKH8TZqc31OBACF9TZgoEDtBfMlO2eVuYjoXm68VbjvX6Hbj3Y6A JhQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=xyR+lCbovY7DSpuUffdnrpU/87Hr2gUcwjUISUwCLJw=; b=dkhuhdz4yEZ6yYTIcK1pSp0zzqWFRjYqo/PF86J6atUqu0EqwKc/A9hNlUp5Z6LZjy 3YFe1fGWs+UjqG3ERaJcGwFtKc5PekWEyiI63BsrlOCleUweiZcCQyheeFTL9/yLKIjd n9tZEwQzuMUekJqle5X6wB9L5f5TZ+DyYd/m9obZL9vRsWTJ6lCNivrJ9vVuh0ZXOJIh ZgbnFfZDQYrB+W2y/JRXMC2VfxX6lFCWBXZtik+x5DkqzR+xxhd5063dGv5Q5Cyn4RBG fjH3QCoJCw0S4vrLlbKiP/fwzoAP4+0m4txTPCC4qbEil4BCjpeCfSi92Lf8UD72vbSR t7eg== X-Gm-Message-State: APjAAAWsHDBQV8SJpO/fQj5awfyUqsQchzIxtbOTgMnr/hXITYaoDVWh gC8UCF4k4z3thYTiaOBdo9Y= X-Received: by 2002:a62:874d:: with SMTP id i74mr7868817pfe.94.1565163790590; Wed, 07 Aug 2019 00:43:10 -0700 (PDT) Received: from hfq-skylake.ipads-lab.se.sjtu.edu.cn ([202.120.40.82]) by smtp.googlemail.com with ESMTPSA id f3sm146879233pfg.165.2019.08.07.00.43.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Aug 2019 00:43:09 -0700 (PDT) From: Fuqian Huang Cc: "David S . Miller" , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Fuqian Huang Subject: [PATCH] net: tundra: tsi108: use spin_lock_irqsave instead of spin_lock_irq in IRQ context Date: Wed, 7 Aug 2019 15:43:00 +0800 Message-Id: <20190807074300.23135-1-huangfq.daxian@gmail.com> X-Mailer: git-send-email 2.11.0 To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org As spin_unlock_irq will enable interrupts. Function tsi108_stat_carry is called from interrupt handler tsi108_irq. Interrupts are enabled in interrupt handler. Use spin_lock_irqsave/spin_unlock_irqrestore instead of spin_(un)lock_irq in IRQ context to avoid this. Signed-off-by: Fuqian Huang --- drivers/net/ethernet/tundra/tsi108_eth.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/tundra/tsi108_eth.c b/drivers/net/ethernet/tundra/tsi108_eth.c index 78a7de3fb622..14215979d07e 100644 --- a/drivers/net/ethernet/tundra/tsi108_eth.c +++ b/drivers/net/ethernet/tundra/tsi108_eth.c @@ -372,8 +372,9 @@ static void tsi108_stat_carry(struct net_device *dev) { struct tsi108_prv_data *data = netdev_priv(dev); u32 carry1, carry2; + unsigned long flags; - spin_lock_irq(&data->misclock); + spin_lock_irqsave(&data->misclock, flags); carry1 = TSI_READ(TSI108_STAT_CARRY1); carry2 = TSI_READ(TSI108_STAT_CARRY2); @@ -441,7 +442,7 @@ static void tsi108_stat_carry(struct net_device *dev) TSI108_STAT_TXPAUSEDROP_CARRY, &data->tx_pause_drop); - spin_unlock_irq(&data->misclock); + spin_unlock_irqrestore(&data->misclock, flags); } /* Read a stat counter atomically with respect to carries. -- 2.11.0