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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 06EA8C4345F for ; Wed, 17 Apr 2024 03:10:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ZmB2mNgA8q4RGQiquNCt84NUWuA0LWLQljDpEYXLFWI=; b=VOExHVI8FOCHxCK7e9nC+Efh/M TVHCTkC/WaVpSgxuq/WxYj2caNCRXRqvz/GCJyEFXdW2pMtGFScQo/LMVwU+FJ/aWyZVJ1qMmuo2Y y1X2KmOqJ4SpQT0eUUmmcY6dwAuyEBXedQIWB3XegLAXVTB/ZpDvvjmzbm/x65tddFAoYxzRw/Sax k+BmiCp93V5eWlFn1823PwDnyQRF5KbEB2xPbwVLxZA5KXF226FP8/LZyT/YJzoe8ERdQVFqxytKv lD3sLectbhgRJ/UPmrPegc9gOXgMXj768p73jSmg5lR5DHK3lleZxm0UUVWVha1nieldrWabxQApd 7sqRtNlA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwvgW-0000000EXbz-1dQE; Wed, 17 Apr 2024 03:10:08 +0000 Received: from mail-qk1-x732.google.com ([2607:f8b0:4864:20::732]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rwvgP-0000000EXXs-23OJ; Wed, 17 Apr 2024 03:10:03 +0000 Received: by mail-qk1-x732.google.com with SMTP id af79cd13be357-78d54a3e462so366254385a.0; Tue, 16 Apr 2024 20:09:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713323395; x=1713928195; darn=lists.infradead.org; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to; bh=ZmB2mNgA8q4RGQiquNCt84NUWuA0LWLQljDpEYXLFWI=; b=iYDApKEAG9RnN6ZQob3EfnWpBm1Qf23W++NKM+0pQZbP0MedTb2lSt01uIdniOYUgO lfzfduPD2rM2nLmJa//AuY3rUmRuAM+TkRUeHbj8U0xx/URrNaxk0h3Wgb0bUWuOGRSq 5pLfibypyvEzIs+VPrePRMCtV0Y4ahtUXyIpbCzGm2jhavqZUVBn1pqkcXj2djqtMlcT AgOQxqddVYwYmh0kvi900mEHhlPhx9DP1iv26SX1JMJQpMJRC2sWOyOeHWYVs9Zv1KyM 5YhfQ5YCp+J23KCYQ9CqDmPMSPnGlvopyhCPbgP46Vm+anvzhgVKBmW8Oa/GOAr3Vve/ FgXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713323395; x=1713928195; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=ZmB2mNgA8q4RGQiquNCt84NUWuA0LWLQljDpEYXLFWI=; b=WwX8Has6/KtXBW50DXxEf/c4mCp82Sx1C6dXG0vf/nkA/7gC5p33wUp0Yg5Xf7SrqC UkEAGC+G9X7GrtpRDxHeRbsJAsAcTCm0sji92OH2NFeKoieB4g+PK0LZlKVQIdlygr8G HAl4GyPI9zsbRvTXwybbOzqx84eLSUCwYrQBUp80+0/d7HF1aBE9gi2y+CGgZxeh/QKl bTq3XSoIaLwBTN6RGK5/3KxjVn6epehphRQuLYBvEj2bJEXWyJSEZ4dGaFQd5JelTgIB n2N5LNt4wWH2LW3yAHXSSjrcoZmoIboZxNsS1X23Z5YPTjCxFZqrAftwvAgUep6SRMP0 qThQ== X-Forwarded-Encrypted: i=1; AJvYcCXQf+PjBzmiIm3s7y4TDZ/tAQaaxDDyW8iv2QByrCGarehHZxegXpEkcPQjNUCUHZDj+3wZ7lnw4rGS2E296FU0A9/WaDO+MjvHCOT8jHKS0/iNyddPlPe0QIPbfUuALaeBD+ZG2hL74YQqGWB8V00RgbwBSqL1KPg= X-Gm-Message-State: AOJu0YwX4dCUNEuKkdDXTufXYqsv4U0bYSmpyGsL9fng4um413cj4C1W nlWRbBeJCUJArMS4mLPE15Q01sk4Ep48qt/C8VZu3yr6hq9p3EAV X-Google-Smtp-Source: AGHT+IETJ9k9mKCNBunC8b0Yz1c8lQDgg7FAC6fT4smpbBh487SS1A3TsJejAqG3PArmUu07sETxxw== X-Received: by 2002:a05:620a:47aa:b0:78e:dcb2:4cbb with SMTP id dt42-20020a05620a47aa00b0078edcb24cbbmr11078301qkb.31.1713323395272; Tue, 16 Apr 2024 20:09:55 -0700 (PDT) Received: from [192.168.1.3] (ip68-4-215-93.oc.oc.cox.net. [68.4.215.93]) by smtp.gmail.com with ESMTPSA id v1-20020a05620a090100b0078ede19b680sm4229193qkv.75.2024.04.16.20.09.52 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 16 Apr 2024 20:09:54 -0700 (PDT) Message-ID: <050ef345-9f4c-437c-863b-fdb8e2a47041@gmail.com> Date: Tue, 16 Apr 2024 20:09:50 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH net-next v2 1/2] net: dsa: mt7530-mdio: read PHY address of switch from device tree To: =?UTF-8?B?QXLEsW7DpyDDnE5BTA==?= , Daniel Golle , DENG Qingfang , Sean Wang , Andrew Lunn , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Matthias Brugger , AngeloGioacchino Del Regno Cc: Bartel Eerdekens , mithat.guner@xeront.com, erkin.bozoglu@xeront.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org References: <20240414-b4-for-netnext-mt7530-phy-addr-from-dt-and-simplify-core-ops-v2-0-1a7649c4d3b6@arinc9.com> <20240414-b4-for-netnext-mt7530-phy-addr-from-dt-and-simplify-core-ops-v2-1-1a7649c4d3b6@arinc9.com> <459b31bd-64b3-4804-bc5a-c8ffd145e055@gmail.com> <7d0ded52-14f0-4f6a-b639-72f537603be8@arinc9.com> Content-Language: en-US From: Florian Fainelli Autocrypt: addr=f.fainelli@gmail.com; keydata= xsDiBEjPuBIRBACW9MxSJU9fvEOCTnRNqG/13rAGsj+vJqontvoDSNxRgmafP8d3nesnqPyR xGlkaOSDuu09rxuW+69Y2f1TzjFuGpBk4ysWOR85O2Nx8AJ6fYGCoeTbovrNlGT1M9obSFGQ X3IzRnWoqlfudjTO5TKoqkbOgpYqIo5n1QbEjCCwCwCg3DOH/4ug2AUUlcIT9/l3pGvoRJ0E AICDzi3l7pmC5IWn2n1mvP5247urtHFs/uusE827DDj3K8Upn2vYiOFMBhGsxAk6YKV6IP0d ZdWX6fqkJJlu9cSDvWtO1hXeHIfQIE/xcqvlRH783KrihLcsmnBqOiS6rJDO2x1eAgC8meAX SAgsrBhcgGl2Rl5gh/jkeA5ykwbxA/9u1eEuL70Qzt5APJmqVXR+kWvrqdBVPoUNy/tQ8mYc nzJJ63ng3tHhnwHXZOu8hL4nqwlYHRa9eeglXYhBqja4ZvIvCEqSmEukfivk+DlIgVoOAJbh qIWgvr3SIEuR6ayY3f5j0f2ejUMYlYYnKdiHXFlF9uXm1ELrb0YX4GMHz80nRmxvcmlhbiBG YWluZW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khkO6shjXhQh7nQb33FjGO4P WU11Nr9i/qoV8QCo12MQEo244RRA6VMud06y/E449rWZFSTwGqb0FS0seTcYNvxt8PB2izX+ HZA8SL54j479ubxhfuoTu5nXdtFYFj5Lj5x34LKPx7MpgAmj0H7SDhpFWF2FzcC1bjiW9mjW HaKaX23Awt97AqQZXegbfkJwX2Y53ufq8Np3e1542lh3/mpiGSilCsaTahEGrHK+lIusl6mz Joil+u3k01ofvJMK0ZdzGUZ/aPMZ16LofjFA+MNxWrZFrkYmiGdv+LG45zSlZyIvzSiG2lKy kuVag+IijCIom78P9jRtB1q1Q5lwZp2TLAJlz92DmFwBg1hyFzwDADjZ2nrDxKUiybXIgZp9 aU2d++ptEGCVJOfEW4qpWCCLPbOT7XBr+g/4H3qWbs3j/cDDq7LuVYIe+wchy/iXEJaQVeTC y5arMQorqTFWlEOgRA8OP47L9knl9i4xuR0euV6DChDrguup2aJVU8JPBBgRAgAPAhsMBQJU X9LxBQkeXB3fAAoJEGFXmRW1Y3YOj4UAn3nrFLPZekMeqX5aD/aq/dsbXSfyAKC45Go0YyxV HGuUuzv+GKZ6nsysJw== In-Reply-To: <7d0ded52-14f0-4f6a-b639-72f537603be8@arinc9.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240416_201001_708797_E23F9E7D X-CRM114-Status: GOOD ( 21.41 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org On 4/16/2024 1:32 AM, Arınç ÜNAL wrote: > On 15/04/2024 18:30, Florian Fainelli wrote: >> >> >> On 4/13/2024 11:07 PM, Arınç ÜNAL via B4 Relay wrote: >>> From: Arınç ÜNAL >>> >>> Read the PHY address the switch listens on from the reg property of the >>> switch node on the device tree. This change brings support for MT7530 >>> switches on boards with such bootstrapping configuration where the >>> switch >>> listens on a different PHY address than the hardcoded PHY address on the >>> driver, 31. >>> >>> As described on the "MT7621 Programming Guide v0.4" document, the MT7530 >>> switch and its PHYs can be configured to listen on the range of 7-12, >>> 15-20, 23-28, and 31 and 0-4 PHY addresses. >>> >>> There are operations where the switch PHY registers are used. For the >>> PHY >>> address of the control PHY, transform the MT753X_CTRL_PHY_ADDR constant >>> into a macro and use it. The PHY address for the control PHY is 0 >>> when the >>> switch listens on 31. In any other case, it is one greater than the PHY >>> address the switch listens on. >>> >>> Reviewed-by: Daniel Golle >>> Tested-by: Daniel Golle >>> Signed-off-by: Arınç ÜNAL >> >> Reviewed-by: Florian Fainelli >> >> I would go a step further and name phy_addr switch_mdio_addr, or >> something along those lines to clearly denote this is not a per-port >> PHY address neither a proper PHY device, but we've already had a >> similar discussion before about spelling this out clearly as a "pseudo >> PHY".... > > I am fine with calling the switch operating on an MDIO bus a psuedo-PHY. > But I don't believe this grants making up names on our own instead of using > the name described in IEEE Std 802.3-2022. The switch listens on a PHY > address on the MDIO bus. The switch listens at a particular address on the MDIO bus, that is the key thing. Whether the addressable device happens to be an Ethernet/SATA/PCIe/USB PHY, an accelerometer, a light switch or an Ethernet switch does not matter as long as it is addressable over clause 22 and/or 45. For all that matters the switch's MDIO interface is not a PHY, otherwise its registers 0-15 would be abiding by the IEEE 802.3-2022 standard, and that is not the case. > The description for the phy_addr member of the > mt753x_info structure clearly explains that so I don't see a reason to > change the variable name. IMHO it is clearer to use mdiodev->addr through and through, the shorthand is not necessary and does not save that many characters to type in the first place. Saving a mdiodev pointer into mt7530_priv and accessing priv->mdiodev->addr would be 18 characters to type versus 14 with priv->phy_addr. Anyway. -- Florian