From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) (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 6C8FD2EEE65; Thu, 25 Jun 2026 14:06:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=156.67.10.101 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782396399; cv=none; b=aa2qji7DjZCfE3+BBM3j+OP41RAOE8aPrI8EzI0rJkhaXWGU0cHPaUkoy3odbHVWuW+ESXTweuCRSN73GbIbSGFJsp5+e4eWQtom83eVOFRZFUo3CZ3N8xeq6xz3nPtFUgzGOGpNRNTcKQBxQ6SaqJnl3rVbf6tXxRIuMA3OCBs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782396399; c=relaxed/simple; bh=f+u5RtJcIgCVjLpx7Av2ZrVcWc8kx6/gH7zoC1Hme2g=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=E6fqZsMij2ovPi3xRfIJrGD3pyUypc5eVnOYQ7MVTMT/FzKhuQ0ca6KOoFk3L+Ot4WFDbUlJgtSh9NppHxEgiQQ+HJ6fq21NYQ6cswRh6zmjMjmqJCP6zhUub8LKM8szFUaGQ22EDrB0ZSr7h+GwDbgg6fMXI7vaOnCCRMMiRqU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch; spf=pass smtp.mailfrom=lunn.ch; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b=umKFd6BU; arc=none smtp.client-ip=156.67.10.101 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lunn.ch Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="umKFd6BU" 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=LaBpv62xdpnE2KPrv3KRWbkaQROLPC7gFgPeRezwIGQ=; b=umKFd6BUT27fcdQcOviwMZOE4B gJTWO8Y/J/fC4FLXVIn7eVyc/Uv5xF+KPiti1nlj78FDpc1ng/8WPWTHr+8aH3Wjz5BNyTkevhTWf OHSsqD9v4Oh7zyG0O6EsaDXJCuJkWPKSVb0Upi3kH9Zl/Yr8qUTNzdKHha6d5ef1zv3Y=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1wckim-009FOW-6A; Thu, 25 Jun 2026 16:06:24 +0200 Date: Thu, 25 Jun 2026 16:06:24 +0200 From: Andrew Lunn To: Pengpeng Hou Cc: Andrew Lunn , davem@davemloft.net, Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] net: pch_gbe: return errors from MIIM accesses Message-ID: <6ce97e2c-ed90-46e7-ad7b-0f520736c3d2@lunn.ch> References: <20260625030503.93588-1-pengpeng@iscas.ac.cn> 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: <20260625030503.93588-1-pengpeng@iscas.ac.cn> On Thu, Jun 25, 2026 at 11:05:03AM +0800, Pengpeng Hou wrote: > pch_gbe_mac_ctrl_miim() polls for the MIIM controller to become ready, > but returns zero on the initial ready timeout and ignores the completion > timeout after issuing the operation. MDIO and PHY helpers can then report > success with zero or stale data. > > Make the MIIM helper return an errno and pass read data through an output > parameter. Propagate the error through the MDIO read path, the probe-time > PHY discovery path, and the internal PHY register helpers that already > return an error status. > > Signed-off-by: Pengpeng Hou Do you have the hardware? This is a complex change to make without being able to test it. You need to think about the risks. On the one side, MII pretty much never fails. It is a big shift register, which just gets clocked out. So the errors you are trying to report probably never happen. On the other side, you are making a big change to the code. How likely is it, you made an error, and have broken this code? I personally would never make a change this size unless i could test it. Please also take a look at drivers/net/mii.c. Notice that all calls to mii->mdio_read() assume success. There is no error checking. Andrew