From owner-svn-src-all@FreeBSD.ORG Sun Jul 18 07:13:55 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9ABC2106564A; Sun, 18 Jul 2010 07:13:55 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 88F208FC17; Sun, 18 Jul 2010 07:13:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o6I7DtoY077246; Sun, 18 Jul 2010 07:13:55 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o6I7DtS4077238; Sun, 18 Jul 2010 07:13:55 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201007180713.o6I7DtS4077238@svn.freebsd.org> From: Alexander Motin Date: Sun, 18 Jul 2010 07:13:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r210205 - stable/8/sys/dev/ata/chipsets X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Jul 2010 07:13:55 -0000 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