From patchwork Fri Dec 7 22:28:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Don Brace X-Patchwork-Id: 10718951 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8BC231750 for ; Fri, 7 Dec 2018 22:28:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 78DD02D8A2 for ; Fri, 7 Dec 2018 22:28:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6C9982D8BD; Fri, 7 Dec 2018 22:28:44 +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=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 C1F532D8A2 for ; Fri, 7 Dec 2018 22:28:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726130AbeLGW2n (ORCPT ); Fri, 7 Dec 2018 17:28:43 -0500 Received: from mail-eopbgr760080.outbound.protection.outlook.com ([40.107.76.80]:43616 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726076AbeLGW2n (ORCPT ); Fri, 7 Dec 2018 17:28:43 -0500 Received: from DM5PR19CA0018.namprd19.prod.outlook.com (2603:10b6:3:151::28) by MWHPR19MB1424.namprd19.prod.outlook.com (2603:10b6:300:c8::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1404.17; Fri, 7 Dec 2018 22:28:38 +0000 Received: from BN1BFFO11FD007.protection.gbl (2a01:111:f400:7c10::1:119) by DM5PR19CA0018.outlook.office365.com (2603:10b6:3:151::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1404.19 via Frontend Transport; Fri, 7 Dec 2018 22:28:37 +0000 Authentication-Results: spf=pass (sender IP is 208.19.99.222) smtp.mailfrom=microsemi.com; linux.vnet.ibm.com; dkim=none (message not signed) header.d=none;linux.vnet.ibm.com; dmarc=bestguesspass action=none header.from=microsemi.com; Received-SPF: Pass (protection.outlook.com: domain of microsemi.com designates 208.19.99.222 as permitted sender) receiver=protection.outlook.com; client-ip=208.19.99.222; helo=AUSMBX2.microsemi.net; Received: from AUSMBX2.microsemi.net (208.19.99.222) by BN1BFFO11FD007.mail.protection.outlook.com (10.58.144.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.1404.13 via Frontend Transport; Fri, 7 Dec 2018 22:28:36 +0000 Received: from AUSMBX2.microsemi.net (10.201.34.32) by AUSMBX2.microsemi.net (10.201.34.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1531.3; Fri, 7 Dec 2018 16:28:35 -0600 Received: from [127.0.1.1] (10.238.32.34) by ausmbx2.microsemi.net (10.201.34.32) with Microsoft SMTP Server id 15.1.1531.3 via Frontend Transport; Fri, 7 Dec 2018 16:28:35 -0600 Subject: [PATCH 05/20] smartpqi: turn off lun data caching for ptraid From: Don Brace To: , , , , , , , , , , , CC: Date: Fri, 7 Dec 2018 16:28:35 -0600 Message-ID: <154422171524.1218.11361629656129819901.stgit@brunhilda> In-Reply-To: <154422079293.1218.12539829857034151457.stgit@brunhilda> References: <154422079293.1218.12539829857034151457.stgit@brunhilda> User-Agent: StGit/0.19-dirty MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:208.19.99.222;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(7916004)(376002)(396003)(346002)(39850400004)(136003)(2980300002)(199004)(189003)(2906002)(23676004)(446003)(305945005)(336012)(476003)(230700001)(68736007)(11346002)(356004)(69596002)(2486003)(126002)(26005)(478600001)(77096007)(58126008)(47776003)(106466001)(316002)(16576012)(110136005)(186003)(76176011)(33896004)(5660300001)(103116003)(53936002)(8676002)(4326008)(106002)(9686003)(50466002)(8936002)(81156014)(2201001)(486006)(97736004)(33716001)(86362001)(14444005)(81166006)(44832011)(921003)(83996005)(2101003)(1121003);DIR:OUT;SFP:1101;SCL:1;SRVR:MWHPR19MB1424;H:AUSMBX2.microsemi.net;FPR:;SPF:Pass;LANG:en;PTR:InfoDomainNonexistent;A:1;MX:1; X-Microsoft-Exchange-Diagnostics: 1;BN1BFFO11FD007;1:KPOU7LxJkv0Kao/HSs6RTL+emXnWHmqs5l1IWvBgoypjLYa4zppmhJjrBAErEtSRMQB24t5eKIWk9Q2SFPRgp42y9AQNTDmoKqkJqrkGrFOtfcMz69whP8uNoe3ifecZ X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1f259365-9d28-41aa-19de-08d65c9354ae X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390098)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4608076)(2017052603328)(7153060);SRVR:MWHPR19MB1424; X-Microsoft-Exchange-Diagnostics: 1;MWHPR19MB1424;3:irQ+usYXz8sXMGQrgkMQyK6P9QuKWm86K4eeVVxW0tltrUN9Bpb6Jsi6PmRzEi5FdTVRt+jZOMA4c8gvWcfkQtS8m/40H9RxdMMXpOxjv+bfo3YWkp7ys/w5Fo4pOfRuqwpDO23j6Fgf/BHxiUUSBwOYSHWypdVlml1xsMDisRIHCp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IRJraa/r0tXpqx+T7sEOC1HfZK99NuRo7f3Wvkccwj8oIyuTOmiT3fDdVk36G3gCsuKJgIhWHG5OxmSJD3gvOjb9g0XFsi7vx9LIfpxdDTIFZ1CGUQtlQXUC+62uPLTyG1XITwWGiZouaQxYy7CrCeGcNrty85t/d3ifEWnO+Uye69s+AifrJQDOUZwSesFdAt9VqzSPZqZ/DLHvtwsnFoeCaA9oQrAvGx/A69grwDFJYu/vd9wqHzLczpre8H6P2qWicUJHOgx4KLGHuYsa+doIu0VrTo6f X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3002001)(3231455)(999002)(944501520)(52105112)(93006095)(93004095)(10201501046)(6055026)(148016)(149066)(150057)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123558120)(20161123562045)(201708071742011)(7699051)(76991095);SRVR:MWHPR19MB1424;BCL:0;PCL:0;RULEID:;SRVR:MWHPR19MB1424; X-Microsoft-Exchange-Diagnostics: 1;MWHPR19MB1424;4:wJ99/WPej6dsXax5QSx9WWfSQPbaPdWj62/7kn1WuwNGxmBN1XWS/KKos0pg7L7Gx+qNXY+x3Bp6THJNeOrGNM/6Cd7WZJqISLxnsjdvmD2LBsyTNguindAoRZpSP8R+VZtQo/ciGM+wye26D7L7xGRMd15MwhxTj7NPW2DXnekF/BjmOzkkw0hPgp8R1oJuFJbyBxPiOC5G7e1Mz+XCEA/j+9THbC8xXDFGGtLT0QeYWytwkgw3kJYprWb+1Uf3k1p5D2INWq1hovV+yCPgKQ== X-Forefront-PRVS: 0879599414 X-Microsoft-Exchange-Diagnostics: =?utf-8?q?1=3BMWHPR19MB1424=3B23=3AV5Y0xnN?= =?utf-8?q?8qyWl8f2xbDBCh9FM8b5ecjfnKFB0BLNm/V1LxPxNNam+6gc4aNVdNb6ZpPS7nxL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gsrA8CqWQHfJuhBy4RvcdmWLkC0BOgGqJpIWBrZJWfKSUzN3omnnTyBbq1v9+9oF9yA/KChEq9lcDRIV7qK/psnYmystcs4DratDKEzRNQq1Fv8FxcF72KTRIAvTnZNNyg==;5:Guc/4cT3V08s4jGXTRRSU4rMPOUC6VLHcCR6n2CQpUiT6og2UVATRNEMVhIEEG05iotbnrG9v8rSV2QmJ8k1UYCPXy9QnUJYvTlDJJ6IoYqvvAC4mADfoSFzzcfR+y8JxwNhbJ+wJ9MktZGNcVqAImcskox43R5+S9tSDBehGrI=;7:F3oKnUKe5kjeD/y9BaYDf7CaIfOPyeNIIMBXS1bnMSq7IVSX+jHHfR6wL3nz8TJRTDaNyr1inDAVwCZCvRm1PpImswGnt4lWv3kEMMMkrkOFYNEWLSonTmAkhqlfbn/64ccb80WL0cmIW+d7fq5Liw== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: microsemi.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Dec 2018 22:28:36.8897 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1f259365-9d28-41aa-19de-08d65c9354ae X-MS-Exchange-CrossTenant-Id: f267a5c8-86d8-4cc9-af71-1fd2c67c8fad X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f267a5c8-86d8-4cc9-af71-1fd2c67c8fad;Ip=[208.19.99.222];Helo=[AUSMBX2.microsemi.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR19MB1424 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 From: Dave Carroll - allow update the luns for PTRAID devices. Reviewed-by: Ajish Koshy Reviewed-by: Murthy Bhat Reviewed-by: Mahesh Rajashekhara Reviewed-by: Justin Lindley Reviewed-by: Scott Teel Reviewed-by: Kevin Barnett Signed-off-by: Dave Carroll Signed-off-by: Don Brace --- drivers/scsi/smartpqi/smartpqi.h | 6 +++ drivers/scsi/smartpqi/smartpqi_init.c | 79 ++++++++++++++++++++++++++++++--- 2 files changed, 79 insertions(+), 6 deletions(-) diff --git a/drivers/scsi/smartpqi/smartpqi.h b/drivers/scsi/smartpqi/smartpqi.h index 646982e45904..fcc4b937de71 100644 --- a/drivers/scsi/smartpqi/smartpqi.h +++ b/drivers/scsi/smartpqi/smartpqi.h @@ -1126,6 +1126,8 @@ enum pqi_ctrl_mode { #define BMIC_SENSE_SUBSYSTEM_INFORMATION 0x66 #define BMIC_WRITE_HOST_WELLNESS 0xa5 #define BMIC_FLUSH_CACHE 0xc2 +#define BMIC_SET_DIAG_OPTIONS 0xf4 +#define BMIC_SENSE_DIAG_OPTIONS 0xf5 #define SA_FLUSH_CACHE 0x1 @@ -1250,6 +1252,10 @@ enum bmic_flush_cache_shutdown_event { RESTART = 4 }; +struct bmic_diag_options { + __le32 options; +}; + #pragma pack() int pqi_add_sas_host(struct Scsi_Host *shost, struct pqi_ctrl_info *ctrl_info); diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c index 667a27ae3c07..9d9e90e13f5c 100644 --- a/drivers/scsi/smartpqi/smartpqi_init.c +++ b/drivers/scsi/smartpqi/smartpqi_init.c @@ -395,6 +395,7 @@ static int pqi_build_raid_path_request(struct pqi_ctrl_info *ctrl_info, u16 vpd_page, enum dma_data_direction *dir) { u8 *cdb; + size_t cdb_length = buffer_length; memset(request, 0, sizeof(*request)); @@ -417,7 +418,7 @@ static int pqi_build_raid_path_request(struct pqi_ctrl_info *ctrl_info, cdb[1] = 0x1; cdb[2] = (u8)vpd_page; } - cdb[4] = (u8)buffer_length; + cdb[4] = (u8)cdb_length; break; case CISS_REPORT_LOG: case CISS_REPORT_PHYS: @@ -427,32 +428,36 @@ static int pqi_build_raid_path_request(struct pqi_ctrl_info *ctrl_info, cdb[1] = CISS_REPORT_PHYS_EXTENDED; else cdb[1] = CISS_REPORT_LOG_EXTENDED; - put_unaligned_be32(buffer_length, &cdb[6]); + put_unaligned_be32(cdb_length, &cdb[6]); break; case CISS_GET_RAID_MAP: request->data_direction = SOP_READ_FLAG; cdb[0] = CISS_READ; cdb[1] = CISS_GET_RAID_MAP; - put_unaligned_be32(buffer_length, &cdb[6]); + put_unaligned_be32(cdb_length, &cdb[6]); break; case SA_FLUSH_CACHE: request->data_direction = SOP_WRITE_FLAG; cdb[0] = BMIC_WRITE; cdb[6] = BMIC_FLUSH_CACHE; - put_unaligned_be16(buffer_length, &cdb[7]); + put_unaligned_be16(cdb_length, &cdb[7]); break; + case BMIC_SENSE_DIAG_OPTIONS: + cdb_length = 0; case BMIC_IDENTIFY_CONTROLLER: case BMIC_IDENTIFY_PHYSICAL_DEVICE: request->data_direction = SOP_READ_FLAG; cdb[0] = BMIC_READ; cdb[6] = cmd; - put_unaligned_be16(buffer_length, &cdb[7]); + put_unaligned_be16(cdb_length, &cdb[7]); break; + case BMIC_SET_DIAG_OPTIONS: + cdb_length = 0; case BMIC_WRITE_HOST_WELLNESS: request->data_direction = SOP_WRITE_FLAG; cdb[0] = BMIC_WRITE; cdb[6] = cmd; - put_unaligned_be16(buffer_length, &cdb[7]); + put_unaligned_be16(cdb_length, &cdb[7]); break; default: dev_err(&ctrl_info->pci_dev->dev, "unknown command 0x%c\n", @@ -618,6 +623,54 @@ static int pqi_flush_cache(struct pqi_ctrl_info *ctrl_info, return rc; } + +#define PQI_FETCH_PTRAID_DATA (1UL<<31) + +static int pqi_set_diag_rescan(struct pqi_ctrl_info *ctrl_info) +{ + int rc; + struct pqi_raid_path_request request; + struct bmic_diag_options *diag; + enum dma_data_direction pci_direction; + + diag = kzalloc(sizeof(*diag), GFP_KERNEL); + if (!diag) + return -ENOMEM; + + rc = pqi_build_raid_path_request(ctrl_info, &request, + BMIC_SENSE_DIAG_OPTIONS, RAID_CTLR_LUNID, diag, + sizeof(*diag), 0, &pci_direction); + if (rc) + goto out; + + rc = pqi_submit_raid_request_synchronous(ctrl_info, &request.header, + 0, NULL, NO_TIMEOUT); + + pqi_pci_unmap(ctrl_info->pci_dev, request.sg_descriptors, 1, + pci_direction); + + if (rc) + goto out; + + diag->options |= cpu_to_le32(PQI_FETCH_PTRAID_DATA); + + rc = pqi_build_raid_path_request(ctrl_info, &request, + BMIC_SET_DIAG_OPTIONS, RAID_CTLR_LUNID, diag, + sizeof(*diag), 0, &pci_direction); + if (rc) + goto out; + + rc = pqi_submit_raid_request_synchronous(ctrl_info, &request.header, + 0, NULL, NO_TIMEOUT); + + pqi_pci_unmap(ctrl_info->pci_dev, request.sg_descriptors, 1, + pci_direction); +out: + kfree(diag); + + return rc; +} + static int pqi_write_host_wellness(struct pqi_ctrl_info *ctrl_info, void *buffer, size_t buffer_length) { @@ -6477,6 +6530,13 @@ static int pqi_ctrl_init(struct pqi_ctrl_info *ctrl_info) return rc; } + rc = pqi_set_diag_rescan(ctrl_info); + if (rc) { + dev_err(&ctrl_info->pci_dev->dev, + "error enabling multi-lun rescan\n"); + return rc; + } + rc = pqi_write_driver_version_to_host_wellness(ctrl_info); if (rc) { dev_err(&ctrl_info->pci_dev->dev, @@ -6583,6 +6643,13 @@ static int pqi_ctrl_init_resume(struct pqi_ctrl_info *ctrl_info) return rc; } + rc = pqi_set_diag_rescan(ctrl_info); + if (rc) { + dev_err(&ctrl_info->pci_dev->dev, + "error enabling multi-lun rescan\n"); + return rc; + } + rc = pqi_write_driver_version_to_host_wellness(ctrl_info); if (rc) { dev_err(&ctrl_info->pci_dev->dev,