]> git.pld-linux.org Git - packages/kernel.git/blame - linux-2.4.20-usb-bugs.patch
- obsolete
[packages/kernel.git] / linux-2.4.20-usb-bugs.patch
CommitLineData
ca915214
JR
1diff -urNp linux-2331/drivers/usb/storage/unusual_devs.h linux-2340/drivers/usb/storage/unusual_devs.h
2--- linux-2331/drivers/usb/storage/unusual_devs.h
3+++ linux-2340/drivers/usb/storage/unusual_devs.h
4@@ -137,6 +137,12 @@ UNUSUAL_DEV( 0x04da, 0x0901, 0x0100, 0x
5 "LS-120 Camera",
6 US_SC_UFI, US_PR_CBI, NULL, 0),
7
8+/* From Yukihiro Nakai, via zaitcev@yahoo.com. */
9+UNUSUAL_DEV( 0x04da, 0x0d05, 0x0000, 0x0000,
10+ "Sharp CE-CW05",
11+ "CD-R/RW Drive",
12+ US_SC_8070, US_PR_CB, NULL, 0),
13+
14 /* Most of the following entries were developed with the help of
15 * Shuttle/SCM directly.
16 */
17@@ -404,7 +404,7 @@ UNUSUAL_DEV( 0x0781, 0x0002, 0x0009, 0x
18 "Sandisk",
19 "ImageMate SDDR-31",
20 US_SC_SCSI, US_PR_BULK, NULL,
21- US_FL_IGNORE_SER),
22+ US_FL_IGNORE_SER | US_FL_START_CHECK ),
23
24 UNUSUAL_DEV( 0x0781, 0x0100, 0x0100, 0x0100,
25 "Sandisk",
26diff -urNp linux-1620/drivers/usb/storage/usb.c linux-2310/drivers/usb/storage/usb.c
27--- linux-1620/drivers/usb/storage/usb.c
28+++ linux-2310/drivers/usb/storage/usb.c
29@@ -453,6 +453,20 @@ static int usb_stor_control_thread(void
30 US_DEBUGP("Faking INQUIRY command\n");
31 fill_inquiry_response(us, data_ptr, 36);
32 us->srb->result = GOOD << 1;
33+ } else if ((us->srb->cmnd[0] == START_STOP) &&
34+ (us->flags & US_FL_START_CHECK)) {
35+ unsigned char saved_cdb[6];
36+
37+ /* Handle those devices which fake
38+ * START_STOP on us, this confuses
39+ * the hell out of media check code. */
40+ US_DEBUGP("Convering START_STOP command\n");
41+ memcpy(saved_cdb, us->srb->cmnd, 6);
42+ memset(us->srb->cmnd, 0, 6);
43+ us->srb->cmnd[0] = TEST_UNIT_READY;
44+ US_DEBUG(usb_stor_show_command(us->srb));
45+ us->proto_handler(us->srb, us);
46+ memcpy(us->srb->cmnd, saved_cdb, 6);
47 } else {
48 /* we've got a command, let's do it! */
49 US_DEBUG(usb_stor_show_command(us->srb));
50diff -urNp linux-1620/drivers/usb/storage/usb.h linux-2310/drivers/usb/storage/usb.h
51--- linux-1620/drivers/usb/storage/usb.h
52+++ linux-2310/drivers/usb/storage/usb.h
53@@ -98,6 +98,7 @@ struct us_unusual_dev {
54 #define US_FL_MODE_XLATE 0x00000002 /* translate _6 to _10 commands for
55 Win/MacOS compatibility */
56 #define US_FL_START_STOP 0x00000004 /* ignore START_STOP commands */
57+#define US_FL_START_CHECK 0x00000008 /* START_STOP => TEST UNIT READY */
58 #define US_FL_IGNORE_SER 0x00000010 /* Ignore the serial number given */
59 #define US_FL_SCM_MULT_TARG 0x00000020 /* supports multiple targets */
60 #define US_FL_FIX_INQUIRY 0x00000040 /* INQUIRY response needs fixing */
61--- linux-2.4.19/drivers/usb/usb-ohci.c 2002-08-02 17:39:45.000000000 -0700
62+++ linux-2.4.19-p3/drivers/usb/usb-ohci.c 2002-10-23 14:22:24.000000000 -0700
63@@ -2165,7 +2165,19 @@
64
65 /* Reset USB (needed by some controllers) */
66 writel (0, &ohci->regs->control);
67-
68+
69+ /*
70+ * Work around lockups in IBM i1200/i1300. We victimize all similar ALi
71+ * motherboards in the process, but it does not hurt them.
72+ * Fix from Alex T. H. Chou @ALi.
73+ */
74+ if (ohci->ohci_dev->vendor == PCI_VENDOR_ID_AL &&
75+ ohci->ohci_dev->device == PCI_DEVICE_ID_AL_M5237) {
76+ /* Force a state change from USBRESET to USBOPERATIONAL */
77+ (void) readl (&ohci->regs->control); /* PCI posting above */
78+ writel (ohci->hc_control = OHCI_USB_OPER, &ohci->regs->control);
79+ }
80+
81 /* HC Reset requires max 10 ms delay */
82 writel (OHCI_HCR, &ohci->regs->cmdstatus);
83 while ((readl (&ohci->regs->cmdstatus) & OHCI_HCR) != 0) {
84diff -urNp linux-2310/drivers/usb/inode.c linux-2330/drivers/usb/inode.c
85--- linux-2310/drivers/usb/inode.c
86+++ linux-2330/drivers/usb/inode.c
87@@ -102,6 +102,27 @@ static void new_dev_inode(struct usb_dev
88 printk(KERN_ERR "usbdevfs: cannot create inode for bus %u device %u\n", busnum, devnum);
89 return;
90 }
91+ if (inode->u.usbdev_i.slist.next != NULL) {
92+ /*
93+ * We are on the list already. This is not supposed to happen.
94+ * The suspicion is that anaconda races khubd (we always get
95+ * here at khubd context from usbdevfs_add_device, with dev
96+ * pointer set correctly, even though khubd kmalloc's it).
97+ */
98+ if (inode->u.usbdev_i.p.dev != NULL &&
99+ inode->u.usbdev_i.p.dev != dev) {
100+ printk(KERN_WARNING
101+ "usbdevfs: confused by inode %d(0x%x)\n",
102+ (int) inode->i_ino, (int) inode->i_ino);
103+ }
104+ if (inode->i_fop != &usbdevfs_device_file_operations) {
105+ printk(KERN_WARNING
106+ "usbdevfs: lost fops in inode %d(0x%x)\n",
107+ (int) inode->i_ino, (int) inode->i_ino);
108+ inode->i_fop = &usbdevfs_device_file_operations;
109+ }
110+ return;
111+ }
112 inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
113 inode->i_uid = sb->u.usbdevfs_sb.devuid;
114 inode->i_gid = sb->u.usbdevfs_sb.devgid;
115@@ -158,9 +179,7 @@ static void free_inode(struct inode *ino
116 inode->i_uid = inode->i_gid = 0;
117 inode->i_size = 0;
118 list_del(&inode->u.usbdev_i.slist);
119- INIT_LIST_HEAD(&inode->u.usbdev_i.slist);
120 list_del(&inode->u.usbdev_i.dlist);
121- INIT_LIST_HEAD(&inode->u.usbdev_i.dlist);
122 iput(inode);
123 }
124
125@@ -512,8 +531,6 @@ static void usbdevfs_read_inode(struct i
126 inode->i_ctime = inode->i_mtime = inode->i_atime = CURRENT_TIME;
127 inode->i_mode = S_IFREG;
128 inode->i_gid = inode->i_uid = 0;
129- INIT_LIST_HEAD(&inode->u.usbdev_i.dlist);
130- INIT_LIST_HEAD(&inode->u.usbdev_i.slist);
131 inode->u.usbdev_i.p.dev = NULL;
132 inode->u.usbdev_i.p.bus = NULL;
133 switch (ITYPE(inode->i_ino)) {
134diff -urNp linux-2330/drivers/usb/pegasus.h linux-2331/drivers/usb/pegasus.h
135--- linux-2330/drivers/usb/pegasus.h
136+++ linux-2331/drivers/usb/pegasus.h
137@@ -164,7 +164,7 @@ PEGASUS_DEV( "USB 10/100 Fast Ethernet",
138 PEGASUS_DEV( "Accton USB 10/100 Ethernet Adapter", VENDOR_ACCTON, 0x1046,
139 DEFAULT_GPIO_RESET )
140 PEGASUS_DEV( "SpeedStream USB 10/100 Ethernet", VENDOR_ACCTON, 0x5046,
141- DEFAULT_GPIO_RESET )
142+ DEFAULT_GPIO_RESET | PEGASUS_II )
143 PEGASUS_DEV( "ADMtek ADM8511 \"Pegasus II\" USB Ethernet",
144 VENDOR_ADMTEK, 0x8511,
145 DEFAULT_GPIO_RESET | PEGASUS_II )
This page took 2.07766 seconds and 4 git commands to generate.