From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 1ACF954BE0 for ; Tue, 28 Nov 2023 17:20:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="tcMRcUo3" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D412CC433C8; Tue, 28 Nov 2023 17:20:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701192057; bh=puusfip924NnsGJF8uNMJlJWB/vurJEyppEM+n1Lj8k=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=tcMRcUo3ib8lMWDBEiKlESJpOBqLmCMzpGbDnyYHxYJiJVVG6EO9LB+uIsMNP6riu yorYOJJEnjNEGL+E7gIqFRLj+pagLLcb/GTBSlAtxMk1xiFU4lXGf1WSlHjn4GHR2L BP3z/4Urpe631EF7o8pKT2NYTcGKvnNNHQkW20MC/6AnyA4S4pcUkQwhP5URZbEWIv 7VZcnvkisjHDfggVetzKkTGOGJpQEL1F2qu0EY7vq+4yNrDM5i4BsdgiPkESRTzwxS U7s+VyKoIBxJE8kh7FK9LA5aK+DxXeSZZAq3ER+G88Aq/F7gRTpSljY3zx7ugE314m 2kWTYk0Nscnpw== Date: Tue, 28 Nov 2023 17:20:53 +0000 From: Simon Horman To: Subbaraya Sundeep Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kuba@kernel.org, davem@davemloft.net, pabeni@redhat.com, edumazet@google.com, sgoutham@marvell.com, gakula@marvell.com, hkelam@marvell.com Subject: Re: [PATCH net] octeontx2-pf: Add missing mutex lock in otx2_get_pauseparam Message-ID: <20231128172053.GA43811@kernel.org> References: <1700930141-5568-1-git-send-email-sbhatta@marvell.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1700930141-5568-1-git-send-email-sbhatta@marvell.com> On Sat, Nov 25, 2023 at 10:05:41PM +0530, Subbaraya Sundeep wrote: > All the mailbox messages sent to AF needs to be guarded > by mutex lock. Add the missing lock in otx2_get_pauseparam > function. > > Fixes: 75f36270990c ("octeontx2-pf: Support to enable/disable pause frames via ethtool") > Signed-off-by: Subbaraya Sundeep Hi, I am wondering if the call to otx2_nix_config_bp() in otx2_dcbnl_ieee_setpfc() also needs to be protected by mbox.lock. And although not strictly related to this patch, while looking over this, I noticed that in otx2_init_hw_resources() it appears that &mbox->lock may be unlocked twice in some error paths. e.g. /* Init Auras and pools used by NIX RQ, for free buffer ptrs */ err = otx2_rq_aura_pool_init(pf); if (err) { mutex_unlock(&mbox->lock); goto err_free_nix_lf; } ... err_free_nix_lf: mutex_lock(&mbox->lock); ... ...