Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b2a53bc636b0e7e9ce4c899ad605432339ef5861
Commit:     b2a53bc636b0e7e9ce4c899ad605432339ef5861
Parent:     21511abd0a248a3f225d3b611cfabb93124605a7
Author:     Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
AuthorDate: Wed Feb 6 02:57:48 2008 +0100
Committer:  Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
CommitDate: Wed Feb 6 02:57:48 2008 +0100

    ide-generic: probing bugfix
    
    On Tuesday 05 February 2008, Linus Torvalds wrote:
    >
    > On Sat, 2 Feb 2008, Bartlomiej Zolnierkiewicz wrote:
    > >
    > > * next part of IDE probing code re-organization saga
    > >   (that would be me)
    >
    > This seems to cause very irritating and bogus messages for me:
    >
    >       Probing IDE interface ide0...
    >       Probing IDE interface ide1...
    >       ide2: I/O resource 0x0-0x7 not free.
    >       ide2: ports already in use, skipping probe
    >       ide3: I/O resource 0x0-0x7 not free.
    >       ide3: ports already in use, skipping probe
    >       ide4: I/O resource 0x0-0x7 not free.
    >       ide4: ports already in use, skipping probe
    >       ide5: I/O resource 0x0-0x7 not free.
    >       ide5: ports already in use, skipping probe
    >       ide6: I/O resource 0x0-0x7 not free.
    >       ide6: ports already in use, skipping probe
    >       ide7: I/O resource 0x0-0x7 not free.
    >       ide7: ports already in use, skipping probe
    >       ide8: I/O resource 0x0-0x7 not free.
    >       ide8: ports already in use, skipping probe
    >       ide9: I/O resource 0x0-0x7 not free.
    >       ide9: ports already in use, skipping probe
    >
    > and that's just totally bogus. It shouldn't even request that region,
    > since it's not been allocated!
    
    The commit 139ddfcab50e5eabcc88341c8743a990ac1be6a2 ("ide: move handling of
    I/O resources out of ide_probe_port()") changed the ordering of 
hwif->noprobe
    check vs ide_hwif_request_regions() call (so that we now reserve I/O regions
    before checking for hwif->noprobe).  However ide-generic host driver 
depended
    on hwif->noprobe to be set for skipping probing of empty ide_hwifs[] slots.
    
    Fix it by passing only indexes of non-empty slots to ide_device_add_all()
    from ide_generic_init().
    
    Signed-off-by: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
---
 drivers/ide/ide-generic.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/ide/ide-generic.c b/drivers/ide/ide-generic.c
index be469db..709b9e4 100644
--- a/drivers/ide/ide-generic.c
+++ b/drivers/ide/ide-generic.c
@@ -20,8 +20,14 @@ static int __init ide_generic_init(void)
        if (ide_hwifs[0].io_ports[IDE_DATA_OFFSET])
                ide_get_lock(NULL, NULL); /* for atari only */
 
-       for (i = 0; i < MAX_HWIFS; i++)
-               idx[i] = ide_hwifs[i].present ? 0xff : i;
+       for (i = 0; i < MAX_HWIFS; i++) {
+               ide_hwif_t *hwif = &ide_hwifs[i];
+
+               if (hwif->io_ports[IDE_DATA_OFFSET] && !hwif->present)
+                       idx[i] = i;
+               else
+                       idx[i] = 0xff;
+       }
 
        ide_device_add_all(idx, NULL);
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to