From mboxrd@z Thu Jan 1 00:00:00 1970 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 27BC617B50F; Wed, 29 Oct 2025 01:26:07 +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=1761701167; cv=none; b=qkY/BrAjWRCFtM1RmnGFJcol3qWqy31U3skFML7riueTiqoc/XtdJpVSCQCZKNc19aYRt7+k5N9kenNVoEXTTX41FiGBea2yhhoSdMI3t9Cd8/XmZOfBfLPg0L8oeAQOFu4CzkCooVFrvo0fZCZnTpYqNHhs+SkjChB690/+e70= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761701167; c=relaxed/simple; bh=6lVql+4xrJUU8L0Plfqy3I66gi1LL1lw3Wf2hqWqjH0=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=K/8j72Im32+7bNWpHakwlaDYEtPpQZ7MQ1f82Qd1LT73lOvki+ZPQnHzy/SQEha32tJXts3J1b/qOMnKStBK0ju3IOQ4UFUVvc+KmFbSFMcdy+VOwKEi4GmHTAaT9TJ2QD4s/MIk5dwJeRHdpXS/968YqefuED6Bo0optXsPd0E= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=idNYHHoX; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="idNYHHoX" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 93617C4CEE7; Wed, 29 Oct 2025 01:26:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1761701167; bh=6lVql+4xrJUU8L0Plfqy3I66gi1LL1lw3Wf2hqWqjH0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=idNYHHoXRWUWxhq9Wp3VloF9yWGXyOnFvjtO4jhITTVgsT8HDlHwNf29Xazjj+Gg/ 56qsOPQrwWo5yYkcGZgNj2ZAWyVnO7FPEMVHlDslCJky2x52ydnnAO2x6cbFeAK33L +O4ZaZojt7sgTK/8gWkkwybGVHmOaqreM9HOzOabJjyqSjy+08XargkDtL8Aa6rg5G 9TCFldWOw6EfZ57BgiEuLdtAotuRPTcxataCHw0d4ZsERfhx3hl/YAO/CNvmy2H8X7 bUfMIxO0+0PZ+hCsN/TiSJ1X8880unnQUwa6ZbGym/QOofanFn/oICq1X20Jxr+F8O qoTB87pHKHFUA== Date: Tue, 28 Oct 2025 18:26:05 -0700 From: Jakub Kicinski To: Buday Csaba Cc: Andrew Lunn , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Paolo Abeni , Philipp Zabel , , Subject: Re: [PATCH net-next v4 4/4] net: mdio: reset PHY before attempting to access registers in fwnode_mdiobus_register_phy Message-ID: <20251028182605.06840664@kernel.org> In-Reply-To: References: Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Wed, 22 Oct 2025 11:08:53 +0200 Buday Csaba wrote: > +/* Hard-reset a PHY before registration */ > +static int fwnode_reset_phy(struct mii_bus *bus, u32 addr, > + struct fwnode_handle *phy_node) > +{ > + struct mdio_device *tmpdev; > + int err; > + > + tmpdev = mdio_device_create(bus, addr); > + if (IS_ERR(tmpdev)) > + return PTR_ERR(tmpdev); > + > + fwnode_handle_get(phy_node); > + device_set_node(&tmpdev->dev, phy_node); > + err = mdio_device_register_reset(tmpdev); > + if (err) { > + mdio_device_free(tmpdev); > + return err; Should we worry about -EPROBE_DEFER on any of the error paths here? If not maybe consider making this function void? We can add errors back if the caller starts to care. > + } > + > + if (mdio_device_has_reset(tmpdev)) { > + dev_info(&bus->dev, > + "PHY device at address %d not detected, resetting PHY.", > + addr); IDK if this is still strictly necessary but I guess \n at the end of the info msg would be idiomatic