Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1511784imm; Wed, 10 Oct 2018 16:15:43 -0700 (PDT) X-Google-Smtp-Source: ACcGV63Q0jFW7r9HvMvzPjqr/oF0FlOxi7l1u+7mi7M7+KMRgSzIOn8xQsAM/ycFIliYngxN5/IL X-Received: by 2002:a62:3047:: with SMTP id w68-v6mr12149782pfw.19.1539213343621; Wed, 10 Oct 2018 16:15:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539213343; cv=none; d=google.com; s=arc-20160816; b=qyKbi1MEATK4k6KjcASQtJFwteM5wcRIf+qeq7iQxxJAKXn+263MA6m0w5msoI+JTP u25lCsjVK7tM0Jsdosk5F1knCbGkYzt0a2q8k1ubhFuIvg+e1CW+RBFyS7TIO6e2gPy3 h4mWUhbQXfZMO+XI7wL21CyMwDnTD5e3AGJrzDwkPFBATicICELqqRiIGkBDX2yX5cti A79gpV6QD8JLUiIjqLN5Au3I9qWtlxGulO6/P3jEIkfEauXsF0GcYfplXslFfx/B5R4h 27jPppQM2EiwLpTP4//GEhYM8S8qK0UD8R09WM1z7n1LsNFYB6PTyduv5KyIBPhdUrO9 oVMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=vZ+j9i2PS04nSV2SyEYKCAA+khUg1QTaVTdn32QYSV0=; b=nUq3sNm3D4PVx91vJZQCucD0Vt2McFf30Vngo4s129paz/eKdfDG3Ramh9a4ISxrHX AxhCTzvVK1mFq62ESJgEeZX5zR2oHBBbSZg+/W3rALHBEi3Wt6X7w4POGQBwcLGf3183 /EwxB7Yil0b9F5W+FSLni83DRoApmnXSnqeG+h2leXnuXPe9/P5NE41hvL77n95Oqkv5 aAHL461q1QBf5F3h3Fy0Kr9ZefSml2/6zvyLVBRdcGucqc7J7IW0GFpEVfm9SVVJBje9 IcBdW8ZmvRMAnXOAnQJD0FcKwRFFGF9b2VK5u7Pv47bre3CpeoRvjppA9VwnPTbb2x2U MCCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=u7Ow87i3; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d28-v6si27139496pgn.203.2018.10.10.16.15.28; Wed, 10 Oct 2018 16:15: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=pass header.i=@kernel.org header.s=default header.b=u7Ow87i3; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727483AbeJKGhp (ORCPT + 99 others); Thu, 11 Oct 2018 02:37:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:35964 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727439AbeJKGho (ORCPT ); Thu, 11 Oct 2018 02:37:44 -0400 Received: from lerouge.suse.de (LFbn-NCY-1-241-207.w83-194.abo.wanadoo.fr [83.194.85.207]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 282322150D; Wed, 10 Oct 2018 23:13:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1539213203; bh=Dco7IKPWXjlRbilRv1G8V3Tbyhp6hacccUSOP4QfdmE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=u7Ow87i3tBaOt5BtwcwnjQKEL8D7dClq6WIymDqafe8yUhkV/5YIYPgK05foGbaS1 +Lgo0xkIQStCQ4+OrYrFnKc1IK7nc9bpvEvpa6FMUbMgu2IiasSpCeai5BjdUfcMld DEDChv6uktdj3VCaFr1tQh2gxWuixGSBzdZyenVM= From: Frederic Weisbecker To: LKML Cc: Frederic Weisbecker , Sebastian Andrzej Siewior , Peter Zijlstra , "David S . Miller" , Linus Torvalds , Thomas Gleixner , "Paul E . McKenney" , Ingo Molnar , Frederic Weisbecker , Mauro Carvalho Chehab Subject: [RFC PATCH 17/30] isdn: Prepare isdn_net_get_locked_lp() for handling softirq mask Date: Thu, 11 Oct 2018 01:12:04 +0200 Message-Id: <1539213137-13953-18-git-send-email-frederic@kernel.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1539213137-13953-1-git-send-email-frederic@kernel.org> References: <1539213137-13953-1-git-send-email-frederic@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This function is implemented on top of spin_lock_bh() that is going to handle a softirq mask in order to apply finegrained vector disablement. The lock function is going to return the previous vectors enabled mask prior to the last call to local_bh_disable(), following a similar model to that of local_irq_save/restore. Subsequent calls to local_bh_disable() and friends can then stack up: bh = local_bh_disable(vec_mask); isdn_net_get_locked_lp(&bh2) { spin_lock(...) *bh2 = local_bh_disable(...) } ... spin_unlock_bh(bh2, ...); local_bh_enable(bh); To prepare for that, make isdn_net_get_locked_lp() able to return a saved vector enabled mask. We'll plug it to spin_[un]lock_bh() in a subsequent patch. Signed-off-by: Frederic Weisbecker Cc: Ingo Molnar Cc: Sebastian Andrzej Siewior Cc: Thomas Gleixner Cc: Peter Zijlstra Cc: Linus Torvalds Cc: David S. Miller Cc: Mauro Carvalho Chehab Cc: Paul E. McKenney --- drivers/isdn/i4l/isdn_concap.c | 3 ++- drivers/isdn/i4l/isdn_net.c | 3 ++- drivers/isdn/i4l/isdn_net.h | 3 ++- drivers/isdn/i4l/isdn_ppp.c | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/isdn/i4l/isdn_concap.c b/drivers/isdn/i4l/isdn_concap.c index 336523e..4352bec 100644 --- a/drivers/isdn/i4l/isdn_concap.c +++ b/drivers/isdn/i4l/isdn_concap.c @@ -41,9 +41,10 @@ static int isdn_concap_dl_data_req(struct concap_proto *concap, struct sk_buff *skb) { + unsigned int bh; struct net_device *ndev = concap->net_dev; isdn_net_dev *nd = ((isdn_net_local *) netdev_priv(ndev))->netdev; - isdn_net_local *lp = isdn_net_get_locked_lp(nd); + isdn_net_local *lp = isdn_net_get_locked_lp(nd, &bh); IX25DEBUG("isdn_concap_dl_data_req: %s \n", concap->net_dev->name); if (!lp) { diff --git a/drivers/isdn/i4l/isdn_net.c b/drivers/isdn/i4l/isdn_net.c index c138f66..a9687ca 100644 --- a/drivers/isdn/i4l/isdn_net.c +++ b/drivers/isdn/i4l/isdn_net.c @@ -1054,6 +1054,7 @@ isdn_net_xmit(struct net_device *ndev, struct sk_buff *skb) isdn_net_local *slp; isdn_net_local *lp = netdev_priv(ndev); int retv = NETDEV_TX_OK; + unsigned int bh; if (((isdn_net_local *) netdev_priv(ndev))->master) { printk("isdn BUG at %s:%d!\n", __FILE__, __LINE__); @@ -1068,7 +1069,7 @@ isdn_net_xmit(struct net_device *ndev, struct sk_buff *skb) } #endif nd = ((isdn_net_local *) netdev_priv(ndev))->netdev; - lp = isdn_net_get_locked_lp(nd); + lp = isdn_net_get_locked_lp(nd, &bh); if (!lp) { printk(KERN_WARNING "%s: all channels busy - requeuing!\n", ndev->name); return NETDEV_TX_BUSY; diff --git a/drivers/isdn/i4l/isdn_net.h b/drivers/isdn/i4l/isdn_net.h index cca6d68..f4621b1 100644 --- a/drivers/isdn/i4l/isdn_net.h +++ b/drivers/isdn/i4l/isdn_net.h @@ -76,7 +76,8 @@ static __inline__ int isdn_net_lp_busy(isdn_net_local *lp) * For the given net device, this will get a non-busy channel out of the * corresponding bundle. The returned channel is locked. */ -static __inline__ isdn_net_local *isdn_net_get_locked_lp(isdn_net_dev *nd) +static __inline__ isdn_net_local *isdn_net_get_locked_lp(isdn_net_dev *nd, + unsigned int *bh) { unsigned long flags; isdn_net_local *lp; diff --git a/drivers/isdn/i4l/isdn_ppp.c b/drivers/isdn/i4l/isdn_ppp.c index a7b275e..4c5ac13 100644 --- a/drivers/isdn/i4l/isdn_ppp.c +++ b/drivers/isdn/i4l/isdn_ppp.c @@ -1258,6 +1258,7 @@ isdn_ppp_xmit(struct sk_buff *skb, struct net_device *netdev) unsigned int proto = PPP_IP; /* 0x21 */ struct ippp_struct *ipt, *ipts; int slot, retval = NETDEV_TX_OK; + unsigned int bh; mlp = netdev_priv(netdev); nd = mlp->netdev; /* get master lp */ @@ -1292,7 +1293,7 @@ isdn_ppp_xmit(struct sk_buff *skb, struct net_device *netdev) goto out; } - lp = isdn_net_get_locked_lp(nd); + lp = isdn_net_get_locked_lp(nd, &bh); if (!lp) { printk(KERN_WARNING "%s: all channels busy - requeuing!\n", netdev->name); retval = NETDEV_TX_BUSY; -- 2.7.4