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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 57138C001B0 for ; Fri, 23 Jun 2023 15:08:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232410AbjFWPIV convert rfc822-to-8bit (ORCPT ); Fri, 23 Jun 2023 11:08:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56150 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231271AbjFWPIO (ORCPT ); Fri, 23 Jun 2023 11:08:14 -0400 Received: from unicorn.mansr.com (unicorn.mansr.com [81.2.72.234]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 892772139 for ; Fri, 23 Jun 2023 08:08:08 -0700 (PDT) Received: from raven.mansr.com (raven.mansr.com [IPv6:2001:8b0:ca0d:1::3]) by unicorn.mansr.com (Postfix) with ESMTPS id 62CB315360; Fri, 23 Jun 2023 15:58:03 +0100 (BST) Received: by raven.mansr.com (Postfix, from userid 51770) id 5590D219FD4; Fri, 23 Jun 2023 15:58:03 +0100 (BST) From: =?iso-8859-1?Q?M=E5ns_Rullg=E5rd?= To: Tony Lindgren Cc: Jeroen Hofstee , netdev@vger.kernel.org, Mugunthan V N , Grygorii Strashko , "open list:TI ETHERNET SWITCH DRIVER (CPSW)" , open list Subject: Re: [PATCH v2] net: cpsw: fix obtaining mac address for am3517 References: <1477668756-2651-1-git-send-email-jhofstee@victronenergy.com> <20161028155213.2t3nwwe3lqaynaer@atomide.com> <20161028181914.mskebckucukzhxhz@atomide.com> Date: Fri, 23 Jun 2023 15:58:03 +0100 In-Reply-To: <20161028181914.mskebckucukzhxhz@atomide.com> (Tony Lindgren's message of "Fri, 28 Oct 2016 11:19:14 -0700") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Tony Lindgren writes: > * Jeroen Hofstee [161028 11:19]: >> Hello Tony, >> >> On 28-10-16 17:52, Tony Lindgren wrote: >> > * Jeroen Hofstee [161028 08:33]: >> > > Commit b6745f6e4e63 ("drivers: net: cpsw: davinci_emac: move reading mac >> > > id to common file") did not only move the code for an am3517, it also >> > > added the slave parameter, resulting in an invalid (all zero) mac address >> > > being returned for an am3517, since it only has a single emac and the slave >> > > parameter is pointing to the second. So simply always read the first and >> > > valid mac-address for a ti,am3517-emac. >> > And others davinci_emac.c users can have more than one. So is the >> > reason the slave parameter points to the second instance because >> > of the location in the hardware? >> >> Sort of, the slave parameter gets determined by the fact if there is one >> or two register range(s) associated with the davinci_emac. In davinci_emac.c >> >> res_ctrl = platform_get_resource(pdev, IORESOURCE_MEM, 1); >> ... >> rc = davinci_emac_try_get_mac(pdev, res_ctrl ? 0 : 1, >> priv->mac_addr); >> >> So it there are two ranges, the slave param becomes 0. It there is only one, >> it >> will be 1. Since the am3517 only has a single regs entry it ends up with >> slave 1, >> while there is only a single davinci_emac. > > OK thanks for clarifying it: > > Acked-by: Tony Lindgren Is there some reason this patch was never picked up, or was it simply forgotten? -- Måns Rullgård