Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1397210imm; Thu, 23 Aug 2018 02:20:26 -0700 (PDT) X-Google-Smtp-Source: AA+uWPwRXNg7fxd7vGfdN6HxhpbJhn/rp6nW1rc5JEX767mHLuuiKYBgGqr20WzVs1LNlRYG/NtP X-Received: by 2002:a63:8b44:: with SMTP id j65-v6mr20492760pge.325.1535016026857; Thu, 23 Aug 2018 02:20:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535016026; cv=none; d=google.com; s=arc-20160816; b=cvhrVTwnZ9oPbOo+HtmHGd5pmbEpgwvW29nozjPbJDtRPlVWcTAlQou38YyYkxGPtH 3r2DEOn2XUBGw3BbzEc7aXWGOwm6Egd8BL45MFnWxLHvGfbENbLGh/RSQGnpWt0DZ+IJ uCxulufRvJpDeu5E7tQchCN98Sr+gm+tJI1bB/YbAaifqBKI51XFg6TGDe9ZeigQswy2 k4pMK14zNH9TCHJQr1f90uHSta9W9cJxtAHd/HUotsfMCwsmXh0uAWAewx/34nH1yR2L LeRXXl5LpFYbD8BWSV9H49lb0sXBNGDUBjvbE1hdsMwHPwWxNKdUnWfFLCzcfbLieaBF 8xYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject:arc-authentication-results; bh=nAnPL9Aw+LUC7X31oee30nOT96EAkJe/SuxCSasiVqU=; b=ft6NjpUOQQQnWuJZxVEKbzjtlEtyTjV9n/1VX/nW+KtenAZKDRE28PDQvjpa5HdQuB H2RGOiPUCJXnEdAPA0Q4eMOTPV3oSGXkVLWDi+vcbaPhwQUekAH9iV9MeBq9gJL8i4vS n0x7vi0xnRmL5ST4Q7h7cxTr6UNXSc/FHgQ9nySgwNC8Q7mGtxcimUuBaqkPqx0yBsuC AiBFW+1POhy1hRwEIARKYWzaof/lbux+Ja2U2T0gV2CFyCIAGszil9ITLda+2cq3BTUA u8yGiYIwqMFhAl2A86AfVNsq22fy4mtabTtdHfP5FruH+MXM6LooAnGDOLYlKxY7lay3 uOmQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e10-v6si4082774pln.161.2018.08.23.02.20.11; Thu, 23 Aug 2018 02:20:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730691AbeHWMrZ (ORCPT + 99 others); Thu, 23 Aug 2018 08:47:25 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:11599 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730128AbeHWMrZ (ORCPT ); Thu, 23 Aug 2018 08:47:25 -0400 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 35D2DA5FA845B; Thu, 23 Aug 2018 17:18:34 +0800 (CST) Received: from [127.0.0.1] (10.74.219.194) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.399.0; Thu, 23 Aug 2018 17:18:27 +0800 Subject: Re: [PATCH plinth/topic-sas-4.18] {topost} scsi: hisi_sas: send HARD RESET to clear the previous affiliation of STP target port when init device To: , References: <1535011127-110586-1-git-send-email-chenxiang66@hisilicon.com> CC: , , , From: "chenxiang (M)" Message-ID: <985900b4-535c-2bb3-65db-033d3b623cbe@hisilicon.com> Date: Thu, 23 Aug 2018 17:18:27 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <1535011127-110586-1-git-send-email-chenxiang66@hisilicon.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.74.219.194] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Sorry, sent the wrong mail list and please ignore the patch. 在 2018/8/23 15:58, c00284940 写道: > If exchange SAS expander from one SAS controller to other SAS controller > without power down, the STP target port will maintain previous affiliation and > reject all subsequent connection requests from other STP initiator ports > with OPEN_REJECT (STP RESOURCES BUSY). > > To solve this issue, send HARD RESET to clear the previous affiliation of > STP target port according to SPL(chapter 6.19.4). > > Signed-off-by: Xiang Chen > --- > drivers/scsi/hisi_sas/hisi_sas_main.c | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c > index bb0fa24..9225138 100644 > --- a/drivers/scsi/hisi_sas/hisi_sas_main.c > +++ b/drivers/scsi/hisi_sas/hisi_sas_main.c > @@ -612,6 +612,7 @@ static int hisi_sas_init_device(struct domain_device *device) > struct hisi_sas_tmf_task tmf_task; > int retry = HISI_SAS_SRST_ATA_DISK_CNT; > struct hisi_hba *hisi_hba = dev_to_hisi_hba(device); > + struct sas_phy *local_phy; > > switch (device->dev_type) { > case SAS_END_DEVICE: > @@ -627,6 +628,14 @@ static int hisi_sas_init_device(struct domain_device *device) > case SAS_SATA_PM: > case SAS_SATA_PM_PORT: > case SAS_SATA_PENDING: > + /* > + * send HARD RESET to clear previous affiliation of > + * STP target port > + */ > + local_phy = sas_get_local_phy(device); > + if (!scsi_is_sas_phy_local(local_phy)) > + sas_phy_reset(local_phy, 1); > + sas_put_local_phy(local_phy); > while (retry-- > 0) { > rc = hisi_sas_softreset_ata_disk(device); > if (!rc)