Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp4945902rwb; Tue, 17 Jan 2023 07:23:29 -0800 (PST) X-Google-Smtp-Source: AMrXdXtEB+xpyyfV7WB84PW1BLmgQAlbdLKNwhlVLtcUcuHnaqvDWLSv6Lxt5saZq2ikBXqGxw4i X-Received: by 2002:a17:902:d353:b0:189:f390:a227 with SMTP id l19-20020a170902d35300b00189f390a227mr2523061plk.56.1673969009095; Tue, 17 Jan 2023 07:23:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673969009; cv=none; d=google.com; s=arc-20160816; b=MwZC3fyotAqLIPzX7lWxmy8I7O+hjvj6NGBkbU4IPpW5vYbrOJQZF+jr5EaqfOgS2H Fh+2mh3NFLeAPrylh4FqcBbF9XIIYWM+zSgnaRA09NppFvHofJ0wf0OfxG8cH+gNVWMx dEXU5kypTrB7CqnzPE/HIRBCcgfX9AeJSkJTNmoxjC99Ro42vPu7nWLtIVM/WbkMPfZI mrY9TGmLGoshIPKcgVheR2wBwu8ETr5Q3d/9zRnTwOal8Wtisr6xF3jAJP4mSSz+OTAy k0moJ1gRRiCHFPOORa3rNxhGzHAmaPx3RE7zqC22chqzblHciJT7jHpIFcCpBkBHC+EB QR0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=CuPv93sa7yWnhCr7phi4YYBcFmYzOL9AGESZb0EF/hg=; b=dEdOKkXDCWG9CH2HgHNYVHjVOYp29kqGwJENFGksQi8G8tA3xbUW/FnsnESsopY3aJ Hd4w+KBnpo/UMhZ9SjeNBNk3S285eu9JTDGPc+tN8gsoO9H2w2nBWnueGpM3Xsb7uK1Z deg2x1/pS0G4uhpb6mUdc8iLYYYItAafmsGAt7UbxhykcQxllJ+k7+rYEMQS8xsp5S3M Rq4K9rzzFCGFc5DXHMFBgttCVTHPCxu+cvZuuIUddTBqr6XBkiY0eUbEYOioeFk/gT96 v3M7WCZZS/IWo4YCmfIhevk0CCG6Dz60jLj0b4D0oapqPrYI3pVeT+holRRO744vhcSM e6Vg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=xMkD7ilR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b17-20020a170903229100b00194aa8823d6si2341175plh.28.2023.01.17.07.23.23; Tue, 17 Jan 2023 07:23:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=xMkD7ilR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231220AbjAQOSJ (ORCPT + 48 others); Tue, 17 Jan 2023 09:18:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41124 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230502AbjAQOSF (ORCPT ); Tue, 17 Jan 2023 09:18:05 -0500 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D49B232525; Tue, 17 Jan 2023 06:18:03 -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-Transfer-Encoding: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=CuPv93sa7yWnhCr7phi4YYBcFmYzOL9AGESZb0EF/hg=; b=xM kD7ilRG02s9MXrk3pVr/vC7cP7JdgHf3M8jyj2xvRTWDbdhHDVbfuMitFSooiAcfDi8i3BtvAO7l/ 2xBXAByUa0Mx8EoJKzo30ef5Ojdr060AeZpR+2sUyTSkdvhoBHvP7QAibK9CitCOpYa55EZPNuoJc gT9erI8B6DyT4I0=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1pHmmg-002KWT-78; Tue, 17 Jan 2023 15:17:54 +0100 Date: Tue, 17 Jan 2023 15:17:54 +0100 From: Andrew Lunn To: Wei Fang Cc: Pierluigi Passaro , Pierluigi Passaro , Shenwei Wang , Clark Wang , dl-linux-imx , "davem@davemloft.net" , "edumazet@google.com" , "kuba@kernel.org" , "pabeni@redhat.com" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "eran.m@variscite.com" , Nate Drude , Francesco Ferraro Subject: Re: [PATCH v2] net: fec: manage corner deferred probe condition Message-ID: References: <20230115213804.26650-1-pierluigi.p@variscite.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 17, 2023 at 05:54:21AM +0000, Wei Fang wrote: > > -----Original Message----- > > From: Pierluigi Passaro > > Sent: 2023年1月17日 4:23 > > To: Andrew Lunn > > Cc: Pierluigi Passaro ; Wei Fang > > ; Shenwei Wang ; Clark Wang > > ; dl-linux-imx ; > > davem@davemloft.net; edumazet@google.com; kuba@kernel.org; > > pabeni@redhat.com; netdev@vger.kernel.org; linux-kernel@vger.kernel.org; > > eran.m@variscite.com; Nate Drude ; Francesco > > Ferraro > > Subject: Re: [PATCH v2] net: fec: manage corner deferred probe condition > > > > On Mon, Jan 16, 2023 at 4:32 PM Andrew Lunn wrote: > > > > This is the setup of the corner case: > > > > - FEC0 is the owner of MDIO bus, but its own PHY rely on a "delayed" > > > > GPIO > > > > - FEC1 rely on FEC0 for MDIO communications The sequence is > > > > something like this > > > > - FEC0 probe start, but being the reset GPIO "delayed" it return > > > > EPROBE_DEFERRED > > > > - FEC1 is successfully probed: being the MDIO bus still not owned, > > > > the driver assume > > > >   that the ownership must be assigned to the 1st one successfully > > > > probed, but no > > > >   MDIO node is actually present and no communication takes place. > > > > > > So semantics of a phandle is that you expect what it points to, to > > > exists. So if phy-handle points to a PHY, when you follow that pointer > > > and find it missing, you should defer the probe. So this step should > > > not succeed. > > > > > I agree with you: the check is present, but the current logic is not consistent. > > Whenever the node owning the MDIO fails the probe due to > > EPROBE_DEFERRED, also the second node must defer the probe, otherwise no > > MDIO communication is possible. > > That's why the patch set the static variable wait_for_mdio_bus to track the > > status. > > > > - FEC0 is successfully probed, but MDIO bus is now assigned to FEC1 > > > >   and cannot  and no communication takes place > > > > > Have you tested that this issue also exists on the net tree? According to your > description, I simulated your situation on the net tree and tested it with imx6ul, > but the problem you mentioned does not exist. Below is is my test patch. Hi Wei Reading the emails from Pierluigi, i don't get the feeling he really understands the problem and has got to the root cause. I've not seen a really good, detailed explanation of what is going wrong. Andrew