Message ID | 20200111094845.844463900@linuxfoundation.org |
---|---|
State | Superseded |
Headers | show
Return-Path: <SRS0=JpBV=3A=vger.kernel.org=stable-owner@kernel.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9EEAEC33C9E for <stable@archiver.kernel.org>; Sat, 11 Jan 2020 09:58:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 69CA620848 for <stable@archiver.kernel.org>; Sat, 11 Jan 2020 09:58:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578736739; bh=10+L5mGMJmdCExlrHob+ZT1FHuyMtgBPRYa1uDx1N5k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=J5DzsiAB3Xjn5Q2meNP8w7rZFFrZHrDakZ1HjitwSL0vLFR0L4cD0fLn+wGnVSH8d C7X5WmS3kWLaQIfxrkQ7qtNAyO/IAlMY4O1hmaRph9umY2jOIVg9SsxXsC+LD4H+SD K7E5aieX1nHoqW8349pfwdvisWiWllmv+7afrtW4= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729062AbgAKJ66 (ORCPT <rfc822;stable@archiver.kernel.org>); Sat, 11 Jan 2020 04:58:58 -0500 Received: from mail.kernel.org ([198.145.29.99]:52930 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728952AbgAKJ66 (ORCPT <rfc822;stable@vger.kernel.org>); Sat, 11 Jan 2020 04:58:58 -0500 Received: from localhost (unknown [62.119.166.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 376FF2082E; Sat, 11 Jan 2020 09:58:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578736737; bh=10+L5mGMJmdCExlrHob+ZT1FHuyMtgBPRYa1uDx1N5k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=l6r+aCDF6vaJR9mYauVUSEFeKQgpjWrNmZ8zZwKC39XBneNjxqCICTUSC5JiiNsn+ 1uyYxUC4B0tcQ4Ij12CgKGYdoZZ/ewkZ/v1Xv/KuGX6DKbYAis5lP9dpNZKt5qxQ8K 53LCErgLuQuI8fXyCksWh2NlsLjqFVnvZMM9kW6U= From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>, stable@vger.kernel.org, Gao Chuan <gaochuan4@huawei.com>, John Garry <john.garry@huawei.com>, Jason Yan <yanaijie@huawei.com>, "Martin K. Petersen" <martin.petersen@oracle.com>, Sasha Levin <sashal@kernel.org> Subject: [PATCH 4.9 06/91] scsi: libsas: stop discovering if oob mode is disconnected Date: Sat, 11 Jan 2020 10:48:59 +0100 Message-Id: <20200111094845.844463900@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200111094844.748507863@linuxfoundation.org> References: <20200111094844.748507863@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: <stable.vger.kernel.org> X-Mailing-List: stable@vger.kernel.org |
Series |
None
|
expand
|
diff --git a/drivers/scsi/libsas/sas_discover.c b/drivers/scsi/libsas/sas_discover.c index 60de66252fa2..b200edc665a5 100644 --- a/drivers/scsi/libsas/sas_discover.c +++ b/drivers/scsi/libsas/sas_discover.c @@ -97,12 +97,21 @@ static int sas_get_port_device(struct asd_sas_port *port) else dev->dev_type = SAS_SATA_DEV; dev->tproto = SAS_PROTOCOL_SATA; - } else { + } else if (port->oob_mode == SAS_OOB_MODE) { struct sas_identify_frame *id = (struct sas_identify_frame *) dev->frame_rcvd; dev->dev_type = id->dev_type; dev->iproto = id->initiator_bits; dev->tproto = id->target_bits; + } else { + /* If the oob mode is OOB_NOT_CONNECTED, the port is + * disconnected due to race with PHY down. We cannot + * continue to discover this port + */ + sas_put_device(dev); + pr_warn("Port %016llx is disconnected when discovering\n", + SAS_ADDR(port->attached_sas_addr)); + return -ENODEV; } sas_init_dev(dev);