From mboxrd@z Thu Jan 1 00:00:00 1970 From: Borislav Petkov Subject: Re: [PATCH 2/2] ide-generic: handle probing of legacy io-ports Date: Sun, 3 Aug 2008 17:08:03 +0200 Message-ID: <20080803150803.GC27766@gollum.tnic> References: <20080715053356.GA18628@gollum.tnic> <200808022046.16990.bzolnier@gmail.com> <20080803073842.GB8762@gollum.tnic> <200808031611.11033.bzolnier@gmail.com> Reply-To: petkovbb@gmail.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from fg-out-1718.google.com ([72.14.220.155]:25475 "EHLO fg-out-1718.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755585AbYHCPII (ORCPT ); Sun, 3 Aug 2008 11:08:08 -0400 Received: by fg-out-1718.google.com with SMTP id 19so833875fgg.17 for ; Sun, 03 Aug 2008 08:08:05 -0700 (PDT) Content-Disposition: inline In-Reply-To: <200808031611.11033.bzolnier@gmail.com> Sender: linux-ide-owner@vger.kernel.org List-Id: linux-ide@vger.kernel.org To: Bartlomiej Zolnierkiewicz Cc: alan@redhat.com, linux-kernel@vger.kernel.org, linux-ide@vger.kernel.org On Sun, Aug 03, 2008 at 04:11:10PM +0200, Bartlomiej Zolnierkiewicz wrote: [.. ] > There are still some issues to address though. Issues addressed. Here's v2: --- From: Borislav Petkov Date: Sun, 3 Aug 2008 09:28:53 +0200 Subject: [PATCH] ide-generic: handle probing of legacy io-ports v2 Avoid probing the io-ports in case an IDE PCI controller is present and it uses the legacy iobases. If we still want to enforce the probing, we do ide_generic.probe_mask=0x3f on the kernel command line. Signed-off-by: Borislav Petkov --- drivers/ide/ide-generic.c | 21 +++++++++++++++++---- 1 files changed, 17 insertions(+), 4 deletions(-) diff --git a/drivers/ide/ide-generic.c b/drivers/ide/ide-generic.c index 8fe8b5b..1beb51b 100644 --- a/drivers/ide/ide-generic.c +++ b/drivers/ide/ide-generic.c @@ -27,7 +27,7 @@ #define DRV_NAME "ide_generic" -static int probe_mask = 0x03; +static int probe_mask; module_param(probe_mask, int, 0); MODULE_PARM_DESC(probe_mask, "probe mask for legacy ISA IDE ports"); @@ -105,14 +105,27 @@ static int __init ide_generic_init(void) hw_regs_t hw[MAX_HWIFS], *hws[MAX_HWIFS]; struct ide_host *host; unsigned long io_addr; - int i, rc; + int i, rc, dummy, primary = 0, secondary = 0; #ifdef CONFIG_MIPS if (!ide_probe_legacy()) return -ENODEV; #endif - printk(KERN_INFO DRV_NAME ": please use \"probe_mask=0x3f\" module " - "parameter for probing all legacy ISA IDE ports\n"); + ata_legacy_check_iobases(&primary, &secondary, &dummy); + + if (!probe_mask) { + printk(KERN_INFO DRV_NAME ": please use \"probe_mask=0x3f\" " + "module parameter for probing all legacy ISA IDE ports\n"); + + if (primary == 0) + probe_mask |= 0x1; + + if (secondary == 0) + probe_mask |= 0x2; + } else { + printk(KERN_WARNING "%s: enforcing probing of io ports upon " + "user request.\n", DRV_NAME); + } memset(hws, 0, sizeof(hw_regs_t *) * MAX_HWIFS); -- 1.5.5.4 -- Regards/Gruss, Boris.