rpms/kernel/F-8 kernel.spec, 1.551, 1.552 linux-2.6-libata-pata_marvell-play-nice-with-ahci.patch, 1.1, 1.2

Chuck Ebbert cebbert at fedoraproject.org
Mon Oct 13 18:52:09 UTC 2008


Author: cebbert

Update of /cvs/pkgs/rpms/kernel/F-8
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv26747

Modified Files:
	kernel.spec 
	linux-2.6-libata-pata_marvell-play-nice-with-ahci.patch 
Log Message:
libata: pata_marvell: use the upstream patch for playing nice with ahci


Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/F-8/kernel.spec,v
retrieving revision 1.551
retrieving revision 1.552
diff -u -r1.551 -r1.552
--- kernel.spec	10 Oct 2008 22:16:30 -0000	1.551
+++ kernel.spec	13 Oct 2008 18:51:38 -0000	1.552
@@ -1868,6 +1868,9 @@
 
 
 %changelog
+* Mon Oct 13 2008 Chuck Ebbert <cebbert at redhat.com> 2.6.26.6-42
+- libata: pata_marvell: use the upstream patch for playing nice with ahci
+
 * Fri Oct 10 2008 Chuck Ebbert <cebbert at redhat.com> 2.6.26.6-41
 - pci: check range on sysfs mmapped resources
 

linux-2.6-libata-pata_marvell-play-nice-with-ahci.patch:

Index: linux-2.6-libata-pata_marvell-play-nice-with-ahci.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/F-8/linux-2.6-libata-pata_marvell-play-nice-with-ahci.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- linux-2.6-libata-pata_marvell-play-nice-with-ahci.patch	11 Sep 2008 06:53:04 -0000	1.1
+++ linux-2.6-libata-pata_marvell-play-nice-with-ahci.patch	13 Oct 2008 18:51:38 -0000	1.2
@@ -1,47 +1,57 @@
-pata_marvell: Undo the regressions Jeff caused
+From: Alan Cox <alan at lxorguk.ukuu.org.uk>
+Date: Wed, 3 Sep 2008 13:48:34 +0000 (+0100)
+Subject: ahci, pata_marvell: play nicely together
+X-Git-Tag: v2.6.27-rc6~16^2~6
+X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=5b66c829bf5c65663b2f68ee6b42f6e834cd39cd
+
+ahci, pata_marvell: play nicely together
+
+I've been chasing Jeff about this for months.  Jeff added the Marvell
+device identifiers to the ahci driver without making the AHCI driver
+handle the PATA port. This means a lot of users can't use current
+kernels and in most distro cases can't even install.
 
-From: Alan Cox <alan at redhat.com>
-
-I've been chasing Jeff about this for months so am now giving up and sending
-it directly. Jeff added the Marvell device identifiers to the ahci driver
-without making the AHCI driver handle the PATA port. This means a lot of users
-can't use current kernels and in most distro cases can't even install. This has
-been going on since March 2008 for the 6121 Marvell, and late 2007 for the 6145.
+This has been going on since March 2008 for the 6121 Marvell, and late 2007
+for the 6145!!!
 
 This was all pointed out at the time and repeatedly ignored. Bugs assigned
 to Jeff about this are ignored also.
 
 To quote Jeff in email
 
-"Just switch the order of 'ahci' and 'pata_marvell' in
-/etc/modprobe.conf, then use Fedora's tools regenerate the initrd.
+> "Just switch the order of 'ahci' and 'pata_marvell' in
+> /etc/modprobe.conf, then use Fedora's tools regenerate the initrd.
 
-See?  It's not rocket science, and the current configuration can be
-easily made to work for Fedora users."
+> See?  It's not rocket science, and the current configuration can be
+> easily made to work for Fedora users."
 
 (Which isn't trivial, isn't end user, shouldn't be needed, and as it usually
 breaks at install time is in fact impossible)
 
 To quote Jeff in August 2007
 
-"   mv-ahci-pata
-Marvell 6121/6141 PATA support.  Needs fixing in the 'PATA controller
-command' area before it is usable, and can go upstream."
+> "   mv-ahci-pata
+> Marvell 6121/6141 PATA support.  Needs fixing in the 'PATA controller
+> command' area before it is usable, and can go upstream."
 
