Message ID | 355e9a7d351b32ad897251b6f81b5886fcdc6766.1684571393.git.christophe.jaillet@wanadoo.fr |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp242335vqo; Sat, 20 May 2023 02:05:12 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5NQj/t4ggb/Ua/0xMoYrpSsHAHv+HEEavvW1qwc4IFTrZ45yeGP3+S+BpzKpMGN03C9YUL X-Received: by 2002:a17:902:c94f:b0:1a9:8ab1:9f3b with SMTP id i15-20020a170902c94f00b001a98ab19f3bmr6540169pla.14.1684573512525; Sat, 20 May 2023 02:05:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684573512; cv=none; d=google.com; s=arc-20160816; b=BvOCC/4Vm/nb7XMGYx6mfnVs45GBuo3AGbDixevsk3ZQc5sTJ2r+FZ8/KULe3b0tf5 T+6Fd9rlfb6chs+U3fo3m4ElZxi2+JlPhTBn6LyguXQ2yEUOifaeZqIWHnZqYuxhkTcD 7sru35FNB/dM8D2OTVkA9fqa/0IY2IUKWP5BaPIfdCDNMq3FPK4Xr8amwH7nAppaTihR 29v6vMd+1w/+t23KA2MPSAxGWlZJVRzgrWySxGU25jEzc7AS+dM+CPsu2l3F8+208Edx 8ZXD/hk/EQGecYNOZG6vWVkJIKhC63lG1nkjMXb+rpIvhTdpGgELjJjsR9zJP3fuEoXx 1AUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=oQETDRJrVbTE0ETdYYPnZKcQRoVWgLVTmKiK6jA9rrg=; b=D/OZcywpnCvBjrNacZpv8PECPwYaU3QTy14U9sVlCkv1suKNgu8oHdHPGeEGpWW2vE imS0f2ziBBex3tL9jWN9RZAxED8HxbIB4UKI+0boUrRMUlkbNebGN6ZvMg+fOKNOJ67y rRfH75AaofEEiWa3i9kkLB/FKXwTv8GPs+gtEdX8xva3gVTn8fMAB+V/Ci+cFRU1P2cu XTj/wbPvU/6kwp+XDdHtyXOISy2FSxlNxO0NFvEA1Le6UqcU4ZOKoNdpXG0knuezN3PV rXEpWQjMjXDEkk11JYVdZpw7SHb/skbUXsfoikUFkDhE5jlRlj3ht8WECe/meuUG6B5W mdJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=fmfKyYeh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u18-20020a170903125200b001a97fd670e6si1206820plh.208.2023.05.20.02.04.59; Sat, 20 May 2023 02:05:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=fmfKyYeh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230280AbjETIa0 (ORCPT <rfc822;ahmedalshaiji.dev@gmail.com> + 99 others); Sat, 20 May 2023 04:30:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59752 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229523AbjETIaY (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sat, 20 May 2023 04:30:24 -0400 Received: from smtp.smtpout.orange.fr (smtp-27.smtpout.orange.fr [80.12.242.27]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 600D5A3 for <linux-kernel@vger.kernel.org>; Sat, 20 May 2023 01:30:23 -0700 (PDT) Received: from pop-os.home ([86.243.2.178]) by smtp.orange.fr with ESMTPA id 0Hylq5VzBHWsH0HylqQZQ4; Sat, 20 May 2023 10:30:21 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1684571421; bh=oQETDRJrVbTE0ETdYYPnZKcQRoVWgLVTmKiK6jA9rrg=; h=From:To:Cc:Subject:Date; b=fmfKyYeh/B4aI/deh2jAk95LR+ZzeVPc4Ln4zuzzuZFkDAlcfHLp8OTDNASXkHcIV Ftg2EZf55rTKYNQYyMOHhGb6iYzriNOgnMPrsPtgbexXDDutlsTdqVgXTXCJOTwH3z iLfYflB2vMl9kNWXBMR72sdVKf+wDpI+xcDcI4fmyN470r7OxoLjXaRW5FunRPHCYM 5yFUiTLe0g6BliVHQPUPpimbXeXzg942AnAX7V+sMjxTIC4jZndhv448LQ6bS+c9cU +CGc3tVVhRiPVBE1c46aZ5F8ftOUNKK+D8Jb9T0yKeghb7YoHgAh64NL6P3n4rgmbK Ar4Z68IHOFy5g== X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sat, 20 May 2023 10:30:21 +0200 X-ME-IP: 86.243.2.178 From: Christophe JAILLET <christophe.jaillet@wanadoo.fr> To: Rain River <rain.1986.08.12@gmail.com>, Zhu Yanjun <zyjzyj2000@gmail.com>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Ayaz Abdulla <aabdulla@nvidia.com> Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET <christophe.jaillet@wanadoo.fr>, netdev@vger.kernel.org Subject: [PATCH net] forcedeth: Fix an error handling path in nv_probe() Date: Sat, 20 May 2023 10:30:17 +0200 Message-Id: <355e9a7d351b32ad897251b6f81b5886fcdc6766.1684571393.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766403355467265397?= X-GMAIL-MSGID: =?utf-8?q?1766403355467265397?= |
Series |
[net] forcedeth: Fix an error handling path in nv_probe()
|
|
Commit Message
Christophe JAILLET
May 20, 2023, 8:30 a.m. UTC
If an error occures after calling nv_mgmt_acquire_sema(), it should be
undone with a corresponding nv_mgmt_release_sema() call.
Add it in the error handling path of the probe as already done in the
remove function.
Fixes: cac1c52c3621 ("forcedeth: mgmt unit interface")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
I don't think that the Fixes tag is really accurate, but
nv_mgmt_release_sema() was introduced here. And cac1c52c3621 is already old
so should be good enough.
---
drivers/net/ethernet/nvidia/forcedeth.c | 1 +
1 file changed, 1 insertion(+)
Comments
On Sat, May 20, 2023 at 4:30 PM Christophe JAILLET <christophe.jaillet@wanadoo.fr> wrote: > > If an error occures after calling nv_mgmt_acquire_sema(), it should be > undone with a corresponding nv_mgmt_release_sema() call. > > Add it in the error handling path of the probe as already done in the > remove function. > > Fixes: cac1c52c3621 ("forcedeth: mgmt unit interface") > Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Thanks. Acked-by: Zhu Yanjun <zyjzyj2000@gmail.com> Zhu Yanjun > --- > I don't think that the Fixes tag is really accurate, but > nv_mgmt_release_sema() was introduced here. And cac1c52c3621 is already old > so should be good enough. > --- > drivers/net/ethernet/nvidia/forcedeth.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/net/ethernet/nvidia/forcedeth.c b/drivers/net/ethernet/nvidia/forcedeth.c > index 0605d1ee490d..7a549b834e97 100644 > --- a/drivers/net/ethernet/nvidia/forcedeth.c > +++ b/drivers/net/ethernet/nvidia/forcedeth.c > @@ -6138,6 +6138,7 @@ static int nv_probe(struct pci_dev *pci_dev, const struct pci_device_id *id) > return 0; > > out_error: > + nv_mgmt_release_sema(dev); > if (phystate_orig) > writel(phystate|NVREG_ADAPTCTL_RUNNING, base + NvRegAdapterControl); > out_freering: > -- > 2.34.1 >
On Sat, May 20, 2023 at 10:30:17AM +0200, Christophe JAILLET wrote: > If an error occures after calling nv_mgmt_acquire_sema(), it should be > undone with a corresponding nv_mgmt_release_sema() call. nit: s/occures/occurs/ > > Add it in the error handling path of the probe as already done in the > remove function. I was going to ask what happens if nv_mgmt_acquire_sema() fails. Then I realised that it always returns 0. Perhaps it would be worth changing it's return type to void at some point. > Fixes: cac1c52c3621 ("forcedeth: mgmt unit interface") > Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> > --- > I don't think that the Fixes tag is really accurate, but > nv_mgmt_release_sema() was introduced here. And cac1c52c3621 is already old > so should be good enough. > --- > drivers/net/ethernet/nvidia/forcedeth.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/net/ethernet/nvidia/forcedeth.c b/drivers/net/ethernet/nvidia/forcedeth.c > index 0605d1ee490d..7a549b834e97 100644 > --- a/drivers/net/ethernet/nvidia/forcedeth.c > +++ b/drivers/net/ethernet/nvidia/forcedeth.c > @@ -6138,6 +6138,7 @@ static int nv_probe(struct pci_dev *pci_dev, const struct pci_device_id *id) > return 0; > > out_error: > + nv_mgmt_release_sema(dev); > if (phystate_orig) > writel(phystate|NVREG_ADAPTCTL_RUNNING, base + NvRegAdapterControl); > out_freering: > -- > 2.34.1 > >
On Mon, May 22, 2023 at 12:12:48PM +0200, Simon Horman wrote: > On Sat, May 20, 2023 at 10:30:17AM +0200, Christophe JAILLET wrote: > > If an error occures after calling nv_mgmt_acquire_sema(), it should be > > undone with a corresponding nv_mgmt_release_sema() call. > > nit: s/occures/occurs/ > > > > > Add it in the error handling path of the probe as already done in the > > remove function. > > I was going to ask what happens if nv_mgmt_acquire_sema() fails. > Then I realised that it always returns 0. > > Perhaps it would be worth changing it's return type to void at some point. > What? No? It returns true on success and false on failure. drivers/net/ethernet/nvidia/forcedeth.c 5377 static int nv_mgmt_acquire_sema(struct net_device *dev) 5378 { 5379 struct fe_priv *np = netdev_priv(dev); 5380 u8 __iomem *base = get_hwbase(dev); 5381 int i; 5382 u32 tx_ctrl, mgmt_sema; 5383 5384 for (i = 0; i < 10; i++) { 5385 mgmt_sema = readl(base + NvRegTransmitterControl) & NVREG_XMITCTL_MGMT_SEMA_MASK; 5386 if (mgmt_sema == NVREG_XMITCTL_MGMT_SEMA_FREE) 5387 break; 5388 msleep(500); 5389 } 5390 5391 if (mgmt_sema != NVREG_XMITCTL_MGMT_SEMA_FREE) 5392 return 0; 5393 5394 for (i = 0; i < 2; i++) { 5395 tx_ctrl = readl(base + NvRegTransmitterControl); 5396 tx_ctrl |= NVREG_XMITCTL_HOST_SEMA_ACQ; 5397 writel(tx_ctrl, base + NvRegTransmitterControl); 5398 5399 /* verify that semaphore was acquired */ 5400 tx_ctrl = readl(base + NvRegTransmitterControl); 5401 if (((tx_ctrl & NVREG_XMITCTL_HOST_SEMA_MASK) == NVREG_XMITCTL_HOST_SEMA_ACQ) && 5402 ((tx_ctrl & NVREG_XMITCTL_MGMT_SEMA_MASK) == NVREG_XMITCTL_MGMT_SEMA_FREE)) { 5403 np->mgmt_sema = 1; 5404 return 1; ^^^^^^^^^ Success path. 5405 } else 5406 udelay(50); 5407 } 5408 5409 return 0; 5410 } regards, dan carpenter
On Mon, May 22, 2023 at 01:35:38PM +0300, Dan Carpenter wrote: > On Mon, May 22, 2023 at 12:12:48PM +0200, Simon Horman wrote: > > On Sat, May 20, 2023 at 10:30:17AM +0200, Christophe JAILLET wrote: > > > If an error occures after calling nv_mgmt_acquire_sema(), it should be > > > undone with a corresponding nv_mgmt_release_sema() call. > > > > nit: s/occures/occurs/ > > > > > > > > Add it in the error handling path of the probe as already done in the > > > remove function. > > > > I was going to ask what happens if nv_mgmt_acquire_sema() fails. > > Then I realised that it always returns 0. > > > > Perhaps it would be worth changing it's return type to void at some point. > > > > What? No? It returns true on success and false on failure. > > drivers/net/ethernet/nvidia/forcedeth.c > 5377 static int nv_mgmt_acquire_sema(struct net_device *dev) > 5378 { > 5379 struct fe_priv *np = netdev_priv(dev); > 5380 u8 __iomem *base = get_hwbase(dev); > 5381 int i; > 5382 u32 tx_ctrl, mgmt_sema; > 5383 > 5384 for (i = 0; i < 10; i++) { > 5385 mgmt_sema = readl(base + NvRegTransmitterControl) & NVREG_XMITCTL_MGMT_SEMA_MASK; > 5386 if (mgmt_sema == NVREG_XMITCTL_MGMT_SEMA_FREE) > 5387 break; > 5388 msleep(500); > 5389 } > 5390 > 5391 if (mgmt_sema != NVREG_XMITCTL_MGMT_SEMA_FREE) > 5392 return 0; > 5393 > 5394 for (i = 0; i < 2; i++) { > 5395 tx_ctrl = readl(base + NvRegTransmitterControl); > 5396 tx_ctrl |= NVREG_XMITCTL_HOST_SEMA_ACQ; > 5397 writel(tx_ctrl, base + NvRegTransmitterControl); > 5398 > 5399 /* verify that semaphore was acquired */ > 5400 tx_ctrl = readl(base + NvRegTransmitterControl); > 5401 if (((tx_ctrl & NVREG_XMITCTL_HOST_SEMA_MASK) == NVREG_XMITCTL_HOST_SEMA_ACQ) && > 5402 ((tx_ctrl & NVREG_XMITCTL_MGMT_SEMA_MASK) == NVREG_XMITCTL_MGMT_SEMA_FREE)) { > 5403 np->mgmt_sema = 1; > 5404 return 1; > ^^^^^^^^^ > Success path. > > 5405 } else > 5406 udelay(50); > 5407 } > 5408 > 5409 return 0; > 5410 } Thanks Dan, my eyes deceived me. In that case, my question is: what if nv_mgmt_acquire_sema() fails? But I think the answer is that nv_mgmt_release_sema() will do nothing because mgmt_sema is not set. So I think we are good.
Le 22/05/2023 à 13:10, Simon Horman a écrit : > On Mon, May 22, 2023 at 01:35:38PM +0300, Dan Carpenter wrote: >> On Mon, May 22, 2023 at 12:12:48PM +0200, Simon Horman wrote: >>> On Sat, May 20, 2023 at 10:30:17AM +0200, Christophe JAILLET wrote: >>>> If an error occures after calling nv_mgmt_acquire_sema(), it should be >>>> undone with a corresponding nv_mgmt_release_sema() call. >>> >>> nit: s/occures/occurs/ >>> >>>> >>>> Add it in the error handling path of the probe as already done in the >>>> remove function. >>> >>> I was going to ask what happens if nv_mgmt_acquire_sema() fails. >>> Then I realised that it always returns 0. >>> >>> Perhaps it would be worth changing it's return type to void at some point. >>> >> >> What? No? It returns true on success and false on failure. >> >> drivers/net/ethernet/nvidia/forcedeth.c >> 5377 static int nv_mgmt_acquire_sema(struct net_device *dev) >> 5378 { >> 5379 struct fe_priv *np = netdev_priv(dev); >> 5380 u8 __iomem *base = get_hwbase(dev); >> 5381 int i; >> 5382 u32 tx_ctrl, mgmt_sema; >> 5383 >> 5384 for (i = 0; i < 10; i++) { >> 5385 mgmt_sema = readl(base + NvRegTransmitterControl) & NVREG_XMITCTL_MGMT_SEMA_MASK; >> 5386 if (mgmt_sema == NVREG_XMITCTL_MGMT_SEMA_FREE) >> 5387 break; >> 5388 msleep(500); >> 5389 } >> 5390 >> 5391 if (mgmt_sema != NVREG_XMITCTL_MGMT_SEMA_FREE) >> 5392 return 0; >> 5393 >> 5394 for (i = 0; i < 2; i++) { >> 5395 tx_ctrl = readl(base + NvRegTransmitterControl); >> 5396 tx_ctrl |= NVREG_XMITCTL_HOST_SEMA_ACQ; >> 5397 writel(tx_ctrl, base + NvRegTransmitterControl); >> 5398 >> 5399 /* verify that semaphore was acquired */ >> 5400 tx_ctrl = readl(base + NvRegTransmitterControl); >> 5401 if (((tx_ctrl & NVREG_XMITCTL_HOST_SEMA_MASK) == NVREG_XMITCTL_HOST_SEMA_ACQ) && >> 5402 ((tx_ctrl & NVREG_XMITCTL_MGMT_SEMA_MASK) == NVREG_XMITCTL_MGMT_SEMA_FREE)) { >> 5403 np->mgmt_sema = 1; >> 5404 return 1; >> ^^^^^^^^^ >> Success path. >> >> 5405 } else >> 5406 udelay(50); >> 5407 } >> 5408 >> 5409 return 0; >> 5410 } > > Thanks Dan, > > my eyes deceived me. > > In that case, my question is: what if nv_mgmt_acquire_sema() fails? > But I think the answer is that nv_mgmt_release_sema() will do > nothing because mgmt_sema is not set. At least, it is my understanding. Can you fix the typo s/occures/occurs/ when applying the patch, or do you really need a v2 only for that? CJ. > > So I think we are good. > > >
Hello: This patch was applied to netdev/net.git (main) by Jakub Kicinski <kuba@kernel.org>: On Sat, 20 May 2023 10:30:17 +0200 you wrote: > If an error occures after calling nv_mgmt_acquire_sema(), it should be > undone with a corresponding nv_mgmt_release_sema() call. > > Add it in the error handling path of the probe as already done in the > remove function. > > Fixes: cac1c52c3621 ("forcedeth: mgmt unit interface") > Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> > > [...] Here is the summary with links: - [net] forcedeth: Fix an error handling path in nv_probe() https://git.kernel.org/netdev/net/c/5b17a4971d3b You are awesome, thank you!
On Mon, May 22, 2023 at 07:13:43PM +0200, Christophe JAILLET wrote: > Le 22/05/2023 à 13:10, Simon Horman a écrit : > > On Mon, May 22, 2023 at 01:35:38PM +0300, Dan Carpenter wrote: > > > On Mon, May 22, 2023 at 12:12:48PM +0200, Simon Horman wrote: > > > > On Sat, May 20, 2023 at 10:30:17AM +0200, Christophe JAILLET wrote: > > > > > If an error occures after calling nv_mgmt_acquire_sema(), it should be > > > > > undone with a corresponding nv_mgmt_release_sema() call. > > > > > > > > nit: s/occures/occurs/ > > > > > > > > > > > > > > Add it in the error handling path of the probe as already done in the > > > > > remove function. > > > > > > > > I was going to ask what happens if nv_mgmt_acquire_sema() fails. > > > > Then I realised that it always returns 0. > > > > > > > > Perhaps it would be worth changing it's return type to void at some point. > > > > > > > > > > What? No? It returns true on success and false on failure. > > > > > > drivers/net/ethernet/nvidia/forcedeth.c > > > 5377 static int nv_mgmt_acquire_sema(struct net_device *dev) > > > 5378 { > > > 5379 struct fe_priv *np = netdev_priv(dev); > > > 5380 u8 __iomem *base = get_hwbase(dev); > > > 5381 int i; > > > 5382 u32 tx_ctrl, mgmt_sema; > > > 5383 > > > 5384 for (i = 0; i < 10; i++) { > > > 5385 mgmt_sema = readl(base + NvRegTransmitterControl) & NVREG_XMITCTL_MGMT_SEMA_MASK; > > > 5386 if (mgmt_sema == NVREG_XMITCTL_MGMT_SEMA_FREE) > > > 5387 break; > > > 5388 msleep(500); > > > 5389 } > > > 5390 > > > 5391 if (mgmt_sema != NVREG_XMITCTL_MGMT_SEMA_FREE) > > > 5392 return 0; > > > 5393 > > > 5394 for (i = 0; i < 2; i++) { > > > 5395 tx_ctrl = readl(base + NvRegTransmitterControl); > > > 5396 tx_ctrl |= NVREG_XMITCTL_HOST_SEMA_ACQ; > > > 5397 writel(tx_ctrl, base + NvRegTransmitterControl); > > > 5398 > > > 5399 /* verify that semaphore was acquired */ > > > 5400 tx_ctrl = readl(base + NvRegTransmitterControl); > > > 5401 if (((tx_ctrl & NVREG_XMITCTL_HOST_SEMA_MASK) == NVREG_XMITCTL_HOST_SEMA_ACQ) && > > > 5402 ((tx_ctrl & NVREG_XMITCTL_MGMT_SEMA_MASK) == NVREG_XMITCTL_MGMT_SEMA_FREE)) { > > > 5403 np->mgmt_sema = 1; > > > 5404 return 1; > > > ^^^^^^^^^ > > > Success path. > > > > > > 5405 } else > > > 5406 udelay(50); > > > 5407 } > > > 5408 > > > 5409 return 0; > > > 5410 } > > > > Thanks Dan, > > > > my eyes deceived me. > > > > In that case, my question is: what if nv_mgmt_acquire_sema() fails? > > But I think the answer is that nv_mgmt_release_sema() will do > > nothing because mgmt_sema is not set. > > At least, it is my understanding. > > Can you fix the typo s/occures/occurs/ when applying the patch, or do you > really need a v2 only for that? It's beyond my powers to fix things in that way. But I'd say there is no need to respin just for a spelling error. FWIIW, Reviewed-by: Simon Horman <simon.horman@corigine.com>
diff --git a/drivers/net/ethernet/nvidia/forcedeth.c b/drivers/net/ethernet/nvidia/forcedeth.c index 0605d1ee490d..7a549b834e97 100644 --- a/drivers/net/ethernet/nvidia/forcedeth.c +++ b/drivers/net/ethernet/nvidia/forcedeth.c @@ -6138,6 +6138,7 @@ static int nv_probe(struct pci_dev *pci_dev, const struct pci_device_id *id) return 0; out_error: + nv_mgmt_release_sema(dev); if (phystate_orig) writel(phystate|NVREG_ADAPTCTL_RUNNING, base + NvRegAdapterControl); out_freering: