Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp5793196rwb; Tue, 17 Jan 2023 19:16:09 -0800 (PST) X-Google-Smtp-Source: AMrXdXtFeaww5sEqXBBZFsQBrRcmT/s/PSDYSIKAH2o0zuHqG0i+3BHpPKG/rPd3OqcTFVchebXM X-Received: by 2002:aa7:874c:0:b0:58d:a1e9:36d with SMTP id g12-20020aa7874c000000b0058da1e9036dmr5790488pfo.31.1674011769054; Tue, 17 Jan 2023 19:16:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674011769; cv=none; d=google.com; s=arc-20160816; b=rC1kxxWYu6YUKrvFFBopn/vEyqxCqfZtMF3xHxXxugkbQkenBRG5/Jmv9vDUXs1H5X KDpKVjMjY3ugm2DNatCcJPLZJV2DUANDaWiOBYoSpIDey6DVGceFCp2DsGZXSGL822aO 0ey+dWNWIJje5gIeg44yME4CZdfJWJNPA2Mk4IaD7Vf/BKq5iFrgCsATtIbSGXWWNF3V Z4sUcoP2i/FQRVDcY5aJbDYEs8TN3AkzsxFJyUMzT4XECk+k5Zcw3pmSP3wJhkvUmbxm 23RglCscOmNxM7WQM0w510+SQUxTdJupKaf7Off1ubsKFuL/w1dAu8JAkJVdpxcUFwTu 5HVw== 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-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=YpFIqPtiW9OaArCWKSRp3L+DqFNQiRH+JQ1OhEOlGjI=; b=xxcRW4hXHlNhPaW6BKQXq/D+Kb2avwUsMVaeOnZPY3zkcZe8N4HgykuRBBTlQqzYYS oBUX+sMBZWDN+8Wl5n1YQJCPVj4AG84wVRsecYLLLM1dtVzJGvPTslXnMrR4YXs5QukE 3Zv2F+EyfLuBgNFCamVLwZjHqLt4gDqsWRx8eGR9yolJIJfwkO8Np5TKfGQN2WVTNws9 37Xyy+V0ngOHV/27FJZtk2Fa2N+n5tbQoGm5BbiwqYKe2QPreGuRemqi1XG07G62ewDf wjhk4USCY0II7K5ksKil+B7uXFf0cW0qlyOFWRDfPyIWfBgsVbxtYOJ5JgLzHW074nGJ ARPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=rxrXmtzX; 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 x25-20020a056a00189900b0058da2638110si9446709pfh.182.2023.01.17.19.16.03; Tue, 17 Jan 2023 19:16:09 -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=rxrXmtzX; 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 S229722AbjARDCv (ORCPT + 46 others); Tue, 17 Jan 2023 22:02:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37434 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229453AbjARDCt (ORCPT ); Tue, 17 Jan 2023 22:02:49 -0500 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D6C714FC3F; Tue, 17 Jan 2023 19:02:48 -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-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=YpFIqPtiW9OaArCWKSRp3L+DqFNQiRH+JQ1OhEOlGjI=; b=rxrXmtzX8EDhlqVUNG11/gu1vH shFj+DiZINeRAGuhzhZj7Z2VUE5toQKxh0HgQcmt+heR4x5DTEyzFKc6lh71kxN6eGIEI8+yRV3IT 0AlvXJeiM81lkLXQZ0jFMd9iA2i7kJ+imPcrq1MpLFWrGxrPOFK9H2F29MwKxWx5wuIE=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1pHyip-002OEV-MM; Wed, 18 Jan 2023 04:02:43 +0100 Date: Wed, 18 Jan 2023 04:02:43 +0100 From: Andrew Lunn To: Jerome Brunet Cc: netdev@vger.kernel.org, "David S. Miller" , linux-amlogic@lists.infradead.org, Kevin Hilman , Neil Armstrong , Da Xue , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next 2/2] net: mdio: add amlogic gxl mdio mux support Message-ID: References: <20230116091637.272923-1-jbrunet@baylibre.com> <20230116091637.272923-3-jbrunet@baylibre.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230116091637.272923-3-jbrunet@baylibre.com> 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 > +static int gxl_enable_internal_mdio(struct gxl_mdio_mux *priv) > +{ > + u32 val; > + > + /* Setup the internal phy */ > + val = (REG3_ENH | > + FIELD_PREP(REG3_CFGMODE, 0x7) | > + REG3_AUTOMDIX | > + FIELD_PREP(REG3_PHYADDR, 8) | > + REG3_LEDPOL | > + REG3_PHYMDI | > + REG3_CLKINEN | > + REG3_PHYIP); > + > + writel_relaxed(REG4_PWRUPRSTSIG, priv->regs + ETH_REG4); > + writel_relaxed(val, priv->regs + ETH_REG3); > + mdelay(10); Probably the second _relaxed() should not be. You want it guaranteed to be written out before you do the mdelay(). > + > + /* Set the internal phy id */ > + writel_relaxed(FIELD_PREP(REG2_PHYID, 0x110181), > + priv->regs + ETH_REG2); So how does this play with what Heiner has been reporting recently? What is the reset default? Who determined this value? > + /* Enable the internal phy */ > + val |= REG3_PHYEN; > + writel_relaxed(val, priv->regs + ETH_REG3); > + writel_relaxed(0, priv->regs + ETH_REG4); > + > + /* The phy needs a bit of time to come up */ > + mdelay(10); What do you mean by 'come up'? Not link up i assume. But maybe it will not respond to MDIO requests? Andrew