Re: [PATCH] r8152: Refresh MAC address during USBDEVFS_RESET
From: David Miller
Date: Tue Mar 26 2019 - 16:23:06 EST
From: <Mario.Limonciello@xxxxxxxx>
Date: Tue, 26 Mar 2019 19:52:50 +0000
>> -----Original Message-----
>> From: David Miller <davem@xxxxxxxxxxxxx>
>> Sent: Tuesday, March 26, 2019 1:51 PM
>> To: Limonciello, Mario
>> Cc: linux-usb@xxxxxxxxxxxxxxx; netdev@xxxxxxxxxxxxxxx; linux-
>> kernel@xxxxxxxxxxxxxxx; hayeswang@xxxxxxxxxxx; sjg@xxxxxxxxxx;
>> campello@xxxxxxxxxx; Hong, Ryan; Wang, Crag
>> Subject: Re: [PATCH] r8152: Refresh MAC address during USBDEVFS_RESET
>>
>>
>> [EXTERNAL EMAIL]
>>
>> From: Mario Limonciello <mario.limonciello@xxxxxxxx>
>> 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@xxxxxxxx>
>>
>> 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.