ahci: implement skip_host_reset parameter
Under certain circumstances (SSP turned off by the BIOS) and for debugging purposes, skipping global controller reset is helpful. Add a kernel parameter for it. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
This commit is contained in:
Родитель
dea5513763
Коммит
a22e64443f
|
@ -49,6 +49,10 @@
|
||||||
#define DRV_NAME "ahci"
|
#define DRV_NAME "ahci"
|
||||||
#define DRV_VERSION "3.0"
|
#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,
|
static int ahci_enable_alpm(struct ata_port *ap,
|
||||||
enum link_pm policy);
|
enum link_pm policy);
|
||||||
static void ahci_disable_alpm(struct ata_port *ap);
|
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);
|
ahci_enable_ahci(mmio);
|
||||||
|
|
||||||
/* global controller reset */
|
/* global controller reset */
|
||||||
tmp = readl(mmio + HOST_CTL);
|
if (!ahci_skip_host_reset) {
|
||||||
if ((tmp & HOST_RESET) == 0) {
|
tmp = readl(mmio + HOST_CTL);
|
||||||
writel(tmp | HOST_RESET, mmio + HOST_CTL);
|
if ((tmp & HOST_RESET) == 0) {
|
||||||
readl(mmio + HOST_CTL); /* flush */
|
writel(tmp | HOST_RESET, mmio + HOST_CTL);
|
||||||
}
|
readl(mmio + HOST_CTL); /* flush */
|
||||||
|
}
|
||||||
|
|
||||||
/* reset must complete within 1 second, or
|
/* reset must complete within 1 second, or
|
||||||
* the hardware should be considered fried.
|
* the hardware should be considered fried.
|
||||||
*/
|
*/
|
||||||
ssleep(1);
|
ssleep(1);
|
||||||
|
|
||||||
tmp = readl(mmio + HOST_CTL);
|
tmp = readl(mmio + HOST_CTL);
|
||||||
if (tmp & HOST_RESET) {
|
if (tmp & HOST_RESET) {
|
||||||
dev_printk(KERN_ERR, host->dev,
|
dev_printk(KERN_ERR, host->dev,
|
||||||
"controller reset failed (0x%x)\n", tmp);
|
"controller reset failed (0x%x)\n", tmp);
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* turn on AHCI mode */
|
/* turn on AHCI mode */
|
||||||
ahci_enable_ahci(mmio);
|
ahci_enable_ahci(mmio);
|
||||||
|
|
||||||
/* some registers might be cleared on reset. restore initial values */
|
/* Some registers might be cleared on reset. Restore
|
||||||
ahci_restore_initial_config(host);
|
* 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) {
|
if (pdev->vendor == PCI_VENDOR_ID_INTEL) {
|
||||||
u16 tmp16;
|
u16 tmp16;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче