svn commit: r209884 - head/sys/dev/ata/chipsets
Alexander Motin
mav at FreeBSD.org
Sat Jul 10 15:36:28 UTC 2010
Author: mav
Date: Sat Jul 10 15:36:27 2010
New Revision: 209884
URL: http://svn.freebsd.org/changeset/base/209884
Log:
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:
head/sys/dev/ata/chipsets/ata-intel.c
head/sys/dev/ata/chipsets/ata-marvell.c
head/sys/dev/ata/chipsets/ata-nvidia.c
head/sys/dev/ata/chipsets/ata-promise.c
head/sys/dev/ata/chipsets/ata-siliconimage.c
head/sys/dev/ata/chipsets/ata-sis.c
head/sys/dev/ata/chipsets/ata-via.c
Modified: head/sys/dev/ata/chipsets/ata-intel.c
==============================================================================
--- head/sys/dev/ata/chipsets/ata-intel.c Sat Jul 10 15:27:27 2010 (r209883)
+++ head/sys/dev/ata/chipsets/ata-intel.c Sat Jul 10 15:36:27 2010 (r209884)
@@ -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: head/sys/dev/ata/chipsets/ata-marvell.c
==============================================================================
--- head/sys/dev/ata/chipsets/ata-marvell.c Sat Jul 10 15:27:27 2010 (r209883)
+++ head/sys/dev/ata/chipsets/ata-marvell.c Sat Jul 10 15:36:27 2010 (r209884)
@@ -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: head/sys/dev/ata/chipsets/ata-nvidia.c
==============================================================================
--- head/sys/dev/ata/chipsets/ata-nvidia.c Sat Jul 10 15:27:27 2010 (r209883)
+++ head/sys/dev/ata/chipsets/ata-nvidia.c Sat Jul 10 15:36:27 2010 (r209884)
@@ -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: head/sys/dev/ata/chipsets/ata-promise.c
==============================================================================
--- head/sys/dev/ata/chipsets/ata-promise.c Sat Jul 10 15:27:27 2010 (r209883)
+++ head/sys/dev/ata/chipsets/ata-promise.c Sat Jul 10 15:36:27 2010 (r209884)
@@ -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: head/sys/dev/ata/chipsets/ata-siliconimage.c
==============================================================================
--- head/sys/dev/ata/chipsets/ata-siliconimage.c Sat Jul 10 15:27:27 2010 (r209883)
+++ head/sys/dev/ata/chipsets/ata-siliconimage.c Sat Jul 10 15:36:27 2010 (r209884)
@@ -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: head/sys/dev/ata/chipsets/ata-sis.c
==============================================================================
--- head/sys/dev/ata/chipsets/ata-sis.c Sat Jul 10 15:27:27 2010 (r209883)
+++ head/sys/dev/ata/chipsets/ata-sis.c Sat Jul 10 15:36:27 2010 (r209884)
@@ -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: head/sys/dev/ata/chipsets/ata-via.c
==============================================================================
--- head/sys/dev/ata/chipsets/ata-via.c Sat Jul 10 15:27:27 2010 (r209883)
+++ head/sys/dev/ata/chipsets/ata-via.c Sat Jul 10 15:36:27 2010 (r209884)
@@ -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
More information about the svn-src-head
mailing list