mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] r8152: Refresh MAC address during USBDEVFS_RESET
@ 2019-03-25 14:12 Mario Limonciello
  2019-03-25 18:02 ` Simon Glass
  2019-03-26 18:50 ` David Miller
  0 siblings, 2 replies; 5+ messages in thread
From: Mario Limonciello @ 2019-03-25 14:12 UTC (permalink / raw)
  To: linux-usb
  Cc: davem, netdev, linux-kernel, hayeswang, sjg, campello, Ryan Hong,
	Crag Wang, Mario Limonciello

On some platforms it is possible to dynamically change the policy
of what MAC address is selected from the ASL at runtime.

These tools will reset the USB device and expect the change to be
made immediately.

Signed-off-by: Mario Limonciello <mario.limonciello@dell.com>
---
 drivers/net/usb/r8152.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
index 86c8c64..eb5351b 100644
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
@@ -4268,6 +4268,9 @@ static int rtl8152_post_reset(struct usb_interface *intf)
 	if (!tp)
 		return 0;
 
+	/* reset the MAC adddress in case of policy change */
+	set_ethernet_addr(tp);
+
 	netdev = tp->netdev;
 	if (!netif_running(netdev))
 		return 0;
-- 
2.7.4


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

* Re: [PATCH] r8152: Refresh MAC address during USBDEVFS_RESET
  2019-03-25 14:12 [PATCH] r8152: Refresh MAC address during USBDEVFS_RESET Mario Limonciello
@ 2019-03-25 18:02 ` Simon Glass
  2019-03-26 18:50 ` David Miller
  1 sibling, 0 replies; 5+ messages in thread
From: Simon Glass @ 2019-03-25 18:02 UTC (permalink / raw)
  To: Mario Limonciello
  Cc: linux-usb, davem, netdev, lk, hayeswang, Daniel Campello,
	Ryan Hong, Crag Wang

On Mon, 25 Mar 2019 at 08:12, Mario Limonciello
<mario.limonciello@dell.com> wrote:
>
> On some platforms it is possible to dynamically change the policy
> of what MAC address is selected from the ASL at runtime.
>
> These tools will reset the USB device and expect the change to be
> made immediately.
>
> Signed-off-by: Mario Limonciello <mario.limonciello@dell.com>
> ---
>  drivers/net/usb/r8152.c | 3 +++
>  1 file changed, 3 insertions(+)

Reviewed-by: Simon Glass <sjg@chromium.org>

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

* Re: [PATCH] r8152: Refresh MAC address during USBDEVFS_RESET
  2019-03-25 14:12 [PATCH] r8152: Refresh MAC address during USBDEVFS_RESET Mario Limonciello
  2019-03-25 18:02 ` Simon Glass
@ 2019-03-26 18:50 ` David Miller
  2019-03-26 19:52   ` Mario.Limonciello
  1 sibling, 1 reply; 5+ messages in thread
From: David Miller @ 2019-03-26 18:50 UTC (permalink / raw)
  To: mario.limonciello
  Cc: linux-usb, netdev, linux-kernel, hayeswang, sjg, campello,
	Ryan.Hong, Crag.Wang

From: Mario Limonciello <mario.limonciello@dell.com>
Date: Mon, 25 Mar 2019 09:12:23 -0500

> On some platforms it is possible to dynamically change the policy
> of what MAC address is selected from the ASL at runtime.
> 
> These tools will reset the USB device and expect the change to be
> made immediately.
> 
> Signed-off-by: Mario Limonciello <mario.limonciello@dell.com>

You are going to have to emit CHANGEADDR notifications and such if
necessary when you do this.

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

* RE: [PATCH] r8152: Refresh MAC address during USBDEVFS_RESET
  2019-03-26 18:50 ` David Miller
@ 2019-03-26 19:52   ` Mario.Limonciello
  2019-03-26 20:23     ` David Miller
  0 siblings, 1 reply; 5+ messages in thread
