Article View: linux.kernel.netdev
Article #13417Re: [PATCH net-next v1 1/3] r8169: make PHY OCP access safe in atomic context
From: Andrew Lunn
Date: Mon, 09 Nov 2026 20:47
Date: Mon, 09 Nov 2026 20:47
18 lines
8922 bytes
8922 bytes
On Mon, Nov 09, 2026 at 10:30:20AM +0800, javen wrote: > From: Javen Xu <javen_xu@realsil.com.cn> > > r8168_phy_ocp_read() and r8168_phy_ocp_write() wait for the GPHY_OCP > handshake with rtl_loop_wait(), which may sleep (fsleep(25)). Upcoming > PTP support for RTL8127A accesses the PTP block through the same PHY > OCP interface from atomic context (spinlock held, NAPI RX path), and > concurrently with phylib MDIO accesses. > > Busy-wait for the handshake with readl_poll_timeout_atomic() instead, > keeping the previous maximum wait time of 250us, and serialize the > GPHY_OCP register accesses with a new spinlock. There are many drivers which need to access PHY registers via blocking MDIO accesses. Why is this driver different? Andrew
Technical Details
Message-ID:
<7791e7b5-fdc8-4c8c-ab5b-dcc7d7a6506a@lunn.ch>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-359603-linux-kernel-netdev=dewy.ruReferences:
<20261109023022.770-1-javen_xu@realsil.com.cn> <20261109023022.770-2-javen_xu@realsil.com.cn>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-359603-linux-kernel-netdev=dewy.ru From: andrew@lunn.ch (Andrew Lunn) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next v1 1/3] r8169: make PHY OCP access safe in atomic context Date: Mon, 9 Nov 2026 21:47:54 +0100 Organization: Usenet Network Message-ID: <7791e7b5-fdc8-4c8c-ab5b-dcc7d7a6506a@lunn.ch> References: <20261109023022.770-1-javen_xu@realsil.com.cn> <20261109023022.770-2-javen_xu@realsil.com.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: usenet.network; logging-data="447275"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:3+MNz4Cm7afizhL4h7RMod855Ds= sha256:PI7fy5hyPodvHQjjmwtOMlyK6hsG6ufd+Xd9+B56gp4= sha1:z+Q+/Wf7Gl8i82AWZnVwhjUL+gg= sha256:Nx0Q/wwVzHwBDLez6NXZxLaOFKcBiP5rQS/yjOLlFJA= Content-Disposition: inline List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 4C23011391C; Mon, 9 Nov 2026 23:49:57 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.051 X-Spam-Status: No, score=-3.051 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (1024-bit key) header.d=lunn.ch X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id k5Arptp2cQ23; Mon, 9 Nov 2026 23:49:54 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-359603-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=lunn.ch X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id 602D91138DF; Mon, 9 Nov 2026 23:49:45 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id 063C33738A; Mon, 9 Nov 2026 20:48:31 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1794257310; b=qd8hVudvCvsqk+EsRwwChNW+uP0Dsrcir5/8DOmNB//JAROe9UeOAj6RKwa1G6//7IG1 FxKHa4qQHVSuRKecnoxiS33FaUo/XSVt7QWg9J1lfGjFW88rvuql7Hk12S4qyGBM7MV/C nOjxDIejRrfo2RzanrOhTn7towYJK3Yi/BUvPpBOei0N53G6lErMh3/nmMynNLQW45wX6 zznHyRD+5rj23aJkQrhp4KqjAvPKarsBk7x6fh/7OJpH2N7ZiTjQQaqhIPdwJZS6k1pM4 4e/+ooMuubebW9iJuGCDTzPdgNknctiT/NPrB+z1tY3XekIKvYLeTf/ZR/l1KvW9yvA== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794257310; h=X-Original-To:Received:DMARC-Filter:DKIM-Signature:Received:Date: From:To:Cc:Subject:Message-ID:References:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=cr59Jlw63YR0F4Paf2c41Gc0yvl82l13H2pewUH6kQs=; b=AOAYrw0aFX0PAe31nwovfuCxrrH0C5yotGlUgNcJ3wEbG3rhu3xnLDfxwdeFi70a5Haw s9P/Wh01fh/vmYr5/7l2ZTcYkafL7snXp5k4FOrkFDmM7G+nHUf22aAD6Q8HE31i6qOMO L4/AJvk2WzVs7RBONR+lZU7HZIWzkobyTyf8yugZZe3BsToLoCHKZbQFUXXIohBEnm6Am QOMUMaO2HjlxqO0sZzyqnGQTGWJqSl8ZqJSaoev+Ybu+BEZOR++7nuI69NlZ+441QWkOk /HW1OZnIuDs5JvkF1VrGWQ8m05oN2qMlTyfEEz072s0L73VrUS6XF8MJ4PzBzxn8nNQ== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=lunn.ch header.i=@lunn.ch header.a=rsa-sha256 header.s=20171124 header.b=g8WDSSNK; dmarc=pass header.from=lunn.ch; spf=pass smtp.mailfrom=lunn.ch; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 17C06606A333; Mon, 9 Nov 2026 20:48:30 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.a=rsa-sha256 header.s=20171124 header.b=g8WDSSNK X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=156.67.10.101 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1794257305; b=5ohjCd68QSyj0wVKQYM4YEUMm+Oh4oC/FuOdNgWejlXbkYlrpmNW1DncmlMrCcMhwsNT ozKRZDfirVgYxsQ9bJ62hCUoU5yCtT7iYRp1yzgq9dKPQZyHIJbIJJ1GeaEOUKtH7Lc4T mepKTy/HzTIvxRGP3k3Rh6+Ktzt2MRMUEFPnw1FAbdOQmuxWNPHaPqFQV+aReso8eRgGp il+pn1boBT+zhOLfcmzYWEyxUcPUoO2PUtkmuvDrqsbfWcH1dSB7me6dDE+LQnd5Q8XLp UyX3ln45ONNN8alld8lxTvV5sLkgIUF0SNa6v/iiS8AP/BbFRvWcKObPxEJxMcSeoZg== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794257305; h=DMARC-Filter:DKIM-Signature:Received:Date:From:To:Cc:Subject: Message-ID:References:MIME-Version:Content-Type:Content-Disposition: In-Reply-To; bh=cr59Jlw63YR0F4Paf2c41Gc0yvl82l13H2pewUH6kQs=; b=fM67+GA/Pr/zdCc+X7QID50J40nNyhBAp1JmGitwQp/3Se4sLEN2lRwSPXzarQQndJDn 00c4K0lRvXUKsgyS+w9wMLH1X2i+x6HWXt+GHUSPrYJvM1y+N0FGFeT635IaDFGTtAkcA /x7JFn/LwSydx8PNPKJRuk+xQEqqIxByQ1P1LcEMIiP0H6iZD95oBkxIafL8vW6oIwa4s 6LBSqln7io8L0Fp37d/1j+3eT4LqDbWhPNnQhFNK3jj12Pm50fK60gD8aCtcmqRIwBu82 EoHKwaweGagtjtOG5wSYBLNwMq34h6DZVA23spgDEt+VBlOutmyHEKaT+Aq35F0R9Mw== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=lunn.ch; spf=pass smtp.mailfrom=lunn.ch; dkim=pass header.d=lunn.ch header.i=@lunn.ch header.a=rsa-sha256 header.s=20171124 header.b=g8WDSSNK; arc=none smtp.remote-ip=156.67.10.101 X-Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8DB4F606A326; Mon, 9 Nov 2026 20:48:24 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 8DB4F606A326 X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lunn.ch X-DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=cr59Jlw63YR0F4Paf2c41Gc0yvl82l13H2pewUH6kQs=; b=g8WDSSNKQdVFTWx1a5zdBz9zFh GUXXz0IRv0IsR/ve1G3+vzg6g1SAwBk8vuJPsCuCEg8frs4/+xAXqU0xhGRsS9CV4b2HvspveUeFD yT6aQipWAK7+6yhOCeX9N+sliON8Bw/O70MbuMgjDlUHoX+WMZ1/9xy55ndq4LPBVrxc=; X-Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from <andrew@lunn.ch>) id 1xQWHS-00FKzw-TE; Mon, 09 Nov 2026 21:47:54 +0100 X-Cc: hkallweit1@gmail.com, nic_swsd@realtek.com, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, horms@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list X-In-Reply-To: <20261109023022.770-2-javen_xu@realsil.com.cn>