From patchwork Tue Oct 11 17:13:18 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartlomiej Zolnierkiewicz X-Patchwork-Id: 119021 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 8BC3AB6F67 for ; Wed, 12 Oct 2011 04:15:01 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755225Ab1JKROn (ORCPT ); Tue, 11 Oct 2011 13:14:43 -0400 Received: from mail-ey0-f174.google.com ([209.85.215.174]:41848 "EHLO mail-ey0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755212Ab1JKROk (ORCPT ); Tue, 11 Oct 2011 13:14:40 -0400 Received: by eye27 with SMTP id 27so2784550eye.19 for ; Tue, 11 Oct 2011 10:14:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:subject:date:user-agent:cc:mime-version:message-id :content-type:content-transfer-encoding; bh=gBghNCQs31fBn06hnQ8LRNnoZWuhrtlGdUiEoIWZiSU=; b=gaxQrOrazljbueMO9rhtW3fxxywgY8aVOZZwGFEQz/E9pt6nsNatJ/B8PAytOyIe5j V342tpzDB3RbCDWhJTZqRc2Va+rMyYfF4cISj02lL/ZEYk6860Ny6aexoSN7w7pgidlZ nqXbt43ykgNPLBSC+yb7aApAztyZt2u3hB2ek= Received: by 10.223.17.91 with SMTP id r27mr2062574faa.20.1318353279348; Tue, 11 Oct 2011 10:14:39 -0700 (PDT) Received: from linux-mhg7.site (89-74-122-41.dynamic.chello.pl. [89.74.122.41]) by mx.google.com with ESMTPS id r6sm26174183fam.0.2011.10.11.10.14.36 (version=SSLv3 cipher=OTHER); Tue, 11 Oct 2011 10:14:37 -0700 (PDT) From: Bartlomiej Zolnierkiewicz To: David Miller Subject: [PATCH] ide: ide_port_wait_ready() fix Date: Tue, 11 Oct 2011 19:13:18 +0200 User-Agent: KMail/1.13.6 (Linux/2.6.37.6-0.7-desktop-dirty; KDE/4.6.0; x86_64; ; ) Cc: linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org MIME-Version: 1.0 Message-Id: <201110111913.18492.bzolnier@gmail.com> Sender: linux-ide-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ide@vger.kernel.org From: Bartlomiej Zolnierkiewicz 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 --- drivers/ide/ide-probe.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-ide" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: b/drivers/ide/ide-probe.c =================================================================== --- a/drivers/ide/ide-probe.c +++ b/drivers/ide/ide-probe.c @@ -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);