Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 9 Dec 2009 17:11:09 +0000 (UTC)
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r200296 - stable/8/sys/dev/ata/chipsets
Message-ID:  <200912091711.nB9HB9Ek031544@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Wed Dec  9 17:11:09 2009
New Revision: 200296
URL: http://svn.freebsd.org/changeset/base/200296

Log:
  MFC r200117:
  On Soft Reset, read device signature from FIS receive area, instead of
  PxSIG register. It works better for NVidia chipsets. ahci(4) does the same.
  
  PR:             kern/140472, i386/138668

Modified:
  stable/8/sys/dev/ata/chipsets/ata-ahci.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)

Modified: stable/8/sys/dev/ata/chipsets/ata-ahci.c
==============================================================================
--- stable/8/sys/dev/ata/chipsets/ata-ahci.c	Wed Dec  9 14:21:21 2009	(r200295)
+++ stable/8/sys/dev/ata/chipsets/ata-ahci.c	Wed Dec  9 17:11:09 2009	(r200296)
@@ -824,11 +824,10 @@ ata_ahci_hardreset(device_t dev, int por
 static u_int32_t
 ata_ahci_softreset(device_t dev, int port)
 {
-    struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev));
     struct ata_channel *ch = device_get_softc(dev);
-    int offset = ch->unit << 7;
     struct ata_ahci_cmd_tab *ctp =
 	(struct ata_ahci_cmd_tab *)(ch->dma.work + ATA_AHCI_CT_OFFSET);
+    u_int8_t *fis = ch->dma.work + ATA_AHCI_FB_OFFSET + 0x40;
 
     if (bootverbose)
 	device_printf(dev, "software reset port %d...\n", port);
@@ -865,7 +864,10 @@ ata_ahci_softreset(device_t dev, int por
 	return (-1);
     }
 
-    return ATA_INL(ctlr->r_res2, ATA_AHCI_P_SIG + offset);
+    return (((u_int32_t)fis[6] << 24) |
+	    ((u_int32_t)fis[5] << 16) |
+	    ((u_int32_t)fis[4] << 8) |
+	     (u_int32_t)fis[12]);
 }
 
 static void



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200912091711.nB9HB9Ek031544>