From: Mario.Limonciello @ 2019-03-26 19:52 UTC (permalink / raw)
  To: davem
  Cc: linux-usb, netdev, linux-kernel, hayeswang, sjg, campello,
	Ryan.Hong, Crag.Wang

> -----Original Message-----
> From: David Miller <davem@davemloft.net>
> Sent: Tuesday, March 26, 2019 1:51 PM
> To: Limonciello, Mario
> Cc: linux-usb@vger.kernel.org; netdev@vger.kernel.org; linux-
> kernel@vger.kernel.org; hayeswang@realtek.com; sjg@google.com;
> campello@google.com; Hong, Ryan; Wang, Crag
> Subject: Re: [PATCH] r8152: Refresh MAC address during USBDEVFS_RESET
> 
> 
> [EXTERNAL EMAIL]
> 
> From: Mario Limonciello <mario.limonciello@dell.com>
> Date: Mon, 25 Mar 2019 09:12:23 -0500
> 
> > On some platforms it is possible to dynamically change the policy
> > of what MAC address is selected from the ASL at runtime.
> >
> > These tools will reset the USB device and expect the change to be
> > made immediately.
> >
> > Signed-off-by: Mario Limonciello <mario.limonciello@dell.com>
> 
> You are going to have to emit CHANGEADDR notifications and such if
> necessary when you do this.

Thanks for the feedback, I'll add that call.  Do you feel a need that the MAC
address needs to be tracked and compared to what was previously in ACPI
table to know it "really" changed or just emit CHANGEADDR because it "might"
have changed?

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

* Re: [PATCH] r8152: Refresh MAC address during USBDEVFS_RESET
  2019-03-26 19:52   ` Mario.Limonciello
@ 2019-03-26 20:23     ` David Miller
  0 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2019-03-26 20:23 UTC (permalink / raw)
  To: Mario.Limonciello
  Cc: linux-usb, netdev, linux-kernel, hayeswang, sjg, campello,
	Ryan.Hong, Crag.Wang

From: <Mario.Limonciello@dell.com>
Date: Tue, 26 Mar 2019 19:52:50 +0000

>> -----Original Message-----
>> From: David Miller <davem@davemloft.net>
>> Sent: Tuesday, March 26, 2019 1:51 PM
>> To: Limonciello, Mario
>> Cc: linux-usb@vger.kernel.org; netdev@vger.kernel.org; linux-
>> kernel@vger.kernel.org; hayeswang@realtek.com; sjg@google.com;
>> campello@google.com; Hong, Ryan; Wang, Crag
>> Subject: Re: [PATCH] r8152: Refresh MAC address during USBDEVFS_RESET
>> 
>> 
>> [EXTERNAL EMAIL]
>> 
>> From: Mario Limonciello <mario.limonciello@dell.com>
>> Date: Mon, 25 Mar 2019 09:12:23 -0500
>> 
>> > On some platforms it is possible to dynamically change the policy
>> > of what MAC address is selected from the ASL at runtime.
>> >
>> > These tools will reset the USB device and expect the change to be
>> > made immediately.
>> >
>> > Signed-off-by: Mario Limonciello <mario.limonciello@dell.com>
>> 
>> You are going to have to emit CHANGEADDR notifications and such if
>> necessary when you do this.
> 
> Thanks for the feedback, I'll add that call.  Do you feel a need that the MAC
> address needs to be tracked and compared to what was previously in ACPI
> table to know it "really" changed or just emit CHANGEADDR because it "might"
> have changed?

Probably it is better for apps to track it.

You can consider using dev_set_mac_address(), I wouldn't advise cooking your
own copy of the event emission code.

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

end of thread, other threads:[~2019-03-26 20:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-25 14:12 [PATCH] r8152: Refresh MAC address during USBDEVFS_RESET Mario Limonciello
2019-03-25 18:02 ` Simon Glass
2019-03-26 18:50 ` David Miller
2019-03-26 19:52   ` Mario.Limonciello
2019-03-26 20:23     ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®