From: Davin McCall <davmac@ozonline.com.au>
To: Bartlomiej Zolnierkiewicz <B.Zolnierkiewicz@elka.pw.edu.pl>
Cc: linux-kernel@vger.kernel.org, linux-ide@vger.kernel.org
Subject: Re: [PATCH] fix issues with loading PCI ide drivers as modules (linux 2.6.0)
Date: Wed, 7 Jan 2004 00:09:05 +1100 [thread overview]
Message-ID: <20040107000905.7f5ca592.davmac@ozonline.com.au> (raw)
In-Reply-To: <200401061213.39843.bzolnier@elka.pw.edu.pl>
On Tue, 6 Jan 2004 12:13:39 +0100
Bartlomiej Zolnierkiewicz <B.Zolnierkiewicz@elka.pw.edu.pl> wrote:
> > But actually I have found an even better solution - "hwif->present" tells
> > us if the hwif is currently being controlled by some chipset driver (that's
> > what it's there for!) so I check that instead.
>
> This is wrong, driver owns hwif before probing for drives
> (when at least one drive is found hwif->present is set to one),
> so hwif entries can be modified even with hwif->present equal to zero.
For the purposes of the patch that I provided, it doesn't matter. The hwif will only be used if both !hwif->present and chipset==ide_unknown or ide_forced. If !hwif->present, then there are no drives with active IO and so it is safe for another chipset to take over the interface.
Anyway I have re-done the previous patch the way you wanted, so you can take your pick. Personally I prefer the previous one.
Note with this new patch, I no longer needed to check initialize/pre_init variable in ide_hwif_configure - because ide_match_hwif() will never return with a hwif whose chipset is ide_generic (only ide_forced or ide_unknown).
Davin
diff -urN linux-2.6.0-vanilla/drivers/ide/ide-probe.c linux-2.6.0/drivers/ide/ide-probe.c
--- linux-2.6.0-vanilla/drivers/ide/ide-probe.c Thu Nov 27 07:44:24 2003
+++ linux-2.6.0/drivers/ide/ide-probe.c Tue Jan 6 23:13:28 2004
@@ -1343,6 +1343,8 @@
int unit;
if (!hwif->present)
continue;
+ if (hwif->chipset == ide_unknown || hwif->chipset == ide_forced)
+ hwif->chipset = ide_generic;
for (unit = 0; unit < MAX_DRIVES; ++unit)
if (hwif->drives[unit].present)
ata_attach(&hwif->drives[unit]);
diff -urN linux-2.6.0-vanilla/drivers/ide/ide-proc.c linux-2.6.0/drivers/ide/ide-proc.c
--- linux-2.6.0-vanilla/drivers/ide/ide-proc.c Thu Nov 27 07:44:17 2003
+++ linux-2.6.0/drivers/ide/ide-proc.c Tue Jan 6 23:07:52 2004
@@ -348,8 +348,11 @@
int len;
const char *name;
+ /*
+ * Neither ide_unknown nor ide_forced should be set at this point.
+ */
+
switch (hwif->chipset) {
- case ide_unknown: name = "(none)"; break;
case ide_generic: name = "generic"; break;
case ide_pci: name = "pci"; break;
case ide_cmd640: name = "cmd640"; break;
diff -urN linux-2.6.0-vanilla/drivers/ide/ide.c linux-2.6.0/drivers/ide/ide.c
--- linux-2.6.0-vanilla/drivers/ide/ide.c Thu Nov 27 07:43:29 2003
+++ linux-2.6.0/drivers/ide/ide.c Tue Jan 6 23:08:17 2004
@@ -2185,7 +2185,7 @@
memcpy(hwif->io_ports, hwif->hw.io_ports, sizeof(hwif->io_ports));
hwif->irq = vals[2];
hwif->noprobe = 0;
- hwif->chipset = ide_generic;
+ hwif->chipset = ide_forced;
goto done;
case 0: goto bad_option;
diff -urN linux-2.6.0-vanilla/drivers/ide/pci/cmd640.c linux-2.6.0/drivers/ide/pci/cmd640.c
--- linux-2.6.0-vanilla/drivers/ide/pci/cmd640.c Thu Nov 27 07:45:36 2003
+++ linux-2.6.0/drivers/ide/pci/cmd640.c Tue Jan 6 13:07:51 2004
@@ -419,7 +419,7 @@
cmd_hwif1 = &ide_hwifs[1]; /* default, if not found below */
for (i = 0; i < MAX_HWIFS; i++) {
ide_hwif_t *hwif = &ide_hwifs[i];
- if (hwif->chipset == ide_unknown || hwif->chipset == ide_generic) {
+ if (hwif->chipset == ide_unknown || hwif->chipset == ide_forced) {
if (hwif->io_ports[IDE_DATA_OFFSET] == 0x1f0)
cmd_hwif0 = hwif;
else if (hwif->io_ports[IDE_DATA_OFFSET] == 0x170)
diff -urN linux-2.6.0-vanilla/drivers/ide/setup-pci.c linux-2.6.0/drivers/ide/setup-pci.c
--- linux-2.6.0-vanilla/drivers/ide/setup-pci.c Thu Nov 27 07:43:39 2003
+++ linux-2.6.0/drivers/ide/setup-pci.c Tue Jan 6 23:18:50 2004
@@ -59,7 +59,7 @@
for (h = 0; h < MAX_HWIFS; ++h) {
hwif = &ide_hwifs[h];
if (hwif->io_ports[IDE_DATA_OFFSET] == io_base) {
- if (hwif->chipset == ide_generic)
+ if (hwif->chipset == ide_forced)
return hwif; /* a perfect match */
}
}
diff -urN linux-2.6.0-vanilla/include/linux/ide.h linux-2.6.0/include/linux/ide.h
--- linux-2.6.0-vanilla/include/linux/ide.h Thu Nov 27 07:43:36 2003
+++ linux-2.6.0/include/linux/ide.h Tue Jan 6 23:06:23 2004
@@ -282,7 +282,7 @@
ide_pdc4030, ide_rz1000, ide_trm290,
ide_cmd646, ide_cy82c693, ide_4drives,
ide_pmac, ide_etrax100, ide_acorn,
- ide_pc9800
+ ide_pc9800, ide_forced
} hwif_chipset_t;
/*
next prev parent reply other threads:[~2004-01-06 13:06 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-01-03 4:28 Davin McCall
2004-01-04 1:56 ` Bartlomiej Zolnierkiewicz
2004-01-04 3:21 ` Davin McCall
2004-01-04 3:52 ` Bartlomiej Zolnierkiewicz
2004-01-04 6:31 ` Davin McCall
2004-01-04 14:47 ` Bartlomiej Zolnierkiewicz
2004-01-05 2:09 ` Davin McCall
2004-01-05 14:16 ` Bartlomiej Zolnierkiewicz
2004-01-06 2:51 ` Davin McCall
2004-01-06 11:13 ` Bartlomiej Zolnierkiewicz
2004-01-06 13:09 ` Davin McCall [this message]
2004-01-06 13:45 ` Davin McCall
2004-01-30 3:27 ` [PATCH] various IDE patches/cleanups Davin McCall
2004-01-30 3:30 ` Davin McCall
2004-01-30 3:33 ` Davin McCall
2004-01-30 3:34 ` Davin McCall
2004-01-30 3:35 ` Davin McCall
2004-02-05 5:21 ` Davin McCall
2004-02-05 6:37 ` Davin McCall
2004-02-03 19:41 ` Bartlomiej Zolnierkiewicz
2004-02-05 3:51 ` Davin McCall
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20040107000905.7f5ca592.davmac@ozonline.com.au \
--to=davmac@ozonline.com.au \
--cc=B.Zolnierkiewicz@elka.pw.edu.pl \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome