rpms/kernel/F-8 linux-2.6-libata-correct-iordy-handling.patch, NONE, 1.1 linux-2.6-usb-huawei-fix-init-in-modem-mode.patch, NONE, 1.1 kernel.spec, 1.278, 1.279

Chuck Ebbert (cebbert) fedora-extras-commits at redhat.com
Thu Nov 29 00:25:40 UTC 2007


Author: cebbert

Update of /cvs/pkgs/rpms/kernel/F-8
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv8577

Modified Files:
	kernel.spec 
Added Files:
	linux-2.6-libata-correct-iordy-handling.patch 
	linux-2.6-usb-huawei-fix-init-in-modem-mode.patch 
Log Message:
* Wed Nov 28 2007 Chuck Ebbert <cebbert at redhat.com>
- Fix further bugs in init of Huawei USB modem (#253096)
- Fix libata handling of IO ready test (#389971)


linux-2.6-libata-correct-iordy-handling.patch:

--- NEW FILE linux-2.6-libata-correct-iordy-handling.patch ---
From: Alan Cox <alan at lxorguk.ukuu.org.uk>
Date: Tue, 31 Jul 2007 13:01:48 +0000 (+0100)
Subject: libata: Correct IORDY handling
X-Git-Tag: v2.6.24-rc1~1391^2~103
X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=0bc2a79a2002e3cc1b514c100b6c576983da6a90

libata: Correct IORDY handling

Debugging a report of a problem with an ancient solid state disk showed
up some problems in the IORDY handling

1.	We check the wrong bit to see if the device has IORDY
2.	Even then some ancient creaking piles of crap don't support
	SETXFER at all.

The cases it fixes are obscure and the risk of side effects is slight
but possible. This also moves us slightly closer to supporting original
MFM/RLL disks with libata.

Signed-off-by: Alan Cox <alan at redhat.com>
Signed-off-by: Jeff Garzik <jeff at garzik.org>
---

diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 8a79b97..02425e4 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -2759,7 +2759,11 @@ static int ata_dev_set_mode(struct ata_device *dev)
 	/* Old CFA may refuse this command, which is just fine */
 	if (dev->xfer_shift == ATA_SHIFT_PIO && ata_id_is_cfa(dev->id))
         	err_mask &= ~AC_ERR_DEV;
-
+	/* Some very old devices and some bad newer ones fail any kind of
+	   SET_XFERMODE request but support PIO0-2 timings and no IORDY */
+	if (dev->xfer_shift == ATA_SHIFT_PIO && !ata_id_has_iordy(dev->id) &&
+			dev->pio_mode <= XFER_PIO_2)
+		err_mask &= ~AC_ERR_DEV;
 	if (err_mask) {
 		ata_dev_printk(dev, KERN_ERR, "failed to set xfermode "
 			       "(err_mask=0x%x)\n", err_mask);
diff --git a/include/linux/ata.h b/include/linux/ata.h
index c043c1c..40c7af0 100644
--- a/include/linux/ata.h
+++ b/include/linux/ata.h
@@ -358,7 +358,7 @@ struct ata_taskfile {
 #define ata_id_removeable(id)	((id)[0] & (1 << 7))
 #define ata_id_has_dword_io(id)	((id)[50] & (1 << 0))
 #define ata_id_iordy_disable(id) ((id)[49] & (1 << 10))
-#define ata_id_has_iordy(id) ((id)[49] & (1 << 9))
+#define ata_id_has_iordy(id) ((id)[49] & (1 << 11))
 #define ata_id_u32(id,n)	\
 	(((u32) (id)[(n) + 1] << 16) | ((u32) (id)[(n)]))
 #define ata_id_u64(id,n)	\

linux-2.6-usb-huawei-fix-init-in-modem-mode.patch:

--- NEW FILE linux-2.6-usb-huawei-fix-init-in-modem-mode.patch ---
bz #253096

diff -urp -X dontdiff linux-2.6.23.1-42.fc8/drivers/usb/serial/option.c linux-2.6.23.1-42.fc8.e220.1/drivers/usb/serial/option.c
--- linux-2.6.23.1-42.fc8/drivers/usb/serial/option.c	2007-10-09 13:31:38.000000000 -0700
+++ linux-2.6.23.1-42.fc8.e220.1/drivers/usb/serial/option.c	2007-11-27 21:36:11.000000000 -0800
@@ -448,7 +448,7 @@ static void option_indat_callback(struct
 			err = usb_submit_urb(urb, GFP_ATOMIC);
 			if (err)
 				printk(KERN_ERR "%s: resubmit read urb failed. "
-					"(%d)", __FUNCTION__, err);
+					"(%d)\n", __FUNCTION__, err);
 		}
 	}
 	return;
@@ -728,6 +728,35 @@ static int option_send_setup(struct usb_
 	return 0;
 }
 
+static void option_start_huawei(struct usb_serial *serial)
+{
+	struct usb_device *dev = serial->dev;
+	char *buf;
+	int rc;
+
+	if (!(le16_to_cpu(dev->descriptor.idVendor) == HUAWEI_VENDOR_ID &&
+	    le16_to_cpu(dev->descriptor.idProduct) == HUAWEI_PRODUCT_E220))
+		return;
+
+	if ((buf = kmalloc(1, GFP_KERNEL)) == 0)
+		goto err_buf;
+
+	buf[0] = 0x1;
+	rc = usb_control_msg(dev, usb_sndctrlpipe(dev, 0),
+		USB_REQ_SET_FEATURE, USB_TYPE_STANDARD | USB_RECIP_DEVICE,
+		0x01, 0x0, buf, 1, 1000);
+	if (rc) {
+		printk(KERN_ERR "%s: HUAWEI E220 setup failed (%d)\n",
+		    __FUNCTION__, rc);
+	}
+
+	kfree(buf);
+	return;
+
+err_buf:
+	;
+}
+
 static int option_startup(struct usb_serial *serial)
 {
 	int i, err;
@@ -736,6 +765,8 @@ static int option_startup(struct usb_ser
 
 	dbg("%s", __FUNCTION__);
 
+	option_start_huawei(serial);
+
 	/* Now setup per port private data */
 	for (i = 0; i < serial->num_ports; i++) {
 		port = serial->port[i];


Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/F-8/kernel.spec,v
retrieving revision 1.278
retrieving revision 1.279
diff -u -r1.278 -r1.279
--- kernel.spec	28 Nov 2007 20:29:04 -0000	1.278
+++ kernel.spec	29 Nov 2007 00:25:06 -0000	1.279
@@ -667,6 +667,7 @@
 Patch662: linux-2.6-libata-add-dma-disable-option.patch
 Patch665: linux-2.6-libata-dont-fail-revalidation-for-bad-gtf-methods.patch
 Patch666: linux-2.6-libata-pata_serverworks-fix-drive-combinations.patch
+Patch667: linux-2.6-libata-correct-iordy-handling.patch
 Patch670: linux-2.6-ata-quirk.patch
 Patch680: linux-2.6-wireless.patch
 Patch681: linux-2.6-wireless-pending.patch
@@ -712,6 +713,7 @@
 Patch1300: linux-2.6-usb-suspend-classes.patch
 Patch1305: linux-2.6-usb-storage-initialize-huawei-e220-properly.patch
 Patch1306: linux-2.6-usb-storage-always-set-the-allow_restart-flag.patch
+Patch1307: linux-2.6-usb-huawei-fix-init-in-modem-mode.patch
 
 Patch1400: linux-2.6-smarter-relatime.patch
 Patch1503: linux-2.6-xfs-optimize-away-dmapi-tests.patch
@@ -1258,6 +1260,8 @@
 ApplyPatch linux-2.6-libata-dont-fail-revalidation-for-bad-gtf-methods.patch
 # serverworks is broken with some drive combinations
 ApplyPatch linux-2.6-libata-pata_serverworks-fix-drive-combinations.patch
+# fix libata IORDY handling
+ApplyPatch linux-2.6-libata-correct-iordy-handling.patch
 
 # wireless patches headed for 2.6.24
 ApplyPatch linux-2.6-wireless.patch
@@ -1314,6 +1318,7 @@
 ApplyPatch linux-2.6-usb-suspend-classes.patch
 # initialize strange modem/storage device properly (from F7 kernel)
 ApplyPatch linux-2.6-usb-storage-initialize-huawei-e220-properly.patch
+ApplyPatch linux-2.6-usb-huawei-fix-init-in-modem-mode.patch
 # some usb disks spin down automatically and need allow_restart
 ApplyPatch linux-2.6-usb-storage-always-set-the-allow_restart-flag.patch
 
@@ -1968,6 +1973,10 @@
 
 %changelog
 * Wed Nov 28 2007 Chuck Ebbert <cebbert at redhat.com>
+- Fix further bugs in init of Huawei USB modem (#253096)
+- Fix libata handling of IO ready test (#389971)
+
+* Wed Nov 28 2007 Chuck Ebbert <cebbert at redhat.com>
 - Add support for SiS 7019 audio for K12LTSP project
 
 * Tue Nov 27 2007 Kyle McMartin <kmcmartin at redhat.com>




More information about the fedora-extras-commits mailing list