Linux USB
 help / color / mirror / Atom feed
* [PATCH] USB: usblp: reset device at probe for Fuji Xerox DocuPrint P475 AP
@ 2025-11-28  6:52 Miao Li
  2025-12-17 13:27 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Miao Li @ 2025-11-28  6:52 UTC (permalink / raw)
  To: zaitcev, gregkh; +Cc: linux-usb, linux-kernel, limiao870622, Miao Li

From: Miao Li <limiao@kylinos.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@kylinos.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@zut.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);
+
 	/* Analyze and pick initial alternate settings and endpoints. */
 	protocol = usblp_select_alts(usblp);
 	if (protocol < 0) {
-- 
2.25.1


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

end of thread, other threads:[~2025-12-17 13:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-28  6:52 [PATCH] USB: usblp: reset device at probe for Fuji Xerox DocuPrint P475 AP Miao Li
2025-12-17 13:27 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox