All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] cdc-ether: divorce initialisation with a filter reset and a generic method
@ 2017-05-22 12:50 Oliver Neukum
  2017-05-23 15:01 ` David Miller
  2017-10-03  8:09 ` [v2] " Vignesh R
  0 siblings, 2 replies; 7+ messages in thread
From: Oliver Neukum @ 2017-05-22 12:50 UTC (permalink / raw)
  To: davem, netdev, bjorn; +Cc: Oliver Neukum

Some devices need their multicast filter reset but others are crashed by that.
So the methods need to be separated.

Signed-off-by: Oliver Neukum <oneukum@suse.com>
Reported-by: "Ridgway, Keith" <kridgway@harris.com>
---
 drivers/net/usb/cdc_ether.c | 31 ++++++++++++++++++++++++-------
 include/linux/usb/usbnet.h  |  1 +
 2 files changed, 25 insertions(+), 7 deletions(-)

diff --git a/drivers/net/usb/cdc_ether.c b/drivers/net/usb/cdc_ether.c
index f3ae88fdf332..8ab281b478f2 100644
--- a/drivers/net/usb/cdc_ether.c
+++ b/drivers/net/usb/cdc_ether.c
@@ -310,6 +310,26 @@ int usbnet_generic_cdc_bind(struct usbnet *dev, struct usb_interface *intf)
 		return -ENODEV;
 	}
 
+	return 0;
+
+bad_desc:
+	dev_info(&dev->udev->dev, "bad CDC descriptors\n");
+	return -ENODEV;
+}
+EXPORT_SYMBOL_GPL(usbnet_generic_cdc_bind);
+
+
+/* like usbnet_generic_cdc_bind() but handles filter initialization
+ * correctly
+ */
+int usbnet_ether_cdc_bind(struct usbnet *dev, struct usb_interface *intf)
+{
+	int rv;
+
+	rv = usbnet_generic_cdc_bind(dev, intf);
+	if (rv < 0)
+		goto bail_out;
+
 	/* Some devices don't initialise properly. In particular
 	 * the packet filter is not reset. There are devices that
 	 * don't do reset all the way. So the packet filter should
@@ -317,13 +337,10 @@ int usbnet_generic_cdc_bind(struct usbnet *dev, struct usb_interface *intf)
 	 */
 	usbnet_cdc_update_filter(dev);
 
-	return 0;
-
-bad_desc:
-	dev_info(&dev->udev->dev, "bad CDC descriptors\n");
-	return -ENODEV;
+bail_out:
+	return rv;
 }
-EXPORT_SYMBOL_GPL(usbnet_generic_cdc_bind);
+EXPORT_SYMBOL_GPL(usbnet_ether_cdc_bind);
 
 void usbnet_cdc_unbind(struct usbnet *dev, struct usb_interface *intf)
 {
@@ -417,7 +434,7 @@ int usbnet_cdc_bind(struct usbnet *dev, struct usb_interface *intf)
 	BUILD_BUG_ON((sizeof(((struct usbnet *)0)->data)
 			< sizeof(struct cdc_state)));
 
-	status = usbnet_generic_cdc_bind(dev, intf);
+	status = usbnet_ether_cdc_bind(dev, intf);
 	if (status < 0)
 		return status;
 
diff --git a/include/linux/usb/usbnet.h b/include/linux/usb/usbnet.h
index 7dffa5624ea6..97116379db5f 100644
--- a/include/linux/usb/usbnet.h
+++ b/include/linux/usb/usbnet.h
@@ -206,6 +206,7 @@ struct cdc_state {
 };
 
 extern int usbnet_generic_cdc_bind(struct usbnet *, struct usb_interface *);
+extern int usbnet_ether_cdc_bind(struct usbnet *dev, struct usb_interface *intf);
 extern int usbnet_cdc_bind(struct usbnet *, struct usb_interface *);
 extern void usbnet_cdc_unbind(struct usbnet *, struct usb_interface *);
 extern void usbnet_cdc_status(struct usbnet *, struct urb *);
-- 
2.12.0

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

* Re: [PATCH v2] cdc-ether: divorce initialisation with a filter reset and a generic method
  2017-05-22 12:50 [PATCH v2] cdc-ether: divorce initialisation with a filter reset and a generic method Oliver Neukum
@ 2017-05-23 15:01 ` David Miller
  2017-10-03  8:09 ` [v2] " Vignesh R
  1 sibling, 0 replies; 7+ messages in thread
From: David Miller @ 2017-05-23 15:01 UTC (permalink / raw)
  To: oneukum; +Cc: netdev, bjorn

From: Oliver Neukum <oneukum@suse.com>
Date: Mon, 22 May 2017 14:50:30 +0200

> Some devices need their multicast filter reset but others are crashed by that.
> So the methods need to be separated.
> 
> Signed-off-by: Oliver Neukum <oneukum@suse.com>
> Reported-by: "Ridgway, Keith" <kridgway@harris.com>

Applied and queued up for -stable, thanks Oliver.

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

* Re: [v2] cdc-ether: divorce initialisation with a filter reset and a generic method
  2017-05-22 12:50 [PATCH v2] cdc-ether: divorce initialisation with a filter reset and a generic method Oliver Neukum
  2017-05-23 15:01 ` David Miller
@ 2017-10-03  8:09 ` Vignesh R
  2017-10-03 16:59   ` David Miller
  1 sibling, 1 reply; 7+ messages in thread
From: Vignesh R @ 2017-10-03  8:09 UTC (permalink / raw)
  To: davem; +Cc: Oliver Neukum, netdev, bjorn

Hi Dave,

On Monday 22 May 2017 06:20 PM, Oliver Neukum wrote:
> Some devices need their multicast filter reset but others are crashed by that.
> So the methods need to be separated.
> 
> Signed-off-by: Oliver Neukum <oneukum@suse.com>
> Reported-by: "Ridgway, Keith" <kridgway@harris.com>
> ---

I see this patch was merged and said to be queued for -stable, but I
don't see this fix in any of the stable kernels. Would you please ask
for this patch to be backported to -stable kernels?

Regards
Vignesh

>  drivers/net/usb/cdc_ether.c | 31 ++++++++++++++++++++++++-------
>  include/linux/usb/usbnet.h  |  1 +
>  2 files changed, 25 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/net/usb/cdc_ether.c b/drivers/net/usb/cdc_ether.c
> index f3ae88fdf332..8ab281b478f2 100644
> --- a/drivers/net/usb/cdc_ether.c
> +++ b/drivers/net/usb/cdc_ether.c
> @@ -310,6 +310,26 @@ int usbnet_generic_cdc_bind(struct usbnet *dev, struct usb_interface *intf)
>  		return -ENODEV;
>  	}
>  
> +	return 0;
> +
> +bad_desc:
> +	dev_info(&dev->udev->dev, "bad CDC descriptors\n");
> +	return -ENODEV;
> +}
> +EXPORT_SYMBOL_GPL(usbnet_generic_cdc_bind);
> +
> +
> +/* like usbnet_generic_cdc_bind() but handles filter initialization
> + * correctly
> + */
> +int usbnet_ether_cdc_bind(struct usbnet *dev, struct usb_interface *intf)
> +{
> +	int rv;
> +
> +	rv = usbnet_generic_cdc_bind(dev, intf);
> +	if (rv < 0)
> +		goto bail_out;
> +
>  	/* Some devices don't initialise properly. In particular
>  	 * the packet filter is not reset. There are devices that
>  	 * don't do reset all the way. So the packet filter should
> @@ -317,13 +337,10 @@ int usbnet_generic_cdc_bind(struct usbnet *dev, struct usb_interface *intf)
>  	 */
>  	usbnet_cdc_update_filter(dev);
>  
> -	return 0;
> -
> -bad_desc:
> -	dev_info(&dev->udev->dev, "bad CDC descriptors\n");
> -	return -ENODEV;
> +bail_out:
> +	return rv;
>  }
> -EXPORT_SYMBOL_GPL(usbnet_generic_cdc_bind);
> +EXPORT_SYMBOL_GPL(usbnet_ether_cdc_bind);
>  
>  void usbnet_cdc_unbind(struct usbnet *dev, struct usb_interface *intf)
>  {
> @@ -417,7 +434,7 @@ int usbnet_cdc_bind(struct usbnet *dev, struct usb_interface *intf)
>  	BUILD_BUG_ON((sizeof(((struct usbnet *)0)->data)
>  			< sizeof(struct cdc_state)));
>  
> -	status = usbnet_generic_cdc_bind(dev, intf);
> +	status = usbnet_ether_cdc_bind(dev, intf);
>  	if (status < 0)
>  		return status;
>  
> diff --git a/include/linux/usb/usbnet.h b/include/linux/usb/usbnet.h
> index 7dffa5624ea6..97116379db5f 100644
> --- a/include/linux/usb/usbnet.h
> +++ b/include/linux/usb/usbnet.h
> @@ -206,6 +206,7 @@ struct cdc_state {
>  };
>  
>  extern int usbnet_generic_cdc_bind(struct usbnet *, struct usb_interface *);
> +extern int usbnet_ether_cdc_bind(struct usbnet *dev, struct usb_interface *intf);
>  extern int usbnet_cdc_bind(struct usbnet *, struct usb_interface *);
>  extern void usbnet_cdc_unbind(struct usbnet *, struct usb_interface *);
>  extern void usbnet_cdc_status(struct usbnet *, struct urb *);
> 

-- 
Regards
Vignesh

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

* Re: [v2] cdc-ether: divorce initialisation with a filter reset and a generic method
  2017-10-03  8:09 ` [v2] " Vignesh R
@ 2017-10-03 16:59   ` David Miller
  2017-10-04  5:02     ` Vignesh R
  0 siblings, 1 reply; 7+ messages in thread
From: David Miller @ 2017-10-03 16:59 UTC (permalink / raw)
  To: vigneshr; +Cc: oneukum, netdev, bjorn

From: Vignesh R <vigneshr@ti.com>
Date: Tue, 3 Oct 2017 13:39:18 +0530

> Hi Dave,
> 
> On Monday 22 May 2017 06:20 PM, Oliver Neukum wrote:
>> Some devices need their multicast filter reset but others are crashed by that.
>> So the methods need to be separated.
>> 
>> Signed-off-by: Oliver Neukum <oneukum@suse.com>
>> Reported-by: "Ridgway, Keith" <kridgway@harris.com>
>> ---
> 
> I see this patch was merged and said to be queued for -stable, but I
> don't see this fix in any of the stable kernels. Would you please ask
> for this patch to be backported to -stable kernels?

I submit networking -stable patches at a time of my own choosing.
Usually 1 to 2 weeks after it gets applied to my tree.

Please be patient.

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

* Re: [v2] cdc-ether: divorce initialisation with a filter reset and a generic method
  2017-10-03 16:59   ` David Miller
@ 2017-10-04  5:02     ` Vignesh R
  2017-10-27  7:54       ` Vignesh R
  0 siblings, 1 reply; 7+ messages in thread
From: Vignesh R @ 2017-10-04  5:02 UTC (permalink / raw)
  To: David Miller; +Cc: oneukum, netdev, bjorn



On Tuesday 03 October 2017 10:29 PM, David Miller wrote:
> From: Vignesh R <vigneshr@ti.com>
> Date: Tue, 3 Oct 2017 13:39:18 +0530
> 
>> Hi Dave,
>>
>> On Monday 22 May 2017 06:20 PM, Oliver Neukum wrote:
>>> Some devices need their multicast filter reset but others are crashed by that.
>>> So the methods need to be separated.
>>>
>>> Signed-off-by: Oliver Neukum <oneukum@suse.com>
>>> Reported-by: "Ridgway, Keith" <kridgway@harris.com>
>>> ---
>>
>> I see this patch was merged and said to be queued for -stable, but I
>> don't see this fix in any of the stable kernels. Would you please ask
>> for this patch to be backported to -stable kernels?
> 
> I submit networking -stable patches at a time of my own choosing.
> Usually 1 to 2 weeks after it gets applied to my tree.
> 

Sorry, but this patch was merged in v4.12-rc3(end of May) and I did not
see them in netdev stable patchwork nor in Greg's queue. Hence, I
thought this patch might have slipped through the cracks.

> Please be patient.
> 

-- 
Regards
Vignesh

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

* Re: [v2] cdc-ether: divorce initialisation with a filter reset and a generic method
  2017-10-04  5:02     ` Vignesh R
@ 2017-10-27  7:54       ` Vignesh R
  0 siblings, 0 replies; 7+ messages in thread
From: Vignesh R @ 2017-10-27  7:54 UTC (permalink / raw)
  To: David Miller; +Cc: oneukum, netdev, bjorn



On Wednesday 04 October 2017 10:32 AM, Vignesh R wrote:
> 
> 
> On Tuesday 03 October 2017 10:29 PM, David Miller wrote:
>> From: Vignesh R <vigneshr@ti.com>
>> Date: Tue, 3 Oct 2017 13:39:18 +0530
>>
>>> Hi Dave,
>>>
>>> On Monday 22 May 2017 06:20 PM, Oliver Neukum wrote:
>>>> Some devices need their multicast filter reset but others are crashed by that.
>>>> So the methods need to be separated.
>>>>
>>>> Signed-off-by: Oliver Neukum <oneukum@suse.com>
>>>> Reported-by: "Ridgway, Keith" <kridgway@harris.com>
>>>> ---
>>>
>>> I see this patch was merged and said to be queued for -stable, but I
>>> don't see this fix in any of the stable kernels. Would you please ask
>>> for this patch to be backported to -stable kernels?
>>
>> I submit networking -stable patches at a time of my own choosing.
>> Usually 1 to 2 weeks after it gets applied to my tree.
>>
> 
> Sorry, but this patch was merged in v4.12-rc3(end of May) and I did not
> see them in netdev stable patchwork nor in Greg's queue. Hence, I
> thought this patch might have slipped through the cracks.
> 

Unfortunately, I still don't see this patch in any of the stable queues.
Its been 5 months since this patch was added to linux mainline. Can this
patch be now forwarded to stable trees?

-- 
Regards
Vignesh

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

* re: [PATCH v2] cdc-ether: divorce initialisation with a filter reset and a generic method
@ 2017-05-23 11:08 Ridgway, Keith
  0 siblings, 0 replies; 7+ messages in thread
From: Ridgway, Keith @ 2017-05-23 11:08 UTC (permalink / raw)
  To: netdev

> Some devices need their multicast filter reset but others are crashed by that.
> So the methods need to be separated.
>
> Signed-off-by: Oliver Neukum <oneukum@suse.com>
> Reported-by: "Ridgway, Keith" <kridgway@harris.com>

I have tested this patch with three different Harris radios and it fixes the problem we experienced with RNDIS.
I don't have any CDC Ethernet devices to try.
Tested-by: Keith Ridgway <kridgway@harris.com>

> ---
>  drivers/net/usb/cdc_ether.c | 31 ++++++++++++++++++++++++-------
>  include/linux/usb/usbnet.h  |  1 +
>  2 files changed, 25 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/net/usb/cdc_ether.c b/drivers/net/usb/cdc_ether.c
> index f3ae88fdf332..8ab281b478f2 100644
> --- a/drivers/net/usb/cdc_ether.c
> +++ b/drivers/net/usb/cdc_ether.c
> @@ -310,6 +310,26 @@ int usbnet_generic_cdc_bind(struct usbnet *dev, struct usb_interface *intf)
>  		return -ENODEV;
>  	}
>  
> +	return 0;
> +
> +bad_desc:
> +	dev_info(&dev->udev->dev, "bad CDC descriptors\n");
> +	return -ENODEV;
> +}
> +EXPORT_SYMBOL_GPL(usbnet_generic_cdc_bind);
> +
> +
> +/* like usbnet_generic_cdc_bind() but handles filter initialization
> + * correctly
> + */
> +int usbnet_ether_cdc_bind(struct usbnet *dev, struct usb_interface *intf)
> +{
> +	int rv;
> +
> +	rv = usbnet_generic_cdc_bind(dev, intf);
> +	if (rv < 0)
> +		goto bail_out;
> +
>  	/* Some devices don't initialise properly. In particular
>  	 * the packet filter is not reset. There are devices that
>  	 * don't do reset all the way. So the packet filter should
> @@ -317,13 +337,10 @@ int usbnet_generic_cdc_bind(struct usbnet *dev, struct usb_interface *intf)
>  	 */
>  	usbnet_cdc_update_filter(dev);
>  
> -	return 0;
> -
> -bad_desc:
> -	dev_info(&dev->udev->dev, "bad CDC descriptors\n");
> -	return -ENODEV;
> +bail_out:
> +	return rv;
>  }
> -EXPORT_SYMBOL_GPL(usbnet_generic_cdc_bind);
> +EXPORT_SYMBOL_GPL(usbnet_ether_cdc_bind);
>  
>  void usbnet_cdc_unbind(struct usbnet *dev, struct usb_interface *intf)
>  {
> @@ -417,7 +434,7 @@ int usbnet_cdc_bind(struct usbnet *dev, struct usb_interface *intf)
>  	BUILD_BUG_ON((sizeof(((struct usbnet *)0)->data)
>  			< sizeof(struct cdc_state)));
>  
> -	status = usbnet_generic_cdc_bind(dev, intf);
> +	status = usbnet_ether_cdc_bind(dev, intf);
>  	if (status < 0)
>  		return status;
>  
> diff --git a/include/linux/usb/usbnet.h b/include/linux/usb/usbnet.h
> index 7dffa5624ea6..97116379db5f 100644
> --- a/include/linux/usb/usbnet.h
> +++ b/include/linux/usb/usbnet.h
> @@ -206,6 +206,7 @@ struct cdc_state {
>  };
>  
>  extern int usbnet_generic_cdc_bind(struct usbnet *, struct usb_interface *);
> +extern int usbnet_ether_cdc_bind(struct usbnet *dev, struct usb_interface *intf);
>  extern int usbnet_cdc_bind(struct usbnet *, struct usb_interface *);
>  extern void usbnet_cdc_unbind(struct usbnet *, struct usb_interface *);
>  extern void usbnet_cdc_status(struct usbnet *, struct urb *);
> -- 
> 2.12.0
>

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

end of thread, other threads:[~2017-10-27  7:54 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-22 12:50 [PATCH v2] cdc-ether: divorce initialisation with a filter reset and a generic method Oliver Neukum
2017-05-23 15:01 ` David Miller
2017-10-03  8:09 ` [v2] " Vignesh R
2017-10-03 16:59   ` David Miller
2017-10-04  5:02     ` Vignesh R
2017-10-27  7:54       ` Vignesh R
2017-05-23 11:08 [PATCH v2] " Ridgway, Keith

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.