Received: by 2002:ab2:7a09:0:b0:1f8:46dc:890e with SMTP id k9csp299432lqo; Wed, 15 May 2024 15:13:06 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUH6gh2enSDbNwwhGk0fga4exxN/LQVUWOH1S5hE0thNKXMJmttCcKp/P9jelw0Rq9695rkVFW4gL0AdSxV9VE8IW8KrEMvCnXZkRll5g== X-Google-Smtp-Source: AGHT+IEektZHFZj5B9sBSfLfCjffLd3GCQuFyz3GiLny57H2bLRcr855UqmJAIxcsgOaWbnT5Eci X-Received: by 2002:a05:6a00:2daa:b0:6f3:ebc4:4407 with SMTP id d2e1a72fcca58-6f4e0299e1amr18582844b3a.4.1715811186137; Wed, 15 May 2024 15:13:06 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715811186; cv=pass; d=google.com; s=arc-20160816; b=0psOl0oWQXAhR1Fde50umrphN59ZtDmkPQvEcwgzagHHEvgpywudHRsLk+w4oopLC1 QB5sbsevgyhG5GMWehpP7B5rcWK76iABhGKhPyXiXSl09ol852YAg/fgCaB+TeRGiDtX qzPswcZL+NDMyvcP6x6WFBe4a++xPZS55I1LLDUAza2jYvxmAAqGWWOovzhSnVpPCs1Y K/8shDRy8ePHRPOoQVJHaTiLrGooUwNwbRm6JuRkqaV/HXWDcuaxbvXUX2d8q80+PD/Y W7zKZNXwZFvJHmnL3ErHg3NK7NK3irCpseassTcpySW8GLwSUrSpsn/eEhii5JfpMHoC MpKw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature:dkim-filter; bh=rDHIdsIX3b2bTyiVTQajQMkFYSaXfRPjJOUH2y3P0po=; fh=Gt8aWvDrkMamjPpHxnILkymiV50TSlXiuoBx5cYSPV8=; b=gGzQVGdiGApfhTOAx/NYmpbobIRSKsEl8pJ26kyjBZyM1gf0GIg35mH3wq6xCONg58 tkZVtp6M3yVAQ/YkTuqV2valZY/BYcCRtmpCV7Cr23XGBxFtN11ZUbIVn3bI/UfzK9os +WeElwlZSMmOds5wCavTupiAl/+feqsMWLNT1P4fPrd9XW0IVBHd9RSJ47IvSTYmLcPd gr0nbz2mRP6UkbohuEGfjtMdZ92MyfTqCxD1eOHYB/KF9auQ2U20dPVR4YKCGR7Ft4wq RXy7cc01SyW/8DPpQRYW44YEbcagUf/T8nwYX5lCVEpXhC43DapPhktiakCArYWzxWp3 1QxA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@broadcom.com header.s=dkimrelay header.b=FiXvJUL2; arc=pass (i=1 dkim=pass dkdomain=broadcom.com dmarc=pass fromdomain=broadcom.com); spf=pass (google.com: domain of linux-kernel+bounces-180187-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-180187-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id 41be03b00d2f7-63411346ed4si14234890a12.434.2024.05.15.15.13.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 May 2024 15:13:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-180187-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@broadcom.com header.s=dkimrelay header.b=FiXvJUL2; arc=pass (i=1 dkim=pass dkdomain=broadcom.com dmarc=pass fromdomain=broadcom.com); spf=pass (google.com: domain of linux-kernel+bounces-180187-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-180187-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 3CE72B237F1 for ; Wed, 15 May 2024 17:03:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7238D156978; Wed, 15 May 2024 17:02:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="FiXvJUL2" Received: from relay.smtp-ext.broadcom.com (relay.smtp-ext.broadcom.com [192.19.144.209]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A6F511E527; Wed, 15 May 2024 17:02:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.19.144.209 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715792560; cv=none; b=ZF4wcLNDnFraK0318B9IGDpOjbzUz0zm5BNZL7cLeWib8bxYXb7jxLemfmsdMbZj1qzvJfidZSRFqp1enKId4O3NXXsU3bWqVZcbB9yjm3emncW1pU9bIj4FQpttpv89qs1BMYI/2HAviX04h74fYEGjaYJ0atEk4wDYP5mpPOY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715792560; c=relaxed/simple; bh=/nBxJe1TJSXRmzMiulzS4Rejg6VAcuYIOajaFeh1AlU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=VHec8bmCntbrxEo95eq5jJC0iKy/mQHgsH2izwOhwLNfcdqBtkOPGysXMvdMpDw4gzybKi7nZ2KZaxykTi2MXm6ABb26MQgZeJ8grQwOToV4zFWOsehxrd8yS2uHk7ftZAbJbwbxxNvsKPDz8XsKkPdbeXs9Lut6su9+b6u+Ojg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com; spf=fail smtp.mailfrom=broadcom.com; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b=FiXvJUL2; arc=none smtp.client-ip=192.19.144.209 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=broadcom.com Received: from mail-lvn-it-01.lvn.broadcom.net (mail-lvn-it-01.lvn.broadcom.net [10.36.132.253]) by relay.smtp-ext.broadcom.com (Postfix) with ESMTP id 9AA38C0000F7; Wed, 15 May 2024 10:02:31 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 relay.smtp-ext.broadcom.com 9AA38C0000F7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1715792551; bh=/nBxJe1TJSXRmzMiulzS4Rejg6VAcuYIOajaFeh1AlU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FiXvJUL2RBAJIY1djy9zs1JgjM97aZ/objRXr/vEW5NPRDbwB20EROZlzVGpLwUud LWih1BzEyrwTVTrQjYlN9dcFpQTXJYZsf4dlDVS+hbbWxjb93CCvZNcZ0utiB7rPEH i9DW7H2mN0jP7fUixPqQyHVBn0tdT9Wu3YwZAsPE= Received: from fainelli-desktop.igp.broadcom.net (fainelli-desktop.dhcp.broadcom.net [10.67.48.245]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail-lvn-it-01.lvn.broadcom.net (Postfix) with ESMTPSA id 9289E18041CAC4; Wed, 15 May 2024 10:02:29 -0700 (PDT) From: Florian Fainelli To: linux-kernel@vger.kernel.org Cc: broonie@kernel.org, Doug Berger , stable@vger.kernel.org, Florian Fainelli , "David S . Miller" , Florian Fainelli , Broadcom internal kernel review list , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org (open list:BROADCOM GENET ETHERNET DRIVER), Greg Kroah-Hartman , Sasha Levin Subject: [PATCH stable 6.1 3/4] net: bcmgenet: synchronize use of bcmgenet_set_rx_mode() Date: Wed, 15 May 2024 10:02:26 -0700 Message-Id: <20240515170227.1679927-4-florian.fainelli@broadcom.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240515170227.1679927-1-florian.fainelli@broadcom.com> References: <20240515170227.1679927-1-florian.fainelli@broadcom.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Doug Berger commit 2dbe5f19368caae63b1f59f5bc2af78c7d522b3a upstream The ndo_set_rx_mode function is synchronized with the netif_addr_lock spinlock and BHs disabled. Since this function is also invoked directly from the driver the same synchronization should be applied. Fixes: 72f96347628e ("net: bcmgenet: set Rx mode before starting netif") Cc: stable@vger.kernel.org Signed-off-by: Doug Berger Acked-by: Florian Fainelli Signed-off-by: David S. Miller Signed-off-by: Florian Fainelli --- drivers/net/ethernet/broadcom/genet/bcmgenet.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c index c2a991308215..17cf89922ef6 100644 --- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c @@ -2,7 +2,7 @@ /* * Broadcom GENET (Gigabit Ethernet) controller driver * - * Copyright (c) 2014-2020 Broadcom + * Copyright (c) 2014-2024 Broadcom */ #define pr_fmt(fmt) "bcmgenet: " fmt @@ -3344,7 +3344,9 @@ static void bcmgenet_netif_start(struct net_device *dev) struct bcmgenet_priv *priv = netdev_priv(dev); /* Start the network engine */ + netif_addr_lock_bh(dev); bcmgenet_set_rx_mode(dev); + netif_addr_unlock_bh(dev); bcmgenet_enable_rx_napi(priv); umac_enable_set(priv, CMD_TX_EN | CMD_RX_EN, true); -- 2.34.1