Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp2269634lqo; Mon, 13 May 2024 12:57:13 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUH/KpAcS70Nru4ZiVDkhnRn+petFL6X7/e9hL7+qo/nL07jOhxxOTzfvlX1XJrwdCx1eg8j8uZTKWSDt/H4u/E6H0mM3gRZf/mZfvy/w== X-Google-Smtp-Source: AGHT+IGidmky6lSYYaovc9B8zYNardmrdNcEPssmdG5buypZ48bkraUkFr3s47BSRrF8mGv/twlo X-Received: by 2002:a05:6808:1206:b0:3c9:930c:1c9 with SMTP id 5614622812f47-3c9970cfad9mr16651242b6e.40.1715630233185; Mon, 13 May 2024 12:57:13 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715630233; cv=pass; d=google.com; s=arc-20160816; b=k3A+9Ri8/UYjRDGBsohc/64Llh39l8d4dVZc7pTbHqxTsIiEK53QO8YqmFfwGfN0C/ mI7GmXkccU3wMfNrlreTA7HmqMXvrbfDNXBWXO05CEcyiyf6RXVF3mOyQwKSk0QK7SPB Ee/oZdH9P5sQ8laKLqlpbI/w8oHXOfOEoTShvVWCMvT4u86TA7mCEO/rcoxEFaqGmptm wChtuzVb1BR0xlW0z2+qwnUExUzOg41fsbXEdaqTaVysObXfhvIm5HRjKnyt3xZOmi3y 4U0aAg+iIMOno5Hr4kpLBesg3ecGkNa9A/ttDQXGUssMnJ2xl0+2cG7oTbz9E5/WIZ/X q5uQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=KyiN70yh6CjCYB20H+CO8C7rlLenifAVNqM8BuR4EAA=; fh=DxxGzxzsgBxfgQvu+BG6Az4jqTTCe00Zitj45gyngFk=; b=e93lq02kuylT9IDdEX+6pK5OkteH+ftTRlYVugwJdpWTSagMU6LjD/pdAStQ5fZelo PLPSh9sGL7PAbuBJinhn3O/JRMKj+tY59n+hgyvO8Ufi4/T9k/gpdgBYzABi0a3Yk5Cx 1UQZis1Ve9wZNcXpvhpDew3go+ZrZ+3RhL7Hn60fRXJ6Y+qYIbgiz1jYBVTrEHRu0tMr YbBvikGtfLdDmVFD/MSTdaKZJXC3A4nD2nV00L+lsZCMj2SQzY4fFDJO6NrN+mEsaX7I mME5PYKs7669/xFHjhe879cWfSpkHyqM1r0ffW53ZG5v0Snd2+3dui1bo6/5uFISNiF7 aycg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="S/cmjbZd"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-178053-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-178053-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 6a1803df08f44-6a15f2f0c48si102239156d6.509.2024.05.13.12.57.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 May 2024 12:57:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-178053-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="S/cmjbZd"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-178053-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-178053-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id EE30C1C23212 for ; Mon, 13 May 2024 19:57:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 576827CF25; Mon, 13 May 2024 19:56:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="S/cmjbZd" 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 78D9C3C08A; Mon, 13 May 2024 19:56:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715630215; cv=none; b=bT6NORGrP2HwaTdBRxOoPuGMDx6BR3p81rG35oekHRKL7qgbWlA+HuZVaFkvPZjsYrtsSxKetFoQV0EfBTD4J+kGQt9H4E1e6VSu5w9sC29Ftkg0PFVVAOgmzltreMGldVBcCrHLHTEIRCJfZLNoI8uEaJpsUaXLSlWZpkEFbug= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715630215; c=relaxed/simple; bh=wVrCYAqrup8syMMMZL9tLVORbn9Co7XWkPqPW6wAFuc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=EhHTIxfUfXiHnRLKrY2chkQg6Ma1zXE9OWWB8SEe0aA+gpEmvIApy8lo4Yt9Q6mjeL5ZKovh3kLu1YcWoW+LtspAEdOPU5V25Wo79IChD0fSBoixOxU/AilTu7QJiCE/bHsih/HvOpKM5zjXn9n4024vF/OW+fgKzTVPHgEfBSs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=S/cmjbZd; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 66545C113CC; Mon, 13 May 2024 19:56:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715630215; bh=wVrCYAqrup8syMMMZL9tLVORbn9Co7XWkPqPW6wAFuc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=S/cmjbZdCBk/3Ayuu5OwujnOaJESu+1DwgXVdlrQh8dEClczdzlMYQX0izHXQcszx oWRMcOuW5rT591OelN2TTSMqbogi9V4IjypJiz8JT5SwnjeJVl/ke+plEUjL85r37h SGLqlThJxHmBDdbRpnP/i1gr6esr6GKSEsvH6X/kLP452u+jSbtEiLDdX1nN65EaHy 84SkGbBKu5kSzqr3oVT0ke9XLA9oqjoZyAz1m/TpM5FNUlIqop6K9aCKRPN7ISfK0m DvEATrUTujjZvbY5E/xsnGVm1G4ZYAMwkMAQPqDjx8YgzlgMVJClZn4E5zXqIJ1qOn oaqxyFai26xoQ== Date: Mon, 13 May 2024 20:56:49 +0100 From: Simon Horman To: Wei Fang Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, shenwei.wang@nxp.com, xiaoning.wang@nxp.com, richardcochran@gmail.com, andrew@lunn.ch, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev Subject: Re: [PATCH net] net: fec: avoid lock evasion when reading pps_enable Message-ID: <20240513195649.GY2787@kernel.org> References: <20240513015127.961360-1-wei.fang@nxp.com> <20240513195459.GX2787@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@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: <20240513195459.GX2787@kernel.org> On Mon, May 13, 2024 at 08:54:59PM +0100, Simon Horman wrote: > On Mon, May 13, 2024 at 09:51:26AM +0800, Wei Fang wrote: > > The assignment of pps_enable is protected by tmreg_lock, but the read > > operation of pps_enable is not. So the Coverity tool reports a lock > > evasion warning which may cause data race to occur when running in a > > multithread environment. Although this issue is almost impossible to > > occur, we'd better fix it, at least it seems more logically reasonable, > > and it also prevents Coverity from continuing to issue warnings. > > > > Fixes: 278d24047891 ("net: fec: ptp: Enable PPS output based on ptp clock") > > Signed-off-by: Wei Fang > > Reviewed-by: Simon Horman Sorry, I convinced myself this is correct. But I now see that questions have been raised by others. So please ignore the above.