lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <2025121739-parking-swizzle-3cf2@gregkh>
Date: Wed, 17 Dec 2025 14:27:27 +0100
From: Greg KH <gregkh@...uxfoundation.org>
To: Miao Li <limiao870622@....com>
Cc: zaitcev@...hat.com, linux-usb@...r.kernel.org,
	linux-kernel@...r.kernel.org, Miao Li <limiao@...inos.cn>
Subject: Re: [PATCH] USB: usblp: reset device at probe for Fuji Xerox
 DocuPrint P475 AP

On Fri, Nov 28, 2025 at 02:52:06PM +0800, Miao Li wrote:
> From: Miao Li <limiao@...inos.cn>
> 
> when connecting Fuji Xerox DocuPrint P475 AP printer(which vid:pid is
> 0550:020e) to Huawei hisi platform and do reboot test for 500 cycles,
> usblp probe function executed successfully but there is a small
> chance it might not work, we can reset the device at probe to deal
> with the problem.
> 
> Signed-off-by: Miao Li <limiao@...inos.cn>
> ---
>  drivers/usb/class/usblp.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/drivers/usb/class/usblp.c b/drivers/usb/class/usblp.c
> index a7a1d38b6bef..566930eb88a1 100644
> --- a/drivers/usb/class/usblp.c
> +++ b/drivers/usb/class/usblp.c
> @@ -210,6 +210,7 @@ struct quirk_printer_struct {
>  #define USBLP_QUIRK_BIDIR	0x1	/* reports bidir but requires unidirectional mode (no INs/reads) */
>  #define USBLP_QUIRK_USB_INIT	0x2	/* needs vendor USB init string */
>  #define USBLP_QUIRK_BAD_CLASS	0x4	/* descriptor uses vendor-specific Class or SubClass */
> +#define USBLP_QUIRK_RESET_DEV	0x8	/* reset USB device */
>  
>  static const struct quirk_printer_struct quirk_printers[] = {
>  	{ 0x03f0, 0x0004, USBLP_QUIRK_BIDIR }, /* HP DeskJet 895C */
> @@ -228,6 +229,7 @@ static const struct quirk_printer_struct quirk_printers[] = {
>  	{ 0x0482, 0x0010, USBLP_QUIRK_BIDIR }, /* Kyocera Mita FS 820, by zut <kernel@....de> */
>  	{ 0x04f9, 0x000d, USBLP_QUIRK_BIDIR }, /* Brother Industries, Ltd HL-1440 Laser Printer */
>  	{ 0x04b8, 0x0202, USBLP_QUIRK_BAD_CLASS }, /* Seiko Epson Receipt Printer M129C */
> +	{ 0x0550, 0x020e, USBLP_QUIRK_RESET_DEV }, /* FUJI XEROX DocuPrint P475 AP Printer */
>  	{ 0, 0 }
>  };
>  
> @@ -1189,6 +1191,13 @@ static int usblp_probe(struct usb_interface *intf,
>  		le16_to_cpu(dev->descriptor.idVendor),
>  		le16_to_cpu(dev->descriptor.idProduct));
>  
> +	/*
> +	 * Some printer need to reset the device here or it might not work
> +	 * when finished probe.
> +	 */
> +	if (usblp->quirks & USBLP_QUIRK_RESET_DEV)
> +		usb_reset_device(dev);

This feels very very wrong.  Why must a driver tell the device to reset
itself?  How does it pass any Windows USB validation without such a
"reset"?  Why does it require this?

Are you sure this isn't a bug in the host controller logic instead?

thanks,

greg k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