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 X-Spam-Level: X-Spam-Status: No, score=-6.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A6AFBC433DF for ; Tue, 20 Oct 2020 12:50:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4C95822282 for ; Tue, 20 Oct 2020 12:50:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2406673AbgJTMuD (ORCPT ); Tue, 20 Oct 2020 08:50:03 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:36522 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2406594AbgJTMuD (ORCPT ); Tue, 20 Oct 2020 08:50:03 -0400 Received: from andrew by vps0.lunn.ch with local (Exim 4.94) (envelope-from ) id 1kUr5V-002fTB-Rg; Tue, 20 Oct 2020 14:50:01 +0200 Date: Tue, 20 Oct 2020 14:50:01 +0200 From: Andrew Lunn To: Ard Biesheuvel Cc: netdev@vger.kernel.org, Jassi Brar , Ilias Apalodimas , Masami Hiramatsu , Willy Liu , "David S. Miller" , Jakub Kicinski , Masahisa Kojima , Serge Semin Subject: Re: [PATCH net] netsec: ignore 'phy-mode' device property on ACPI systems Message-ID: <20201020125001.GX456889@lunn.ch> References: <20201018163625.2392-1-ardb@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201018163625.2392-1-ardb@kernel.org> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Sun, Oct 18, 2020 at 06:36:25PM +0200, Ard Biesheuvel wrote: > Since commit bbc4d71d63549bc ("net: phy: realtek: fix rtl8211e rx/tx > delay config"), the Realtek PHY driver will override any TX/RX delay > set by hardware straps if the phy-mode device property does not match. > > This is causing problems on SynQuacer based platforms (the only SoC > that incorporates the netsec hardware), since many were built with > this Realtek PHY, and shipped with firmware that defines the phy-mode > as 'rgmii', even though the PHY is configured for TX and RX delay using > pull-ups. > > >From the driver's perspective, we should not make any assumptions in > the general case that the PHY hardware does not require any initial > configuration. However, the situation is slightly different for ACPI > boot, since it implies rich firmware with AML abstractions to handle > hardware details that are not exposed to the OS. So in the ACPI case, > it is reasonable to assume that the PHY comes up in the right mode, > regardless of whether the mode is set by straps, by boot time firmware > or by AML executed by the ACPI interpreter. > > So let's ignore the 'phy-mode' device property when probing the netsec > driver in ACPI mode, and hardcode the mode to PHY_INTERFACE_MODE_NA, > which should work with any PHY provided that it is configured by the > time the driver attaches to it. While at it, document that omitting > the mode is permitted for DT probing as well, by setting the phy-mode > DT property to the empty string. > > Cc: Jassi Brar > Cc: Ilias Apalodimas > Cc: Masami Hiramatsu > Cc: Andrew Lunn > Cc: Willy Liu > Cc: "David S. Miller" > Cc: Jakub Kicinski > Cc: Masahisa Kojima > Cc: Serge Semin > Fixes: 533dd11a12f6 ("net: socionext: Add Synquacer NetSec driver") > Signed-off-by: Ard Biesheuvel Reviewed-by: Andrew Lunn Andrew