From patchwork Thu Apr 11 12:46:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 162064 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp7377777jan; Thu, 11 Apr 2019 05:47:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqxwebPo+5lStDYS+sj15sNNz49zaKry7D7VGlI0S39Ab2juLcTfR8EtD33ol/I9ufNoPQQq X-Received: by 2002:a17:902:a98b:: with SMTP id bh11mr50624236plb.63.1554986876257; Thu, 11 Apr 2019 05:47:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554986876; cv=none; d=google.com; s=arc-20160816; b=PKX0sJ2jRtkQPB72cnt4IBjoT39++rVKfyIj+Std7e64ZM8l/HDVmjG53nuX3nwco6 lhh7yzL6LtvNusAzw4DFUIeqLDX5NUvKPOg8Sm7CBFoZq9PsHpg5xRjoW8OJ9Vxi2hM+ TbkzQJz/l5GhmKYyW46+FEUVKOBJYD14HO9LHXaHq5anf+4le0EjEWEbcmSevNV3E00P 6CxbLKso91pkpTgqA/yviOJCShtLM83lF2u63MNzTzEdtgCpv4q2rbwCxz32+kmUa+Dr aHUgQQDPcM7SFkz3vd3XFYT5wFQ3tTXUVFNp+L6p+sPcF8rumiYPhcFQM5Knu1V7i9uw n+Mw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=evYBysxtNHO/aDRZWzoADy/RuiNTSZ4FJHrXuY/vFGU=; b=UQpZ6LkTWNcjHapNhE7P9EHkdRo9FoC5rXcESjN6+Oyflz5M1jnqWsvtY0K18DVu34 ey4BLLOKcQZMjAvxbdFMi1B4alDHzKyIRTcWd4A8LAkhHN7pDceP26X7Fo14qm28LjZZ Mu2wFXUqXhL6Puo63BsMoaLP4CDEY7r+oxGl5L0gP9xUgH6gM0SdyUOZB8e6W3dOlyIF aAs4jM+n29iphFPuSOmSCGGfaCB3HlyIVGmNJKfUVwBp4GW881LOsMtI1jwJ3VhWax9c kGJkAOR2+y7n0kG1QAq2PV9GRRVCOYKgmlIziraY1uRb43VA33JagqEzGq8gGQ7/1w8o S+6g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-scsi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-scsi-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 v186si17719055pgd.466.2019.04.11.05.47.56; Thu, 11 Apr 2019 05:47:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-scsi-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-scsi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726987AbfDKMrz (ORCPT + 1 other); Thu, 11 Apr 2019 08:47:55 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:41558 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726829AbfDKMrc (ORCPT ); Thu, 11 Apr 2019 08:47:32 -0400 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id B4305CC29C2BA525B29B; Thu, 11 Apr 2019 20:47:29 +0800 (CST) Received: from localhost.localdomain (10.67.212.75) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.408.0; Thu, 11 Apr 2019 20:47:19 +0800 From: John Garry To: , CC: , , , Xiang Chen , "John Garry" Subject: [PATCH 5/9] scsi: hisi_sas: allocate different SAS address for directly attached situation Date: Thu, 11 Apr 2019 20:46:40 +0800 Message-ID: <1554986804-233706-6-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1554986804-233706-1-git-send-email-john.garry@huawei.com> References: <1554986804-233706-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.67.212.75] X-CFilter-Loop: Reflected Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org From: Xiang Chen In commit 8b8d66531555 ("scsi: hisi_sas: make SAS address of SATA disks unique"), we ensured that each SATA disk in the system has a unique SAS address, even if it is fake. That was for v2 hw. Add this for v3 hw. Signed-off-by: Xiang Chen Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_v3_hw.c | 2 ++ 1 file changed, 2 insertions(+) -- 2.17.1 diff --git a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c index 3b33816ea6e6..89551b772cd4 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c +++ b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c @@ -1380,6 +1380,7 @@ static irqreturn_t phy_up_v3_hw(int phy_no, struct hisi_hba *hisi_hba) struct hisi_sas_initial_fis *initial_fis; struct dev_to_host_fis *fis; u8 attached_sas_addr[SAS_ADDR_SIZE] = {0}; + struct Scsi_Host *shost = hisi_hba->shost; dev_info(dev, "phyup: phy%d link_rate=%d(sata)\n", phy_no, link_rate); initial_fis = &hisi_hba->initial_fis[phy_no]; @@ -1396,6 +1397,7 @@ static irqreturn_t phy_up_v3_hw(int phy_no, struct hisi_hba *hisi_hba) sas_phy->oob_mode = SATA_OOB_MODE; attached_sas_addr[0] = 0x50; + attached_sas_addr[6] = shost->host_no; attached_sas_addr[7] = phy_no; memcpy(sas_phy->attached_sas_addr, attached_sas_addr,