From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Aaro Koskinen <aaro.koskinen@iki.fi>,
Ralf Baechle <ralf@linux-mips.org>,
David Daney <ddaney.cavm@gmail.com>,
linux-mips@linux-mips.org
Subject: Re: [PATCH v2 2/3] MIPS: OCTEON: device_tree_init: don't fill mac if already set
Date: Wed, 24 Feb 2016 13:25:51 +0300 [thread overview]
Message-ID: <56CD852F.4000204@cogentembedded.com> (raw)
In-Reply-To: <1456267927-2492-3-git-send-email-aaro.koskinen@iki.fi>
Hello.
On 2/24/2016 1:52 AM, Aaro Koskinen wrote:
> Don't fill MAC address if it's already set. This allows DTB to
> override the bootinfo.
>
> Acked-by: David Daney <david.daney@cavium.com>
> Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
> ---
> arch/mips/cavium-octeon/octeon-platform.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/arch/mips/cavium-octeon/octeon-platform.c b/arch/mips/cavium-octeon/octeon-platform.c
> index a7d9f07..7aeafed 100644
> --- a/arch/mips/cavium-octeon/octeon-platform.c
> +++ b/arch/mips/cavium-octeon/octeon-platform.c
> @@ -13,6 +13,7 @@
> #include <linux/i2c.h>
> #include <linux/usb.h>
> #include <linux/dma-mapping.h>
> +#include <linux/etherdevice.h>
> #include <linux/module.h>
> #include <linux/mutex.h>
> #include <linux/slab.h>
> @@ -525,10 +526,17 @@ static void __init octeon_fdt_set_phy(int eth, int phy_addr)
>
> static void __init octeon_fdt_set_mac_addr(int n, u64 *pmac)
> {
> + const u8 *old_mac;
> + int old_len;
> u8 new_mac[6];
> u64 mac = *pmac;
> int r;
>
> + old_mac = fdt_getprop(initial_boot_params, n, "local-mac-address",
> + &old_len);
> + if (!old_mac || old_len != 6 || is_valid_ether_addr(old_mac))
> + return;
So if there's no such prop or the length is not 6, you just return?
[...]
MBR, Sergei
next prev parent reply other threads:[~2016-02-24 10:26 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-23 22:52 [PATCH v2 0/3] MIPS: OCTEON: fill mac addresses with appended DTB Aaro Koskinen
2016-02-23 22:52 ` [PATCH v2 1/3] MIPS: OCTEON: device_tree_init: use separate pass to fill mac addresses Aaro Koskinen
2016-02-23 22:52 ` [PATCH v2 2/3] MIPS: OCTEON: device_tree_init: don't fill mac if already set Aaro Koskinen
2016-02-24 10:25 ` Sergei Shtylyov [this message]
2016-02-24 18:35 ` Aaro Koskinen
2016-02-23 22:52 ` [PATCH v2 3/3] MIPS: OCTEON: device_tree_init: fill mac addresses when using appended dtb Aaro Koskinen
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=56CD852F.4000204@cogentembedded.com \
--to=sergei.shtylyov@cogentembedded.com \
--cc=aaro.koskinen@iki.fi \
--cc=ddaney.cavm@gmail.com \
--cc=linux-mips@linux-mips.org \
--cc=ralf@linux-mips.org \
/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