Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 82152
b: refs/heads/master
c: c860a8f
h: refs/heads/master
v: v3
  • Loading branch information
Bartlomiej Zolnierkiewicz committed Feb 1, 2008
1 parent 5ac71ad commit 64c8981
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 22 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: cf7125ae05e5ac671eec2508656816bbc0a8c723
refs/heads/master: c860a8f2d29b7da84fb3aed7b097f53c2c225fd6
49 changes: 28 additions & 21 deletions trunk/drivers/ide/ide-probe.c
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,33 @@ static void hwif_register (ide_hwif_t *hwif)
__FUNCTION__, ret);
}

static int wait_hwif_ready(ide_hwif_t *hwif)
/**
* ide_port_wait_ready - wait for port to become ready
* @hwif: IDE port
*
* This is needed on some PPCs and a bunch of BIOS-less embedded
* platforms. Typical cases are:
*
* - The firmware hard reset the disk before booting the kernel,
* the drive is still doing it's poweron-reset sequence, that
* can take up to 30 seconds.
*
* - The firmware does nothing (or no firmware), the device is
* still in POST state (same as above actually).
*
* - Some CD/DVD/Writer combo drives tend to drive the bus during
* their reset sequence even when they are non-selected slave
* devices, thus preventing discovery of the main HD.
*
* Doing this wait-for-non-busy should not harm any existing
* configuration and fix some issues like the above.
*
* BenH.
*
* Returns 0 on success, error code (< 0) otherwise.
*/

static int ide_port_wait_ready(ide_hwif_t *hwif)
{
int unit, rc;

Expand Down Expand Up @@ -742,26 +768,7 @@ static void probe_hwif(ide_hwif_t *hwif)

local_irq_set(flags);

/* This is needed on some PPCs and a bunch of BIOS-less embedded
* platforms. Typical cases are:
*
* - The firmware hard reset the disk before booting the kernel,
* the drive is still doing it's poweron-reset sequence, that
* can take up to 30 seconds
* - The firmware does nothing (or no firmware), the device is
* still in POST state (same as above actually).
* - Some CD/DVD/Writer combo drives tend to drive the bus during
* their reset sequence even when they are non-selected slave
* devices, thus preventing discovery of the main HD
*
* Doing this wait-for-busy should not harm any existing configuration
* (at least things won't be worse than what current code does, that
* is blindly go & talk to the drive) and fix some issues like the
* above.
*
* BenH.
*/
if (wait_hwif_ready(hwif) == -EBUSY)
if (ide_port_wait_ready(hwif) == -EBUSY)
printk(KERN_DEBUG "%s: Wait for ready failed before probe !\n", hwif->name);

/*
Expand Down

0 comments on commit 64c8981

Please sign in to comment.