lkml.org 
[lkml]   [2011]   [Oct]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
SubjectRe: [PATCH] ide: ide_port_wait_ready() fix
Date
David Miller wrote:

> From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
> Date: Tue, 11 Oct 2011 19:13:18 +0200
>
> > From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
> > Subject: [PATCH] ide: ide_port_wait_ready() fix
> >
> > Fix for commit a20b2a4 ("ide: skip probe if there are no devices on
> > the port (v2)"). We must check for slave device before failing.
> >
> > Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
>
> This will mishandle the case where there is no slave in the device
> list.

I don't see it:

@ -598,7 +598,7 @@ static int ide_port_wait_ready(ide_hwif_
{
const struct ide_tp_ops *tp_ops = hwif->tp_ops;
ide_drive_t *drive;
- int i, rc;
+ int i, rc, prev_rc = 0;

printk(KERN_DEBUG "Probing IDE interface %s...\n", hwif->name);

@@ -623,8 +623,10 @@ static int ide_port_wait_ready(ide_hwif_
tp_ops->write_devctl(hwif, ATA_DEVCTL_OBS);
mdelay(2);
rc = ide_wait_not_busy(hwif, 35000);
- if (rc)
+ if (prev_rc && rc)
goto out;
+ prev_rc = rc;
+ rc = 0;
} else
printk(KERN_DEBUG "%s: ide_wait_not_busy() skipped\n",
drive->name);
If there is no slave device but there is a master device the code falls-through
and returns a success.

The patch fixes regression introduced in commit a20b2a4 as some esoteric
setups return ide_wait_not_busy() -ENODEV error on master device while there
is slave device present in the system.


\
 
 \ /
  Last update: 2011-10-12 17:03    [W:0.063 / U:1.476 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site