Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 18 Jul 2010 07:13:55 +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: r210205 - stable/8/sys/dev/ata/chipsets
Message-ID:  <201007180713.o6I7DtS4077238@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mav
Date: Sun Jul 18 07:13:55 2010
New Revision: 210205
URL: http://svn.freebsd.org/changeset/base/210205

Log:
  MFC r209884:
  If ata_sata_phy_reset() failed and ata_generic_reset() is not called, mark
  channel as having no devices connected. This improves hot-unplug operation
  on legacy-emulating SATA controllers.

Modified:
  stable/8/sys/dev/ata/chipsets/ata-intel.c
  stable/8/sys/dev/ata/chipsets/ata-marvell.c
  stable/8/sys/dev/ata/chipsets/ata-nvidia.c
  stable/8/sys/dev/ata/chipsets/ata-promise.c
  stable/8/sys/dev/ata/chipsets/ata-siliconimage.c
  stable/8/sys/dev/ata/chipsets/ata-sis.c
  stable/8/sys/dev/ata/chipsets/ata-via.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-intel.c
==============================================================================
--- stable/8/sys/dev/ata/chipsets/ata-intel.c	Sun Jul 18 07:11:03 2010	(r210204)
+++ stable/8/sys/dev/ata/chipsets/ata-intel.c	Sun Jul 18 07:13:55 2010	(r210205)
@@ -554,8 +554,12 @@ ata_intel_31244_tf_write(struct ata_requ
 static void
 ata_intel_31244_reset(device_t dev)
 {
+    struct ata_channel *ch = device_get_softc(dev);
+
     if (ata_sata_phy_reset(dev, -1, 1))
 	ata_generic_reset(dev);
+    else
+	ch->devices = 0;
 }
 
 ATA_DECLARE_DRIVER(ata_intel);

Modified: stable/8/sys/dev/ata/chipsets/ata-marvell.c
==============================================================================
--- stable/8/sys/dev/ata/chipsets/ata-marvell.c	Sun Jul 18 07:11:03 2010	(r210204)
+++ stable/8/sys/dev/ata/chipsets/ata-marvell.c	Sun Jul 18 07:13:55 2010	(r210205)
@@ -579,6 +579,8 @@ ata_marvell_edma_reset(device_t dev)
     /* enable channel and test for devices */
     if (ata_sata_phy_reset(dev, -1, 1))
 	ata_generic_reset(dev);
+    else
+	ch->devices = 0;
 
     /* enable EDMA machinery */
     ATA_OUTL(ctlr->r_res1, 0x02028 + ATA_MV_EDMA_BASE(ch), 0x00000001);

Modified: stable/8/sys/dev/ata/chipsets/ata-nvidia.c
==============================================================================
--- stable/8/sys/dev/ata/chipsets/ata-nvidia.c	Sun Jul 18 07:11:03 2010	(r210204)
+++ stable/8/sys/dev/ata/chipsets/ata-nvidia.c	Sun Jul 18 07:13:55 2010	(r210205)
@@ -296,8 +296,12 @@ ata_nvidia_status(device_t dev)
 static void
 ata_nvidia_reset(device_t dev)
 {
+    struct ata_channel *ch = device_get_softc(dev);
+
     if (ata_sata_phy_reset(dev, -1, 1))
 	ata_generic_reset(dev);
+    else
+	ch->devices = 0;
 }
 
 static int

Modified: stable/8/sys/dev/ata/chipsets/ata-promise.c
==============================================================================
--- stable/8/sys/dev/ata/chipsets/ata-promise.c	Sun Jul 18 07:11:03 2010	(r210204)
+++ stable/8/sys/dev/ata/chipsets/ata-promise.c	Sun Jul 18 07:13:55 2010	(r210205)
@@ -744,6 +744,8 @@ ata_promise_mio_reset(device_t dev)
 
 	    if (ata_sata_phy_reset(dev, -1, 1))
 		ata_generic_reset(dev);
+	    else
+		ch->devices = 0;
 
 	    /* reset and enable plug/unplug intr */
 	    ATA_OUTL(ctlr->r_res2, 0x06c, (0x00000011 << ch->unit));

Modified: stable/8/sys/dev/ata/chipsets/ata-siliconimage.c
==============================================================================
--- stable/8/sys/dev/ata/chipsets/ata-siliconimage.c	Sun Jul 18 07:11:03 2010	(r210204)
+++ stable/8/sys/dev/ata/chipsets/ata-siliconimage.c	Sun Jul 18 07:13:55 2010	(r210205)
@@ -364,8 +364,12 @@ ata_sii_status(device_t dev)
 static void
 ata_sii_reset(device_t dev)
 {
+    struct ata_channel *ch = device_get_softc(dev);
+
     if (ata_sata_phy_reset(dev, -1, 1))
 	ata_generic_reset(dev);
+    else
+	ch->devices = 0;
 }
 
 static int

Modified: stable/8/sys/dev/ata/chipsets/ata-sis.c
==============================================================================
--- stable/8/sys/dev/ata/chipsets/ata-sis.c	Sun Jul 18 07:11:03 2010	(r210204)
+++ stable/8/sys/dev/ata/chipsets/ata-sis.c	Sun Jul 18 07:13:55 2010	(r210205)
@@ -228,8 +228,12 @@ ata_sis_ch_attach(device_t dev)
 static void
 ata_sis_reset(device_t dev)
 {
+    struct ata_channel *ch = device_get_softc(dev);
+
     if (ata_sata_phy_reset(dev, -1, 1))
 	ata_generic_reset(dev);
+    else
+	ch->devices = 0;
 }
 
 static int

Modified: stable/8/sys/dev/ata/chipsets/ata-via.c
==============================================================================
--- stable/8/sys/dev/ata/chipsets/ata-via.c	Sun Jul 18 07:11:03 2010	(r210204)
+++ stable/8/sys/dev/ata/chipsets/ata-via.c	Sun Jul 18 07:13:55 2010	(r210205)
@@ -290,9 +290,12 @@ ata_via_reset(device_t dev)
 
     if ((ctlr->chip->cfg2 & VIABAR) && (ch->unit > 1))
         ata_generic_reset(dev);
-    else
+    else {
 	if (ata_sata_phy_reset(dev, -1, 1))
 	    ata_generic_reset(dev);
+	else
+	    ch->devices = 0;
+    }
 }
 
 static int



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