From patchwork Tue Dec 18 22:26:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: dann frazier X-Patchwork-Id: 1015679 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43KCLY584qz9s6w; Wed, 19 Dec 2018 09:27:01 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1gZNpC-0006e5-Qf; Tue, 18 Dec 2018 22:26:50 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.86_2) (envelope-from ) id 1gZNpB-0006dv-PD for kernel-team@lists.ubuntu.com; Tue, 18 Dec 2018 22:26:49 +0000 Received: from mail-it1-f197.google.com ([209.85.166.197]) by youngberry.canonical.com with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1gZNpB-0006Sx-Ez for kernel-team@lists.ubuntu.com; Tue, 18 Dec 2018 22:26:49 +0000 Received: by mail-it1-f197.google.com with SMTP id y86so5029097ita.2 for ; Tue, 18 Dec 2018 14:26:49 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-disposition:user-agent; bh=XD3b0b8gDQjWynDkfz68KOCv3na8yF6WlE2Ev0shgXA=; b=IS7HlliBo1ezXOaGoQPrXEjq7fbkWw4jk6iaDkldnft0ltxHS+odZdtabzUtcvqg8W yg+shHI/TB6qZcScjS9BtoJ9hTw7fQR2trkFp042dDcU/8vgZfsnJPIoGAnf2LTorWdb UvgeDSJHqvrtQ3+aGiLgRF348ZlW3C4HZhc+vrmdnW9Xh0gMRYFGB+0ZY8X2nADa8f3L kCvjiaxAZnKujjVWzNv0RYKztzxjked3wxTfj6FBpxn1Qq06BZOZygB3kjekcRqkI21B zR4dtsgfSUWE3tME2r5M8VOumafjOuMwJj3XPq4rwUgpbCy96hKNYdU2HzFNOQQvfqdY Jxww== X-Gm-Message-State: AA+aEWYgMb0Nx5POyRYF3Z0C85Tl4AH61gSjA/KdamDe1P3nl1uxiA65 ViQskYNemMYGRXY/TaEPHu0snKZxIh3xtMY3YU+FxHMXsLEF61Tjlge6LpyTHIUPp889Qr486r7 09Cz9HmKr/AnjelSURS8oBZlgJqcufot2fnadHkxjdg== X-Received: by 2002:a02:7a58:: with SMTP id z24mr17861294jad.22.1545172008194; Tue, 18 Dec 2018 14:26:48 -0800 (PST) X-Google-Smtp-Source: AFSGD/XHQKIj92ObH1ml9fdYpbPtCheLIjaR52NFi0GGPlal3EymzBM+ONvD0RsMhiukecb6yKCwrQ== X-Received: by 2002:a02:7a58:: with SMTP id z24mr17861283jad.22.1545172007806; Tue, 18 Dec 2018 14:26:47 -0800 (PST) Received: from xps13.canonical.com (c-107-2-141-103.hsd1.co.comcast.net. [107.2.141.103]) by smtp.gmail.com with ESMTPSA id j1sm6704876iok.79.2018.12.18.14.26.46 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 18 Dec 2018 14:26:46 -0800 (PST) Date: Tue, 18 Dec 2018 15:26:46 -0700 From: dann frazier To: kernel-team@lists.ubuntu.com Subject: [PATCH][Disco][SRU Cosmic][SRU Bionic] scsi: libsas: check the ata device status by ata_dev_enabled() Message-ID: <20181218222602.GA30233@xps13.dannf> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Jason Yan BugLink: https://bugs.launchpad.net/bugs/1809046 When ata device IDENTIFY failed, the ata device status is ATA_DEV_UNKNOWN. The libata reported like: [113518.620433] ata5.00: qc timeout (cmd 0xec) [113518.653646] ata5.00: failed to IDENTIFY (I/O error, err_mask=0x4) But libsas verifies the device status by ata_dev_disabled(), which skipped ATA_DEV_UNKNOWN. This will make libsas think the ata device probing succeed the device cannot be actually brought up. And even the new bcast of this device will be considered as flutter and will not probe this device again. Change ata_dev_disabled() to !ata_dev_enabled() so that libsas can deal with this if the ata device probe failed. New bcasts can let us try to probe the device again and bring it up if it is fine to IDENTIFY. Tested-by: Zhou Yupeng Signed-off-by: Jason Yan CC: John Garry CC: Johannes Thumshirn CC: Ewan Milne CC: Christoph Hellwig CC: Tomas Henzl CC: Dan Williams CC: Hannes Reinecke Reviewed-by: John Garry Reviewed-by: Hannes Reinecke Reviewed-by: Johannes Thumshirn Reviewed-by: Christoph Hellwig Signed-off-by: Martin K. Petersen (cherry picked from commit 437207d3697f500f34f126a8ab1c29417ba4a184) Signed-off-by: dann frazier Acked-by: Khalid Elmously Acked-by: Kleber Sacilotto de Souza --- drivers/scsi/libsas/sas_ata.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/libsas/sas_ata.c b/drivers/scsi/libsas/sas_ata.c index 64a958a99f6a8..4f6cdf53e9136 100644 --- a/drivers/scsi/libsas/sas_ata.c +++ b/drivers/scsi/libsas/sas_ata.c @@ -654,7 +654,7 @@ void sas_probe_sata(struct asd_sas_port *port) /* if libata could not bring the link up, don't surface * the device */ - if (ata_dev_disabled(sas_to_ata_dev(dev))) + if (!ata_dev_enabled(sas_to_ata_dev(dev))) sas_fail_probe(dev, __func__, -ENODEV); }