Linux-Wireless Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] mt76: mt76x0: fix default mac address overwrite
@ 2019-11-23 22:42 Lorenzo Bianconi
  2019-12-01  9:14 ` Lorenzo Bianconi
  2019-12-02 14:49 ` Kalle Valo
  0 siblings, 2 replies; 5+ messages in thread
From: Lorenzo Bianconi @ 2019-11-23 22:42 UTC (permalink / raw)
  To: nbd; +Cc: linux-wireless, lorenzo.bianconi, kevin.patrick.schmidt

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 <kevin.patrick.schmidt@googlemail.com>
Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
 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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] mt76: mt76x0: fix default mac address overwrite
  2019-11-23 22:42 [PATCH] mt76: mt76x0: fix default mac address overwrite Lorenzo Bianconi
@ 2019-12-01  9:14 ` Lorenzo Bianconi
  2019-12-02  9:16   ` Kalle Valo
       [not found]   ` <0101016ec5e5b1ef-b4e11580-7984-4edc-94ef-5656419b4d26-000000@us-west-2.amazonses.com>
  2019-12-02 14:49 ` Kalle Valo
  1 sibling, 2 replies; 5+ messages in thread
From: Lorenzo Bianconi @ 2019-12-01  9:14 UTC (permalink / raw)
  To: kvalo
  Cc: linux-wireless, lorenzo.bianconi, kevin.patrick.schmidt,
	paweldembicki, freifunk, nbd

[-- Attachment #1: Type: text/plain, Size: 1684 bytes --]

> 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 <kevin.patrick.schmidt@googlemail.com>
> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>

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
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] mt76: mt76x0: fix default mac address overwrite
  2019-12-01  9:14 ` Lorenzo Bianconi
@ 2019-12-02  9:16   ` Kalle Valo
       [not found]   ` <0101016ec5e5b1ef-b4e11580-7984-4edc-94ef-5656419b4d26-000000@us-west-2.amazonses.com>
  1 sibling, 0 replies; 5+ messages in thread
From: Kalle Valo @ 2019-12-02  9:16 UTC (permalink / raw)
  To: Lorenzo Bianconi
  Cc: linux-wireless, lorenzo.bianconi, kevin.patrick.schmidt,
	paweldembicki, freifunk, nbd

Lorenzo Bianconi <lorenzo@kernel.org> 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 <kevin.patrick.schmidt@googlemail.com>
>> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
>
> 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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] mt76: mt76x0: fix default mac address overwrite
       [not found]   ` <0101016ec5e5b1ef-b4e11580-7984-4edc-94ef-5656419b4d26-000000@us-west-2.amazonses.com>
@ 2019-12-02  9:21     ` Lorenzo Bianconi
  0 siblings, 0 replies; 5+ messages in thread
From: Lorenzo Bianconi @ 2019-12-02  9:21 UTC (permalink / raw)
  To: Kalle Valo
  Cc: Lorenzo Bianconi, linux-wireless, kevin.patrick.schmidt,
	paweldembicki, freifunk, nbd

[-- Attachment #1: Type: text/plain, Size: 1040 bytes --]

On Dec 02, Kalle Valo wrote:
> Lorenzo Bianconi <lorenzo@kernel.org> 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 <kevin.patrick.schmidt@googlemail.com>
> >> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
> >
> > 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
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] mt76: mt76x0: fix default mac address overwrite
  2019-11-23 22:42 [PATCH] mt76: mt76x0: fix default mac address overwrite Lorenzo Bianconi
  2019-12-01  9:14 ` Lorenzo Bianconi
@ 2019-12-02 14:49 ` Kalle Valo
  1 sibling, 0 replies; 5+ messages in thread
From: Kalle Valo @ 2019-12-02 14:49 UTC (permalink / raw)
  To: Lorenzo Bianconi
  Cc: nbd, linux-wireless, lorenzo.bianconi, kevin.patrick.schmidt

Lorenzo Bianconi <lorenzo@kernel.org> 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 <kevin.patrick.schmidt@googlemail.com>
> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, back to index

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-23 22:42 [PATCH] mt76: mt76x0: fix default mac address overwrite Lorenzo Bianconi
2019-12-01  9:14 ` Lorenzo Bianconi
2019-12-02  9:16   ` Kalle Valo
     [not found]   ` <0101016ec5e5b1ef-b4e11580-7984-4edc-94ef-5656419b4d26-000000@us-west-2.amazonses.com>
2019-12-02  9:21     ` Lorenzo Bianconi
2019-12-02 14:49 ` Kalle Valo

Linux-Wireless Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-wireless/0 linux-wireless/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-wireless linux-wireless/ https://lore.kernel.org/linux-wireless \
		linux-wireless@vger.kernel.org
	public-inbox-index linux-wireless

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-wireless


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git