LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [git patches] IDE updates part #4
Date: Wed, 6 Feb 2008 01:48:17 +0100	[thread overview]
Message-ID: <200802060148.17663.bzolnier@gmail.com> (raw)
In-Reply-To: <alpine.LFD.1.00.0802051059330.3110@woody.linux-foundation.org>


Hi Linus,

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!
> 
> So that "ide_device_add_all()" is missing some checks. Should it check the 
> probe[] array like ideprobe_init() used to, or what?

This is ide-generic problem exhibited by recent ide_device_add_all() changes.
Fix below (it works for me) - you may merge the patch as it is or wait an hour
or so for the next IDE tree pull request.

Also sorry for the issue in the first place (it turned out that it slipped
my testing because I has been running with IDE_MAX_HWIFS=2 for some time :).


From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Subject: [PATCH] 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 <bzolnier@gmail.com>
---
 drivers/ide/ide-generic.c |   10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

Index: b/drivers/ide/ide-generic.c
===================================================================
--- 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);
 

  reply	other threads:[~2008-02-06  0:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-02 19:35 Bartlomiej Zolnierkiewicz
2008-02-05 19:09 ` Linus Torvalds
2008-02-06  0:48   ` Bartlomiej Zolnierkiewicz [this message]
2008-04-27 14:26 [git patches] IDE updates part 4 Bartlomiej Zolnierkiewicz

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=200802060148.17663.bzolnier@gmail.com \
    --to=bzolnier@gmail.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    --subject='Re: [git patches] IDE updates part #4' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).