All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] USB: cdc-acm: blacklist Heimann USB Appset device
@ 2021-06-22 14:14 Hannu Hartikainen
  2021-06-22 19:54 ` Greg KH
  0 siblings, 1 reply; 3+ messages in thread
From: Hannu Hartikainen @ 2021-06-22 14:14 UTC (permalink / raw)
  To: linux-usb; +Cc: Oliver Neukum, Hannu Hartikainen

The device (32a7:0000 Heimann Sensor GmbH USB appset demo) claims to be
a CDC-ACM device in its descriptors but in fact is not. If it is run
with echo disabled it returns garbled data, probably due to something
that happens in the TTY layer. And when run with echo enabled (the
default), it will mess up the calibration data of the sensor the first
time any data is sent to the device.

In short, I had a bad time after connecting the sensor and trying to get
it to work. I hope blacklisting it in the cdc-acm driver will save
someone else a bit of trouble.

Signed-off-by: Hannu Hartikainen <hannu@hrtk.in>
---

This is my first time submitting a patch. I hope I'll be able to submit
a driver for this device later. The device is a microcontroller-based
USB implementation/converter for a thermal camera that communicates over
SPI.

 drivers/usb/class/cdc-acm.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index ca7a61190dd9..d50b606d09aa 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -1959,6 +1959,11 @@ static const struct usb_device_id acm_ids[] = {
 	.driver_info = IGNORE_DEVICE,
 	},
 
+	/* Exclude Heimann Sensor GmbH USB appset demo */
+	{ USB_DEVICE(0x32a7, 0x0000),
+	.driver_info = IGNORE_DEVICE,
+	},
+
 	/* control interfaces without any protocol set */
 	{ USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_ACM,
 		USB_CDC_PROTO_NONE) },
-- 
2.32.0


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

* Re: [PATCH] USB: cdc-acm: blacklist Heimann USB Appset device
  2021-06-22 14:14 [PATCH] USB: cdc-acm: blacklist Heimann USB Appset device Hannu Hartikainen
@ 2021-06-22 19:54 ` Greg KH
  2021-06-22 21:00   ` Hannu Hartikainen
  0 siblings, 1 reply; 3+ messages in thread
From: Greg KH @ 2021-06-22 19:54 UTC (permalink / raw)
  To: Hannu Hartikainen; +Cc: linux-usb, Oliver Neukum

On Tue, Jun 22, 2021 at 05:14:54PM +0300, Hannu Hartikainen wrote:
> The device (32a7:0000 Heimann Sensor GmbH USB appset demo) claims to be
> a CDC-ACM device in its descriptors but in fact is not. If it is run
> with echo disabled it returns garbled data, probably due to something
> that happens in the TTY layer. And when run with echo enabled (the
> default), it will mess up the calibration data of the sensor the first
> time any data is sent to the device.
> 
> In short, I had a bad time after connecting the sensor and trying to get
> it to work. I hope blacklisting it in the cdc-acm driver will save
> someone else a bit of trouble.
> 
> Signed-off-by: Hannu Hartikainen <hannu@hrtk.in>
> ---
> 
> This is my first time submitting a patch. I hope I'll be able to submit
> a driver for this device later. The device is a microcontroller-based
> USB implementation/converter for a thermal camera that communicates over
> SPI.
> 
>  drivers/usb/class/cdc-acm.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
> index ca7a61190dd9..d50b606d09aa 100644
> --- a/drivers/usb/class/cdc-acm.c
> +++ b/drivers/usb/class/cdc-acm.c
> @@ -1959,6 +1959,11 @@ static const struct usb_device_id acm_ids[] = {
>  	.driver_info = IGNORE_DEVICE,
>  	},
>  
> +	/* Exclude Heimann Sensor GmbH USB appset demo */
> +	{ USB_DEVICE(0x32a7, 0x0000),
> +	.driver_info = IGNORE_DEVICE,
> +	},
> +

If it's blacklisted here, what driver does control this device?

thanks,

greg k-h

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

* Re: [PATCH] USB: cdc-acm: blacklist Heimann USB Appset device
  2021-06-22 19:54 ` Greg KH
@ 2021-06-22 21:00   ` Hannu Hartikainen
  0 siblings, 0 replies; 3+ messages in thread
From: Hannu Hartikainen @ 2021-06-22 21:00 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-usb, Oliver Neukum

On Tue, 22 Jun 2021 21:54:31 +0200, Greg KH <gregkh@linuxfoundation.org> wrote:
> If it's blacklisted here, what driver does control this device?

On my machine, no other device driver takes control. The `usbcore`
driver loads the `cdc-acm` driver because the descriptors match but
after cdc-acm returns without claiming the interfaces, no other driver
is probed AFAICT.

I've written an incomplete driver myself; I'll see if I can publish it
later. But the traffic is just USB bulk messages and should be doable in
userspace without a driver. Sadly the devices are not very common and
the USB traffic is undocumented.

Best,
Hannu

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

end of thread, other threads:[~2021-06-22 21:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-22 14:14 [PATCH] USB: cdc-acm: blacklist Heimann USB Appset device Hannu Hartikainen
2021-06-22 19:54 ` Greg KH
2021-06-22 21:00   ` Hannu Hartikainen

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.