2019-11-23 22:46:31

by Lorenzo Bianconi

[permalink] [raw]
Subject: [PATCH] mt76: mt76x0: fix default mac address overwrite

Current implementation always use default eeprom mac address to
configure device registers even if it is updated using
mt76_eeprom_override. Fix it initializing macaddr filed of mt76_dev data
structure with eeprom mac address and running mt76_eeprom_override
before mt76x02_mac_setaddr

Fixes: d1bc9bf2072c ("mt76: mt76x0: eeprom: add support for MAC address from OF")
Tested-by: Kevin Schmidt <[email protected]>
Signed-off-by: Lorenzo Bianconi <[email protected]>
---
drivers/net/wireless/mediatek/mt76/mt76x0/eeprom.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/mediatek/mt76/mt76x0/eeprom.c b/drivers/net/wireless/mediatek/mt76/mt76x0/eeprom.c
index a03e2d01fba7..d1405528b504 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x0/eeprom.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76x0/eeprom.c
@@ -342,8 +342,11 @@ int mt76x0_eeprom_init(struct mt76x02_dev *dev)
dev_info(dev->mt76.dev, "EEPROM ver:%02hhx fae:%02hhx\n",
version, fae);

- mt76x02_mac_setaddr(dev, dev->mt76.eeprom.data + MT_EE_MAC_ADDR);
+ memcpy(dev->mt76.macaddr, (u8 *)dev->mt76.eeprom.data + MT_EE_MAC_ADDR,
+ ETH_ALEN);
mt76_eeprom_override(&dev->mt76);
+ mt76x02_mac_setaddr(dev, dev->mt76.macaddr);
+
mt76x0_set_chip_cap(dev);
mt76x0_set_freq_offset(dev);
mt76x0_set_temp_offset(dev);
--
2.21.0


2019-12-01 09:20:40

by Lorenzo Bianconi

[permalink] [raw]
Subject: Re: [PATCH] mt76: mt76x0: fix default mac address overwrite

> Current implementation always use default eeprom mac address to
> configure device registers even if it is updated using
> mt76_eeprom_override. Fix it initializing macaddr filed of mt76_dev data
> structure with eeprom mac address and running mt76_eeprom_override
> before mt76x02_mac_setaddr
>
> Fixes: d1bc9bf2072c ("mt76: mt76x0: eeprom: add support for MAC address from OF")
> Tested-by: Kevin Schmidt <[email protected]>
> Signed-off-by: Lorenzo Bianconi <[email protected]>

Hi Kalle,

since the commit d1bc9bf2072c is already in Linus's tree and multiple users
reported regression due this commit, could you please apply this patch in
wireless-drivers tree?

Regards,
Lorenzo

> ---
> drivers/net/wireless/mediatek/mt76/mt76x0/eeprom.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/wireless/mediatek/mt76/mt76x0/eeprom.c b/drivers/net/wireless/mediatek/mt76/mt76x0/eeprom.c
> index a03e2d01fba7..d1405528b504 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt76x0/eeprom.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt76x0/eeprom.c
> @@ -342,8 +342,11 @@ int mt76x0_eeprom_init(struct mt76x02_dev *dev)
> dev_info(dev->mt76.dev, "EEPROM ver:%02hhx fae:%02hhx\n",
> version, fae);
>
> - mt76x02_mac_setaddr(dev, dev->mt76.eeprom.data + MT_EE_MAC_ADDR);
> + memcpy(dev->mt76.macaddr, (u8 *)dev->mt76.eeprom.data + MT_EE_MAC_ADDR,
> + ETH_ALEN);
> mt76_eeprom_override(&dev->mt76);
> + mt76x02_mac_setaddr(dev, dev->mt76.macaddr);
> +
> mt76x0_set_chip_cap(dev);
> mt76x0_set_freq_offset(dev);
> mt76x0_set_temp_offset(dev);
> --
> 2.21.0
>


Attachments:
(No filename) (1.64 kB)
signature.asc (235.00 B)
Download all attachments

2019-12-02 09:17:22

by Kalle Valo

[permalink] [raw]
Subject: Re: [PATCH] mt76: mt76x0: fix default mac address overwrite

Lorenzo Bianconi <[email protected]> writes:

>> Current implementation always use default eeprom mac address to
>> configure device registers even if it is updated using
>> mt76_eeprom_override. Fix it initializing macaddr filed of mt76_dev data
>> structure with eeprom mac address and running mt76_eeprom_override
>> before mt76x02_mac_setaddr
>>
>> Fixes: d1bc9bf2072c ("mt76: mt76x0: eeprom: add support for MAC address from OF")
>> Tested-by: Kevin Schmidt <[email protected]>
>> Signed-off-by: Lorenzo Bianconi <[email protected]>
>
> Hi Kalle,
>
> since the commit d1bc9bf2072c is already in Linus's tree and multiple users
> reported regression due this commit, could you please apply this patch in
> wireless-drivers tree?

Ok, I assigned this to me in patchwork and I'll queue this for v5.5.

--
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

2019-12-02 09:23:27

by Lorenzo Bianconi

[permalink] [raw]
Subject: Re: [PATCH] mt76: mt76x0: fix default mac address overwrite

On Dec 02, Kalle Valo wrote:
> Lorenzo Bianconi <[email protected]> writes:
>
> >> Current implementation always use default eeprom mac address to
> >> configure device registers even if it is updated using
> >> mt76_eeprom_override. Fix it initializing macaddr filed of mt76_dev data
> >> structure with eeprom mac address and running mt76_eeprom_override
> >> before mt76x02_mac_setaddr
> >>
> >> Fixes: d1bc9bf2072c ("mt76: mt76x0: eeprom: add support for MAC address from OF")
> >> Tested-by: Kevin Schmidt <[email protected]>
> >> Signed-off-by: Lorenzo Bianconi <[email protected]>
> >
> > Hi Kalle,
> >
> > since the commit d1bc9bf2072c is already in Linus's tree and multiple users
> > reported regression due this commit, could you please apply this patch in
> > wireless-drivers tree?
>
> Ok, I assigned this to me in patchwork and I'll queue this for v5.5.

Thx.

Regards,
Lorenzo

>
> --
> https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
>


Attachments:
(No filename) (1.02 kB)
signature.asc (235.00 B)
Download all attachments

2019-12-02 14:50:07

by Kalle Valo

[permalink] [raw]
Subject: Re: [PATCH] mt76: mt76x0: fix default mac address overwrite

Lorenzo Bianconi <[email protected]> wrote:

> Current implementation always use default eeprom mac address to
> configure device registers even if it is updated using
> mt76_eeprom_override. Fix it initializing macaddr filed of mt76_dev data
> structure with eeprom mac address and running mt76_eeprom_override
> before mt76x02_mac_setaddr
>
> Fixes: d1bc9bf2072c ("mt76: mt76x0: eeprom: add support for MAC address from OF")
> Tested-by: Kevin Schmidt <[email protected]>
> Signed-off-by: Lorenzo Bianconi <[email protected]>

Patch applied to wireless-drivers.git, thanks.

693d060536ab mt76: mt76x0: fix default mac address overwrite

--
https://patchwork.kernel.org/patch/11259011/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches