linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 1/1] r8152: sync sa_family with the media type of network device
@ 2019-04-22  5:03 crag0715
  2019-04-22 20:39 ` Jakub Kicinski
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: crag0715 @ 2019-04-22  5:03 UTC (permalink / raw)
  To: linux-usb, netdev
  Cc: linux-kernel, hayeswang, mario_limonciello, crag0715, Crag.Wang,
	David S. Miller, Simon Glass, Grant Grundler, Sean Paul,
	David Chen, Kai-Heng Feng, Gustavo A. R. Silva, Charles Hyde,
	Sebastian Andrzej Siewior, zhong jiang

From: "Crag.Wang" <crag.wang@dell.com>

Without this patch the socket address family sporadically gets wrong
value ends up the dev_set_mac_address() fails to set the desired MAC
address.

Signed-off-by: Crag.Wang <crag.wang@dell.com>
---
 drivers/net/usb/r8152.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
index 4c63b40d5e00..41fb39ce69c9 100644
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
@@ -1225,6 +1225,8 @@ static int determine_ethernet_addr(struct r8152 *tp, struct sockaddr *sa)
 	struct net_device *dev = tp->netdev;
 	int ret;
 
+	sa->sa_family = dev->type;
+
 	if (tp->version == RTL_VER_01) {
 		ret = pla_ocp_read(tp, PLA_IDR, 8, sa->sa_data);
 	} else {
-- 
2.20.1


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

* Re: [PATCH v2 1/1] r8152: sync sa_family with the media type of network device
  2019-04-22  5:03 [PATCH v2 1/1] r8152: sync sa_family with the media type of network device crag0715
@ 2019-04-22 20:39 ` Jakub Kicinski
  2019-04-23  2:52   ` Crag Wang
  2019-04-22 21:29 ` Mario.Limonciello
  2019-04-23  5:15 ` David Miller
  2 siblings, 1 reply; 9+ messages in thread
From: Jakub Kicinski @ 2019-04-22 20:39 UTC (permalink / raw)
  To: crag0715
  Cc: linux-usb, netdev, linux-kernel, hayeswang, mario_limonciello,
	Crag.Wang, David S. Miller, Simon Glass, Grant Grundler,
	Sean Paul, David Chen, Kai-Heng Feng, Gustavo A. R. Silva,
	Charles Hyde, Sebastian Andrzej Siewior, zhong jiang

On Mon, 22 Apr 2019 13:03:43 +0800, crag0715@gmail.com wrote:
> From: "Crag.Wang" <crag.wang@dell.com>
> 
> Without this patch the socket address family sporadically gets wrong
> value ends up the dev_set_mac_address() fails to set the desired MAC
> address.
> 
> Signed-off-by: Crag.Wang <crag.wang@dell.com>

Code looks reasonable.  This must have been caused by:

Fixes: 25766271e42f ("r8152: Refresh MAC address during USBDEVFS_RESET")

which is still in net-next.  In the future please make sure you read:

https://www.kernel.org/doc/html/latest/networking/netdev-FAQ.html

In particular:

https://www.kernel.org/doc/html/latest/networking/netdev-FAQ.html#q-how-do-i-indicate-which-tree-net-vs-net-next-my-patch-should-be-in

To assure smooth flow of your patches into the tree :)

Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com>

> diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
> index 4c63b40d5e00..41fb39ce69c9 100644
> --- a/drivers/net/usb/r8152.c
> +++ b/drivers/net/usb/r8152.c
> @@ -1225,6 +1225,8 @@ static int determine_ethernet_addr(struct r8152 *tp, struct sockaddr *sa)
>  	struct net_device *dev = tp->netdev;
>  	int ret;
>  
> +	sa->sa_family = dev->type;
> +
>  	if (tp->version == RTL_VER_01) {
>  		ret = pla_ocp_read(tp, PLA_IDR, 8, sa->sa_data);
>  	} else {


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

* RE: [PATCH v2 1/1] r8152: sync sa_family with the media type of network device
  2019-04-22  5:03 [PATCH v2 1/1] r8152: sync sa_family with the media type of network device crag0715
  2019-04-22 20:39 ` Jakub Kicinski
@ 2019-04-22 21:29 ` Mario.Limonciello
  2019-04-23  5:15 ` David Miller
  2 siblings, 0 replies; 9+ messages in thread
From: Mario.Limonciello @ 2019-04-22 21:29 UTC (permalink / raw)
  To: crag0715, linux-usb, netdev
  Cc: linux-kernel, hayeswang, Crag.Wang, davem, sjg, grundler,
	seanpaul, David.Chen7, kai.heng.feng, gustavo, charles.hyde,
	bigeasy, zhongjiang

> -----Original Message-----
> From: crag0715@gmail.com <crag0715@gmail.com>
> Sent: Monday, April 22, 2019 12:04 AM
> To: linux-usb@vger.kernel.org; netdev@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org; hayeswang@realtek.com; Limonciello, Mario;
> crag0715@gmail.com; Wang, Crag; David S. Miller; Simon Glass; Grant Grundler;
> Sean Paul; Chen7, David; Kai-Heng Feng; Gustavo A. R. Silva; Charles Hyde;
> Sebastian Andrzej Siewior; zhong jiang
> Subject: [PATCH v2 1/1] r8152: sync sa_family with the media type of network
> device
> 
> 
> [EXTERNAL EMAIL]
> 
> From: "Crag.Wang" <crag.wang@dell.com>
> 
> Without this patch the socket address family sporadically gets wrong
> value ends up the dev_set_mac_address() fails to set the desired MAC
> address.

Ah yes, this is because of an uninitialized struct sockaddr, so random garbage.
I didn't catch it during my testing, good catch.

> 
> Signed-off-by: Crag.Wang <crag.wang@dell.com>
> ---
>  drivers/net/usb/r8152.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
> index 4c63b40d5e00..41fb39ce69c9 100644
> --- a/drivers/net/usb/r8152.c
> +++ b/drivers/net/usb/r8152.c
> @@ -1225,6 +1225,8 @@ static int determine_ethernet_addr(struct r8152 *tp,
> struct sockaddr *sa)
>  	struct net_device *dev = tp->netdev;
>  	int ret;
> 
> +	sa->sa_family = dev->type;
> +
>  	if (tp->version == RTL_VER_01) {
>  		ret = pla_ocp_read(tp, PLA_IDR, 8, sa->sa_data);
>  	} else {
> --
> 2.20.1

Reviewed-By: Mario Limonciello <mario.limonciello@dell.com>

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

* Re: [PATCH v2 1/1] r8152: sync sa_family with the media type of network device
  2019-04-22 20:39 ` Jakub Kicinski
@ 2019-04-23  2:52   ` Crag Wang
  0 siblings, 0 replies; 9+ messages in thread
From: Crag Wang @ 2019-04-23  2:52 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: linux-usb, netdev, linux-kernel, hayeswang, Mario Limonciello,
	Crag.Wang, David S. Miller, Simon Glass, Grant Grundler,
	Sean Paul, David Chen, Kai-Heng Feng, Gustavo A. R. Silva,
	Charles Hyde, Sebastian Andrzej Siewior, zhong jiang

On Tue, Apr 23, 2019 at 4:39 AM Jakub Kicinski
<jakub.kicinski@netronome.com> wrote:
>
> On Mon, 22 Apr 2019 13:03:43 +0800, crag0715@gmail.com wrote:
> > From: "Crag.Wang" <crag.wang@dell.com>
> >
> > Without this patch the socket address family sporadically gets wrong
> > value ends up the dev_set_mac_address() fails to set the desired MAC
> > address.
> >
> > Signed-off-by: Crag.Wang <crag.wang@dell.com>
>
> Code looks reasonable.  This must have been caused by:
>
> Fixes: 25766271e42f ("r8152: Refresh MAC address during USBDEVFS_RESET")
>
> which is still in net-next.  In the future please make sure you read:
>
> https://www.kernel.org/doc/html/latest/networking/netdev-FAQ.html
>
> In particular:
>
> https://www.kernel.org/doc/html/latest/networking/netdev-FAQ.html#q-how-do-i-indicate-which-tree-net-vs-net-next-my-patch-should-be-in
>
> To assure smooth flow of your patches into the tree :)
>
> Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com>
>
Yes, patch is intended to fix 25766271e42f which is still in net-next.

It appears that prefix is desired in the subject. Thanks for sharing the info.

Crag

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

* Re: [PATCH v2 1/1] r8152: sync sa_family with the media type of network device
  2019-04-22  5:03 [PATCH v2 1/1] r8152: sync sa_family with the media type of network device crag0715
  2019-04-22 20:39 ` Jakub Kicinski
  2019-04-22 21:29 ` Mario.Limonciello
@ 2019-04-23  5:15 ` David Miller
  2 siblings, 0 replies; 9+ messages in thread
From: David Miller @ 2019-04-23  5:15 UTC (permalink / raw)
  To: crag0715
  Cc: linux-usb, netdev, linux-kernel, hayeswang, mario_limonciello,
	crag.wang, sjg, grundler, seanpaul, david.chen7, kai.heng.feng,
	gustavo, charles.hyde, bigeasy, zhongjiang

From: crag0715@gmail.com
Date: Mon, 22 Apr 2019 13:03:43 +0800

> From: "Crag.Wang" <crag.wang@dell.com>
> 
> Without this patch the socket address family sporadically gets wrong
> value ends up the dev_set_mac_address() fails to set the desired MAC
> address.
> 
> Signed-off-by: Crag.Wang <crag.wang@dell.com>

Applied to net-next with Fixes: tag added.

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

* Re: [PATCH v2 1/1] r8152: sync sa_family with the media type of network device
  2019-04-22  3:17   ` Crag Wang
