Skip to content

Commit

Permalink
ide-generic: don't probe all legacy ISA IDE ports by default
Browse files Browse the repository at this point in the history
We can't probe all legacy ISA IDE ports by default as the resources may be
occupied by other ISA devices.  Add "probe_mask" module parameter and probe
only first two ISA IDE ports by default leaving the decision about probing
the rest to the user (systems with ISA ide2-6 should be very, very rare).

This fixes a regression caused by:

commit 343a345
Author: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Date:   Tue Jun 10 20:56:36 2008 +0200

    ide-generic: add missing hwif->chipset setup
...

Reported-by: Mikael Pettersson <mikpe@it.uu.se>
Bisected-by: Mikael Pettersson <mikpe@it.uu.se>
Tested-by: Mikael Pettersson <mikpe@it.uu.se>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
  • Loading branch information
Bartlomiej Zolnierkiewicz committed Jun 15, 2008
1 parent fbc69fd commit 0cbccbc
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion drivers/ide/ide-generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@

#define DRV_NAME "ide_generic"

static int probe_mask = 0x03;
module_param(probe_mask, int, 0);
MODULE_PARM_DESC(probe_mask, "probe mask for legacy ISA IDE ports");

static ssize_t store_add(struct class *cls, const char *buf, size_t n)
{
ide_hwif_t *hwif;
Expand Down Expand Up @@ -89,14 +93,17 @@ static int __init ide_generic_init(void)
u8 idx[MAX_HWIFS];
int i;

printk(KERN_INFO DRV_NAME ": please use \"probe_mask=0x3f\" module "
"parameter for probing all legacy ISA IDE ports\n");

for (i = 0; i < MAX_HWIFS; i++) {
ide_hwif_t *hwif;
unsigned long io_addr = ide_default_io_base(i);
hw_regs_t hw;

idx[i] = 0xff;

if (io_addr) {
if ((probe_mask & (1 << i)) && io_addr) {
if (!request_region(io_addr, 8, DRV_NAME)) {
printk(KERN_ERR "%s: I/O resource 0x%lX-0x%lX "
"not free.\n",
Expand Down

0 comments on commit 0cbccbc

Please sign in to comment.