Commit dbc9f2a6 authored by Alan Cox's avatar Alan Cox Committed by Linus Torvalds

[PATCH] don't force enable generic IDE controllers

Fixes hangs on Micron Samurai boards
parent 00da91f2
/* /*
* linux/drivers/ide/generic.c Version 0.10 Sept 11, 2002 * linux/drivers/ide/pci/generic.c Version 0.11 December 30, 2002
* *
* Copyright (C) 2001-2002 Andre Hedrick <andre@linux-ide.org> * Copyright (C) 2001-2002 Andre Hedrick <andre@linux-ide.org>
* Portions (C) Copyright 2002 Red Hat Inc <alan@redhat.com>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2, or (at your option) any
* later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* For the avoidance of doubt the "preferred form" of this code is one which
* is in an open non patent encumbered format. Where cryptographic key signing
* forms part of the process of creating an executable the information
* including keys needed to generate an equivalently functional executable
* are deemed to be part of the source code.
*/ */
#undef REALLY_SLOW_IO /* most systems can safely undef this */ #undef REALLY_SLOW_IO /* most systems can safely undef this */
#include <linux/config.h> /* for CONFIG_BLK_DEV_IDEPCI */ #include <linux/config.h> /* for CONFIG_BLK_DEV_IDEPCI */
...@@ -89,6 +105,7 @@ extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *); ...@@ -89,6 +105,7 @@ extern void ide_setup_pci_device(struct pci_dev *, ide_pci_device_t *);
static int __devinit generic_init_one(struct pci_dev *dev, const struct pci_device_id *id) static int __devinit generic_init_one(struct pci_dev *dev, const struct pci_device_id *id)
{ {
ide_pci_device_t *d = &generic_chipsets[id->driver_data]; ide_pci_device_t *d = &generic_chipsets[id->driver_data];
u16 command;
if (dev->device != d->device) if (dev->device != d->device)
BUG(); BUG();
...@@ -102,6 +119,12 @@ static int __devinit generic_init_one(struct pci_dev *dev, const struct pci_devi ...@@ -102,6 +119,12 @@ static int __devinit generic_init_one(struct pci_dev *dev, const struct pci_devi
(!(PCI_FUNC(dev->devfn) & 1))) (!(PCI_FUNC(dev->devfn) & 1)))
return 1; return 1;
pci_read_config_word(dev, PCI_COMMAND, &command);
if(!(command & PCI_COMMAND_IO))
{
printk(KERN_INFO "Skipping disabled %s IDE controller.\n", d->name);
return 1;
}
ide_setup_pci_device(dev, d); ide_setup_pci_device(dev, d);
MOD_INC_USE_COUNT; MOD_INC_USE_COUNT;
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment