From patchwork Tue Feb 17 23:36:44 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viswas G X-Patchwork-Id: 9950965 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 7D41C6038F for ; Wed, 13 Sep 2017 10:42:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6F73228F7A for ; Wed, 13 Sep 2017 10:42:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6429D28FBC; Wed, 13 Sep 2017 10:42:14 +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=-3.5 required=2.0 tests=BAYES_00, DATE_IN_PAST_96_XX, 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 E53CE28F7A for ; Wed, 13 Sep 2017 10:42:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752025AbdIMKmM (ORCPT ); Wed, 13 Sep 2017 06:42:12 -0400 Received: from mail-cys01nam02hn0244.outbound.protection.outlook.com ([104.47.37.244]:3712 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751705AbdIMKmK (ORCPT ); Wed, 13 Sep 2017 06:42:10 -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=eGKOjnaJCr7hrBEyHJu8CqCP0hCy+qq+P+BBwEIuOOU=; b=Ga2WDRzb7SERliMnu1yrk3DDYL6bQQb/L7G4pEhZOqbod3uuX6Q5lrl+REVRcgTe9tZd5UsktdUpQdmluMV5sPyfqN0/J3Kos1kBUm93CIYdRwWEprzS017Kt+31IkIZcwjbBmigbI7m53H26IXTIDo/9240CzFjKzvbzGqHHTU= Received: from CY4PR02CA0004.namprd02.prod.outlook.com (10.169.188.14) by SN1PR0201MB1502.namprd02.prod.outlook.com (10.163.129.156) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.35.12; Wed, 13 Sep 2017 10:42:08 +0000 Received: from BN1AFFO11FD021.protection.gbl (2a01:111:f400:7c10::139) by CY4PR02CA0004.outlook.office365.com (2603:10b6:903:18::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.56.8 via Frontend Transport; Wed, 13 Sep 2017 10:42:07 +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 BN1AFFO11FD021.mail.protection.outlook.com (10.58.52.81) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.13.11 via Frontend Transport; Wed, 13 Sep 2017 10:42:07 +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; Wed, 13 Sep 2017 03:42:05 -0700 From: Viswas G To: CC: , , , , , Subject: [PATCH V2 3/9] pm80xx : Different SAS addresses for phys. Date: Wed, 18 Feb 2015 05:06:44 +0530 Message-ID: <20150217233650.9091-4-Viswas.G@microsemi.com> X-Mailer: git-send-email 2.12.3 In-Reply-To: <20150217233650.9091-1-Viswas.G@microsemi.com> References: <20150217233650.9091-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:SPM; SFS:(10009020)(6009001)(366002)(346002)(39860400002)(376002)(2980300002)(438002)(199003)(189002)(305945005)(69596002)(6916009)(76506005)(104016004)(50986999)(76176999)(50226002)(57986006)(2950100002)(478600001)(356003)(1076002)(5660300001)(50466002)(2351001)(54906002)(5890100001)(48376002)(8676002)(36756003)(81166006)(81156014)(53936002)(2906002)(110136004)(5003940100001)(316002)(6666003)(4326008)(97736004)(189998001)(8936002)(47776003)(86362001)(68736007)(77096006)(106466001)(5530500006); DIR:OUT; SFP:1501; SCL:5; SRVR:SN1PR0201MB1502; H:avsrvexchhts1.microsemi.net; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD021; 1:kSRF9L4AciCTM26C79NQHPB4F61hyIDYzKrBumz5GB/GyVA/8vR4Kq32tviD8u+TlD2f7THD/kTWLmyI1BxPCLVEit5CCE9mnIpwyfEt4hdAVjL69RPG9VQR15MsDG7E X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 814e513f-4ce0-44d7-5414-08d4fa9414be 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:SN1PR0201MB1502; X-Microsoft-Exchange-Diagnostics: 1; SN1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7pf/avrkuAMu1UbUkgvn1x1pUQq4o9Jg+F8U9Sn6Q/8bEPUFm5OVCKSVX7XGiSxfsXlELsG5lafFcZLR9R2h8NITjcIvqXBYV59R5dX9H5gTdWR3/MH+IVWVZwbrm64ume4vZwClkIQw7OfIBfVaHcDDey9W/O0E1vPaCIys/Z3WnUMU30RvWTKz3cFStdRtQEv/pq8C4aAmo3AxTu3NNQMH+4HcAN6+gfSEtXQqK45C5vP51INKEiO4YEZmzPFrLirzVTuSkaBLuT7NE8IhlwEGQicH4rgGD1zK4dQ5ihBVh/2GBatMIym0qwNZaxJcysd8k4Qsotzso4mYAEfrO+a1iJuSYzuEB7Fih08nRcF1zZUJb+XOiGYmDC+YqINrY5fzQM7QaQWhYUtnIqAa+Fpg3UXI3Wj7jhBp3rIQuqnpf5d6Mqu36quQUxHFHfju1IuYwe4bs20KyyfDVDBtTDf 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)(3002001)(93006095)(93004095)(100000703101)(100105400095)(10201501046)(6055026)(6041248)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123555025)(20161123558100)(20161123562025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:SN1PR0201MB1502; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:SN1PR0201MB1502; X-Microsoft-Exchange-Diagnostics: 1; SN1PR0201MB1502; 4:2XDxfmLS8PN0aE7BpvL7t4ZvoFLSVLShMRZnH2zpcVoqancNeHY6KPqk71DnFDaxQRn3+9mg7nlSL5OQ8FO4WzM2mw6YT51qRXc9e5QovlAHHbxX3H5obphfhtaH24V5l7+EMWVelBOc1epgV4DsH464QDYmG561/OJbwwzzcfKH7Ysuqofyrft1999TWO568z7OR02fwmz/mozon0HlZaKda2YJTZEKF1ZK/FQgqvj2KmibkjMPApguhdArAtDGPCz83oocEJVt1rmb1QVHdGbJkdIRKB5l3WC8gtMv0jI= X-Forefront-PRVS: 042957ACD7 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN1PR0201MB1502; 23:rflyiwb0GSJjke9lNTJ0qtNcHIPB99a9Vvn+hSR?= =?us-ascii?Q?CGH9Bk+33o81k1EpgZy2bBqI9zhJX9DUdri/OUwLiR+NO3ojWlmUeJD620JN?= =?us-ascii?Q?oPKOc8QKimVyVjx4wkg6k+logAa9X/K02YEyhoEP+sADJLtZ1fa3+d2u1Tqy?= =?us-ascii?Q?rmCyZlsR9MFLJoo+eTLopPHCtNeS3AkL7/KpJyKEzl9msQu0Kv9HGNWWPRAM?= =?us-ascii?Q?Q086RtE35bMvpPWUY+jRAprpX4qO5OG/FbF1AqaMFw9MrhLyL+kCHu0P5Lfp?= =?us-ascii?Q?/vMd7wulGdqtoWhISZbKnqwT40DnUjEu2V0aCjAaX4RlbkCau9ShdL+cVkQL?= =?us-ascii?Q?XiJmYVcC1XyPgB/hIvGS/iwfrMppyOdUJMyt9a2VbNzicznFINMAIyyuYqRS?= =?us-ascii?Q?mT7qCK/6oHHINaigZARB5cP+JgtPQCDGjw+ZX6g7IFq5wFVW2DZ20c4SGEdE?= =?us-ascii?Q?HZZVsPk/6+Zh24xGR0+x2/62SCoMQ4OeDotdCMQhQQS71ybAaJ2nVWqunNh4?= =?us-ascii?Q?k+6/k4uekedEqK6xNYiwlDPOUefBUnYK76mW8WLmOiGkDiKzL0L1MW350PsU?= =?us-ascii?Q?FP6F2vnvEroQfrUmvgIj1uQD7ywQDkeMdTjIGioIKdleL6nkeC807RHJp53D?= =?us-ascii?Q?xwyJEvqNrKWo3z6/KBpJav4TIzFWTkE6/DmvQvWAiRN1gP4UIJlSc+hIo1an?= =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Z3M94GxUJWaVVq+jLozTmBMMx///+zzi1kzCZAdBOPFq7JMTsYKAMFrlmbrr6XnHmqjGzUas2ydeog2A==; 24:N0cQhJWfP1f6dXK9OwYDb3NLVm3mXOuMKmFMSRBbxhnrQqYvR2f0dyoqhXS8Sgf6ZpagoIu8BY4MTNcFv6LAzg==; 7:LRqJST8EITa8GcmiZxa5p8tnAwoWADu858QL5mxzdEj7EDN4ExyYSgXCgek+MbuEiq4DUIoHjGNS7aeJheQN3dtkvOSWO5yyrlNFZKD47h8e5Iife5+ZDD8ULwGJXRX3b/KEo8oQ5opzqkYOWMPQpAW/jJAMSLaiRuK4DVsqiuibdSmnUXc/MVtMsA1nEnCzZDGz+r3UMoDJDVzGUZHlgL6/N4ps1jvOohXe1y3vCS0= SpamDiagnosticOutput: 1:22 X-OriginatorOrg: microsemi.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Sep 2017 10:42:07.2304 (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: SN1PR0201MB1502 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 034b2f7d1135..d282f1562615 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; @@ -593,10 +593,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; @@ -613,6 +615,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 @@ -674,10 +677,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;