From aa2371e980e7e8982292b23d6f0ce2d97da7c310 Mon Sep 17 00:00:00 2001 From: Tejun Heo Date: Mon, 10 Mar 2008 10:25:25 +0900 Subject: [PATCH] --- yaml --- r: 87423 b: refs/heads/master c: a22e64443f0aa4aa4e3c56a49e5c060e90752c07 h: refs/heads/master i: 87421: 315737fcdf438f1ed1d312ce818984ef5beaa76d 87419: d01debb48ec4ebf849cc0996e5c75e63a7db5704 87415: 78b9df2d4182313da0357cd2e6284644ea5c7f6f 87407: 48fa072fe980f347934f378a87ea11fb8857cb92 87391: ab99768d75ab83548794972c037b6ba9d3f7624d 87359: ffd985ff2be6a8eddfdc11d6c0bed19773202cc2 87295: 47bd6e8bbe3ee18cefebd4b2f67e30c4477aa494 v: v3 --- [refs] | 2 +- trunk/drivers/ata/ahci.c | 48 ++++++++++++++++++++++++---------------- 2 files changed, 30 insertions(+), 20 deletions(-) diff --git a/[refs] b/[refs] index 398514b63b2b..5b10e9629b52 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: dea55137634226fd74d5187a15dee1244ec252cb +refs/heads/master: a22e64443f0aa4aa4e3c56a49e5c060e90752c07 diff --git a/trunk/drivers/ata/ahci.c b/trunk/drivers/ata/ahci.c index 53f5afd9420c..bbfccdbba3ab 100644 --- a/trunk/drivers/ata/ahci.c +++ b/trunk/drivers/ata/ahci.c @@ -49,6 +49,10 @@ #define DRV_NAME "ahci" #define DRV_VERSION "3.0" +static int ahci_skip_host_reset; +module_param_named(skip_host_reset, ahci_skip_host_reset, int, 0444); +MODULE_PARM_DESC(skip_host_reset, "skip global host reset (0=don't skip, 1=skip)"); + static int ahci_enable_alpm(struct ata_port *ap, enum link_pm policy); static void ahci_disable_alpm(struct ata_port *ap); @@ -1088,29 +1092,35 @@ static int ahci_reset_controller(struct ata_host *host) ahci_enable_ahci(mmio); /* global controller reset */ - tmp = readl(mmio + HOST_CTL); - if ((tmp & HOST_RESET) == 0) { - writel(tmp | HOST_RESET, mmio + HOST_CTL); - readl(mmio + HOST_CTL); /* flush */ - } + if (!ahci_skip_host_reset) { + tmp = readl(mmio + HOST_CTL); + if ((tmp & HOST_RESET) == 0) { + writel(tmp | HOST_RESET, mmio + HOST_CTL); + readl(mmio + HOST_CTL); /* flush */ + } - /* reset must complete within 1 second, or - * the hardware should be considered fried. - */ - ssleep(1); + /* reset must complete within 1 second, or + * the hardware should be considered fried. + */ + ssleep(1); - tmp = readl(mmio + HOST_CTL); - if (tmp & HOST_RESET) { - dev_printk(KERN_ERR, host->dev, - "controller reset failed (0x%x)\n", tmp); - return -EIO; - } + tmp = readl(mmio + HOST_CTL); + if (tmp & HOST_RESET) { + dev_printk(KERN_ERR, host->dev, + "controller reset failed (0x%x)\n", tmp); + return -EIO; + } - /* turn on AHCI mode */ - ahci_enable_ahci(mmio); + /* turn on AHCI mode */ + ahci_enable_ahci(mmio); - /* some registers might be cleared on reset. restore initial values */ - ahci_restore_initial_config(host); + /* Some registers might be cleared on reset. Restore + * initial values. + */ + ahci_restore_initial_config(host); + } else + dev_printk(KERN_INFO, host->dev, + "skipping global host reset\n"); if (pdev->vendor == PCI_VENDOR_ID_INTEL) { u16 tmp16;