-Only he applied it all anyway later and broke everything.
+Only he add the ids anyway later and caused regressions, adding a further
+id in March causing more regresions.
 
 The actual fix for the moment is very simple. If the user has included
 the pata_marvell driver let it drive the ports. If they've only selected
 for SATA support give them the AHCI driver which will run the port a fraction
-faster.
-
+faster. Allow the user to control this decision via ahci.marvell_enable as
+a module parameter so that distributions can ship 'it works' defaults and
+smarter users (or config tools) can then flip it over it desired.
 
 Signed-off-by: Alan Cox <alan at redhat.com>
+Signed-off-by: Jeff Garzik <jgarzik at redhat.com>
+---
 
-Index: linux-2.6.26.noarch/drivers/ata/Kconfig
-===================================================================
---- linux-2.6.26.noarch.orig/drivers/ata/Kconfig
-+++ linux-2.6.26.noarch/drivers/ata/Kconfig
+diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig
+index ae84949..11c8c19 100644
+--- a/drivers/ata/Kconfig
++++ b/drivers/ata/Kconfig
 @@ -448,8 +448,10 @@ config PATA_MARVELL
  	tristate "Marvell PATA support via legacy mode"
  	depends on PCI
@@ -55,22 +65,134 @@
  
  	  If unsure, say N.
  
-Index: linux-2.6.26.noarch/drivers/ata/ahci.c
-===================================================================
---- linux-2.6.26.noarch.orig/drivers/ata/ahci.c
-+++ linux-2.6.26.noarch/drivers/ata/ahci.c
-@@ -538,9 +538,14 @@ static const struct pci_device_id ahci_p
- 	{ PCI_VDEVICE(SI, 0x1185), board_ahci_nopmp },		/* SiS 968 */
- 	{ PCI_VDEVICE(SI, 0x0186), board_ahci_nopmp },		/* SiS 968 */
+diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
+index c729e69..bce26ee 100644
+--- a/drivers/ata/ahci.c
++++ b/drivers/ata/ahci.c
+@@ -610,6 +610,15 @@ module_param(ahci_em_messages, int, 0444);
+ module_param_named(skip_host_reset, ahci_skip_host_reset, int, 0444);
+ MODULE_PARM_DESC(skip_host_reset, "skip global host reset (0=don't skip, 1=skip)");
+ 
++#if defined(CONFIG_PATA_MARVELL) || defined(CONFIG_PATA_MARVELL_MODULE)
++static int marvell_enable;
++#else
++static int marvell_enable = 1;
++#endif
++module_param(marvell_enable, int, 0644);
++MODULE_PARM_DESC(marvell_enable, "Marvell SATA via AHCI (1 = enabled)");
++
++
+ static int ahci_enable_alpm(struct ata_port *ap,
+ 		enum link_pm policy);
+ static void ahci_disable_alpm(struct ata_port *ap);
+@@ -732,6 +741,8 @@ static void ahci_save_initial_config(struct pci_dev *pdev,
+ 			   "MV_AHCI HACK: port_map %x -> %x\n",
+ 			   port_map,
+ 			   port_map & mv);
++		dev_printk(KERN_ERR, &pdev->dev,
++			  "Disabling your PATA port. Use the boot option 'ahci.marvell_enable=0' to avoid this.\n");
+ 
+ 		port_map &= mv;
+ 	}
+@@ -2533,6 +2544,12 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
+ 	if (!printed_version++)
+ 		dev_printk(KERN_DEBUG, &pdev->dev, "version " DRV_VERSION "\n");
  
-+#if  !defined(CONFIG_PATA_MARVELL) && !defined(CONFIG_PATA_MARVELL_MODULE)
- 	/* Marvell */
 +	/* The AHCI driver can only drive the SATA ports, the PATA driver
 +	   can drive them all so if both drivers are selected make sure
 +	   AHCI stays out of the way */
- 	{ PCI_VDEVICE(MARVELL, 0x6145), board_ahci_mv },	/* 6145 */
- 	{ PCI_VDEVICE(MARVELL, 0x6121), board_ahci_mv },	/* 6121 */
++	if (pdev->vendor == PCI_VENDOR_ID_MARVELL && !marvell_enable)
++		return -ENODEV;
++
+ 	/* acquire resources */
+ 	rc = pcim_enable_device(pdev);
+ 	if (rc)
+diff --git a/drivers/ata/pata_marvell.c b/drivers/ata/pata_marvell.c
+index 24a011b..0d87eec 100644
+--- a/drivers/ata/pata_marvell.c
++++ b/drivers/ata/pata_marvell.c
+@@ -20,29 +20,30 @@
+ #include <linux/ata.h>
+ 
+ #define DRV_NAME	"pata_marvell"
+-#define DRV_VERSION	"0.1.4"
++#define DRV_VERSION	"0.1.6"
+ 
+ /**
+- *	marvell_pre_reset	-	check for 40/80 pin
+- *	@link: link
+- *	@deadline: deadline jiffies for the operation
++ *	marvell_pata_active	-	check if PATA is active
++ *	@pdev: PCI device
+  *
+- *	Perform the PATA port setup we need.
++ *	Returns 1 if the PATA port may be active. We know how to check this
++ *	for the 6145 but not the other devices
+  */
+ 
+-static int marvell_pre_reset(struct ata_link *link, unsigned long deadline)
++static int marvell_pata_active(struct pci_dev *pdev)
+ {
+-	struct ata_port *ap = link->ap;
+-	struct pci_dev *pdev = to_pci_dev(ap->host->dev);
++	int i;
+ 	u32 devices;
+ 	void __iomem *barp;
+-	int i;
+ 
+-	/* Check if our port is enabled */
++	/* We don't yet know how to do this for other devices */
++	if (pdev->device != 0x6145)
++		return 1;	
+ 
+ 	barp = pci_iomap(pdev, 5, 0x10);
+ 	if (barp == NULL)
+ 		return -ENOMEM;
++
+ 	printk("BAR5:");
+ 	for(i = 0; i <= 0x0F; i++)
+ 		printk("%02X:%02X ", i, ioread8(barp + i));
+@@ -51,9 +52,27 @@ static int marvell_pre_reset(struct ata_link *link, unsigned long deadline)
+ 	devices = ioread32(barp + 0x0C);
+ 	pci_iounmap(pdev, barp);
+ 
+-	if ((pdev->device == 0x6145) && (ap->port_no == 0) &&
+-	    (!(devices & 0x10)))	/* PATA enable ? */
+-		return -ENOENT;
++	if (devices & 0x10)
++		return 1;
++	return 0;
++}
++
++/**
++ *	marvell_pre_reset	-	check for 40/80 pin
++ *	@link: link
++ *	@deadline: deadline jiffies for the operation
++ *
++ *	Perform the PATA port setup we need.
++ */
++
++static int marvell_pre_reset(struct ata_link *link, unsigned long deadline)
++{
++	struct ata_port *ap = link->ap;
++	struct pci_dev *pdev = to_pci_dev(ap->host->dev);
++
++	if (pdev->device == 0x6145 && ap->port_no == 0 &&
++		!marvell_pata_active(pdev))	/* PATA enable ? */
++			return -ENOENT;
+ 
+ 	return ata_sff_prereset(link, deadline);
+ }
+@@ -128,6 +147,12 @@ static int marvell_init_one (struct pci_dev *pdev, const struct pci_device_id *i
+ 	if (pdev->device == 0x6101)
+ 		ppi[1] = &ata_dummy_port_info;
+ 
++#if defined(CONFIG_AHCI) || defined(CONFIG_AHCI_MODULE)
++	if (!marvell_pata_active(pdev)) {
++		printk(KERN_INFO DRV_NAME ": PATA port not active, deferring to AHCI driver.\n");
++		return -ENODEV;
++	}
 +#endif
+ 	return ata_pci_sff_init_one(pdev, ppi, &marvell_sht, NULL);
+ }
  
- 	/* Generic, PCI class code for AHCI */
- 	{ PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,




More information about the scm-commits mailing list