From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 21224C54E76 for ; Sun, 19 Nov 2023 16:24:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231397AbjKSQYN (ORCPT ); Sun, 19 Nov 2023 11:24:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56628 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229556AbjKSQYM (ORCPT ); Sun, 19 Nov 2023 11:24:12 -0500 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 46B92F9; Sun, 19 Nov 2023 08:24:08 -0800 (PST) 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=izoxJtFa+gut2GWYiJJ8Hdj7FJsw6dsjll3K6JT4ym4=; b=ruh65STffNt9q1uP1/ORdjOM+z BP7aC3fu/N9AclhSPAEJVT1Encp6gbfzcF7bYuwBthNUNcO4qR4haVfoNhVyFweylbXjCoNCVw0v7 UenMcNnA3qFcrtVivc9mJlJexbjRWPEWyEfFbs+X7xNw8qpdwDq7LZRWgW+dVgzCF50E=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1r4kaW-000ZXQ-Hw; Sun, 19 Nov 2023 17:24:00 +0100 Date: Sun, 19 Nov 2023 17:24:00 +0100 From: Andrew Lunn To: Christian Marangi Cc: Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Florian Fainelli , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [net PATCH] net: phy: correctly check soft_reset ret ONLY if defined for PHY Message-ID: <5d35be32-58bb-465d-91d9-ca3e8029373e@lunn.ch> References: <20231119151258.20201-1-ansuelsmth@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231119151258.20201-1-ansuelsmth@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Nov 19, 2023 at 04:12:58PM +0100, Christian Marangi wrote: > soft_reset call for phy_init_hw had multiple revision across the years > and the implementation goes back to 2014. Originally was a simple call > to write the generic PHY reset BIT, it was then moved to a dedicated > function. It was then added the option for PHY driver to define their > own special way to reset the PHY. Till this change, checking for ret was > correct as it was always filled by either the generic reset or the > custom implementation. This changed tho with commit 6e2d85ec0559 ("net: > phy: Stop with excessive soft reset"), as the generic reset call to PHY > was dropped but the ret check was never made entirely optional and > dependent whether soft_reset was defined for the PHY driver or not. > > Luckly nothing was ever added before the soft_reset call so the ret > check (in the case where a PHY didn't had soft_reset defined) although > wrong, never caused problems as ret was init 0 at the start of > phy_init_hw. > > To prevent any kind of problem and to make the function cleaner and more > robust, correctly move the ret check if the soft_reset section making it > optional and needed only with the function defined. I think this should target net-next, not net. It does not appear to be an problem which actually affects somebody using stable kernels. The change itself looks O.K. Andrew