From: "Måns Rullgård" <mans@mansr.com>
To: Tony Lindgren <tony@atomide.com>
Cc: Jeroen Hofstee <jhofstee@victronenergy.com>,
netdev@vger.kernel.org, Mugunthan V N <mugunthanvnm@ti.com>,
Grygorii Strashko <grygorii.strashko@ti.com>,
"open list\:TI ETHERNET SWITCH DRIVER \(CPSW\)"
<linux-omap@vger.kernel.org>,
open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] net: cpsw: fix obtaining mac address for am3517
Date: Fri, 01 Mar 2019 14:52:45 +0000 [thread overview]
Message-ID: <yw1ximx26402.fsf@mansr.com> (raw)
In-Reply-To: <20161028181914.mskebckucukzhxhz@atomide.com> (Tony Lindgren's message of "Fri, 28 Oct 2016 11:19:14 -0700")
Tony Lindgren <tony@atomide.com> writes:
> * Jeroen Hofstee <jhofstee@victronenergy.com> [161028 11:19]:
>> Hello Tony,
>>
>> On 28-10-16 17:52, Tony Lindgren wrote:
>> > * Jeroen Hofstee <jhofstee@victronenergy.com> [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 <tony@atomide.com>
What happened to this patch?
--
Måns Rullgård
next prev parent reply other threads:[~2019-03-01 14:52 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1477668756-2651-1-git-send-email-jhofstee@victronenergy.com>
2016-10-28 15:52 ` [PATCH v2] net: cpsw: fix obtaining mac address for am3517 Tony Lindgren
2016-10-28 18:17 ` Jeroen Hofstee
2016-10-28 18:19 ` Tony Lindgren
2019-03-01 14:52 ` Måns Rullgård [this message]
2023-06-23 14:58 ` Måns Rullgård
2023-06-23 20:14 ` Simon Horman
2023-06-23 21:13 ` Jeroen Hofstee
2023-06-23 21:41 ` Andrew Lunn
2023-06-24 14:55 ` Simon Horman
2023-06-24 15:02 ` Måns Rullgård
2023-06-24 15:53 ` Simon Horman
2023-06-24 15:59 ` Måns Rullgård
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=yw1ximx26402.fsf@mansr.com \
--to=mans@mansr.com \
--cc=grygorii.strashko@ti.com \
--cc=jhofstee@victronenergy.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=mugunthanvnm@ti.com \
--cc=netdev@vger.kernel.org \
--cc=tony@atomide.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).