Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp2225106rwe; Sun, 28 Aug 2022 06:34:37 -0700 (PDT) X-Google-Smtp-Source: AA6agR55a2RivIDbEhlNkJosJD+lq+8r9aJ6VyH08oeLmjrcth/0G6GiTZ4URQgZvZAhojwUm9Py X-Received: by 2002:a17:902:d643:b0:172:84c4:d513 with SMTP id y3-20020a170902d64300b0017284c4d513mr12285042plh.138.1661693677095; Sun, 28 Aug 2022 06:34:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661693677; cv=none; d=google.com; s=arc-20160816; b=QwcHNve4jB8j61xlbhSKYdONURlNKBxdv9GBgNv3cEweEZ2inDIr3jPCs/dvPxXF6+ BwPApHtkC1P2mN71xRItNn4flIiKRVjyzmSFuopasKi1W5o3fRFKNE2AcU44DdhZStm8 DS1BzxyibskUFFVV6zjx77iCoLjE46qQzPyDEWOwGAi+xkVfdJNtv1Z3udZKOWJazgFi Zyp2n40S3UMEHDFPKChS4wC/IsEU9pI0256ns0tWoN7YO50hSe6DKmCA48gGmLVTTjgn wxerhD+GdH6yrKG8OrMVNpcsZw67EXSLaD+EbTiZ4/KavU3l/lavmj/yi4kRh3AkLaPb GVCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=3kAQ5K5eIGeNzDKGV7oJwvNpJhXIVKVpoG1HfB4JozY=; b=o3fnC1QstiiQZ40O/ugWECf+LyiVeGGU+YPsJIF3P5MxnBEaIQJjN4ijRZQizjfr2a /Xt79LHQuelLLC8L9lvS2C2p4X+162lrghMUyHkTvAIdvbUJlU4uSkb+ZFHG2vngxDFZ tKl9jLRe+7QnhHwDm+Kncwnp9VaS118ONMOERA7xpwmOkduIJ+nLEG7QQNDHyfl0kdQ8 4a3dcjPXICkvgr4lmZmY2A79GU+VI3lHY1tKQBkMSRsZ8pbbi1BVBK1ytdx5xoR6hzMa yNMq2rVWIM1UyqnoigXLDcUFZz/RdRgjpiNwVJyC/TS/Do6se1+j1vTHBzY9B6IvHysq fGZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=eb5Ic9mB; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z22-20020a17090a8b9600b001fd8d5bb6a2si3669601pjn.57.2022.08.28.06.34.24; Sun, 28 Aug 2022 06:34:37 -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=@gmail.com header.s=20210112 header.b=eb5Ic9mB; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229697AbiH1Nbm (ORCPT + 99 others); Sun, 28 Aug 2022 09:31:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60492 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229511AbiH1Nbj (ORCPT ); Sun, 28 Aug 2022 09:31:39 -0400 Received: from mail-ej1-x635.google.com (mail-ej1-x635.google.com [IPv6:2a00:1450:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CFA6B24BF6; Sun, 28 Aug 2022 06:31:38 -0700 (PDT) Received: by mail-ej1-x635.google.com with SMTP id kk26so10943685ejc.11; Sun, 28 Aug 2022 06:31:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc; bh=3kAQ5K5eIGeNzDKGV7oJwvNpJhXIVKVpoG1HfB4JozY=; b=eb5Ic9mBKxmCXT4VEX4X3k03ETsaS0PsYLQ8P8JU+gR0JYwlPM99sPaBbeGhFXNKx3 baUT3670yeoQYOUVl6CijcTr80ZtczMvGKZFVYXM2n8oVB21oCWwP5vGMB8n8k21FHIp rIbSyHTIcqsF+WuR5q5yhPVnEZebHVTU/FFWRu+99In0OE9USrDAw6acibAxcEiGavzl AsgwaeZDuJXE7bZcFwt+fiZt8k/yqP2+quh/M/mmKh9WVEHLKk6NuXAjMz2B1UHjLBMz vgTegNFhVP2lwoRnRdSeKXHKMkgqbS24b4QsrLImVtU51vcCoFH9pl5ZcHuZkzT3Pvc+ 2EtQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc; bh=3kAQ5K5eIGeNzDKGV7oJwvNpJhXIVKVpoG1HfB4JozY=; b=nRUhqB2m59AFGdSXorotjABxAy6Wq3bLzUBfSp2QJh/COISo8dFPUehuvpt9msLdjI dUcGLAFOya6FarXxrzDqHmZNPBV3/a43VL8Ya7Bb0AZXeL6feKHFTvEvyc6/6KapxQdm wF4MGeR0YBGMchngFRbfWBvd5poRMA7+2ZhfGx0mwdMyB4vqM07Hz/sbavaJSDmfpPxA FGuAbStJ7nXR2WgfYNAlJxb0XSNYbsknY5bUDpbg1DNaosDmz/F3H0XnGMhHaKeuTnph QYPAV22ol9l9j686DR4oFpu53t7NESFNNrRWMO8D+KS/R5n4PCskH3KdzXOkakC74fRz rDfg== X-Gm-Message-State: ACgBeo34YSeNToXhN/kYUkhvD71aWcXdC38CmzM6wLDHOiy76glbs3N0 VlG8piDKPDKJa4rHdeJCZjfUFFZf0Me2SpoFJkTvDmAqC/8= X-Received: by 2002:a17:906:730d:b0:73d:c8a1:a6ae with SMTP id di13-20020a170906730d00b0073dc8a1a6aemr11016005ejc.540.1661693497381; Sun, 28 Aug 2022 06:31:37 -0700 (PDT) MIME-Version: 1.0 References: <20220818050019.1924408-1-keguang.zhang@gmail.com> <20220821171030.wc343w6zmrtcz5to@mobilestation> In-Reply-To: <20220821171030.wc343w6zmrtcz5to@mobilestation> From: Kelvin Cheung Date: Sun, 28 Aug 2022 21:31:25 +0800 Message-ID: Subject: Re: [PATCH] MIPS: loongson32: Fix the validation failure of LS1B & LS1C Ethernet PHY To: Serge Semin Cc: linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, Thomas Bogendoerfer , "David S . Miller" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Hi Serge, Your patch also works for me. But what about the plat_dat->interface? Is it obsolete? Serge Semin =E4=BA=8E2022=E5=B9=B48=E6=9C=8822=E6= =97=A5=E5=91=A8=E4=B8=80 01:10=E5=86=99=E9=81=93=EF=BC=9A > > Hello Keguang > > On Thu, Aug 18, 2022 at 01:00:19PM +0800, Keguang Zhang wrote: > > From: Kelvin Cheung > > > > The Ethernet of LS1B/LS1C doesn't work due to the stmmac driver > > using phylink_generic_validate() instead of stmmac_validate(). > > Moreover the driver assumes the PHY interface mode > > passed in platform data is always supported. > > > > stmmaceth stmmaceth.0 eth0: validation of gmii with support 00000000,00= 000000,000062cf and advertisement 00000000,00000000,000062cf failed: -EINVA= L > > stmmaceth stmmaceth.0 eth0: stmmac_open: Cannot attach to PHY (error: -= 22) > > > > This patch sets phy_interface field of platform data. > > I've got a similar fix in my repo, though didn't have a chance to test > it out due to lacking any loongson hardware. I've discovered the > issues on my still going way of the STMMAC driver refactoring. Anyway > IMO the problem is a bit different than you describe and should be > fixed in a bit different way. Please see a patch attached to this > email. Could you test it out on your hw? If it fixes the problem you > can resend it as v2 patch. > > -Sergey > > > > > Fixes: 04a0683f7db4 ("net: stmmac: convert to phylink_generic_validate(= )") > > Fixes: d194923d51c9 ("net: stmmac: fill in supported_interfaces") > > Signed-off-by: Kelvin Cheung > > --- > > arch/mips/loongson32/common/platform.c | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --git a/arch/mips/loongson32/common/platform.c b/arch/mips/loongso= n32/common/platform.c > > index 794c96c2a4cd..741aace80b80 100644 > > --- a/arch/mips/loongson32/common/platform.c > > +++ b/arch/mips/loongson32/common/platform.c > > @@ -147,8 +147,10 @@ static struct plat_stmmacenet_data ls1x_eth0_pdata= =3D { > > .phy_addr =3D -1, > > #if defined(CONFIG_LOONGSON1_LS1B) > > .interface =3D PHY_INTERFACE_MODE_MII, > > + .phy_interface =3D PHY_INTERFACE_MODE_MII, > > #elif defined(CONFIG_LOONGSON1_LS1C) > > .interface =3D PHY_INTERFACE_MODE_RMII, > > + .phy_interface =3D PHY_INTERFACE_MODE_RMII, > > #endif > > .mdio_bus_data =3D &ls1x_mdio_bus_data, > > .dma_cfg =3D &ls1x_eth_dma_cfg, > > > > base-commit: 568035b01cfb107af8d2e4bd2fb9aea22cf5b868 > > -- > > 2.34.1 > > --=20 Best regards, Kelvin Cheung