From patchwork Tue Sep 19 17:09:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viswas G X-Patchwork-Id: 9959691 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 54B1C60208 for ; Tue, 19 Sep 2017 17:10:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3F6FA28E93 for ; Tue, 19 Sep 2017 17:10:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 340A828EC4; Tue, 19 Sep 2017 17:10:41 +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 4592228E93 for ; Tue, 19 Sep 2017 17:10:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751408AbdISRKi (ORCPT ); Tue, 19 Sep 2017 13:10:38 -0400 Received: from mail-sn1nam01on0051.outbound.protection.outlook.com ([104.47.32.51]:13350 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751370AbdISRKf (ORCPT ); Tue, 19 Sep 2017 13:10:35 -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=cbfW51D+V2hZqy+vPqHqfuMDHX6LT+aaM7C2bQn/TdD6jWDLLFQ9Y6Daxaosg7bP/U2itjn6s6bKZ6eUnrSmq9u+vcJXn60q/ZDezAu2qOvapok75GreFQQyW0IbHU38ck0wBHAVKNeNqoV3pB0tAg8HnNlg1l1W/wiXAPqeVXA= Received: from SN4PR0201CA0068.namprd02.prod.outlook.com (10.171.31.158) by SN1PR0201MB1455.namprd02.prod.outlook.com (10.163.129.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.56.11; Tue, 19 Sep 2017 17:10:34 +0000 Received: from BN1AFFO11FD044.protection.gbl (2a01:111:f400:7c10::172) by SN4PR0201CA0068.outlook.office365.com (2603:10b6:803:20::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.56.11 via Frontend Transport; Tue, 19 Sep 2017 17:10:34 +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 BN1AFFO11FD044.mail.protection.outlook.com (10.58.52.191) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.35.14 via Frontend Transport; Tue, 19 Sep 2017 17:10:33 +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, 19 Sep 2017 10:10:11 -0700 From: Viswas G To: CC: , , , , , Subject: [PATCH V3 3/9] pm80xx : Different SAS addresses for phys. Date: Tue, 19 Sep 2017 22:39:58 +0530 Message-ID: <20170919171004.10331-4-Viswas.G@microsemi.com> X-Mailer: git-send-email 2.12.3 In-Reply-To: <20170919171004.10331-1-Viswas.G@microsemi.com> References: <20170919171004.10331-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)(346002)(376002)(39860400002)(2980300002)(438002)(199003)(189002)(2351001)(189998001)(104016004)(5890100001)(50226002)(5660300001)(106466001)(76506005)(57986006)(6916009)(36756003)(2950100002)(68736007)(8936002)(50986999)(54906002)(76176999)(2906002)(305945005)(48376002)(356003)(5003940100001)(6666003)(316002)(81166006)(478600001)(16586007)(81156014)(53936002)(1076002)(97736004)(4326008)(50466002)(47776003)(86362001)(77096006)(8676002)(69596002); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR0201MB1455; H:avsrvexchhts1.microsemi.net; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD044; 1:/U7d9k0X3OJ+p179vyEMqnMqpnym7U+ItPZ9gy/m2yxRbwLSjPbn/ldxnDt0rrGsuJhwWE5yyC9ud+GWEnI1iSKKUOFwhctaf2tHAN3fUbr1OeNpoU/RYUYgHMHNOF5G X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9ef6f742-5ddf-449a-ca57-08d4ff8156e9 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(8251501002)(300000503095)(300135400095)(2017052603199)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:SN1PR0201MB1455; X-Microsoft-Exchange-Diagnostics: 1; SN1PR0201MB1455; 3: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UJzX+vbz5UK7sxTJ4OVgq/TINUcR1UO5JXv6RAWLme7+1/kYR4CMlCTt+sAZ1jGg5mmWZpdzymM5GGDimyUeRGH0OzfTModKrAJ5OmiJduv0Ys1ZQwa6PLpXBuaRt5yCMAMi67wBwPQOSBNC7A+DoCcO9+iDeXJdAVFO4oo9W5Qf4LEw5Nr5QevFQyF9lm+ktzFP07YNCxFscMoBPWtdk6v9aY+Eag7WwIt17gHBRwtPplCINsuivuh6QMMijwhhA44+5qe6U3ukhHdVCjyyIYoH6bvbMqA06/19q5cX6wQEk7u1fVH7qKcv0mFUXYrFfuP9IkulSoKIu3QlXUC8UFjM+wCkGwHBP/83n0hjdWOcSXOEUrXim0mxQKON0CYZEkF8clNx3HxrTP3D559lXM9YxzoU3MApenZ5yX2lER/2OEK/Geil6z2VJSmSn25TO2R5MK 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)(5005006)(8121501046)(10201501046)(3002001)(100000703101)(100105400095)(93006095)(93004095)(6055026)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123560025)(20161123564025)(20161123555025)(20161123562025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:SN1PR0201MB1455; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:SN1PR0201MB1455; X-Microsoft-Exchange-Diagnostics: 1; SN1PR0201MB1455; 4:6Dm62Y9QkRGcLFk16xRPUm/Q2G/PtE4iw4BqLca7iv+QbEtva65A1SZ0tgxsjKl0MU7mwbK6jmQLk3MeDSH6jKKzGY9Mk4yNRXhrNfMKphPUYtY0/FbeHyxEu7qbFfFz8Ilh0/63Ui+nhrV/gQ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Nt53xiJk6L81/ogHfDPKSh2OoF1AnL8Gaw7wcG/lp3C4q6OZ7dgISBBYmN95EjorLcAVfsoT43ikQtF9zqRk=; 7:yeaprXCldvAM2TsAV9y2Ga/k5tyozoO5o9OuecRk9vKQ2pJ9hPwfFkAifmdocpUSFww/RPYLv3zNnXTj2RD1juPVk6vcfIlXvs5VPCfJmUZojI2JIJsvY5dQ4Adh5qT0egbjrhJbgVpsjN6emccQNhoY4Kj8Lj4YAE5KN0GznWfufIEiCRNbLo44C9tVBVu+NOs592f9l5N53f133qiptvxJjpSPP+c5T+TTA2RZjNU= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: microsemi.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Sep 2017 17:10:33.5272 (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: SN1PR0201MB1455 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;