Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp2268871lqo; Mon, 13 May 2024 12:55:16 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWMpnkgjD6qy1lkWB1P/nh9hs1meF7FMGeD9oM5Kjm8QsJoiI5yFWBov/lEkwAfi0BXLJhbDTBnm1i5AUpxiMkR+p8+KPgYUS/qjY44qw== X-Google-Smtp-Source: AGHT+IG6FprbLfPI/Th7WvqLbdvqRrisDxhwmFBIlEIvVMOkDTIo+Q73z4z+EEGaWAFrT3zqo33Y X-Received: by 2002:a50:baeb:0:b0:56e:2e0:79d1 with SMTP id 4fb4d7f45d1cf-5734d5973b7mr7759494a12.4.1715630115361; Mon, 13 May 2024 12:55:15 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715630115; cv=pass; d=google.com; s=arc-20160816; b=OVwrhcSb25CChxxf+TzFkUL6FJC2Cfq5Jw5BuQJEapLSpZKX2WOY3QoDTO04CeCPQl MIDeEu4zsNkxX68LD4qQnrJ2e2V81ewV3vDeN5iWJsVeRzAAQLUixM+4BHkzFdtzRRXV qbcIFcAPFTgG40piPxmLf4isfqwsRyiuPaDCC13T4Ezl2vr8NDBg4kqkUQ2IFy5N8KH2 HiQmKwWqcQotBqVqGvUOegeJ3U6pXC5dfccj/8qPrwPSSsCL7yIXU3TkjNWdWjoqj/x9 Wo0l0CUUUbPElN3qFf368jgPlIBpX6cxL9J55YMIzEDeAE32HKzWH8Jkz3oh+g8+OiIt mWuw== 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=ZTNsH3cZZed0JbNsKREzrHUK23HUcMZq1tHd485j2q0=; fh=DxxGzxzsgBxfgQvu+BG6Az4jqTTCe00Zitj45gyngFk=; b=iV4Pty/pMkUAIs0aW+D9pUD86hkgqlxuRdtnX4T8kcXGKodzBW6TWP7dSVH29nVCAN V8ubFjJyGnuhc/mPUWwPNO5o+RkSqzv7TC+r5Z+E5n8zp8Ut3P0zt8bez/CBJuaVV9qR oEM5aL+GEZkw/XsZSFiWgA7r2WWM0e4sAIQ2FqQuklSKvCPkKwS0yLuISlOFBcK40ATt GYXrLHgP+NVC9iDXdlmj5ynYGSkv6rCjVJU0XKW58dlyVcuypVUpITDcMXyn527VjmdT H+fopNBXVTrKjTzb4JG5XrLSsMURaOGGkXUXNg1MRletOib6iZgN45TqjC05Nnt4tCbN r6Kw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=G6drc2CP; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-178051-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-178051-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-5733c378b62si5202527a12.669.2024.05.13.12.55.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 May 2024 12:55:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-178051-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=G6drc2CP; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-178051-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-178051-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 am.mirrors.kernel.org (Postfix) with ESMTPS id E435D1F24AF8 for ; Mon, 13 May 2024 19:55:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D473A7BB19; Mon, 13 May 2024 19:55:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="G6drc2CP" 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 0058E58AD0; Mon, 13 May 2024 19:55:04 +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=1715630105; cv=none; b=C22AdbHS3ogD7dByMf4CTwjJcPv3c5QjtaZo4OXUyJ5F5xKo3C0wvOv06c0K5r2R+V1GfZ0WzXADWEYZm59E67PRiy15/4hnIeFXk/5A+WJSRAawhR/HAaI67L4mleYlDSgt94Ky0zrC+DJKjNaMR73jmRpez+U5IsaQV52quXA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715630105; c=relaxed/simple; bh=IkLUVPUe2JxomMky8U3xB6zxLV0N3W5/jahjh5ZToDY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=PZUZulGvkwtCQK5MtnaBwE+ngCvZJbH2SSdB4rEmbBXiKBQw+/bLLa6IM0kQUTevf+qFXpvsky99YUAPhWiYffZkqqywLPdY418pLkVHXx/9/6mFdlgvvLZp2qIiOloGZ9cuXhCA3kWdL5tu7KYrxOPul7WUiKXXGvLEhrZJ+2E= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=G6drc2CP; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 23AA4C113CC; Mon, 13 May 2024 19:55:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715630104; bh=IkLUVPUe2JxomMky8U3xB6zxLV0N3W5/jahjh5ZToDY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=G6drc2CPVlXHQEcRZcWx9PgtVbyu4N5CHZdMzBpZunFtAQ84ug4h0snqrOjQ1/uUt cfiHVwVsVrX4hA6KWoCU2KASNpH1d8GF/3wFnxsQDY92zjyVSvYszwTWfz2xveLKig gMRtUs+AE7jyFbMonxAJ/Xgps5FLccP39DCbB6sVGbw+XOjlGLV+zA7iumyXMcL2Cb 54PgvNPFkDJAerKoU+kwcbuofuEzQFuX45hey1i9SujHD4du05+zMoFBpVSB4IS3hm TVYnSNxoSDqSA1MjfKZHrxgxmjXakVqbXo2Aiaod6Dvt104GoTVd/tNZ15IWv2FjIi KMsEDp5P7Z42g== Date: Mon, 13 May 2024 20:54:59 +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: <20240513195459.GX2787@kernel.org> References: <20240513015127.961360-1-wei.fang@nxp.com> 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: <20240513015127.961360-1-wei.fang@nxp.com> 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