From patchwork Wed Oct 18 06:09:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viswas G X-Patchwork-Id: 10013475 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7F52860215 for ; Wed, 18 Oct 2017 06:09:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 70E5A27B81 for ; Wed, 18 Oct 2017 06:09:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6574128138; Wed, 18 Oct 2017 06:09:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 46D8A27B81 for ; Wed, 18 Oct 2017 06:09:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933537AbdJRGJf (ORCPT ); Wed, 18 Oct 2017 02:09:35 -0400 Received: from mail-by2nam03on0045.outbound.protection.outlook.com ([104.47.42.45]:15840 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933304AbdJRGJc (ORCPT ); Wed, 18 Oct 2017 02:09:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mscc365.onmicrosoft.com; s=selector1-microsemi-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=ggxDTax2UmdolypgplSITb2KaVXexQuZ+81SLEQM5Wg=; b=kQMiKnmqggLeBpYH7Z09OEtyF4Cp7aZrJ/m29nWWAvBcPNKPN//CQWjmJr3N7DEPkYX3z8UkzSeclpa2PfOFllJWKhjG4SoY+UDdEegTZmdbYyuaoccQUu+wtbLP1HsGohuafuTwnmNEP08+hUslhZlIpmCGFwR1Jjnqy25QO0M= Received: from BN6PR02CA0081.namprd02.prod.outlook.com (10.161.158.22) by BLUPR0201MB1827.namprd02.prod.outlook.com (10.162.239.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Wed, 18 Oct 2017 06:09:30 +0000 Received: from BN1BFFO11FD017.protection.gbl (2a01:111:f400:7c10::1:144) by BN6PR02CA0081.outlook.office365.com (2603:10b6:405:60::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.77.21 via Frontend Transport; Wed, 18 Oct 2017 06:09:30 +0000 Authentication-Results: spf=pass (sender IP is 208.19.100.21) smtp.mailfrom=microsemi.com; oracle.com; dkim=none (message not signed) header.d=none;oracle.com; dmarc=bestguesspass action=none header.from=microsemi.com; Received-SPF: Pass (protection.outlook.com: domain of microsemi.com designates 208.19.100.21 as permitted sender) receiver=protection.outlook.com; client-ip=208.19.100.21; helo=avsrvexchhts1.microsemi.net; Received: from avsrvexchhts1.microsemi.net (208.19.100.21) by BN1BFFO11FD017.mail.protection.outlook.com (10.58.144.80) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.77.10 via Frontend Transport; Wed, 18 Oct 2017 06:09:30 +0000 Received: from localhost (10.187.72.81) by avsrvexchhts1.microsemi.net (10.100.34.105) with Microsoft SMTP Server id 14.3.361.1; Tue, 17 Oct 2017 23:09:23 -0700 From: Viswas G To: CC: , , , , , Subject: [PATCH V4 3/9] pm80xx : Different SAS addresses for phys. Date: Wed, 18 Oct 2017 11:39:09 +0530 Message-ID: <20171018060915.8549-4-Viswas.G@microsemi.com> X-Mailer: git-send-email 2.12.3 In-Reply-To: <20171018060915.8549-1-Viswas.G@microsemi.com> References: <20171018060915.8549-1-Viswas.G@microsemi.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:208.19.100.21; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(39860400002)(376002)(346002)(2980300002)(438002)(189002)(199003)(2906002)(316002)(2950100002)(106466001)(53936002)(4326008)(76176999)(50986999)(57986006)(2351001)(478600001)(305945005)(356003)(189998001)(5660300001)(76506005)(8936002)(8676002)(6666003)(104016004)(50226002)(16586007)(36756003)(6916009)(81166006)(1076002)(68736007)(97736004)(69596002)(47776003)(54906003)(77096006)(86362001)(81156014)(50466002)(5890100001)(5003940100001)(48376002)(106002); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR0201MB1827; H:avsrvexchhts1.microsemi.net; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD017; 1:A3j53Zd/DjsHM5VdgcMSnyibGIfYFoRLTWISd9QOxrnho3E/kAhSYvyCTVsoPEQhLIe74eJLzcFgAxmZ8CpnevOOR0J3VjDX75ZMCuEwz4OX6TbsIIyMWHXrXqM3La76 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7c6c05cf-08b8-4b63-10ba-08d515eecba9 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(8251501002)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:BLUPR0201MB1827; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0201MB1827; 3:L8eyGPMXDkrcznxIuCxdUCm0W11BcR+q0JY9yG9J/GcVCW3zsmJTKEfkVfpoZr867Bkk+txsxmfn3zCyRli5IRNqLD8Q8M940aF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Eq8rvGTVsUP6kf1iYe1GTDwjAURPY+5mgyTZuNP9ARtWOx3ScANF5VEx3xapMw6Ms4k8Zi2fzD9O6EypqLl4vCct7Bkme7W30nMjaj8KODl+nXJ39S04DgvMsVHnKyhUEVO1OZqlT5+eVAvHogcQTSAH+QIewi7iaLvmB8gWrJ/qizJXJSctfX8c9Q4pSclGVgj3IAyEeRHwQl74JebIdxvONiV0ChoElkVX+QSXkUnnH39xT8qmjDr/K8iqKF2LP6uMDl1aGg75wy+BNLkx15WadHnlrDgBQdGgcG7CrkaYmbz85xm+nDQZxYJw4Iig8UIJjBL0HzFjfK2cGn2Tn+GMq09/mikz2f6FJNxdncY5I/RjFQY X-Exchange-Antispam-Report-Test: UriScan:(72170198267865); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(93006095)(93004095)(10201501046)(100000703101)(100105400095)(3002001)(6055026)(6041248)(20161123564025)(20161123562025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123560025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BLUPR0201MB1827; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BLUPR0201MB1827; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0201MB1827; 4:c1vQl/SCvZ66TJpp81ngs9tk2nKvH2wVmZ9mPYVRqX5x6QLlr9i868nf6a6h8MmRNdkK72mAyGl69VuBlaO7kqjLJhiXzuZ3DEUHkI/vm0KRX3DIDIsCtjtURJwk5ESsZj515BN89MNa3uDLy5GgzsoaWZ2VgP61uZGnzce5CMPWEYVUrDkeGDBGgZmTYR/tMCAK8Cua46KDWNdV04VmQEudP2S6oM61UsqtjfACfb7UvQu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sa7V1ZJ2T3Old5qufJ/NHvaTiRtCAyzVD74hBQeps=; 7:d59DEsre9JFI9Zib2HPwJWGdXKIedtHNoTdgHgQhkKqdENf2mL46LRMST4QGwf7EdJ8AH/I13LA+Zo/8mK+kUA4XTxzt8jo7SMUTCW85UuVg1iHRrHTEuSdnsjljAvHLIDUvp+WFq9runWHNfdOMysX2CVZQOgF7xaDHQwQozIb7fDUf/ivDqbMJ0SBNJwe4ldllAXlP6GZHCyQd2fyStUHkMJ12UZddKUON1W3Dz9A= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: microsemi.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Oct 2017 06:09:30.2615 (UTC) X-MS-Exchange-CrossTenant-Id: f267a5c8-86d8-4cc9-af71-1fd2c67c8fad X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f267a5c8-86d8-4cc9-af71-1fd2c67c8fad; Ip=[208.19.100.21]; Helo=[avsrvexchhts1.microsemi.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0201MB1827 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Different SAS addresses are assigned for each set of phys. Signed-off-by: Viswas G Acked-by: Jack Wang --- drivers/scsi/pm8001/pm8001_init.c | 13 +++++++++---- drivers/scsi/pm8001/pm80xx_hwi.c | 3 +-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/drivers/scsi/pm8001/pm8001_init.c b/drivers/scsi/pm8001/pm8001_init.c index 0e013f76b582..7a697ca68501 100644 --- a/drivers/scsi/pm8001/pm8001_init.c +++ b/drivers/scsi/pm8001/pm8001_init.c @@ -132,7 +132,7 @@ static void pm8001_phy_init(struct pm8001_hba_info *pm8001_ha, int phy_id) sas_phy->oob_mode = OOB_NOT_CONNECTED; sas_phy->linkrate = SAS_LINK_RATE_UNKNOWN; sas_phy->id = phy_id; - sas_phy->sas_addr = &pm8001_ha->sas_addr[0]; + sas_phy->sas_addr = (u8 *)&phy->dev_sas_addr; sas_phy->frame_rcvd = &phy->frame_rcvd[0]; sas_phy->ha = (struct sas_ha_struct *)pm8001_ha->shost->hostdata; sas_phy->lldd_phy = phy; @@ -591,10 +591,12 @@ static void pm8001_post_sas_ha_init(struct Scsi_Host *shost, for (i = 0; i < chip_info->n_phy; i++) { sha->sas_phy[i] = &pm8001_ha->phy[i].sas_phy; sha->sas_port[i] = &pm8001_ha->port[i].sas_port; + sha->sas_phy[i]->sas_addr = + (u8 *)&pm8001_ha->phy[i].dev_sas_addr; } sha->sas_ha_name = DRV_NAME; sha->dev = pm8001_ha->dev; - + sha->strict_wide_ports = 1; sha->lldd_module = THIS_MODULE; sha->sas_addr = &pm8001_ha->sas_addr[0]; sha->num_phys = chip_info->n_phy; @@ -611,6 +613,7 @@ static void pm8001_post_sas_ha_init(struct Scsi_Host *shost, static void pm8001_init_sas_add(struct pm8001_hba_info *pm8001_ha) { u8 i, j; + u8 sas_add[8]; #ifdef PM8001_READ_VPD /* For new SPC controllers WWN is stored in flash vpd * For SPC/SPCve controllers WWN is stored in EEPROM @@ -672,10 +675,12 @@ static void pm8001_init_sas_add(struct pm8001_hba_info *pm8001_ha) pm8001_ha->sas_addr[j] = payload.func_specific[0x804 + i]; } - + memcpy(sas_add, pm8001_ha->sas_addr, SAS_ADDR_SIZE); for (i = 0; i < pm8001_ha->chip->n_phy; i++) { + if (i && ((i % 4) == 0)) + sas_add[7] = sas_add[7] + 4; memcpy(&pm8001_ha->phy[i].dev_sas_addr, - pm8001_ha->sas_addr, SAS_ADDR_SIZE); + sas_add, SAS_ADDR_SIZE); PM8001_INIT_DBG(pm8001_ha, pm8001_printk("phy %d sas_addr = %016llx\n", i, pm8001_ha->phy[i].dev_sas_addr)); diff --git a/drivers/scsi/pm8001/pm80xx_hwi.c b/drivers/scsi/pm8001/pm80xx_hwi.c index 8fb5ddf08cc4..2b26445d1b97 100644 --- a/drivers/scsi/pm8001/pm80xx_hwi.c +++ b/drivers/scsi/pm8001/pm80xx_hwi.c @@ -3041,7 +3041,6 @@ hw_event_phy_down(struct pm8001_hba_info *pm8001_ha, void *piomb) port->port_state = portstate; phy->identify.device_type = 0; phy->phy_attached = 0; - memset(&phy->dev_sas_addr, 0, SAS_ADDR_SIZE); switch (portstate) { case PORT_VALID: break; @@ -4394,7 +4393,7 @@ pm80xx_chip_phy_start_req(struct pm8001_hba_info *pm8001_ha, u8 phy_id) payload.sas_identify.dev_type = SAS_END_DEVICE; payload.sas_identify.initiator_bits = SAS_PROTOCOL_ALL; memcpy(payload.sas_identify.sas_addr, - pm8001_ha->sas_addr, SAS_ADDR_SIZE); + &pm8001_ha->phy[phy_id].dev_sas_addr, SAS_ADDR_SIZE); payload.sas_identify.phy_id = phy_id; ret = pm8001_mpi_build_cmd(pm8001_ha, circularQ, opcode, &payload, 0); return ret;