>From 843fa56f9784b75316a73ca6ab94966f33d528c4 Mon Sep 17 00:00:00 2001 From: Oliver Neukum <oliver@xxxxxxxxxx> Date: Tue, 20 Mar 2012 14:21:41 +0100 Subject: [PATCH] work around for broken HP printer+storage combos --- Hi, it turns out that there are a lot of broken HP printers. The key to make them work well should be to disable polling while printing in hp-lib. (It is switched on only by udev in the first place) Nevertheless the harmful commands may come from user space, so we need to do something about that. Given the number of affected devices I refrained from bloating the quirks table and coded a heuristics. What do you think? Regards Oliver drivers/usb/storage/usb.c | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c index db51ba1..8a53a78 100644 --- a/drivers/usb/storage/usb.c +++ b/drivers/usb/storage/usb.c @@ -585,6 +585,16 @@ static int get_device_info(struct us_data *us, const struct usb_device_id *id, msgs[msg], utsname()->release); } + /* a collective workaround for buggy HP printer+storage combos */ + if (id->idVendor == 0x03f0) + if (dev->actconfig->desc.bNumInterfaces > 1) + for (int i = 0; i < udev->actconfig->desc.bNumInterfaces; i++) { + struct usb_interface *intf = config->interface[i]; + if (intf->cur_altsetting->desc->bInterfaceClass == 7) { + us->fflags |= USB_QUIRK_RESET_MORPHS; + break; + } + } return 0; } -- 1.7.1 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html