+ pata-ahci-ensure-that-we-dont-grab-both-functions.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled

     pata: ahci: Ensure that we don't grab both functions

has been added to the -mm tree.  Its filename is

     pata-ahci-ensure-that-we-dont-grab-both-functions.patch

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

------------------------------------------------------
Subject: pata: ahci: Ensure that we don't grab both functions
From: Alan Cox <alan@xxxxxxxxxx>

When we force the chip into dual fn mode so we get PATA and AHCI we must be
sure we don't then do anything dumb like try and grab both with the AHCI
driver.

Signed-off-by: Alan Cox <alan@xxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 drivers/scsi/ahci.c |   15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff -puN drivers/scsi/ahci.c~pata-ahci-ensure-that-we-dont-grab-both-functions drivers/scsi/ahci.c
--- a/drivers/scsi/ahci.c~pata-ahci-ensure-that-we-dont-grab-both-functions
+++ a/drivers/scsi/ahci.c
@@ -1323,6 +1323,17 @@ static int ahci_init_one (struct pci_dev
 	if (!printed_version++)
 		dev_printk(KERN_DEBUG, &pdev->dev, "version " DRV_VERSION "\n");
 
+	/* JMicron-specific fixup: make sure we're in AHCI mode */
+	/* This is protected from races with ata_jmicron by the pci probe
+	   locking */
+	if (pdev->vendor == PCI_VENDOR_ID_JMICRON) {
+		/* AHCI enable, AHCI on function 0 */
+		pci_write_config_byte(pdev, 0x41, 0xa1);
+		/* Function 1 is the PATA controller */
+		if (PCI_FUNC(pdev->devfn))
+			return -ENODEV;
+	}
+
 	rc = pci_enable_device(pdev);
 	if (rc)
 		return rc;
@@ -1378,10 +1389,6 @@ static int ahci_init_one (struct pci_dev
 	if (have_msi)
 		hpriv->flags |= AHCI_FLAG_MSI;
 
-	/* JMicron-specific fixup: make sure we're in AHCI mode */
-	if (pdev->vendor == 0x197b)
-		pci_write_config_byte(pdev, 0x41, 0xa1);
-
 	/* initialize adapter */
 	rc = ahci_host_init(probe_ent);
 	if (rc)
_

Patches currently in -mm which might be from alan@xxxxxxxxxx are

origin.patch
my-name-is-ingo-molnar-you-killed-my-make-allyesconfig-prepare-to-die.patch
jmicron-pci-identifiers.patch
pata-ata_piix-time0-time1-setup.patch
pata-pata_ali-further-debug-work.patch
pata-pata_amd-new-chips.patch
pata-pata_ali-revisions-below-0x20-need-cd-config-poking-too.patch
pata-sort-out-mc65-compile-for-now.patch
pata-libata-fix-the-host_set-hacks-and-sort-out-simplex-mode.patch
pata-pata_it821x-fix-pass-through.patch
pata-ahci-ensure-that-we-dont-grab-both-functions.patch
pata-jmicron-add-quirks-to-force-the-device-into-a-sane-mode.patch
pata-jmicron-configuration.patch
pata-it821x-fix-the-atapi-autodma-setup.patch
pata-ata_generic-generic-bios-setup-sff-ata-driver.patch
pata-jmicron-ide-old-type-driver.patch
pata-pata_qdi-fix-return-code.patch
pata-ide-jmicron-finish-writing.patch
pata-jmicron-it-works-better-if-you-get-the-file-name-right.patch
pata-jmicron-further-clean-up.patch
pata-ata_jmicro-fix-an-escapee.patch
pata-jmicron-jmicron-multifunction-setup.patch
pata-libata-enable-per-device-speed-setting.patch
pata-jmicron-missed-one.patch
sanitize-3c589_cs.patch
ide-backport-piix-fixes-from-libata-into-the-legacy-driver.patch
move-ide-to-unmaintained-drop-reference-to-old-git-tree.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux