Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp758289rwr; Wed, 26 Apr 2023 06:08:31 -0700 (PDT) X-Google-Smtp-Source: AKy350YGrkmWgC5UCsWUK+0Pakajp5IQalFmjSdTKcAc+ndr1PawOb6h3AJCWAgDxIXQTpAE9MwB X-Received: by 2002:a17:90a:9a8b:b0:247:53b4:ec52 with SMTP id e11-20020a17090a9a8b00b0024753b4ec52mr20522315pjp.8.1682514510977; Wed, 26 Apr 2023 06:08:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682514510; cv=none; d=google.com; s=arc-20160816; b=ct5d3XTpV5eta5FH9+GT6NGszXJTM6S9lDHa7W/PO9gwW9w3n8JR3vaszqJA6YP+PA OjdYEbGE1kvQmcoSyiIf/Agl1A0waqr/uzytzsjPYIscsD2NoY+EICeeYEi3nfcdXVtA Mb2L926aKWoAqmGQGFtvL8F80BQW8opPdyEpLYkLQ02r10esxikzNk2CWQw+4kfBX9m3 WESRnjtphXg+V7xb2ZGh2D/7dcVDWNbszUN/ZtWYtAFmRudkFPnPy+x19UrJSr8pNM7X ePlnBOD4ejF9cuqSl0ylRSsubbAspJ0c8NFPjMPv7iURFtnPv7/eATm+6MZW8LzRsC6f MOOQ== 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=DZNqjfdQOuqzJ3kVZRYTgiz2unGBFuvW0+zVW2+EbFs=; b=KRojg0A1TpRFAJZJpIwIeE4E9QstoQpa6SBtgxvpLLfr2UsjqvjxTWSXaGfU/e9zD5 zC3y7oh8LAtxpnbvxTN8FeIHX4UN1o4oPrHiZDig40ec4O1hNICLTEbMuemTzRIIqqkY DvPSWG9ROmAW8WZF/VIkzmZO0xN7vE4LDC9z37LAefGEzeRXd/bNDKzY07j9vTD2t1eE r5Qclalc/XFl8z9DmAS9FFKBu/fGpCSQVFzZV2Yo4M1Ym/97alTmiZTLGz7suvQQaD9C I/nIEG3lDBN2o3gpEIShaLIn4Wd+ierPOzBfVlkMGPH1jCKXjEau5EwZCxG0KlBpQ3LS 9ZdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=FTANkcon; 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 w17-20020a63d751000000b0051b930ef846si15958298pgi.141.2023.04.26.06.08.11; Wed, 26 Apr 2023 06:08:30 -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=@lunn.ch header.s=20171124 header.b=FTANkcon; 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 S240876AbjDZNHX (ORCPT + 99 others); Wed, 26 Apr 2023 09:07:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41496 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240506AbjDZNHW (ORCPT ); Wed, 26 Apr 2023 09:07:22 -0400 Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 96A032D7E; Wed, 26 Apr 2023 06:07:21 -0700 (PDT) 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=DZNqjfdQOuqzJ3kVZRYTgiz2unGBFuvW0+zVW2+EbFs=; b=FTANkconCKruRK6Aa2GGuNgRy1 7md18qyPgkpMtOjioDdwbQOBHFw55+o6q5ZnR1g+lpUGuGmryc3iQPv5j9AGnc07DWea/dIk/7i07 V0KVOJeFgsFeAw+gjBIKJmMcIfkGXauI15NNpX751iD4xfLw+tzhrgIPW5yFp5xWnZ0U=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1preSH-00BGpF-Fm; Wed, 26 Apr 2023 14:41:05 +0200 Date: Wed, 26 Apr 2023 14:41:05 +0200 From: Andrew Lunn To: Siddharth Vadapalli Cc: hkallweit1@gmail.com, linux@armlinux.org.uk, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, srk@ti.com Subject: Re: [RFC PATCH 2/2] net: phy: dp83869: fix mii mode when rgmii strap cfg is used Message-ID: <5a2bc044-5fb0-4162-a75a-24c94f8ed3f7@lunn.ch> References: <20230425054429.3956535-1-s-vadapalli@ti.com> <20230425054429.3956535-3-s-vadapalli@ti.com> <99932a4f-4573-b80b-080b-7d9d3f57bef0@ti.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <99932a4f-4573-b80b-080b-7d9d3f57bef0@ti.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, T_SCC_BODY_TEXT_LINE,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 > >> @@ -692,8 +692,11 @@ static int dp83869_configure_mode(struct phy_device *phydev, > >> /* Below init sequence for each operational mode is defined in > >> * section 9.4.8 of the datasheet. > >> */ > >> + phy_ctrl_val = dp83869->mode; > >> + if (phydev->interface == PHY_INTERFACE_MODE_MII) > >> + phy_ctrl_val |= DP83869_OP_MODE_MII; > > > > Should there be some validation here with dp83869->mode? > > > > DP83869_RGMII_COPPER_ETHERNET, DP83869_RGMII_SGMII_BRIDGE etc don't > > make sense if MII is being used. DP83869_100M_MEDIA_CONVERT and maybe > > DP83869_RGMII_100_BASE seem to be the only valid modes with MII? > > The DP83869_OP_MODE_MII macro corresponds to BIT(5) which is the RGMII_MII_SEL > bit in the OP_MODE_DECODE register. If the RGMII_MII_SEL bit is set, MII mode is > selected. If the bit is cleared, which is the default value, RGMII mode is > selected. As pointed out by you, there are modes which aren't valid with MII > mode. However, a mode which isn't valid with RGMII mode (default value of the > RGMII_MII_SEL bit) also exists: DP83869_SGMII_COPPER_ETHERNET. For this reason, > I believe that setting the bit when MII mode is requested shouldn't cause any > issues. If you say so. I was just thinking you could give the poor software engineer a hint the hardware engineer has put on strapping resistors which means the PHY is not going to work. Andrew