Mercurial > illumos > git > illumos-omnios
changeset 21288:6ae6dbc1f4a1
Merge pull request #469 from danmcd/master
DLPX-63519 ATA reads timeout after Azure update
author | Dominik Hassler <hadfl@omniosce.org> |
---|---|
date | Thu, 23 May 2019 19:21:21 +0200 |
parents | 55592718a5de (current diff) 0175f0b37e6b (diff) |
children | 4135cf426ffd |
files | |
diffstat | 3 files changed, 43 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/usr/src/uts/intel/io/dktp/controller/ata/ata_common.c Fri May 17 12:09:03 2019 +0200 +++ b/usr/src/uts/intel/io/dktp/controller/ata/ata_common.c Thu May 23 19:21:21 2019 +0200 @@ -24,6 +24,7 @@ * Use is subject to license terms. * * Copyright 2018 RackTop Systems. + * Copyright (c) 2019 by Delphix. All rights reserved. */ #include <sys/types.h> @@ -36,6 +37,7 @@ #include <sys/uio.h> #include <sys/cred.h> #include <sys/cpu.h> +#include <sys/x86_archext.h> #include "ata_common.h" #include "ata_disk.h" #include "atapi.h" @@ -180,6 +182,11 @@ static struct bus_ops ata_bus_ops; static struct bus_ops *scsa_bus_ops_p; +/* + * ATA workaround for Azure bug + */ +boolean_t ata_azure_workaround = B_FALSE; + /* ARGSUSED */ static int ata_open(dev_t *devp, int flag, int otyp, cred_t *cred_p) @@ -391,6 +398,13 @@ return (err); } + /* + * See comment in function ata_pciide_dma_start() of ata_dma.c for + * more details. + */ + if (get_hwenv() & HW_MICROSOFT) + ata_azure_workaround = B_TRUE; + /* save pointer to SCSA provided bus_ops struct */ scsa_bus_ops_p = ata_ops.devo_bus_ops;
--- a/usr/src/uts/intel/io/dktp/controller/ata/ata_dma.c Fri May 17 12:09:03 2019 +0200 +++ b/usr/src/uts/intel/io/dktp/controller/ata/ata_dma.c Thu May 23 19:21:21 2019 +0200 @@ -22,6 +22,7 @@ /* * Copyright 2004 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * Copyright (c) 2019 by Delphix. All rights reserved. */ #pragma ident "%Z%%M% %I% %E% SMI" @@ -96,6 +97,8 @@ size_t prd_size = sizeof (prde_t) * ATA_DMA_NSEGS; +extern boolean_t ata_azure_workaround; + int ata_pciide_alloc( dev_info_t *dip, @@ -236,8 +239,24 @@ */ tmp = ddi_get8(bmhandle, (uchar_t *)bmaddr + PCIIDE_BMICX_REG); tmp &= PCIIDE_BMICX_MASK; - ddi_put8(bmhandle, (uchar_t *)bmaddr + PCIIDE_BMICX_REG, - (tmp | direction)); + + /* + * After Hyper-V update 14393-10.0-0-0.295, ATA dma stopped + * working. Referring to Section 2.1 (Bus Master IDE Command Register) + * of the IDE specification from http://www.bswd.com/idems100.pdf: + * + * Writing only the direction bit first with bit 0 (start/stop bit) + * set to Zero, results in a side effect of the Bus master DMA + * controller losing all state information, which the new Hyper-V + * update adheres to strictly and hence results in DMA not working. + * + * It is unclear if this fix could negatively impact existing + * hardware, so it is gated under a flag. + */ + if (!ata_azure_workaround) { + ddi_put8(bmhandle, (uchar_t *)bmaddr + PCIIDE_BMICX_REG, + (tmp | direction)); + } ddi_put8(bmhandle, (uchar_t *)bmaddr + PCIIDE_BMICX_REG, (tmp | PCIIDE_BMICX_SSBM_E | direction));
--- a/usr/src/uts/intel/io/hyperv/vmbus/hyperv.c Fri May 17 12:09:03 2019 +0200 +++ b/usr/src/uts/intel/io/hyperv/vmbus/hyperv.c Thu May 23 19:21:21 2019 +0200 @@ -38,7 +38,7 @@ */ /* - * Copyright (c) 2017 by Delphix. All rights reserved. + * Copyright (c) 2017, 2019 by Delphix. All rights reserved. */ /* @@ -272,6 +272,13 @@ cmn_err(CE_CONT, "?Hyper-V Version: %d.%d.%d [SP%d]\n", regs[1] >> 16, regs[1] & 0xffff, regs[0], regs[2]); + /* + * Hyper-V version numbering is based on Linux source code, in + * function ms_hyperv_init_platform(). + */ + cmn_err(CE_CONT, "?Hyper-V Host Build: %d-%d.%d-%d-%d.%d\n", + regs[0], regs[1] >> 16, regs[1] & 0xffff, regs[2], + regs[3] >> 24, regs[3] & 0xffffff); if (boothowto & RB_VERBOSE) { printf(" Features=0x%b\n", hyperv_features,