@ 2019-04-22  4:48     ` David Miller
  0 siblings, 0 replies; 9+ messages in thread
From: David Miller @ 2019-04-22  4:48 UTC (permalink / raw)
  To: crag0715
  Cc: netdev, linux-usb, linux-kernel, hayeswang, mario_limonciello,
	crag.wang, sjg, seanpaul, grundler, david.chen7, f.fainelli,
	jslaby, gustavo, charles.hyde, bigeasy, zhongjiang

From: Crag Wang <crag0715@gmail.com>
Date: Mon, 22 Apr 2019 11:17:49 +0800

> On Mon, Apr 22, 2019 at 10:44 AM David Miller <davem@davemloft.net> wrote:
>>
>>
>> Networking driver patches not sent to netdev@vger.kernel.org are very unlikely
>> to be integrated.
>>
>> Thank you.
> 
> Adding netdev@vger.kernel.org to this email, sorry about missing the
> recipient in the first place.

This does not get the patch queued up in patchwork, nor allow other readers of
netdev to see the patch so that it can be properly reviewed.

You must make a new, fresh, posting of your patch.

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

* Re: [PATCH v2 1/1] r8152: sync sa_family with the media type of network device
  2019-04-22  2:44 ` David Miller
@ 2019-04-22  3:17   ` Crag Wang
  2019-04-22  4:48     ` David Miller
  0 siblings, 1 reply; 9+ messages in thread
From: Crag Wang @ 2019-04-22  3:17 UTC (permalink / raw)
  To: David Miller, netdev
  Cc: linux-usb, linux-kernel, hayeswang, Mario Limonciello, crag.wang,
	sjg, seanpaul, grundler, david.chen7, f.fainelli, jslaby,
	gustavo, charles.hyde, bigeasy, zhongjiang

On Mon, Apr 22, 2019 at 10:44 AM David Miller <davem@davemloft.net> wrote:
>
>
> Networking driver patches not sent to netdev@vger.kernel.org are very unlikely
> to be integrated.
>
> Thank you.

Adding netdev@vger.kernel.org to this email, sorry about missing the
recipient in the first place.

Thanks,
Crag

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

* Re: [PATCH v2 1/1] r8152: sync sa_family with the media type of network device
  2019-04-22  2:23 crag0715
@ 2019-04-22  2:44 ` David Miller
  2019-04-22  3:17   ` Crag Wang
  0 siblings, 1 reply; 9+ messages in thread
From: David Miller @ 2019-04-22  2:44 UTC (permalink / raw)
  To: crag0715
  Cc: linux-usb, linux-kernel, hayeswang, mario_limonciello, crag.wang,
	sjg, seanpaul, grundler, david.chen7, f.fainelli, jslaby,
	gustavo, charles.hyde, bigeasy, zhongjiang


Networking driver patches not sent to netdev@vger.kernel.org are very unlikely
to be integrated.

Thank you.

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

* [PATCH v2 1/1] r8152: sync sa_family with the media type of network device
@ 2019-04-22  2:23 crag0715
  2019-04-22  2:44 ` David Miller
  0 siblings, 1 reply; 9+ messages in thread
From: crag0715 @ 2019-04-22  2:23 UTC (permalink / raw)
  To: linux-usb
  Cc: linux-kernel, hayeswang, mario_limonciello, crag0715, Crag.Wang,
	David S. Miller, Simon Glass, Sean Paul, Grant Grundler,
	David Chen, Florian Fainelli, Jiri Slaby, Gustavo A. R. Silva,
	Charles Hyde, Sebastian Andrzej Siewior, zhong jiang

From: "Crag.Wang" <crag.wang@dell.com>

Without this patch the socket address family sporadically gets wrong
value ends up the dev_set_mac_address() fails to set the desired MAC
address.

Signed-off-by: Crag.Wang <crag.wang@dell.com>
---
 drivers/net/usb/r8152.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
index 4c63b40d5e00..41fb39ce69c9 100644
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
@@ -1225,6 +1225,8 @@ static int determine_ethernet_addr(struct r8152 *tp, struct sockaddr *sa)
 	struct net_device *dev = tp->netdev;
 	int ret;
 
+	sa->sa_family = dev->type;
+
 	if (tp->version == RTL_VER_01) {
 		ret = pla_ocp_read(tp, PLA_IDR, 8, sa->sa_data);
 	} else {
-- 
2.20.1


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

end of thread, other threads:[~2019-04-23  5:15 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-22  5:03 [PATCH v2 1/1] r8152: sync sa_family with the media type of network device crag0715
2019-04-22 20:39 ` Jakub Kicinski
2019-04-23  2:52   ` Crag Wang
2019-04-22 21:29 ` Mario.Limonciello
2019-04-23  5:15 ` David Miller
  -- strict thread matches above, loose matches on Subject: below --
2019-04-22  2:23 crag0715
2019-04-22  2:44 ` David Miller
2019-04-22  3:17   ` Crag Wang
2019-04-22  4:48     ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).