Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp606933rwl; Wed, 12 Apr 2023 01:12:13 -0700 (PDT) X-Google-Smtp-Source: AKy350aTAaVaQnMhwZ6TVT0EQgtE9HuXBBaZ9crCGoxu/ifUy4Nem4GMazUfd0Gl4Ivysg90/I9K X-Received: by 2002:a05:6402:758:b0:504:7171:4542 with SMTP id p24-20020a056402075800b0050471714542mr4931296edy.0.1681287132785; Wed, 12 Apr 2023 01:12:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681287132; cv=none; d=google.com; s=arc-20160816; b=zgI/A2K4o7dZQhU5oOgN2Uq0F79ip6jZE0UmHSMpwLo59dLJOAmM4kY43RVcoq/VS7 5yhtBvLBj3UySkViMipPIb1bn6vv5kBrh4z08Wj8HjD8wh7sSo9pJbXHJci9+vPM7EMW EM+hS37tjadAHcAP2iINuDj6P1x0gDZu9Kwh55gbIIfbAcwXftnwiBDq3KaLOgF8bRxQ /05sTYtGeXPzl3+qGvX0Ce6P3i3vBCfOGNeR95qZou9imSmTlN5TsYeN7sySdZSd+Och VXuqgruCsjl28bdEzcTa22BlrBC4eVVERyURTHr7kVxeKPhdL5PobQJXHiXTCsS9RctR 2Q9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=6sMvKzPXUQPaUNOAoXoB+ksyWApeu4V++9ieBbSNplg=; b=vVcIIciyTv3B8r5eMiDYopi3rcjqCTDpnixFx7od4/CJbzCXknd5sXES5qjnKwcZSu k3LEBqErq73bc51pZMkaqtiKfqr48+0/LwS77pqkCM/EYA0YnTieS3phBR1UJi/9doEo EFGAMk4NJvqEnDC1noGwNpdnXng0gts/u8MDcw1lcn6tg0gDXQ07IgSXaBDOEc2Vmeb0 p8hHxiNFVlBsgXwnOevL4S953tXtTvYvuIybIn9M+dNM98RfUTPxftFSHMsUSHCrXVjw ae2M3BY9TPTff1nQ6XjRoUfr9ym4NB8ZtZK+4TT6TpVildPWGaikuQuZovGdKnLnxkAX xfrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=AIVwknBR; 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=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u2-20020aa7db82000000b004ab250bcee5si12881479edt.647.2023.04.12.01.11.48; Wed, 12 Apr 2023 01:12:12 -0700 (PDT) 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=@bootlin.com header.s=gm1 header.b=AIVwknBR; 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=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229917AbjDLIGl (ORCPT + 99 others); Wed, 12 Apr 2023 04:06:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49796 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229875AbjDLIGh (ORCPT ); Wed, 12 Apr 2023 04:06:37 -0400 Received: from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net [217.70.183.199]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 024E95BB5; Wed, 12 Apr 2023 01:06:34 -0700 (PDT) Received: (Authenticated sender: maxime.chevallier@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id F28BBFF812; Wed, 12 Apr 2023 08:06:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1681286793; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6sMvKzPXUQPaUNOAoXoB+ksyWApeu4V++9ieBbSNplg=; b=AIVwknBRq8FtcBddorKYDhaPsak6w1IVgxAE9xHvkAPQVErV8RYUDd6KxSE5Er7tT0vBOu Dr/zOZLwchd2skzKssKhhMzHtlpL5oBblK2V12mCHU6oe9I1HtLDHGB4/vBMJcOfGauOna /7B10RZPn3M+Nv+lOMkBQenM38zYKP5VBOJbbXyfvi5jYNYCDg8fX026aIiocQYbGAn6AX W+pGpnyr7cl1G6D2ikFwuDuOKEEbDerKgYAsUJma5XImsB7RJSV06/wDsp9Te9xu7VxRnf PwnvgufuGi3mvEukHNtihQcLj7fNZdeUqMZFl3gCWlhgmzNt+LDl5THknAdB0A== Date: Wed, 12 Apr 2023 10:06:27 +0200 From: Maxime Chevallier To: "Russell King (Oracle)" Cc: davem@davemloft.net, Sit Michael Wei Hong , Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , Maxime Coquelin , "linux-stm32 @ st-md-mailman . stormreply . com" , "alexis . lothore @ bootlin . com" , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, thomas.petazzoni@bootlin.com, Andrew Lunn , Jakub Kicinski , Eric Dumazet , Paolo Abeni , Florian Fainelli , Heiner Kallweit , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH net] net: phylink: check for SFP bus presence in phylink_expects_phy Message-ID: <20230412100627.1daab691@pc-288.home> In-Reply-To: References: <20230412074850.41260-1-maxime.chevallier@bootlin.com> Organization: Bootlin X-Mailer: Claws Mail 4.1.1 (GTK 3.24.37; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 Hello Russell, On Wed, 12 Apr 2023 08:51:21 +0100 "Russell King (Oracle)" wrote: > On Wed, Apr 12, 2023 at 09:48:50AM +0200, Maxime Chevallier wrote: > > When an SFP bus is present, we don't expect a PHY to be attached > > directly from the MAC driver, it will be handled by phylink at SFP > > attach time. > > If we have a SFP, then phylink should be configured for in-band mode. > Maybe fix the firmware description instead? > The DT used on that platform has the following configuration : [...] &gmac1 { status = "okay"; phy-mode = "sgmii"; managed = "in-band-status"; sfp = <&sfp>; [...] } Here phylink_expects_phy() returns true because although we use in-band management, the link mode is set to sgmii, and phylink_expects_phy() checks if we are in in-band mode AND 802.3z. As we have an SFP and the link mode will be changed according to the module we plug-in, there should be no problem switching phy-mode to "1000BaseX", so I'm perfectly fine with this solution. However, is it semantically correct to use sgmii here ? If so, it may be a bit counter-intuitive to have to set the mode to 1000BaseX just so that the phylink_expects_phy() check passes ? Thanks for the quick reply, Maxime