From patchwork Fri Dec 7 22:28:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Don Brace X-Patchwork-Id: 10718945 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 5133C109C for ; Fri, 7 Dec 2018 22:28:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3D9372DA7C for ; Fri, 7 Dec 2018 22:28:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 307312F73E; Fri, 7 Dec 2018 22:28:24 +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 298E52DA7C for ; Fri, 7 Dec 2018 22:28:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726076AbeLGW2W (ORCPT ); Fri, 7 Dec 2018 17:28:22 -0500 Received: from mail-eopbgr740048.outbound.protection.outlook.com ([40.107.74.48]:56192 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726008AbeLGW2W (ORCPT ); Fri, 7 Dec 2018 17:28:22 -0500 Received: from MWHPR19CA0067.namprd19.prod.outlook.com (2603:10b6:300:94::29) by CY4PR19MB0935.namprd19.prod.outlook.com (2603:10b6:903:a9::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1404.20; Fri, 7 Dec 2018 22:28:12 +0000 Received: from BY2FFO11FD019.protection.gbl (2a01:111:f400:7c0c::185) by MWHPR19CA0067.outlook.office365.com (2603:10b6:300:94::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1404.19 via Frontend Transport; Fri, 7 Dec 2018 22:28:12 +0000 Authentication-Results: spf=pass (sender IP is 208.19.99.221) 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.221 as permitted sender) receiver=protection.outlook.com; client-ip=208.19.99.221; helo=AUSMBX1.microsemi.net; Received: from AUSMBX1.microsemi.net (208.19.99.221) by BY2FFO11FD019.mail.protection.outlook.com (10.1.14.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.1404.13 via Frontend Transport; Fri, 7 Dec 2018 22:28:12 +0000 Received: from AUSMBX2.microsemi.net (10.201.34.32) by AUSMBX1.microsemi.net (10.201.34.31) 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:11 -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:10 -0600 Subject: [PATCH 01/20] smartpqi: add support for PQI Config Table handshake From: Don Brace To: , , , , , , , , , , , CC: Date: Fri, 7 Dec 2018 16:28:10 -0600 Message-ID: <154422169082.1218.12309135947267907976.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.221;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(7916004)(346002)(136003)(39860400002)(396003)(376002)(2980300002)(199004)(189003)(356004)(50466002)(4744004)(8936002)(8676002)(110136005)(16576012)(316002)(81166006)(53936002)(44832011)(58126008)(230700001)(81156014)(486006)(478600001)(2201001)(14444005)(446003)(575784001)(476003)(126002)(86362001)(106002)(11346002)(33716001)(106466001)(305945005)(77096007)(26005)(186003)(69596002)(103116003)(2906002)(4326008)(5660300001)(9686003)(33896004)(47776003)(336012)(97736004)(68736007)(23676004)(2486003)(76176011)(921003)(1121003)(83996005)(2101003);DIR:OUT;SFP:1101;SCL:1;SRVR:CY4PR19MB0935;H:AUSMBX1.microsemi.net;FPR:;SPF:Pass;LANG:en;PTR:InfoDomainNonexistent;A:1;MX:1; X-Microsoft-Exchange-Diagnostics: 1;BY2FFO11FD019;1:otHtHh4vUn1mWs1u1DRBHPgEh+M65i3MXBkG1e7Mc/d5xCtKgF9jphdz2QF0uEjrPD5uIw5PbKaw8kXzrDRduYSAFoLB2EBBZUeCHrUqH0Tfc/t3TknpYZwg+0sd//ot X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 515a730e-ce8f-4801-1bb1-08d65c934601 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390098)(7020095)(4652040)(8989299)(5600074)(711020)(4608076)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060);SRVR:CY4PR19MB0935; X-Microsoft-Exchange-Diagnostics: 1;CY4PR19MB0935;3:cGGMuXW15cOfF1yNdfz9G7t3dwMzT/DxSvU4R09tqj8tOCJBD8qhGoedtaRk8YaBHWnzha4+erBhQauM3X3eSc5064oUpWMCXlc3bD2xmlnjjSd7SZVjsPhG4Wu//iOEPAghsCdk+PAXGFmTWqd0z/rxqxk/0CXVMZam1RfEOldI6+QGk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oyTendTXWrAnxmcQ3iz+mvuHTgmehzPtRkJdT2Hhoh/NSIQxb5ajkJxfKVu9tsni1f75+QYQSjI4Fxao6Y0Y7FtXMbF9WZ8akluPY0r0BkV/KL0PFqf/GIr1eGZKvgaCQgXSWAagpZi4DBe4LbshDfYU1jsuCtMxAtw2dHH5MZDGVQyDN6D130cx4Yx3xGp/k+QjlCPS35dTEr54C0pkj5GEYAR9xdWPjOBf6wtIivkUnI7JfwObVdbjdjHcTsE1n9PohEMJ+YAutFLrTX8SSTI13cY1id 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)(3231455)(999002)(944501520)(52105112)(93006095)(93004095)(3002001)(10201501046)(6055026)(148016)(149066)(150057)(6041310)(20161123564045)(20161123560045)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051)(76991095);SRVR:CY4PR19MB0935;BCL:0;PCL:0;RULEID:;SRVR:CY4PR19MB0935; X-Microsoft-Exchange-Diagnostics: 1;CY4PR19MB0935;4:CYetOXFftFcvw+P4N+e7u0BNTHi7pr4QA8XZ2EZ3cmjK5BT/eJHMtPU9Rr/xSOeab/BspiMFfCiHcVb2r9ZEun366CL/mOdhlDzbBmFMfiTq4+bzSiHdGBqC0oODpDNj6DABdpx9QRxptOBgocxITDrg3txv/hswQzivEfjfYQbOGQ6AOHkQBqApPOfhbuTihFBs08uKRPnXT+2GLD6BTXbAit+xwaFUHzRLOqPMJBybTazfalyTLZ4lhSTpY/jGmkJkvk2afB0nC91UJM3b0Q== X-Forefront-PRVS: 0879599414 X-Microsoft-Exchange-Diagnostics: =?utf-8?q?1=3BCY4PR19MB0935=3B23=3AQ0EP2Hm?= =?utf-8?q?XT5HCTcFrzZK9Hk20QECejDHV3F4rocCS746iqrWIP/QU9XAAEyXya+pD+KYpUTd+?= =?utf-8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U66X2i+HeNZ3IdpBiZGT+YogAjVL3jucTWKmPhcVFJqie4KBUJoqMfqo/Dp983PnxN6FT8PPSeGn6irjbDwv3KFu8psFyyE/8lkHUTSGEp2ZRnlzd485dGj39gdmyP5q7MJLckWiY3e3EegtLHfZdu5kw8ihPw==;5:fdVmnaDfdTtLWeF7pf5srfGLcIalaAhQ80+ZcqAgyq+gWa3xejWIOiD6e3LYcc8WSygl1ZEzF7nrkTcMZGyYtzDf3QlkAi3erUaVzQ7yTlWoIRKwPvcFjm40EBehDZkByP/2otNCbwx6GIsCCSXOd6ExFDI5tn9QaRKw2CnfvWY=;7:Fti7UNIdAypxZZ4+K5o9IITRpqmqzwdpz5wT6/wogBUfhbKe1gVenWc8xrU6N+3BJbE/Ze25y2ao+8fuB6lP9LJAZKdspecT1bbI/ruylZx8Cm1fLr5TWuYcoWN4t971caZCEVTNWmbhuLwiyVWIqw== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: microsemi.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Dec 2018 22:28:12.2679 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 515a730e-ce8f-4801-1bb1-08d65c934601 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.221];Helo=[AUSMBX1.microsemi.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR19MB0935 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: Kevin Barnett Add support for new IUs and parsing of the Firmware Features section of the PQI Config Table to implement the "handshake" between the driver and firmware to communicate firmware features supported and enabled by the driver. Reviewed-by: Ajish Koshy Reviewed-by: Mahesh Rajashekhara Reviewed-by: Murthy Bhat Reviewed-by: Justin Lindley Reviewed-by: Scott Teel Signed-off-by: Kevin Barnett Signed-off-by: Don Brace --- drivers/scsi/smartpqi/smartpqi.h | 43 ++++++ drivers/scsi/smartpqi/smartpqi_init.c | 254 ++++++++++++++++++++++++++++++++- 2 files changed, 293 insertions(+), 4 deletions(-) diff --git a/drivers/scsi/smartpqi/smartpqi.h b/drivers/scsi/smartpqi/smartpqi.h index e97bf2670315..bbf056ddd026 100644 --- a/drivers/scsi/smartpqi/smartpqi.h +++ b/drivers/scsi/smartpqi/smartpqi.h @@ -389,6 +389,35 @@ struct pqi_task_management_response { u8 response_code; }; +struct pqi_vendor_general_request { + struct pqi_iu_header header; + __le16 request_id; + __le16 function_code; + union { + struct { + __le16 first_section; + __le16 last_section; + u8 reserved[48]; + } config_table_update; + + struct { + __le64 buffer_address; + __le32 buffer_length; + u8 reserved[40]; + } ofa_memory_allocation; + } data; +}; + +struct pqi_vendor_general_response { + struct pqi_iu_header header; + __le16 request_id; + __le16 function_code; + __le16 status; + u8 reserved[2]; +}; + +#define PQI_VENDOR_GENERAL_CONFIG_TABLE_UPDATE 0 + struct pqi_aio_error_info { u8 status; u8 service_response; @@ -419,6 +448,7 @@ struct pqi_raid_error_info { #define PQI_REQUEST_IU_GENERAL_ADMIN 0x60 #define PQI_REQUEST_IU_REPORT_VENDOR_EVENT_CONFIG 0x72 #define PQI_REQUEST_IU_SET_VENDOR_EVENT_CONFIG 0x73 +#define PQI_REQUEST_IU_VENDOR_GENERAL 0x75 #define PQI_REQUEST_IU_ACKNOWLEDGE_VENDOR_EVENT 0xf6 #define PQI_RESPONSE_IU_GENERAL_MANAGEMENT 0x81 @@ -430,6 +460,7 @@ struct pqi_raid_error_info { #define PQI_RESPONSE_IU_AIO_PATH_IO_ERROR 0xf3 #define PQI_RESPONSE_IU_AIO_PATH_DISABLED 0xf4 #define PQI_RESPONSE_IU_VENDOR_EVENT 0xf5 +#define PQI_RESPONSE_IU_VENDOR_GENERAL 0xf7 #define PQI_GENERAL_ADMIN_FUNCTION_REPORT_DEVICE_CAPABILITY 0x0 #define PQI_GENERAL_ADMIN_FUNCTION_CREATE_IQ 0x10 @@ -644,6 +675,7 @@ struct pqi_encryption_info { #define PQI_CONFIG_TABLE_MAX_LENGTH ((u16)~0) /* configuration table section IDs */ +#define PQI_CONFIG_TABLE_ALL_SECTIONS (-1) #define PQI_CONFIG_TABLE_SECTION_GENERAL_INFO 0 #define PQI_CONFIG_TABLE_SECTION_FIRMWARE_FEATURES 1 #define PQI_CONFIG_TABLE_SECTION_FIRMWARE_ERRATA 2 @@ -680,6 +712,17 @@ struct pqi_config_table_general_info { /* command */ }; +struct pqi_config_table_firmware_features { + struct pqi_config_table_section_header header; + __le16 num_elements; + u8 features_supported[]; +/* u8 features_requested_by_host[]; */ +/* u8 features_enabled[]; */ +}; + +#define PQI_FIRMWARE_FEATURE_OFA 0 +#define PQI_FIRMWARE_FEATURE_SMP 1 + struct pqi_config_table_debug { struct pqi_config_table_section_header header; __le32 scratchpad; diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c index a25a07a0b7f0..72e635cc594c 100644 --- a/drivers/scsi/smartpqi/smartpqi_init.c +++ b/drivers/scsi/smartpqi/smartpqi_init.c @@ -2706,6 +2706,12 @@ static unsigned int pqi_process_io_intr(struct pqi_ctrl_info *ctrl_info, case PQI_RESPONSE_IU_AIO_PATH_IO_SUCCESS: case PQI_RESPONSE_IU_GENERAL_MANAGEMENT: break; + case PQI_RESPONSE_IU_VENDOR_GENERAL: + io_request->status = + get_unaligned_le16( + &((struct pqi_vendor_general_response *) + response)->status); + break; case PQI_RESPONSE_IU_TASK_MANAGEMENT: io_request->status = pqi_interpret_task_management_response( @@ -5947,6 +5953,233 @@ static int pqi_get_ctrl_firmware_version(struct pqi_ctrl_info *ctrl_info) return rc; } +struct pqi_config_table_section_info { + struct pqi_ctrl_info *ctrl_info; + void *section; + u32 section_offset; + void __iomem *section_iomem_addr; +}; + +static inline bool pqi_is_firmware_feature_supported( + struct pqi_config_table_firmware_features *firmware_features, + unsigned int bit_position) +{ + unsigned int byte_index; + + byte_index = bit_position / BITS_PER_BYTE; + + if (byte_index >= le16_to_cpu(firmware_features->num_elements)) + return false; + + return firmware_features->features_supported[byte_index] & + (1 << (bit_position % BITS_PER_BYTE)) ? true : false; +} + +static inline bool pqi_is_firmware_feature_enabled( + struct pqi_config_table_firmware_features *firmware_features, + void __iomem *firmware_features_iomem_addr, + unsigned int bit_position) +{ + unsigned int byte_index; + u8 __iomem *features_enabled_iomem_addr; + + byte_index = (bit_position / BITS_PER_BYTE) + + (le16_to_cpu(firmware_features->num_elements) * 2); + + features_enabled_iomem_addr = firmware_features_iomem_addr + + offsetof(struct pqi_config_table_firmware_features, + features_supported) + byte_index; + + return *((__force u8 *)features_enabled_iomem_addr) & + (1 << (bit_position % BITS_PER_BYTE)) ? true : false; +} + +static inline void pqi_request_firmware_feature( + struct pqi_config_table_firmware_features *firmware_features, + unsigned int bit_position) +{ + unsigned int byte_index; + + byte_index = (bit_position / BITS_PER_BYTE) + + le16_to_cpu(firmware_features->num_elements); + + firmware_features->features_supported[byte_index] |= + (1 << (bit_position % BITS_PER_BYTE)); +} + +static int pqi_config_table_update(struct pqi_ctrl_info *ctrl_info, + u16 first_section, u16 last_section) +{ + struct pqi_vendor_general_request request; + + memset(&request, 0, sizeof(request)); + + request.header.iu_type = PQI_REQUEST_IU_VENDOR_GENERAL; + put_unaligned_le16(sizeof(request) - PQI_REQUEST_HEADER_LENGTH, + &request.header.iu_length); + put_unaligned_le16(PQI_VENDOR_GENERAL_CONFIG_TABLE_UPDATE, + &request.function_code); + put_unaligned_le16(first_section, + &request.data.config_table_update.first_section); + put_unaligned_le16(last_section, + &request.data.config_table_update.last_section); + + return pqi_submit_raid_request_synchronous(ctrl_info, &request.header, + 0, NULL, NO_TIMEOUT); +} + +static int pqi_enable_firmware_features(struct pqi_ctrl_info *ctrl_info, + struct pqi_config_table_firmware_features *firmware_features, + void __iomem *firmware_features_iomem_addr) +{ + void *features_requested; + void __iomem *features_requested_iomem_addr; + + features_requested = firmware_features->features_supported + + le16_to_cpu(firmware_features->num_elements); + + features_requested_iomem_addr = firmware_features_iomem_addr + + (features_requested - (void *)firmware_features); + + memcpy_toio(features_requested_iomem_addr, features_requested, + le16_to_cpu(firmware_features->num_elements)); + + return pqi_config_table_update(ctrl_info, + PQI_CONFIG_TABLE_SECTION_FIRMWARE_FEATURES, + PQI_CONFIG_TABLE_SECTION_FIRMWARE_FEATURES); +} + +struct pqi_firmware_feature { + char *feature_name; + unsigned int feature_bit; + bool supported; + bool enabled; + void (*feature_status)(struct pqi_ctrl_info *ctrl_info, + struct pqi_firmware_feature *firmware_feature); +}; + +static void pqi_firmware_feature_status(struct pqi_ctrl_info *ctrl_info, + struct pqi_firmware_feature *firmware_feature) +{ + if (!firmware_feature->supported) { + dev_info(&ctrl_info->pci_dev->dev, "%s not supported by controller\n", + firmware_feature->feature_name); + return; + } + + if (firmware_feature->enabled) { + dev_info(&ctrl_info->pci_dev->dev, + "%s enabled\n", firmware_feature->feature_name); + return; + } + + dev_err(&ctrl_info->pci_dev->dev, "failed to enable %s\n", + firmware_feature->feature_name); +} + +static inline void pqi_firmware_feature_update(struct pqi_ctrl_info *ctrl_info, + struct pqi_firmware_feature *firmware_feature) +{ + if (firmware_feature->feature_status) + firmware_feature->feature_status(ctrl_info, firmware_feature); +} + +static DEFINE_MUTEX(pqi_firmware_features_mutex); + +static struct pqi_firmware_feature pqi_firmware_features[] = { + { + .feature_name = "Online Firmware Activation", + .feature_bit = PQI_FIRMWARE_FEATURE_OFA, + .feature_status = pqi_firmware_feature_status, + }, + { + .feature_name = "Serial Management Protocol", + .feature_bit = PQI_FIRMWARE_FEATURE_SMP, + .feature_status = pqi_firmware_feature_status, + }, +}; + +static void pqi_process_firmware_features( + struct pqi_config_table_section_info *section_info) +{ + int rc; + struct pqi_ctrl_info *ctrl_info; + struct pqi_config_table_firmware_features *firmware_features; + void __iomem *firmware_features_iomem_addr; + unsigned int i; + unsigned int num_features_supported; + + ctrl_info = section_info->ctrl_info; + firmware_features = section_info->section; + firmware_features_iomem_addr = section_info->section_iomem_addr; + + for (i = 0, num_features_supported = 0; + i < ARRAY_SIZE(pqi_firmware_features); i++) { + if (pqi_is_firmware_feature_supported(firmware_features, + pqi_firmware_features[i].feature_bit)) { + pqi_firmware_features[i].supported = true; + num_features_supported++; + } else { + pqi_firmware_feature_update(ctrl_info, + &pqi_firmware_features[i]); + } + } + + if (num_features_supported == 0) + return; + + for (i = 0; i < ARRAY_SIZE(pqi_firmware_features); i++) { + if (!pqi_firmware_features[i].supported) + continue; + pqi_request_firmware_feature(firmware_features, + pqi_firmware_features[i].feature_bit); + } + + rc = pqi_enable_firmware_features(ctrl_info, firmware_features, + firmware_features_iomem_addr); + if (rc) { + dev_err(&ctrl_info->pci_dev->dev, + "failed to enable firmware features in PQI configuration table\n"); + for (i = 0; i < ARRAY_SIZE(pqi_firmware_features); i++) { + if (!pqi_firmware_features[i].supported) + continue; + pqi_firmware_feature_update(ctrl_info, + &pqi_firmware_features[i]); + } + return; + } + + for (i = 0; i < ARRAY_SIZE(pqi_firmware_features); i++) { + if (!pqi_firmware_features[i].supported) + continue; + if (pqi_is_firmware_feature_enabled(firmware_features, + firmware_features_iomem_addr, + pqi_firmware_features[i].feature_bit)) + pqi_firmware_features[i].enabled = true; + pqi_firmware_feature_update(ctrl_info, + &pqi_firmware_features[i]); + } +} + +static void pqi_init_firmware_features(void) +{ + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(pqi_firmware_features); i++) { + pqi_firmware_features[i].supported = false; + pqi_firmware_features[i].enabled = false; + } +} + +static void pqi_process_firmware_features_section( + struct pqi_config_table_section_info *section_info) +{ + mutex_lock(&pqi_firmware_features_mutex); + pqi_init_firmware_features(); + pqi_process_firmware_features(section_info); + mutex_unlock(&pqi_firmware_features_mutex); +} + static int pqi_process_config_table(struct pqi_ctrl_info *ctrl_info) { u32 table_length; @@ -5954,8 +6187,11 @@ static int pqi_process_config_table(struct pqi_ctrl_info *ctrl_info) void __iomem *table_iomem_addr; struct pqi_config_table *config_table; struct pqi_config_table_section_header *section; + struct pqi_config_table_section_info section_info; table_length = ctrl_info->config_table_length; + if (table_length == 0) + return 0; config_table = kmalloc(table_length, GFP_KERNEL); if (!config_table) { @@ -5972,13 +6208,22 @@ static int pqi_process_config_table(struct pqi_ctrl_info *ctrl_info) ctrl_info->config_table_offset; memcpy_fromio(config_table, table_iomem_addr, table_length); + section_info.ctrl_info = ctrl_info; section_offset = get_unaligned_le32(&config_table->first_section_offset); while (section_offset) { section = (void *)config_table + section_offset; + section_info.section = section; + section_info.section_offset = section_offset; + section_info.section_iomem_addr = + table_iomem_addr + section_offset; + switch (get_unaligned_le16(§ion->section_id)) { + case PQI_CONFIG_TABLE_SECTION_FIRMWARE_FEATURES: + pqi_process_firmware_features_section(§ion_info); + break; case PQI_CONFIG_TABLE_SECTION_HEARTBEAT: if (pqi_disable_heartbeat) dev_warn(&ctrl_info->pci_dev->dev, @@ -6123,10 +6368,6 @@ static int pqi_ctrl_init(struct pqi_ctrl_info *ctrl_info) ctrl_info->pqi_mode_enabled = true; pqi_save_ctrl_mode(ctrl_info, PQI_MODE); - rc = pqi_process_config_table(ctrl_info); - if (rc) - return rc; - rc = pqi_alloc_admin_queues(ctrl_info); if (rc) { dev_err(&ctrl_info->pci_dev->dev, @@ -6188,6 +6429,11 @@ static int pqi_ctrl_init(struct pqi_ctrl_info *ctrl_info) pqi_change_irq_mode(ctrl_info, IRQ_MODE_MSIX); ctrl_info->controller_online = true; + + rc = pqi_process_config_table(ctrl_info); + if (rc) + return rc; + pqi_start_heartbeat_timer(ctrl_info); rc = pqi_enable_events(ctrl_info); From patchwork Fri Dec 7 22:28:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Don Brace X-Patchwork-Id: 10718961 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 0AFE4109C for ; Fri, 7 Dec 2018 22:29:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EB9712D8A2 for ; Fri, 7 Dec 2018 22:29:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DF4B12DA76; Fri, 7 Dec 2018 22:29:03 +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 6CE342DA59 for ; Fri, 7 Dec 2018 22:29:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726090AbeLGW3D (ORCPT ); Fri, 7 Dec 2018 17:29:03 -0500 Received: from mail-eopbgr710083.outbound.protection.outlook.com ([40.107.71.83]:48192 "EHLO NAM05-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726041AbeLGW3C (ORCPT ); Fri, 7 Dec 2018 17:29:02 -0500 Received: from BL2PR19CA0021.namprd19.prod.outlook.com (2603:10b6:201:f::31) by BLUPR19MB0404.namprd19.prod.outlook.com (2a01:111:e400:c470::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1404.21; Fri, 7 Dec 2018 22:28:19 +0000 Received: from BY2FFO11FD014.protection.gbl (2a01:111:f400:7c0c::178) by BL2PR19CA0021.outlook.office365.com (2603:10b6:201:f::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1404.19 via Frontend Transport; Fri, 7 Dec 2018 22:28:19 +0000 Authentication-Results: spf=pass (sender IP is 208.19.99.221) 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.221 as permitted sender) receiver=protection.outlook.com; client-ip=208.19.99.221; helo=AUSMBX1.microsemi.net; Received: from AUSMBX1.microsemi.net (208.19.99.221) by BY2FFO11FD014.mail.protection.outlook.com (10.1.14.76) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.1404.13 via Frontend Transport; Fri, 7 Dec 2018 22:28:18 +0000 Received: from AUSMBX2.microsemi.net (10.201.34.32) by AUSMBX1.microsemi.net (10.201.34.31) 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:17 -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:16 -0600 Subject: [PATCH 02/20] Add retries for device reset From: Don Brace To: , , , , , , , , , , , CC: Date: Fri, 7 Dec 2018 16:28:16 -0600 Message-ID: <154422169686.1218.16312393024655070834.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.221;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(7916004)(396003)(376002)(39850400004)(136003)(346002)(2980300002)(189003)(199004)(53936002)(8676002)(81156014)(81166006)(305945005)(8936002)(2201001)(9686003)(5660300001)(86362001)(106002)(110136005)(58126008)(316002)(103116003)(4326008)(230700001)(2906002)(478600001)(69596002)(33716001)(16576012)(97736004)(2486003)(23676004)(106466001)(47776003)(50466002)(336012)(14444005)(356004)(446003)(44832011)(476003)(26005)(77096007)(68736007)(76176011)(33896004)(486006)(11346002)(126002)(186003)(921003)(2101003)(1121003)(83996005);DIR:OUT;SFP:1101;SCL:1;SRVR:BLUPR19MB0404;H:AUSMBX1.microsemi.net;FPR:;SPF:Pass;LANG:en;PTR:InfoDomainNonexistent;MX:1;A:1; X-Microsoft-Exchange-Diagnostics: 1;BY2FFO11FD014;1:4jiLcAPM/WdNqLmgJCj1oML0VhvO8AQ4SXjcQAr0uAASHB/prcOgNML3KuIf0HzjY5BkWX013kI8aUSTD5LfAD1YJ64b5S5J1LZaUj/9LbjWM99lb0gv88r8i2CKO3KM X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7543f788-f143-49e3-8430-08d65c9349e0 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390098)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4608076)(2017052603328)(7153060);SRVR:BLUPR19MB0404; X-Microsoft-Exchange-Diagnostics: 1;BLUPR19MB0404;3:W90T3zDck+drfjnxirldITVk2fG/wr75vbY42nWhc1iOa3fbiLrUAPKJcDOBGOwK7WaQHJkfjVPbDXAGIXx3TGEwgwchSEUhNsS06m8VYRfLX5MdJundIHKMnG5IazPF/G5CU1pVSUlzAjl6NFv9/TiT2jaLyZwA73GkvwEcAwTp9tgbiBmdpmemDzqrS/SBJ9YTdmH7K7e9QD/ybM7fG1De/8uf6F+Ak9NJZIeA+0KGKqZ5MBCqYCd2jVEDJ8U2Eub3HW0mSbEtyl1LWMevzR5iob4Rju+OnF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sgZCvvOw5VuGKy9itCjXHzxklcg2zWYVuKPpIUAnINYTyLzKeSCpkvvA61msN3Sa2hBQ/uOx4j4oq4/3F55bXnz59Ypzk4YctIxDwNAShsSfCDEIjAL3QhuczeIMkCO5isZNjYJbB+IbBvfil3TAyZ5GsKiTLYQSx8VAuv2RktEqF7W0ouidmHY5F X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3231455)(999002)(944501520)(52105112)(93006095)(93004095)(3002001)(10201501046)(6055026)(148016)(149066)(150057)(6041310)(20161123564045)(20161123560045)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051)(76991095);SRVR:BLUPR19MB0404;BCL:0;PCL:0;RULEID:;SRVR:BLUPR19MB0404; X-Microsoft-Exchange-Diagnostics: 1;BLUPR19MB0404;4:jzyYAXcIIpxb67f0Nw2qkm0q61FShCTu94QwfY2YZ137dGBymu2bKXwNPoeZBpSQVpXzgUJB92+P3rj1aWmhIvAo09F+fgnLeb/iC0VXsQScLoM9chH4BU4F4qHJd4qnNdRW3kFNtcz+4/DwyqPZ0juw2y1h2GHX1K4L629C/2KYkTNzlKQ5BKNVSkULxI+AG7tYvbou6TiqQPGxsrdqnWSVNydoTGazM1rS2mJU6oqOWesvmAeeTFxE8JUwvXi0VG7ZYO+YzmaW//G8FPkt1A== X-Forefront-PRVS: 0879599414 X-Microsoft-Exchange-Diagnostics: =?utf-8?q?1=3BBLUPR19MB0404=3B23=3Apw1LuGV?= =?utf-8?q?jbu5pMPVeS4HWgpnIa4bpDo6uOqf7+mkx/8H+v7CukSuDj9dyfzGD2dk5m7w0qbKh?= =?utf-8?q?cnt7z0QI2VWiQ7S4BmmKObupiTiCIXA4JJ4MmlR7CL5iJ9me49D/bjZ412jH8Hyil?= =?utf-8?q?tVxbNXkbncewjL1YxQM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5RQQklMBizxnZiFcLY66Ee/6EqosQgLGephQ==;5:lduQ9KMpic/A0ohKGKYyMKyHovzwnqkUWF9r8G8feaPmm68OYbCJoDrWLcbqyte0laVAABs/w67zxGlzQUIyykeveIuEZoxBMfagEOg1fgMytCL+iCv5lKgZJxue23ZkLX/apxh9Qm+nplpfN26jheTotGvonp7FmDYJZUEtXj4=;7:waTD87ArIV75Ofes44/MJ0yNkSHtLxC0ir06qCwCP1tDeSqmKGvew4r0GeLfHXhUP3x8ea7hie5+XP8CjBHWwW0Ht4TiRGCl65Quq/Y1dd/4gfoEkdhB26TrB6FO4S6Z1hUlhKJzDyNbZESuhIPHUA== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: microsemi.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Dec 2018 22:28:18.7339 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7543f788-f143-49e3-8430-08d65c9349e0 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.221];Helo=[AUSMBX1.microsemi.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR19MB0404 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: Mahesh Rajashekhara Reviewed-by: Ajish Koshy Reviewed-by: Murthy Bhat Reviewed-by: Justin Lindley Reviewed-by: Scott Benesh Reviewed-by: Dave Carroll Reviewed-by: Scott Teel Reviewed-by: Kevin Barnett Signed-off-by: Mahesh Rajashekhara Signed-off-by: Don Brace --- drivers/scsi/smartpqi/smartpqi.h | 1 + drivers/scsi/smartpqi/smartpqi_init.c | 14 +++++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/smartpqi/smartpqi.h b/drivers/scsi/smartpqi/smartpqi.h index bbf056ddd026..646982e45904 100644 --- a/drivers/scsi/smartpqi/smartpqi.h +++ b/drivers/scsi/smartpqi/smartpqi.h @@ -587,6 +587,7 @@ typedef u32 pqi_index_t; #define SOP_TASK_ATTRIBUTE_ACA 4 #define SOP_TMF_COMPLETE 0x0 +#define SOP_TMF_REJECTED 0x4 #define SOP_TMF_FUNCTION_SUCCEEDED 0x8 /* additional CDB bytes usage field codes */ diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c index 72e635cc594c..db95b1cb6889 100644 --- a/drivers/scsi/smartpqi/smartpqi_init.c +++ b/drivers/scsi/smartpqi/smartpqi_init.c @@ -2665,6 +2665,9 @@ static int pqi_interpret_task_management_response( case SOP_TMF_FUNCTION_SUCCEEDED: rc = 0; break; + case SOP_TMF_REJECTED: + rc = -EAGAIN; + break; default: rc = -EIO; break; @@ -5218,14 +5221,23 @@ static int pqi_lun_reset(struct pqi_ctrl_info *ctrl_info, return rc; } +#define PQI_LUN_RESET_RETRIES 3 +#define PQI_LUN_RESET_RETRY_INTERVAL_MSECS 10000 /* Performs a reset at the LUN level. */ static int pqi_device_reset(struct pqi_ctrl_info *ctrl_info, struct pqi_scsi_dev *device) { int rc; + unsigned int retries; - rc = pqi_lun_reset(ctrl_info, device); + for (retries = 0;;) { + rc = pqi_lun_reset(ctrl_info, device); + if (rc != -EAGAIN || + ++retries > PQI_LUN_RESET_RETRIES) + break; + msleep(PQI_LUN_RESET_RETRY_INTERVAL_MSECS); + } if (rc == 0) rc = pqi_device_wait_for_pending_io(ctrl_info, device); From patchwork Fri Dec 7 22:28:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Don Brace X-Patchwork-Id: 10718953 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 2D1B9109C for ; Fri, 7 Dec 2018 22:28:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1A9902D8A2 for ; Fri, 7 Dec 2018 22:28:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0E0522DA76; Fri, 7 Dec 2018 22:28:45 +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 931772D8A2 for ; Fri, 7 Dec 2018 22:28:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726076AbeLGW2o (ORCPT ); Fri, 7 Dec 2018 17:28:44 -0500 Received: from mail-eopbgr770071.outbound.protection.outlook.com ([40.107.77.71]:31455 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726008AbeLGW2o (ORCPT ); Fri, 7 Dec 2018 17:28:44 -0500 Received: from BN6PR19CA0073.namprd19.prod.outlook.com (2603:10b6:404:133::11) by DM5PR19MB0940.namprd19.prod.outlook.com (2603:10b6:3:32::14) 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:25 +0000 Received: from BN1AFFO11FD015.protection.gbl (2a01:111:f400:7c10::136) by BN6PR19CA0073.outlook.office365.com (2603:10b6:404:133::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1404.19 via Frontend Transport; Fri, 7 Dec 2018 22:28:25 +0000 Authentication-Results: spf=pass (sender IP is 208.19.99.221) 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.221 as permitted sender) receiver=protection.outlook.com; client-ip=208.19.99.221; helo=AUSMBX1.microsemi.net; Received: from AUSMBX1.microsemi.net (208.19.99.221) by BN1AFFO11FD015.mail.protection.outlook.com (10.58.52.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.1404.13 via Frontend Transport; Fri, 7 Dec 2018 22:28:24 +0000 Received: from AUSMBX2.microsemi.net (10.201.34.32) by AUSMBX1.microsemi.net (10.201.34.31) 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:23 -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:23 -0600 Subject: [PATCH 03/20] smartpqi: add no_write_same for logical volumes From: Don Brace To: , , , , , , , , , , , CC: Date: Fri, 7 Dec 2018 16:28:23 -0600 Message-ID: <154422170303.1218.5869815246528180397.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.221;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(7916004)(136003)(346002)(396003)(39860400002)(376002)(2980300002)(189003)(199004)(86362001)(186003)(336012)(486006)(356004)(446003)(11346002)(26005)(476003)(77096007)(2201001)(126002)(230700001)(44832011)(305945005)(2906002)(478600001)(103116003)(16576012)(110136005)(58126008)(106002)(69596002)(47776003)(76176011)(5660300001)(33896004)(50466002)(14444005)(2486003)(23676004)(316002)(8676002)(33716001)(106466001)(4326008)(8936002)(81156014)(81166006)(53936002)(9686003)(68736007)(97736004)(921003)(83996005)(2101003)(1121003);DIR:OUT;SFP:1101;SCL:1;SRVR:DM5PR19MB0940;H:AUSMBX1.microsemi.net;FPR:;SPF:Pass;LANG:en;PTR:InfoDomainNonexistent;MX:1;A:1; X-Microsoft-Exchange-Diagnostics: 1;BN1AFFO11FD015;1:UPPA1dkPA7uTypuKQoyFy3JWbz0bKjyrA45RatkBCxFM3R2dT5+ABesjsFaMyGNRzEKUerRw/wVhdZuutd0eP6MhSpIjBsSWqBK7bLYkK73m/498DZeQWaW35+sqixVp X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d404dd67-82c8-42ae-d554-08d65c934d86 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390098)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4608076)(2017052603328)(7153060);SRVR:DM5PR19MB0940; X-Microsoft-Exchange-Diagnostics: 1;DM5PR19MB0940;3:gZv4iF72CRhtF3WAIeMicaCEZBnvOvlrokaoxrCP48ftqBiBThzuDThzzHRhh6BwEzag5qBLvi767gD/qaJYYKztMrY5wRiqXucRF6FbNMrgPdfDeVNmLX/G84VUd1GcZ/xt4wj1rqDmfyjZyuMpC1VFJ0vsuilt0q6mvmQysvF4zsM7gCuS+3P6X6cr50LHo5R4aaoSUYhjRsZxlEkIsUzQa5UIJ7+XkuH+OlbmFvZUMsUuvizw/GCE3kWMnCpboZkeO828KoPSqXNlzMsUbJsXU+64FLO1eWWmHJDXLV0WWW6hFt+tcwZx5LEYO+YgEHWEn8P25ScZlm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Ccc7KGTwdUiki1nA6YnJyqmDSvKKTRGWND8R8KGCdR7NRGQ6SBJt/+Tfyk/ypGFb0ONzUAYGhgK4yxQl3y6XZEJNqWJXVbXdo24FrXkVu8g9PYOYlG3adAv2kgf0IlQxv8EveGLq X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3002001)(93006095)(93004095)(3231455)(999002)(944501520)(52105112)(10201501046)(6055026)(148016)(149066)(150057)(6041310)(20161123558120)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(201708071742011)(7699051)(76991095);SRVR:DM5PR19MB0940;BCL:0;PCL:0;RULEID:;SRVR:DM5PR19MB0940; X-Microsoft-Exchange-Diagnostics: 1;DM5PR19MB0940;4:tzG0Rb9O++2tW2qIE65f/pXpRcPh1/qwqpKY4PA2tGHv6vUBayVq2BUSavRuzbX6+SEPw+ZnY+eGtWZeEPFc9yuUbt5EcZBfl25Rp1mj+6ib2wNa3+P/vD0Z+JxRknx21wkN3mCnf8HIestu4lihltcBOv8wi09q+1xnVu/9rY3L9dKRXgjeHTQ79g7PmAiYVm2MzdMt0uMASejUvb3+eMn6LwzBST0+8MteAQEpSd2lfSzeipFVeh9LkVJIGZdQbF5d2q7QvOIZw0V1rQc5Uw== X-Forefront-PRVS: 0879599414 X-Microsoft-Exchange-Diagnostics: =?utf-8?q?1=3BDM5PR19MB0940=3B23=3A9Ugxl4t?= =?utf-8?q?GytLZnLGhs5pNMCnj7s8bLNDzQ4NyrJc/BE1pfJwcjdVUGBXmeuboM9T4Lam6UfpI?= =?utf-8?q?p5Fmd0MgxZz7Bhkr4eCJV/TZX6eD6dPByJ81MKHyGMGkJdxebEUW/PJIgV+5AfzRL?= =?utf-8?q?hJ/T1BeVVNUcIXGAQxigL8W+JfoypElnNJFicmjtu5teVHqysJnLJAeorfm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wCmhIbqPKI/U5pbEh1Q7Xhu0DkmyLsL48qWIcKnd07wu6NvIRbNI9Q0h4EuoOdl9rl/FoAlo+er6X6G62dor190SlgZbNRpiwvsNCRaKZNE7MwBscyTgJQRA+PPVWEYP3qHrRXlMg/dyt789ro4cE/Uj9btQIZlujukMw=;7:CSAsgDLAGb1HXKfDNHeVsNz0oNe1PP8ExwpHDvL1Zt94BzkEOqIlZmNo3MOSUusoqJU8rpEuty4Ju/f7dwH74/tWRERnzQmU1a8VFTOeaidESoqyUAz0EUtTCa3iVVJH8HVP0KRO0FJPEIVLnZdOzQ== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: microsemi.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Dec 2018 22:28:24.9040 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d404dd67-82c8-42ae-d554-08d65c934d86 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.221];Helo=[AUSMBX1.microsemi.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR19MB0940 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 During slave_alloc, for logical volumes include no_write_same into the scsi_device structure. This will insure that WRITE_SAME will not be used for LD's. Reviewed-by: Ajish Koshy Reviewed-by: Murthy Bhat Reviewed-by: Mahesh Rajashekhara Reviewed-by: Justin Lindley Reviewed-by: Scott Benesh Reviewed-by: Scott Teel Reviewed-by: Kevin Barnett Signed-off-by: Dave Carroll Signed-off-by: Don Brace --- drivers/scsi/smartpqi/smartpqi_init.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c index db95b1cb6889..8e68dba1c789 100644 --- a/drivers/scsi/smartpqi/smartpqi_init.c +++ b/drivers/scsi/smartpqi/smartpqi_init.c @@ -176,6 +176,11 @@ static inline void pqi_scsi_done(struct scsi_cmnd *scmd) scmd->scsi_done(scmd); } +static inline void pqi_disable_write_same(struct scsi_device *sdev) +{ + sdev->no_write_same = 1; +} + static inline bool pqi_scsi3addr_equal(u8 *scsi3addr1, u8 *scsi3addr2) { return memcmp(scsi3addr1, scsi3addr2, 8) == 0; @@ -5326,6 +5331,8 @@ static int pqi_slave_alloc(struct scsi_device *sdev) scsi_change_queue_depth(sdev, device->advertised_queue_depth); } + if (pqi_is_logical_device(device)) + pqi_disable_write_same(sdev); } spin_unlock_irqrestore(&ctrl_info->scsi_device_list_lock, flags); From patchwork Fri Dec 7 22:28:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Don Brace X-Patchwork-Id: 10718947 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 D62CB109C for ; Fri, 7 Dec 2018 22:28:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C5BB22DA7C for ; Fri, 7 Dec 2018 22:28:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B93632F73E; Fri, 7 Dec 2018 22:28:35 +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 5556A2DA7C for ; Fri, 7 Dec 2018 22:28:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726110AbeLGW2f (ORCPT ); Fri, 7 Dec 2018 17:28:35 -0500 Received: from mail-eopbgr770043.outbound.protection.outlook.com ([40.107.77.43]:64916 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726076AbeLGW2e (ORCPT ); Fri, 7 Dec 2018 17:28:34 -0500 Received: from MWHPR19CA0019.namprd19.prod.outlook.com (2603:10b6:300:d4::29) by BLUPR19MB0402.namprd19.prod.outlook.com (2a01:111:e400:c470::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1404.21; Fri, 7 Dec 2018 22:28:31 +0000 Received: from BN1AFFO11FD021.protection.gbl (2a01:111:f400:7c10::110) by MWHPR19CA0019.outlook.office365.com (2603:10b6:300:d4::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1404.17 via Frontend Transport; Fri, 7 Dec 2018 22:28:31 +0000 Authentication-Results: spf=pass (sender IP is 208.19.99.221) 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.221 as permitted sender) receiver=protection.outlook.com; client-ip=208.19.99.221; helo=AUSMBX1.microsemi.net; Received: from AUSMBX1.microsemi.net (208.19.99.221) by BN1AFFO11FD021.mail.protection.outlook.com (10.58.52.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.1404.13 via Frontend Transport; Fri, 7 Dec 2018 22:28:30 +0000 Received: from AUSMBX2.microsemi.net (10.201.34.32) by AUSMBX1.microsemi.net (10.201.34.31) 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:29 -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:29 -0600 Subject: [PATCH 04/20] smartpqi: correct host serial num for ssa From: Don Brace To: , , , , , , , , , , , CC: Date: Fri, 7 Dec 2018 16:28:29 -0600 Message-ID: <154422170921.1218.9790759541295356684.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.221;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(7916004)(396003)(376002)(136003)(39860400002)(346002)(2980300002)(189003)(199004)(47776003)(106466001)(230700001)(53936002)(81166006)(103116003)(8936002)(81156014)(9686003)(478600001)(69596002)(8676002)(68736007)(50466002)(4326008)(97736004)(33716001)(2486003)(186003)(76176011)(26005)(33896004)(305945005)(77096007)(2201001)(476003)(486006)(2906002)(5660300001)(446003)(11346002)(126002)(86362001)(106002)(58126008)(110136005)(23676004)(16576012)(356004)(44832011)(316002)(336012)(921003)(1121003)(83996005)(2101003);DIR:OUT;SFP:1101;SCL:1;SRVR:BLUPR19MB0402;H:AUSMBX1.microsemi.net;FPR:;SPF:Pass;LANG:en;PTR:InfoDomainNonexistent;MX:1;A:1; X-Microsoft-Exchange-Diagnostics: 1;BN1AFFO11FD021;1:2XpA35WyBcc5n/LTWYdmBXTljBbFnUm1oRQSN+ALHFPAInxzRGgZD5gKPqLQbK/pEZ/VEGjvKYatHPyHy5UUEcCcNRMbUwX0PSuKI1GnDjrj2X7eTySswdUTpLgVnGXG X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a351cf70-3e43-400b-15a6-08d65c935106 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390098)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4608076)(2017052603328)(7153060);SRVR:BLUPR19MB0402; X-Microsoft-Exchange-Diagnostics: 1;BLUPR19MB0402;3:zJtyxPLnNUPGXgDn+OmjtBIlBMOlZ9hXlS81ghmntwjjf/pr85skXOfUfgpQTxfafOoUA808vlvTvy2ld/UwOr6+nAwgwfdR90ylZEGgkvPRigXmP2RKmg2bBkAeULEsm6kY8zcYLFYIrG4I/GWLcnSoXCA2CdhPjBdwry78yizkWWgxSfPtNprYjx40MI3OoKJ5qXaQJM83kRO0Js6luIRSj6sAucamg29vGL5V3VgCKaUhcC1C5zCaK0ENRGeN5zUhnf61zYtuB+tGV8LwDU9e9oel+u6B2tzIb2lkASU/kBlqCNG+NNNmHgNo0C5ve8UT+ZMJE/lhMRl75UVA/jmn/AMf1f680SrjXifVE7I=;25:vpg+maLblJSTYkGUJPuBRQ06i9eMyu2CxEKCin0zoS41TsShQlaRyNsOTcNImngaa8ZjcxJaxotOyqRlP6XeyK75O4kFiPB1kFhZxgYOrXjdofPiJdhAksfY7TCOXbkZ7YrtWdgGimFXPvEPjpK6QFhtPSc1K2ByU1uq2XVN/Ehw0MZJspxFmjmjJ6Q7DVVLgLjJX3oVgvHe3qvs9O2u4jRITM13FPqOXwVn+5cPzON/1XMRhb8gmZsYt8hRqDx9u4Bd/Nz1QCh6RYqO/3PsSR0lHsFC82harrOhXNlztvwhf2tSOJ77g9C7w5dpNH8KRahfgbY5pmE+d2sPBw0/0LcGcRQbXZhnzeWjNNpLnVE= X-MS-TrafficTypeDiagnostic: BLUPR19MB0402: X-Microsoft-Exchange-Diagnostics: 1;BLUPR19MB0402;31:RMLaU5p9HdXcKBHmo94c13YgR0weCV7UUTr/Ugquz7TupB6TezkYB/DGINZpQ5I5U1mxTClnx1I5Mxw133LshaCbAAe3n8BYrL1kDjaAhV5WYeMSyRlC//PbvNVObfeXFrnun+BzI4JFIOTzc1V64ZtIf5iQZTFXdiZKTDej+i1+BY9Va/om3v1aO+khvxh1vMSIkHsT9D/GETzai/fAwZ4EIH4fph+I7Y1k4h40/k8=;20:ItT4FBhcpVLwam8IcBl42SVMPXl7XpkUZ/4R72HxHcKNmLDJlhknL2YXY5HUt0A9ux/rh06Hv3BFSXqLLGTDIj/Ze/wHmc9MQvvR/7EDqRklGJakn0mB3ik63aak5bCei1WsI94BjZZF1CXE8llk7BIkQmdlPcRIrIt4i8hLvdNTXSkGE4bZwC8snxJDHH72os0fWZPJ6H5xajZk4PsS/hYrv1+e8dwjyzdQyLSj5zVVD1QUBxaTO+UBiO/XivCZCxyVekFw9mqAWV7AV4LhOQHLmMWo/64KzQdpr1DNi6qltchq9TQuiTV1hmvadLS3zSglcMNQ0yXTOMdawdKtITBptY+xnzwCAIoFVZJDxbOEsrzExHhg6Y9JWSHPF6PpHx70uJh45bUc1CHXj7w0OQtrYswKDNlco+n5q2MTk844OAY9gDQxCoiHf0cE4wnA/GBb7whqdFesy55Eo3stp5/SRjoDfnEZEdaegUvcenNrjdysYtC022X0FB6YYHWs 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)(3231455)(999002)(944501520)(52105112)(93006095)(93004095)(3002001)(10201501046)(6055026)(148016)(149066)(150057)(6041310)(20161123564045)(20161123560045)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051)(76991095);SRVR:BLUPR19MB0402;BCL:0;PCL:0;RULEID:;SRVR:BLUPR19MB0402; X-Microsoft-Exchange-Diagnostics: 1;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eCsBxHnoP9lKzQztZezv3QRXPXLWnXrg= X-Microsoft-Exchange-Diagnostics: 1;BLUPR19MB0402;6:0yOOAUggwFslNfWcSjBqBT+WP738mQIRME+3pOq+PJfQfpaYpCn0s9zTXN3pUUsS7HqmgkVQT0qwmyVq5qUSwe8nNlSdlJXRnNF0rMzY0QRGyZJfFxeBhcCv/K/ffL9uz69qIrMc3oU0J9LlTRs8AzlzbNRyLv7vU8tIs3W0jvL5qDiUUXHHeUxEQykr8K6+Fm9r7hizrVDym6pSRIInUIPEtvEFek8z6olYbsB3eNm+pr4CagPjlmchM+tcL+ijhE52YstzQRNSnYdnZcZDQp0okTuDYbkgSxr2MaG8M81tfsMi+MFd+rH6+424rUJaU28YZe6xipgOK+8Arw40Kpkd1yDlSwvAxzK4NMyj4RDFU1p5MYsPKIVIl8CCz0JLiu3alQtIFbQFoiPY8h4W5Rvc5RWhAXeuz3qGjOq4gymsArVPrradS33NfjrzcnYs33LpLElM159PIgKhY6gRjQ==;5:XRd0fmpbVNqos3dUAtbaINTbFhVMcFR1qHIDXB+/aQp6qy+JO8arRIYJrUL8JwqIttSieQTBMY+Mzg9cNnBzpvjGsFLbLcDYuqHcnlxLanH/+hkPn+1+cyRBeSan9/2C+k/mkkYkjWbfZxO6uDsUe6A3hQiR6WkVMJyrdKS+X4c=;7:5GC6i4dDvndemIeu3vzdGEl6qHBWDUNRA0FXQkamb+XvLogo843SgRbPgFjGvg3lR1HJdrD/5jclSJjtEuLALAVjN8oI0dcisFK+hO4bonSs7tgYoE7omHcTogy58ps1Wq10wRdg3OZULFvvDWiLzA== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: microsemi.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Dec 2018 22:28:30.7554 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a351cf70-3e43-400b-15a6-08d65c935106 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.221];Helo=[AUSMBX1.microsemi.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR19MB0402 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: Mahesh Rajashekhara Reviewed-by: Scott Benesh Reviewed-by: Ajish Koshy Reviewed-by: Murthy Bhat Reviewed-by: Mahesh Rajashekhara Reviewed-by: Dave Carroll Reviewed-by: Scott Teel Reviewed-by: Kevin Barnett Signed-off-by: Mahesh Rajashekhara Signed-off-by: Don Brace --- drivers/scsi/smartpqi/smartpqi_init.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c index 8e68dba1c789..667a27ae3c07 100644 --- a/drivers/scsi/smartpqi/smartpqi_init.c +++ b/drivers/scsi/smartpqi/smartpqi_init.c @@ -645,6 +645,7 @@ struct bmic_host_wellness_driver_version { u8 driver_version_tag[2]; __le16 driver_version_length; char driver_version[32]; + u8 dont_write_tag[2]; u8 end_tag[2]; }; @@ -674,6 +675,8 @@ static int pqi_write_driver_version_to_host_wellness( strncpy(buffer->driver_version, "Linux " DRIVER_VERSION, sizeof(buffer->driver_version) - 1); buffer->driver_version[sizeof(buffer->driver_version) - 1] = '\0'; + buffer->dont_write_tag[0] = 'D'; + buffer->dont_write_tag[1] = 'W'; buffer->end_tag[0] = 'Z'; buffer->end_tag[1] = 'Z'; 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/BHxiUUSBwOYSHWypdVlml1xsMDisRIHCpItu5jRg2whYCJLSZ4ZBnHoWBk+c+Wa/3lPYiz7Sp2s5UG2PKgeUwJLTpozpcbr3Jg6VLs1esKWYQhENB0hdBBhMnvlPr+alJNnez+sqUmbZk2xOTUJB0YDp0VCbZPDR9F8k61zCOdId9U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xYy7CrCeGcNrty85t/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+6gc4aNVdNb6ZpPS7nxLM?= =?utf-8?q?l7w2pN8L/28PJjYAgy9U9elW3xyxAQ+MGkPTrEePIhI+h6qFuMTXVpLtR5SCRCIon?= =?utf-8?q?bB2aroXozYDVS+v6KStsTDzxyt3sJvQ7jeCJsLSzYEuOYvKfb5Z1h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s4jGXTRRSU4rMPOUC6VLHcCR6n2CQpUiT6og2UVATRNEMVhIEEG05iotbnrG9v8rSV2QmJ8k1UYCPXy9QnUJYvTlDJJ6IoYqvvAC4mADfoSFzzcfR+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, From patchwork Fri Dec 7 22:28:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Don Brace X-Patchwork-Id: 10718955 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 09554109C for ; Fri, 7 Dec 2018 22:28:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E963D2D8A2 for ; Fri, 7 Dec 2018 22:28:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DB9F22DA76; Fri, 7 Dec 2018 22:28:55 +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 2BA962D8A2 for ; Fri, 7 Dec 2018 22:28:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726081AbeLGW2y (ORCPT ); Fri, 7 Dec 2018 17:28:54 -0500 Received: from mail-eopbgr760058.outbound.protection.outlook.com ([40.107.76.58]:58531 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726008AbeLGW2y (ORCPT ); Fri, 7 Dec 2018 17:28:54 -0500 Received: from BN6PR19CA0092.namprd19.prod.outlook.com (2603:10b6:404:133::30) by BN6PR19MB0931.namprd19.prod.outlook.com (2603:10b6:404:75::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1404.21; Fri, 7 Dec 2018 22:28:46 +0000 Received: from BN1AFFO11FD015.protection.gbl (2a01:111:f400:7c10::177) by BN6PR19CA0092.outlook.office365.com (2603:10b6:404:133::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1404.19 via Frontend Transport; Fri, 7 Dec 2018 22:28:45 +0000 Authentication-Results: spf=pass (sender IP is 208.19.99.221) 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.221 as permitted sender) receiver=protection.outlook.com; client-ip=208.19.99.221; helo=AUSMBX1.microsemi.net; Received: from AUSMBX1.microsemi.net (208.19.99.221) by BN1AFFO11FD015.mail.protection.outlook.com (10.58.52.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.1404.13 via Frontend Transport; Fri, 7 Dec 2018 22:28:45 +0000 Received: from AUSMBX2.microsemi.net (10.201.34.32) by AUSMBX1.microsemi.net (10.201.34.31) 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:41 -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:41 -0600 Subject: [PATCH 06/20] smartpqi: refactor sending controller raid requests From: Don Brace To: , , , , , , , , , , , CC: Date: Fri, 7 Dec 2018 16:28:41 -0600 Message-ID: <154422172132.1218.18346212909813247484.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.221;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(7916004)(396003)(376002)(39860400002)(346002)(136003)(2980300002)(199004)(189003)(69596002)(58126008)(305945005)(230700001)(86362001)(103116003)(2486003)(478600001)(23676004)(316002)(2201001)(356004)(106002)(16576012)(110136005)(77096007)(26005)(8676002)(81166006)(81156014)(336012)(8936002)(5660300001)(186003)(33716001)(4326008)(50466002)(126002)(47776003)(2906002)(97736004)(14444005)(76176011)(68736007)(11346002)(106466001)(33896004)(9686003)(53936002)(486006)(44832011)(446003)(476003)(921003)(1121003)(83996005)(2101003);DIR:OUT;SFP:1101;SCL:1;SRVR:BN6PR19MB0931;H:AUSMBX1.microsemi.net;FPR:;SPF:Pass;LANG:en;PTR:InfoDomainNonexistent;A:1;MX:1; X-Microsoft-Exchange-Diagnostics: 1;BN1AFFO11FD015;1:7MlVcvgtE+/5DwMO6xbaEgttLN2wO6wLyv4/Ly8XGiIZcvxoRKWnx5zYNlgtHcSUwj0uqzFQiJcHDYT5zT6hMJDfTZVWSSwxt5GHqvwltF1mPBKZnwqfDzrJLko5xSpz X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 21b65571-73e0-4ea2-064c-08d65c9359f1 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390098)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4608076)(2017052603328)(7153060);SRVR:BN6PR19MB0931; X-Microsoft-Exchange-Diagnostics: 1;BN6PR19MB0931;3:7tv7hMCP3NR4n7ViN4o6FU/vGWPUysr1P1KYPRO9UopsUV4HPLDFeQ/KBEqHrjrdvLVpX5rZUvKTc7Ma8kc+Y1oxV1WsJkMvKI83+aX44R06ZrWBUenVvxUP+SmX8FiqKgClQty4TTmltI8y6X4RuhMv+ZtsmeQ316X3Hd9K4ssP0iDC3UemMkX3JC1ClQ7EAjrpZKot8nvLyfo8fOAjdj2x0OBKxvPIZSJT54AoI5ei/Rzt6DnwTzITmyfPNOlpm1sXuXNS79fGJ1vA5n8ikkbjVXz+zbuM8obiu5qHZXEC0tbRi7Nxko9c48fcKckPWVU5jkoeOfGoOYe0Lvsp8zQ5Npx9ojL13Ch9btC+jRk=;25:+i8cIm9jBrpBPEfp3mWpw4LoW8NH7hbfGFotbDibo8CjNa9TS5dQw1d1fUB5FzZ1NoRHtEZsTHgYKFMR4KauLiC6YNm59t3ePdog5dux2e71OgLlnQNLMp/LnDnFDW5sr4uHJXEcIsSGVJ4XWRC2nw8kNcyKBiWsopCLd5Y9vXVnY7bj9nf3at6WFvcbrCn4ui8Pz9V4IuHTN4HZzLQ4zc0mtJbPenea42Uj3l5p8a/bbJRte8y6ReQ5nIzV4E3AEBjZ1bLE6m5s0WDeqKUV6AGlFWeVLmPEq2maTXSj8K3q+ASKbdcsIWDsIS6CwqTT9jLrGbsy3PwuWPg1y+YBjQ== X-MS-TrafficTypeDiagnostic: BN6PR19MB0931: X-Microsoft-Exchange-Diagnostics: 1;BN6PR19MB0931;31:9vTJnMtYjQoe6lG8q5Ct+kpq0jlERYp+gqxL9Yw0K5riiy/FNkm13OUyv2oXNaUfOWlsbO9Nrx65q87Fx1ZYkuTL4a+BYBpxOxqyH6nFQdWe3sxBWg8pHUV1E0auvYUBpbnjPouS5MjulK1imQfDtU2k3yLY5aauKRdYQ3DgFGcawPL/ceDs0qYIDgdsn8cvFQkpljGDTp26dJ2LRxnzuTG6w+x7oJfm7Oci9gLwAtQ=;20:LW5igv4jq0P3ygjG2hz2xg5EHQHCYEoS5W1OMvxlb6rsLqCRZrIxBKxjfczwXVvVJNkbYmXd+Ttbnet8IpVRqG2gMQpbHX3ojFPQB402lTkYolxtRV3GVYYHba6s1NoDA+IxuPPq/3pu3T5dHBd2LRpE7KSOdTO9Fq8qgyGWLilQftekzxMxi1pd+Tve7gaeeqYK8cuPx9iutledBbvzSBOIZpumUzQDwi89eMN4JOKwNPCmTknD8oxBT0BqXTFAy8aMp+alAw829DJKl8q1EygNCHaR1wAHYRJwkYY323DfzCAKrRBW9pjQHM8WLlz2a+0x92vPjlbHJIIuM85F3HCiILjypwWvljRljWWqZXzV7H8fw2g+wf8i1OR6oMb/C1Z6q9t4l+jd6byvSNMWaxFdlgt9nZ/eziog3QsjwUjlkrX/P+JwMVGXjbkEc4mg6+APzHqU36V8CmnCt//8swD6HC1CTgea0k4hLhruvD4toNOPAM6WiubcEh6+xzBo X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(10201501046)(93006095)(93004095)(3002001)(3231455)(999002)(944501520)(52105112)(6055026)(148016)(149066)(150057)(6041310)(20161123558120)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(201708071742011)(7699051)(76991095);SRVR:BN6PR19MB0931;BCL:0;PCL:0;RULEID:;SRVR:BN6PR19MB0931; X-Microsoft-Exchange-Diagnostics: 1;BN6PR19MB0931;4:WvmJs68mLQIbLDx70fGP0g2kAb+45m3CSscleZ+THTFCUBbvQH1CHP2X39YJkp3B8gtez5dl6Y1sFl1CFPFecQyCoHXW2qEJNSHLzh6a8pEVahpXSC4dLux+ZXsrw8qKJS6Xb45Gw8AgIlE8DkTxDGs/XQ7ZMrQItFKo4zNoS6bikOcJB06clWQ4G8oiJ9dtW4Kg+mhiJy8U3Yl4xizABvBwzk10uS7OnVeMyHqo9RClvkVL8T1KKp/9jVOrNJK2ILrSjAOzcIhmVmCrmgxWJg== X-Forefront-PRVS: 0879599414 X-Microsoft-Exchange-Diagnostics: =?utf-8?q?1=3BBN6PR19MB0931=3B23=3Ai5f+GWT?= =?utf-8?q?wXuw58S1HGN8B6aGIz0ZDHr6FjW60AAFYeiyQEH3tcwY7xxluNpmRvd45XH+J8K3k?= =?utf-8?q?rBNRd/k6MRClW0OeQII3TLra1EDI0pZ995a4dk2HYLTdpaESABKcahUmzNg58qxD9?= =?utf-8?q?X5r2t2pjBd65Bnpr6WgVpyhkCw6AVp70/4YziTFszImFik29xmtbzfQdhbMYbTxRe?= =?utf-8?q?xSrUhOjcV2YcUUJc7+mC63cpLsUlFIaXbGz4oeah+74izhSjOuz4vHdAURBNUfoVB?= =?utf-8?q?2VHsWms12MfOo35HfLu3vv6LGn5Z1hZ21Dz1xBuUdYfPbFmaAf0SHK/6owm6jZQXw?= =?utf-8?q?ZVaqBayzCBVIT1NG9F2MjMyaW6dd9KTK2ATtDUIu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OxxWEv676V32q4h8WjcKzNk3+OWCwQxIY/58GYYgcc+oKwGKH2QGbsvmwXB5M4tvHnwtVvZ2+Vkq0+WMuTb22FnYA== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: microsemi.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Dec 2018 22:28:45.7169 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 21b65571-73e0-4ea2-064c-08d65c9359f1 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.221];Helo=[AUSMBX1.microsemi.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR19MB0931 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 cleanup the common code which creates a raid path request for the controller LUNID and sends it synchronously, into a common routine; Reviewed-by: Murthy Bhat Reviewed-by: Mahesh Rajashekhara Reviewed-by: Scott Teel Reviewed-by: Kevin Barnett Signed-off-by: Dave Carroll Signed-off-by: Don Brace --- drivers/scsi/smartpqi/smartpqi_init.c | 134 +++++++++++---------------------- 1 file changed, 46 insertions(+), 88 deletions(-) diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c index 9d9e90e13f5c..004a7b9aac26 100644 --- a/drivers/scsi/smartpqi/smartpqi_init.c +++ b/drivers/scsi/smartpqi/smartpqi_init.c @@ -519,44 +519,58 @@ static void pqi_free_io_request(struct pqi_io_request *io_request) atomic_dec(&io_request->refcount); } -static int pqi_identify_controller(struct pqi_ctrl_info *ctrl_info, - struct bmic_identify_controller *buffer) +static int pqi_send_scsi_raid_request(struct pqi_ctrl_info *ctrl_info, u8 cmd, + u8 *scsi3addr, void *buffer, size_t buffer_length, u16 vpd_page, + struct pqi_raid_error_info *error_info, + unsigned long timeout_msecs) { int rc; enum dma_data_direction dir; struct pqi_raid_path_request request; rc = pqi_build_raid_path_request(ctrl_info, &request, - BMIC_IDENTIFY_CONTROLLER, RAID_CTLR_LUNID, buffer, - sizeof(*buffer), 0, &dir); + cmd, scsi3addr, buffer, + buffer_length, vpd_page, &dir); if (rc) return rc; - rc = pqi_submit_raid_request_synchronous(ctrl_info, &request.header, 0, - NULL, NO_TIMEOUT); + rc = pqi_submit_raid_request_synchronous(ctrl_info, &request.header, + 0, error_info, timeout_msecs); pqi_pci_unmap(ctrl_info->pci_dev, request.sg_descriptors, 1, dir); return rc; } -static int pqi_scsi_inquiry(struct pqi_ctrl_info *ctrl_info, - u8 *scsi3addr, u16 vpd_page, void *buffer, size_t buffer_length) +/* Helper functions for pqi_send_scsi_raid_request */ + +static inline int pqi_send_ctrl_raid_request(struct pqi_ctrl_info *ctrl_info, + u8 cmd, void *buffer, size_t buffer_length) { - int rc; - enum dma_data_direction dir; - struct pqi_raid_path_request request; + return pqi_send_scsi_raid_request(ctrl_info, cmd, RAID_CTLR_LUNID, + buffer, buffer_length, 0, NULL, NO_TIMEOUT); +} - rc = pqi_build_raid_path_request(ctrl_info, &request, - INQUIRY, scsi3addr, buffer, buffer_length, vpd_page, - &dir); - if (rc) - return rc; +static inline int pqi_send_ctrl_raid_with_error(struct pqi_ctrl_info *ctrl_info, + u8 cmd, void *buffer, size_t buffer_length, + struct pqi_raid_error_info *error_info) +{ + return pqi_send_scsi_raid_request(ctrl_info, cmd, RAID_CTLR_LUNID, + buffer, buffer_length, 0, error_info, NO_TIMEOUT); +} - 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, dir); - return rc; +static inline int pqi_identify_controller(struct pqi_ctrl_info *ctrl_info, + struct bmic_identify_controller *buffer) +{ + return pqi_send_ctrl_raid_request(ctrl_info, BMIC_IDENTIFY_CONTROLLER, + buffer, sizeof(*buffer)); +} + +static inline int pqi_scsi_inquiry(struct pqi_ctrl_info *ctrl_info, + u8 *scsi3addr, u16 vpd_page, void *buffer, size_t buffer_length) +{ + return pqi_send_scsi_raid_request(ctrl_info, INQUIRY, scsi3addr, + buffer, buffer_length, vpd_page, NULL, NO_TIMEOUT); } static int pqi_identify_physical_device(struct pqi_ctrl_info *ctrl_info, @@ -590,9 +604,7 @@ static int pqi_flush_cache(struct pqi_ctrl_info *ctrl_info, enum bmic_flush_cache_shutdown_event shutdown_event) { int rc; - struct pqi_raid_path_request request; struct bmic_flush_cache *flush_cache; - enum dma_data_direction dir; /* * Don't bother trying to flush the cache if the controller is @@ -607,17 +619,9 @@ static int pqi_flush_cache(struct pqi_ctrl_info *ctrl_info, flush_cache->shutdown_event = shutdown_event; - rc = pqi_build_raid_path_request(ctrl_info, &request, - SA_FLUSH_CACHE, RAID_CTLR_LUNID, flush_cache, - sizeof(*flush_cache), 0, &dir); - if (rc) - goto out; + rc = pqi_send_ctrl_raid_request(ctrl_info, SA_FLUSH_CACHE, flush_cache, + sizeof(*flush_cache)); - 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, dir); -out: kfree(flush_cache); return rc; @@ -629,66 +633,32 @@ static int pqi_flush_cache(struct pqi_ctrl_info *ctrl_info, 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); - + rc = pqi_send_ctrl_raid_request(ctrl_info, BMIC_SENSE_DIAG_OPTIONS, + diag, sizeof(*diag)); 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); + rc = pqi_send_ctrl_raid_request(ctrl_info, BMIC_SET_DIAG_OPTIONS, + diag, sizeof(*diag)); out: kfree(diag); return rc; } -static int pqi_write_host_wellness(struct pqi_ctrl_info *ctrl_info, +static inline int pqi_write_host_wellness(struct pqi_ctrl_info *ctrl_info, void *buffer, size_t buffer_length) { - int rc; - struct pqi_raid_path_request request; - enum dma_data_direction dir; - - rc = pqi_build_raid_path_request(ctrl_info, &request, - BMIC_WRITE_HOST_WELLNESS, RAID_CTLR_LUNID, buffer, - buffer_length, 0, &dir); - if (rc) - return rc; - - 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, dir); - return rc; + return pqi_send_ctrl_raid_request(ctrl_info, BMIC_WRITE_HOST_WELLNESS, + buffer, buffer_length); } #pragma pack(1) @@ -837,23 +807,11 @@ static inline void pqi_cancel_update_time_worker( cancel_delayed_work_sync(&ctrl_info->update_time_work); } -static int pqi_report_luns(struct pqi_ctrl_info *ctrl_info, u8 cmd, +static inline int pqi_report_luns(struct pqi_ctrl_info *ctrl_info, u8 cmd, void *buffer, size_t buffer_length) { - int rc; - enum dma_data_direction dir; - struct pqi_raid_path_request request; - - rc = pqi_build_raid_path_request(ctrl_info, &request, - cmd, RAID_CTLR_LUNID, buffer, buffer_length, 0, &dir); - if (rc) - return rc; - - 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, dir); - return rc; + return pqi_send_ctrl_raid_request(ctrl_info, cmd, buffer, + buffer_length); } static int pqi_report_phys_logical_luns(struct pqi_ctrl_info *ctrl_info, u8 cmd, From patchwork Fri Dec 7 22:28:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Don Brace X-Patchwork-Id: 10718957 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 16B9E1750 for ; Fri, 7 Dec 2018 22:29:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 03A882DA76 for ; Fri, 7 Dec 2018 22:29:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EBCA42DAA8; Fri, 7 Dec 2018 22:29:01 +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 5096A2DA76 for ; Fri, 7 Dec 2018 22:29:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726073AbeLGW3A (ORCPT ); Fri, 7 Dec 2018 17:29:00 -0500 Received: from mail-eopbgr690085.outbound.protection.outlook.com ([40.107.69.85]:61360 "EHLO NAM04-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726008AbeLGW27 (ORCPT ); Fri, 7 Dec 2018 17:28:59 -0500 Received: from BN6PR19CA0119.namprd19.prod.outlook.com (2603:10b6:404:a0::33) by BN6PR19MB1411.namprd19.prod.outlook.com (2603:10b6:404:126::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1404.21; Fri, 7 Dec 2018 22:28:55 +0000 Received: from BN1BFFO11FD017.protection.gbl (2a01:111:f400:7c10::1:174) by BN6PR19CA0119.outlook.office365.com (2603:10b6:404:a0::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1404.17 via Frontend Transport; Fri, 7 Dec 2018 22:28:49 +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 BN1BFFO11FD017.mail.protection.outlook.com (10.58.144.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.1404.13 via Frontend Transport; Fri, 7 Dec 2018 22:28:49 +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:47 -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:47 -0600 Subject: [PATCH 07/20] smartpqi: add sysfs attributes From: Don Brace To: , , , , , , , , , , , CC: Date: Fri, 7 Dec 2018 16:28:47 -0600 Message-ID: <154422172753.1218.12927296834156279239.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)(136003)(39850400004)(396003)(376002)(346002)(2980300002)(199004)(189003)(478600001)(86362001)(446003)(4326008)(68736007)(53936002)(76176011)(33896004)(126002)(486006)(476003)(2201001)(9686003)(14444005)(356004)(26005)(230700001)(77096007)(44832011)(186003)(336012)(2486003)(11346002)(47776003)(23676004)(106002)(8676002)(5660300001)(103116003)(110136005)(8936002)(316002)(81156014)(50466002)(81166006)(58126008)(16576012)(305945005)(2906002)(33716001)(106466001)(97736004)(69596002)(921003)(1121003)(2101003)(83996005);DIR:OUT;SFP:1101;SCL:1;SRVR:BN6PR19MB1411;H:AUSMBX2.microsemi.net;FPR:;SPF:Pass;LANG:en;PTR:InfoDomainNonexistent;A:1;MX:1; X-Microsoft-Exchange-Diagnostics: 1;BN1BFFO11FD017;1:G2jYbd2njNaPuflXPvko7DnDbneEPv6lOQnp5aV4r663AKGOfkp4xsGHQebtpHIKuQ3IxBL6xoOzafuwL318K6yRDlpOcizSD+pFQXg0F1bZcltCn4hq7MRLhsCdUtjA X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1e1d6739-7579-49e7-84cc-08d65c935c08 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390098)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4608076)(2017052603328)(7153060);SRVR:BN6PR19MB1411; X-Microsoft-Exchange-Diagnostics: 1;BN6PR19MB1411;3:v9hlILbyY7Xb93ZkU7SnqzhyDOvSpGqOBSgMhd4iKrATWxiR95pLw9/HSAyc4XEtybPT/dT2LXGwxFIUN665gq1B1VJd5/wd6gqtGcVT7sgMIKgyBfNdin4rUlS7B+r9xd+BBRCxjC6vu+aIS/wef+8ZP71HPWcawEOXDXJT2Pv7AGfAq9qsWrYoqsWC2LEbi00AQ8tqvZ/CKMkDLX5wl9Jbwhf8YM3g4YFydvrTJzeTfqoK/hezk+v5yHdHfVWixW1hMWG88eONDPqYtD7+51SGCYTo74Nl958dTY5BRTg8CCuTLSmiitkfIo0f89ZAhQa0zmRJVer67jQYY6YFK2QesQCgwqDc3SPFHYfX6/0=;25:vanrEeCPel3VfMmDzodWQyV3w1672LT3IMKRzGF87Z9XKPjdm31yq37RdrmnHDgvfNaW48beMOgYTQaatrWuIA1vFt4otpceNhcv93dfMqhv2Ixq2zDIuKD9hMPFUxxXreElfEkZVWYWkiEgT3OO52KJlHPviuKQBQ7LCYxdcBnV/Vpd6rSmunSgQFI+B6KcQXMNAVtgSxn44DYdvW8Dfk38ESPSQh0n8VYvSMKtBZeQnqEA1kNtSzexWr1Q/YR/Bke2wcJhq/Gkn707JoDz+FS9OVib1i4REugpNvTP+6Bj6weqlJSZ57MFkVsvqroDeNVunXmSgVYhvuneJzg3Pw== X-MS-TrafficTypeDiagnostic: BN6PR19MB1411: X-Microsoft-Exchange-Diagnostics: 1;BN6PR19MB1411;31:VQrsXuekOUIHxj5TW6g7+UVuH/pINeSU77nJj5XjOV9sgLyuloOyQWocf4hElcV30Tc8HwTiy2G1m0FhVwMhdqhXQS4hJBI8hV46scX0Zcu0A6moMib52ORo/ate4I5ZPkXZ/7unAhxqzMa2gNzRmP4Uerw42XCK+ByK+9QFER9qUCuENGcbNuso73bEuqMWRiXeJaA8T8HYbpUbTE7QO8/olibwHQS3aYMDKwEVHaU=;20:NyQQ5JKSpv2k9EwMnClwSxaHhmLE9HIUBK90x7QIVxvtvt5h1Qmx9iWshQ1b5OGE/ZMnaR2prxaXWNIABMJuhGUx2/a8f1/KZG8/rUDM3D/MwpX5GjkN4zQAAUmsCW1Vty8DKjjrEPTwwf0HuZ9RdJcuFdJLi7v2KuoBDnmfWaMungSOceaqRsmZwL6ZkFq/xDpdI+8A35/CqvjEjI+leuW0OqSeVxhpJvQi3MiBbMQ/pODF7MPmVfDsBAcmB7aucSdNf3tG3AM5I38NJMMFegEUt6eOb25JJprYb5mff2uQ4Bz0/AvMuhHiKBk25lOPalvYCw89VGqXyxTpntYndrWgaedS6Sah/d+jbUH4qHiTiXkKJPi9YC5g2AtvxV22aWuZS9D/fL0vzmBwfihHCN8pBE7h8OAM86XOqM8VE5w0aUG/BRFidOXzDe73R/cTTOS+XeByj+uPlDvd2WSUqD3IrGuuGxa0/ujGXUa0Bf42CEdb0+AXws9hi+QABFn/ 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)(3231455)(999002)(944501520)(52105112)(93006095)(93004095)(3002001)(10201501046)(6055026)(148016)(149066)(150057)(6041310)(20161123564045)(20161123560045)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051)(76991095);SRVR:BN6PR19MB1411;BCL:0;PCL:0;RULEID:;SRVR:BN6PR19MB1411; X-Microsoft-Exchange-Diagnostics: 1;BN6PR19MB1411;4:y8noJkiUqN1YP1B7unXaIq6sq+Vh/g8WGOgNdFw4trMdEALlFGB5vaSttXwIguGT7Tm6PXVHdtqzVqyVv6atg2Y7tooDSk5q7EgQzmd9N61wNySlriq5Xr6bRjdRByGFcpyqiDUIhndtvLR2/diMQcjpk/03LqsI2bdqa4o6rKS2TpNQd8p8oOEDnGHp7VjvJQlrXattyC249u0Op1zzHU2Fdk/i+iyykGYHf1S41Si/LlzbN+5EHeu8MunJNWvuSEUZp7K1D78ipDBTUKMUYw== X-Forefront-PRVS: 0879599414 X-Microsoft-Exchange-Diagnostics: =?utf-8?q?1=3BBN6PR19MB1411=3B23=3Ax3/d4ql?= =?utf-8?q?N4XfzQAdKLSw8Q45FbCM0sLTbmEOEvEHdFCJjmqLI6YN/U8Sy9kEEZPoWIn+TLBpP?= =?utf-8?q?KhhRcmXGB4fc7rOsCrVgKX/yxCKZ363qoX6ozQi2h8UAG3V/yiK6bQfZ09dMDZs/F?= =?utf-8?q?OnfFyhTULd0XYLwc3tsn7UJNNgaTLOotJrL/lptrpcurTdKN2DazHX/FQKJVrAeXf?= =?utf-8?q?bVbUs2CHemINekbCEKcK44d0DLupETFfHSQI/ptkNYw3n1fYr8Hizp0F8l0MLrCtm?= =?utf-8?q?BICaWdIwLmijVnDXtnpEQhHxUuZ70EaNjUu/HBj7evlNmkMTjadyLco5H7GfDtOPc?= =?utf-8?q?93CywgQrEhfWiz035xwPXxdL5PKbypBNukZW2BIP3V7/+HsSSHDsAfTFVpWA716IJ?= =?utf-8?q?qmV316XZ8isND2nm0kkZN/xdDkuMKZONxSafffkb72LaLO7tgepnPvrJnpU+4ctzR?= =?utf-8?q?a75P1zGf0bGrVsAlW7a2OF250bFmxmfiPvuDgzeMrS1mlKGdpc+U713zlFZsnz32z?= =?utf-8?q?CiCYfJMPG3Qe+pLeq+lxxWm2lfaRxJ1azxbmPjs01OrAzD7xIcWLFN94PAmkK2hBR?= =?utf-8?q?Defy6RkjzYTA3eRTRMXVZ0zBIxTgtzmNBq+wfAoQiJTJGUO8ceLBsH+DdHFAT/d19?= =?utf-8?q?Qw/UPeuPtBBtoP8kB5K3yWuS/FYnhnmMFdvDXrCXYmqzNvau+8EyW2//MA4HgI46P?= =?utf-8?q?ZASl95Gda7P1DWwVBXQsnhyx/l75eOeQe51eLOfxSm9h5vB/NVsRQDt4OkULC8GFN?= =?utf-8?q?yEaeUgRcpHlVOVegJtW7Lo1RlZXdfNYppKjj/t8JKm2L6tWI2ByZ0CWROTS0I2i0O?= =?utf-8?q?70oEE+2LbIZ3wiyU1lefmwQyeIPFaYYvq/pfzXmlcuaTVabaxFPbzdkEDrfdJCqih?= =?utf-8?q?2DhthqW8xkxi72abA+eeawhEFIVyy3HQzYjwuO8sYvRIDcQaWxYE80YEDarWozrmJ?= =?utf-8?q?wqLv5c75vHZZa8ySx2eN/dhVwoHad8AShfsF4x/O45AxnvO5bCwCV3jjfO24bLj2y?= =?utf-8?q?smJL8E0IlB8u3T5Pm+t16N66NhYSART88dqi/SU7y+4vFYD6NE7sI4GrIzAB2CAM+?= =?utf-8?q?Hzz5geHEJFKm2GB3yy/6I9+Ud5979AfOGjilQylhAVXHHd2jQhoBP7FlRmdUzynuu?= =?utf-8?q?W1IMeSnc8PiXPyD10q/EMiLqhb+yJATGMeqCTdvS+2WK5H/6lDZiSZwKYp8Zw=3D?= =?utf-8?q?=3D?= X-Microsoft-Antispam-Message-Info: ENM0kT6TXin/1xWXasP79JQAGckamV7HAXJ/bCivcamLtK1++QUJu+AKlHjsP/x/+Namkmge/D1V5xXEsoJmjfhksHwGawkJLzNQlz7tCrnBZ8soyTpqYaHFKCLP2Klt+1F94YTRkczpFvrOQx11EJ/VIT625SB82e6a63hmT0pNRavDf8LpGreEaXQvP2ufppibRHz+nQRtuQmFDUTd90Oy1eF3ubGcl3ebsVfiNZvcitonVH3mgyXvUlpR7oo27lAsPls1hHWZ3DWwux0RSPCzRh3dF/rmBccW8a401U++NzTCCUWoK+nzNXJVECS1LsFIxEraxqJ4hYtdUWp1mUFh1PhAFgFDdHMbFrnEv1c= X-Microsoft-Exchange-Diagnostics: 1;BN6PR19MB1411;6:p7wjNMWDDFzejJjxtrqD0MJevWqv4NMXSq7fYPRUjvFSYGFX3kEhAcNYsaReHE1ZSfjEM8PuXZuEMz5h0ylJHb9R3t7zKRWG4uTN2ZotgYnE+iDWGsqEWe0lo/mrb9eBNdnEMqXJfUhCcz7dJ4d5viX96FjBpKCxslzL+VaPqQ4zl+1yi9bRbhP7anpyT/NaXZhtHuWh6rYspMDqc9LBK2hVBYhAJPihmdxlKrP1NMx60wGGq3v9XpbSGKv7XoqwX8K14FUXo8yf4yWCIBO1sBOegvU5x2y/3swiGJYd9c3WJ93ySjn0oUWk2u3umtq7bdFD1BkYfjggoSQOHV8W+eDEZnIuwLDzgOpXijCL9H/yilnyQWDglZYh+mL0315xtg1GUlcvc8ww+aHpdLvxeL64sAvuXVXPVViWBe+VAX1nSZoQnPWqWO+SmrrZHKhGKPXoyp9a6h42dqDvUAjfSg==;5:rqKPWEcIzDVxl89n2GHI8O+YEGjizqXluLWkSiYem4vD/UuEptw1vwuGKAlpcWnzCR7JL2p9fLIWug2Y9RsMvKiTndLRmTgfldX6gQ77qdB1kqcu8NIsPk/6xtsNlpbcoKJsPZa9r8KaG81avRY0TsBhYStzaMyUPLsku+5R+E8=;7:BU3V6MAVcBHGhlUZ+nVKQ51pi/KJfSvLWB8pXAporlEMxpupN/S//Uq5lfjh0fz3eD4VTlQHU8Rd7c9FmwmQViw6Pxx8HOC0d2UFybYKolNAiQnAbhuCKLX1ibSgpW64dSSx0tU7EPLwKln6bLHlMQ== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: microsemi.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Dec 2018 22:28:49.2264 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1e1d6739-7579-49e7-84cc-08d65c935c08 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: BN6PR19MB1411 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 - add sysfs device attributes, unique_id, lunid and path_info. Reviewed-by: Scott Teel Reviewed-by: Kevin Barnett Signed-off-by: Dave Carroll Signed-off-by: Don Brace --- drivers/scsi/smartpqi/smartpqi.h | 3 drivers/scsi/smartpqi/smartpqi_init.c | 232 +++++++++++++++++++++++++++++++++ 2 files changed, 235 insertions(+) diff --git a/drivers/scsi/smartpqi/smartpqi.h b/drivers/scsi/smartpqi/smartpqi.h index fcc4b937de71..a39c324dedab 100644 --- a/drivers/scsi/smartpqi/smartpqi.h +++ b/drivers/scsi/smartpqi/smartpqi.h @@ -852,6 +852,7 @@ struct pqi_scsi_dev { u8 scsi3addr[8]; __be64 wwid; u8 volume_id[16]; + u8 unique_id[16]; u8 is_physical_device : 1; u8 is_external_raid_device : 1; u8 target_lun_valid : 1; @@ -898,6 +899,8 @@ struct pqi_scsi_dev { #define CISS_VPD_LV_DEVICE_GEOMETRY 0xc1 /* vendor-specific page */ #define CISS_VPD_LV_BYPASS_STATUS 0xc2 /* vendor-specific page */ #define CISS_VPD_LV_STATUS 0xc3 /* vendor-specific page */ +#define SCSI_VPD_HEADER_SZ 4 +#define SCSI_VPD_DEVICE_ID_IDX 8 /* Index of page id in page */ #define VPD_PAGE (1 << 8) diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c index 004a7b9aac26..20c8c85660e7 100644 --- a/drivers/scsi/smartpqi/smartpqi_init.c +++ b/drivers/scsi/smartpqi/smartpqi_init.c @@ -573,6 +573,79 @@ static inline int pqi_scsi_inquiry(struct pqi_ctrl_info *ctrl_info, buffer, buffer_length, vpd_page, NULL, NO_TIMEOUT); } +static bool pqi_vpd_page_supported(struct pqi_ctrl_info *ctrl_info, + u8 *scsi3addr, u16 vpd_page) +{ + int rc; + int i; + int pages; + unsigned char *buf, bufsize; + + buf = kzalloc(256, GFP_KERNEL); + if (!buf) + return false; + + /* Get the size of the page list first */ + rc = pqi_scsi_inquiry(ctrl_info, scsi3addr, + VPD_PAGE | SCSI_VPD_SUPPORTED_PAGES, + buf, SCSI_VPD_HEADER_SZ); + if (rc != 0) + goto exit_unsupported; + + pages = buf[3]; + if ((pages + SCSI_VPD_HEADER_SZ) <= 255) + bufsize = pages + SCSI_VPD_HEADER_SZ; + else + bufsize = 255; + + /* Get the whole VPD page list */ + rc = pqi_scsi_inquiry(ctrl_info, scsi3addr, + VPD_PAGE | SCSI_VPD_SUPPORTED_PAGES, + buf, bufsize); + if (rc != 0) + goto exit_unsupported; + + pages = buf[3]; + for (i = 1; i <= pages; i++) + if (buf[3 + i] == vpd_page) + goto exit_supported; + +exit_unsupported: + kfree(buf); + return false; + +exit_supported: + kfree(buf); + return true; +} + +static int pqi_get_device_id(struct pqi_ctrl_info *ctrl_info, + u8 *scsi3addr, u8 *device_id, int buflen) +{ + int rc; + unsigned char *buf; + + if (!pqi_vpd_page_supported(ctrl_info, scsi3addr, SCSI_VPD_DEVICE_ID)) + return 1; /* function not supported */ + + buf = kzalloc(64, GFP_KERNEL); + if (!buf) + return -ENOMEM; + + rc = pqi_scsi_inquiry(ctrl_info, scsi3addr, + VPD_PAGE | SCSI_VPD_DEVICE_ID, + buf, 64); + if (rc == 0) { + if (buflen > 16) + buflen = 16; + memcpy(device_id, &buf[SCSI_VPD_DEVICE_ID_IDX], buflen); + } + + kfree(buf); + + return rc; +} + static int pqi_identify_physical_device(struct pqi_ctrl_info *ctrl_info, struct pqi_scsi_dev *device, struct bmic_identify_physical_device *buffer, @@ -1244,6 +1317,14 @@ static int pqi_get_device_info(struct pqi_ctrl_info *ctrl_info, } } + if (pqi_get_device_id(ctrl_info, device->scsi3addr, + device->unique_id, sizeof(device->unique_id)) < 0) + dev_warn(&ctrl_info->pci_dev->dev, + "Can't get device id for scsi %d:%d:%d:%d\n", + ctrl_info->scsi_host->host_no, + device->bus, device->target, + device->lun); + out: kfree(buffer); @@ -1775,6 +1856,12 @@ static inline bool pqi_skip_device(u8 *scsi3addr) return false; } +static inline bool pqi_expose_device(struct pqi_scsi_dev *device) +{ + return !device->is_physical_device || + !pqi_skip_device(device->scsi3addr); +} + static int pqi_update_scsi_devices(struct pqi_ctrl_info *ctrl_info) { int i; @@ -5722,6 +5809,145 @@ static struct device_attribute *pqi_shost_attrs[] = { NULL }; +static ssize_t pqi_unique_id_show(struct device *dev, + struct device_attribute *attr, char *buffer) +{ + struct pqi_ctrl_info *ctrl_info; + struct scsi_device *sdev; + struct pqi_scsi_dev *device; + unsigned long flags; + unsigned char uid[16]; + + sdev = to_scsi_device(dev); + ctrl_info = shost_to_hba(sdev->host); + + spin_lock_irqsave(&ctrl_info->scsi_device_list_lock, flags); + + device = sdev->hostdata; + if (!device) { + spin_unlock_irqrestore(&ctrl_info->scsi_device_list_lock, + flags); + return -ENODEV; + } + memcpy(uid, device->unique_id, sizeof(uid)); + + spin_unlock_irqrestore(&ctrl_info->scsi_device_list_lock, flags); + + return snprintf(buffer, PAGE_SIZE, "%16phN", uid); +} + +static ssize_t pqi_lunid_show(struct device *dev, + struct device_attribute *attr, char *buffer) +{ + struct pqi_ctrl_info *ctrl_info; + struct scsi_device *sdev; + struct pqi_scsi_dev *device; + unsigned long flags; + u8 lunid[8]; + + sdev = to_scsi_device(dev); + ctrl_info = shost_to_hba(sdev->host); + + spin_lock_irqsave(&ctrl_info->scsi_device_list_lock, flags); + + device = sdev->hostdata; + if (!device) { + spin_unlock_irqrestore(&ctrl_info->scsi_device_list_lock, + flags); + return -ENODEV; + } + memcpy(lunid, device->scsi3addr, sizeof(lunid)); + + spin_unlock_irqrestore(&ctrl_info->scsi_device_list_lock, flags); + + return snprintf(buffer, PAGE_SIZE, "0x%8phN\n", lunid); +} + +#define MAX_PATHS 8 +static ssize_t pqi_path_info_show(struct device *dev, + struct device_attribute *attr, char *buf) +{ + struct pqi_ctrl_info *ctrl_info; + struct scsi_device *sdev; + struct pqi_scsi_dev *device; + unsigned long flags; + int i; + int output_len = 0; + u8 box; + u8 bay; + u8 path_map_index = 0; + char *active; + unsigned char phys_connector[2]; + + sdev = to_scsi_device(dev); + ctrl_info = shost_to_hba(sdev->host); + + spin_lock_irqsave(&ctrl_info->scsi_device_list_lock, flags); + + device = sdev->hostdata; + if (!device) { + spin_unlock_irqrestore(&ctrl_info->scsi_device_list_lock, + flags); + return -ENODEV; + } + + bay = device->bay; + for (i = 0; i < MAX_PATHS; i++) { + path_map_index = 1<active_path_index) + active = "Active"; + else if (device->path_map & path_map_index) + active = "Inactive"; + else + continue; + + output_len += scnprintf(buf + output_len, + PAGE_SIZE - output_len, + "[%d:%d:%d:%d] %20.20s ", + ctrl_info->scsi_host->host_no, + device->bus, device->target, + device->lun, + scsi_device_type(device->devtype)); + + if (device->devtype == TYPE_RAID || + pqi_is_logical_device(device)) + goto end_buffer; + + memcpy(&phys_connector, &device->phys_connector[i], + sizeof(phys_connector)); + if (phys_connector[0] < '0') + phys_connector[0] = '0'; + if (phys_connector[1] < '0') + phys_connector[1] = '0'; + + output_len += scnprintf(buf + output_len, + PAGE_SIZE - output_len, + "PORT: %.2s ", phys_connector); + + box = device->box[i]; + if (box != 0 && box != 0xFF) + output_len += scnprintf(buf + output_len, + PAGE_SIZE - output_len, + "BOX: %hhu ", box); + + if ((device->devtype == TYPE_DISK || + device->devtype == TYPE_ZBC) && + pqi_expose_device(device)) + output_len += scnprintf(buf + output_len, + PAGE_SIZE - output_len, + "BAY: %hhu ", bay); + +end_buffer: + output_len += scnprintf(buf + output_len, + PAGE_SIZE - output_len, + "%s\n", active); + } + + spin_unlock_irqrestore(&ctrl_info->scsi_device_list_lock, flags); + return output_len; +} + + static ssize_t pqi_sas_address_show(struct device *dev, struct device_attribute *attr, char *buffer) { @@ -5798,12 +6024,18 @@ static ssize_t pqi_raid_level_show(struct device *dev, return snprintf(buffer, PAGE_SIZE, "%s\n", raid_level); } +static DEVICE_ATTR(lunid, 0444, pqi_lunid_show, NULL); +static DEVICE_ATTR(unique_id, 0444, pqi_unique_id_show, NULL); +static DEVICE_ATTR(path_info, 0444, pqi_path_info_show, NULL); static DEVICE_ATTR(sas_address, 0444, pqi_sas_address_show, NULL); static DEVICE_ATTR(ssd_smart_path_enabled, 0444, pqi_ssd_smart_path_enabled_show, NULL); static DEVICE_ATTR(raid_level, 0444, pqi_raid_level_show, NULL); static struct device_attribute *pqi_sdev_attrs[] = { + &dev_attr_lunid, + &dev_attr_unique_id, + &dev_attr_path_info, &dev_attr_sas_address, &dev_attr_ssd_smart_path_enabled, &dev_attr_raid_level, From patchwork Fri Dec 7 22:28:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Don Brace X-Patchwork-Id: 10718959 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 8C3AB18B8 for ; Fri, 7 Dec 2018 22:29:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 75F822DA59 for ; Fri, 7 Dec 2018 22:29:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 69CCE2DA76; Fri, 7 Dec 2018 22:29:02 +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 46CD42DA96 for ; Fri, 7 Dec 2018 22:29:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726091AbeLGW3B (ORCPT ); Fri, 7 Dec 2018 17:29:01 -0500 Received: from mail-eopbgr750071.outbound.protection.outlook.com ([40.107.75.71]:48551 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726090AbeLGW3A (ORCPT ); Fri, 7 Dec 2018 17:29:00 -0500 Received: from BN6PR19CA0119.namprd19.prod.outlook.com (2603:10b6:404:a0::33) by CY1PR19MB0410.namprd19.prod.outlook.com (2a01:111:e400:c448::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1404.18; Fri, 7 Dec 2018 22:28:56 +0000 Received: from BN1BFFO11FD017.protection.gbl (2a01:111:f400:7c10::1:174) by BN6PR19CA0119.outlook.office365.com (2603:10b6:404:a0::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1404.17 via Frontend Transport; Fri, 7 Dec 2018 22:28:55 +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 BN1BFFO11FD017.mail.protection.outlook.com (10.58.144.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.1404.13 via Frontend Transport; Fri, 7 Dec 2018 22:28:55 +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:54 -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:53 -0600 Subject: [PATCH 08/20] smartpqi: add h3c ssid From: Don Brace To: , , , , , , , , , , , CC: Date: Fri, 7 Dec 2018 16:28:53 -0600 Message-ID: <154422173369.1218.16688279960862608500.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)(136003)(39860400002)(376002)(346002)(396003)(2980300002)(189003)(199004)(53936002)(69596002)(81166006)(8676002)(9686003)(33716001)(11346002)(446003)(8936002)(476003)(86362001)(336012)(478600001)(2201001)(126002)(97736004)(68736007)(76176011)(2906002)(81156014)(47776003)(50466002)(106466001)(33896004)(103116003)(44832011)(110136005)(23676004)(2486003)(5660300001)(230700001)(305945005)(26005)(356004)(106002)(186003)(316002)(16576012)(58126008)(4326008)(486006)(77096007)(42413003)(921003)(1121003)(2101003)(83996005);DIR:OUT;SFP:1101;SCL:1;SRVR:CY1PR19MB0410;H:AUSMBX2.microsemi.net;FPR:;SPF:Pass;LANG:en;PTR:InfoDomainNonexistent;MX:1;A:1; X-Microsoft-Exchange-Diagnostics: 1;BN1BFFO11FD017;1:IfcKAlhU8h3OvYYbf+LtyPzPDtY5JJl+yKIiZ1Abit4Zd5lCVXPWwnGM2m9T3RwpjaEzTToDBCPyfSJMlUYYR8ONa7c6QbhtJfIY2GPgRWMG4p8sFnhZ0CIkKoVJjovF X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 507b110f-f8b0-4c51-e76e-08d65c935ff1 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390098)(7020095)(4652040)(8989299)(5600074)(711020)(4608076)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060);SRVR:CY1PR19MB0410; X-Microsoft-Exchange-Diagnostics: 1;CY1PR19MB0410;3:xBYfmtJU61dqeAGgBcrvl7IxqyjWwaBof2QJzSEecK0i4dd26Ta4wFq1ahtqW4oFAQ5xk5sD4/uNT1YI4MIVyimwowpcG963oSiJt6Y3ZNYZox/+6e1mLwdxW63xhWPnAlf+fxSfkkg4lCIEIe7yg4vpOko3/3YvtRWEbztaYvxj1aWmnwFvob/AACh1bqDQnSme1rrCL33UqE9zpWMXdtsaijSRqzqvsVDxuJnJ2R0DpaX6EVXBdLjky+h46a33R2UG/phTU9fiK/vUbpVD6CqycrVYvMN8bRS3a6k5LLBpfwBadD8X7RBk/hZg3quxchze3aVO0s1Unjl6iy5TX7QxcolmRMf4HyOa/fDlv7I=;25:98g/v3GiwFrNX/5/1QHyiGYE8Q2lwfNEtGXwMYfCsSaQRmjPf/qaH1xwV5RGa/qZYbx5+x08H/R+R2xhmg6802chPpejLZVKjwHZ/Tl9J5YTYKMlVsFTnIRrghj6xthZ+IDzv425X6RFX80UztelZeLaUKuYVTPDEvAihn40twPhPjN57/umSe68tO8xap12odOGBqcbUhMRWN5NOsQpvEryzHT86Ux83jjPC9l+zSA6M8wzGjpXLinb74/T1Firgg6FhO05cpow9nBDESJl5O03rTSaQhus+L9OvR1TQElNWkgRni3PgprkkEFMDkARU5eGTUOEBJ67QcCC8VF66Mys10RhYJUWTaFzVkSX0/g= X-MS-TrafficTypeDiagnostic: CY1PR19MB0410: X-Microsoft-Exchange-Diagnostics: 1;CY1PR19MB0410;31:87/zkqMjvBiHC0yIFnF01DKgpt1SNfuqe2gk5ioFljquj1kwxkxA6H7QOtkQiRLF78JAI93R3PGrUSXe9L1BANIthy41dixCg2pW9ZqToExy7Qh6tLvdYdq9ZUvH3SygDWwkj1g1PiYZLVFHbOY3dFffv8J4IP7nLFLKDuJrcYhXX4q/EEKI0z0+2DW3minCfGu99SJtq1tWeLLApr+GCPoW95RpikwTews1mSMB+N8=;20:1uxKJ+yZM7HZbw2tEPLjfGjTctYmFAav9WuBh4an15eSWAGzizIzpBnFEO4F6Wt5sphBtwrupK0cGvkc1B+di+kFbdxjMatP82NNL9wjfuo0VuHnzNdXPntMtyWOVdD2T3fIUl7j9P8qNhDpSVagZtcyIH4Lf/pzW6FIKaJDe1fCRHFaXynoY2oS90fLLBUZXuYG78Fk7CA2gXL1bFu249XMGQHOM7jmJ81v74onu0zAfX0i3LPp2yknGhyRH0ILyKAmqaz8ck97QfLKX49GKR9g5fVoQ65/VSSQWVG082jZFoH9OEtdepm1OfTAxE7azZ/ZnIAjtrDqtl8DponTYmeT0olv1JDdu+X7LX2hgSiHo4h9D2GOHdcZVwBQ57Q8h7ZyWJJP9V3txSW0dVloz9QUspcJvR5DJPu9dr421u461iRvXHDS67lV0eZ1SMaDRfY6zQrGeHh0WFY3WnbDnmCljkZ12TMq6QhyEB91xNtDbvalvufHi7QskhycOVUr X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3231455)(999002)(944501520)(52105112)(93006095)(93004095)(3002001)(10201501046)(6055026)(148016)(149066)(150057)(6041310)(20161123564045)(20161123560045)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051)(76991095);SRVR:CY1PR19MB0410;BCL:0;PCL:0;RULEID:;SRVR:CY1PR19MB0410; X-Microsoft-Exchange-Diagnostics: 1;CY1PR19MB0410;4:ecroMyOPMPqMnVXD4UDXSop2XyWIFLFvbuPM4MKcOVB7j2n++TpvZMa+WfJyXegx97VV3CI+mpxd5c62i53kVx/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19MB0410;6:/bCTRqi3ehrGwke/mB4tGfvxsOYBYyJV7U0BoFFc3pSVdJeIapTLgfjd60mO+eF8eVmM6jRirkcPOmE+zH2uX3Hdgw17OeUoKMi6WastfiyGgLYje4Qgqv+AQwW1UVXki7gSQ4qIm/7w9zkm/MIGyHtwA55RIOg5iu8pSLakysk90OwGZnJaVlYTCuUCJOhTs9A159TFk3le62c9HYcDC0CTa1VgSm+AFPQVClvzA6DD9QWewZ8QXShFyL4K/NLCboNOUFN5aIKSGrFZ4Ro0xOGAlqzfTPB4an/ThGjS8ME1kn7+/w3JABhtYJ5vvJQ/1ki4SQolMBD5H/SsSAagBWivLOL3980RKD6z5qlGQVe0w5J5RDFvKCDXloIVceVDg3vnp/JEL3hRWeU535BHf33YLedSgfxzs4uwsdMTcu9BCTRyKPnoZ+hukRc0N3TwDQEeKtgdiIheycCM7LnGwA==;5:iDFl0Go4O/QNyul6QVBqAwb+FIJEn+0Rz1+yApKm8GmrQi40x58bUXJ3HeyhEVdztqN9nM/v7PLK9RthECw22SHdHo00mM/t2WzDAJ94tw5a08op68geDkmCnYhY4opAQas/sY1pEK3mgylEowLpEu/FRWNaVt0oNO/8W1g8/hE=;7:/b9wwGOZxfkeaPrgYIYiXMBk+7dKsFPqUkCe2SC1qb1zRgIlkNQNNl6R1gk8kdtReEXr/dw+viebfPJh+EwmWRa+eibGmW/uUdXx+BFk5FtLWicn7S8/1uFeLhsQLtl1GXSlmaMZhEbB8YmkAFNWzg== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: microsemi.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Dec 2018 22:28:55.7890 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 507b110f-f8b0-4c51-e76e-08d65c935ff1 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: CY1PR19MB0410 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: Murthy Bhat Reviewed-by: Scott Benesh Reviewed-by: Mahesh Rajashekhara Reviewed-by: Dave Carroll Reviewed-by: Scott Teel Reviewed-by: Kevin Barnett Signed-off-by: Murthy Bhat Signed-off-by: Don Brace --- drivers/scsi/smartpqi/smartpqi_init.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c index 20c8c85660e7..7ece16495a09 100644 --- a/drivers/scsi/smartpqi/smartpqi_init.c +++ b/drivers/scsi/smartpqi/smartpqi_init.c @@ -7327,6 +7327,14 @@ static const struct pci_device_id pqi_pci_id_table[] = { PCI_DEVICE_SUB(PCI_VENDOR_ID_ADAPTEC2, 0x028f, 0x193d, 0x8461) }, + { + PCI_DEVICE_SUB(PCI_VENDOR_ID_ADAPTEC2, 0x028f, + 0x193d, 0xc460) + }, + { + PCI_DEVICE_SUB(PCI_VENDOR_ID_ADAPTEC2, 0x028f, + 0x193d, 0xc461) + }, { PCI_DEVICE_SUB(PCI_VENDOR_ID_ADAPTEC2, 0x028f, 0x193d, 0xf460) From patchwork Fri Dec 7 22:28:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Don Brace X-Patchwork-Id: 10718973 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 D7A1A109C for ; Fri, 7 Dec 2018 22:29:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C4D3D2F2E1 for ; Fri, 7 Dec 2018 22:29:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B61EF2F2E3; Fri, 7 Dec 2018 22:29:46 +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 90FE42F2CF for ; Fri, 7 Dec 2018 22:29:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726112AbeLGW3p (ORCPT ); Fri, 7 Dec 2018 17:29:45 -0500 Received: from mail-eopbgr710086.outbound.protection.outlook.com ([40.107.71.86]:9504 "EHLO NAM05-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726041AbeLGW3p (ORCPT ); Fri, 7 Dec 2018 17:29:45 -0500 Received: from DM5PR19CA0005.namprd19.prod.outlook.com (2603:10b6:3:151::15) by BLUPR19MB0404.namprd19.prod.outlook.com (2a01:111:e400:c470::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1404.21; Fri, 7 Dec 2018 22:29:02 +0000 Received: from BN1AFFO11FD006.protection.gbl (2a01:111:f400:7c10::154) by DM5PR19CA0005.outlook.office365.com (2603:10b6:3:151::15) 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:29:01 +0000 Authentication-Results: spf=pass (sender IP is 208.19.99.221) 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.221 as permitted sender) receiver=protection.outlook.com; client-ip=208.19.99.221; helo=AUSMBX1.microsemi.net; Received: from AUSMBX1.microsemi.net (208.19.99.221) by BN1AFFO11FD006.mail.protection.outlook.com (10.58.52.66) 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:29:01 +0000 Received: from AUSMBX2.microsemi.net (10.201.34.32) by AUSMBX1.microsemi.net (10.201.34.31) 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:29:00 -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:59 -0600 Subject: [PATCH 09/20] smartpqi: fix disk name mount point From: Don Brace To: , , , , , , , , , , , CC: Date: Fri, 7 Dec 2018 16:28:59 -0600 Message-ID: <154422173982.1218.8933383140339420829.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.221;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(7916004)(396003)(376002)(39850400004)(136003)(346002)(2980300002)(189003)(199004)(53936002)(8676002)(81156014)(81166006)(305945005)(8936002)(2201001)(9686003)(5660300001)(86362001)(106002)(110136005)(58126008)(316002)(103116003)(4326008)(230700001)(2906002)(478600001)(69596002)(33716001)(16576012)(97736004)(2486003)(23676004)(106466001)(47776003)(50466002)(336012)(14444005)(356004)(446003)(44832011)(476003)(26005)(77096007)(68736007)(76176011)(33896004)(486006)(11346002)(126002)(186003)(921003)(2101003)(1121003)(83996005);DIR:OUT;SFP:1101;SCL:1;SRVR:BLUPR19MB0404;H:AUSMBX1.microsemi.net;FPR:;SPF:Pass;LANG:en;PTR:InfoDomainNonexistent;MX:1;A:1; X-Microsoft-Exchange-Diagnostics: 1;BN1AFFO11FD006;1:UhjZgfjJL8AXijPaPhZh+Rde2ESo7LenFQnPnwZL1xm4F9J4UjKj3RYSB5WpakeZJgCumEnfMHsi0X/ejcfIvYjgOjIZIBzFTRMwub/zuY60jK95iBimcE4wzn8FKbFM X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ebee3029-8533-48a7-159f-08d65c936310 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390098)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4608076)(2017052603328)(7153060);SRVR:BLUPR19MB0404; X-Microsoft-Exchange-Diagnostics: 1;BLUPR19MB0404;3:e3aLa0s6Ct89dckKwOriaUifUKdQ6jmbqdR3CBtePnYW77XLLjb0OvCZbhAfOEwvVKY5AP6vlY+44cxgoDcU5I1+hRinKDNCGKxN1jzbTkTgRb+Rm+3IghgomcEZz1o8uMatQz2aqRv2X9HgzLCgKsOvzQ/8MWBHLCMFCTYY0ZhVdoKpoL6ZNbMYleajaSoLx8Ua5Som7Nr/pOpXy2lMCb+Ktmycj0nXprwl3B/Inig2DbgWiw58gtaPh2hbQp39THP4gxgikvuZupLXTQcXVkdUCe76VAPlL/Vfp7Um1OVuJMDfZbPn2VS7qgcOq/Y+1/7lf2fr+DfkrrBinJx321uQvEAELI7kaVd+OVsslzM=;25:44Ju1uZ8rmeiTcClzuAKHC7VXQaVP6mp2ksl1TWGsjRFBQjAfOEnCKdydlznU2AL2RIJ40yNQNDY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kSkH6XfnSXN5YVtjYI9o8oSQtiXqfRpcBI9MhWa6bOGUYOrt X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3231455)(999002)(944501520)(52105112)(93006095)(93004095)(3002001)(10201501046)(6055026)(148016)(149066)(150057)(6041310)(20161123564045)(20161123560045)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051)(76991095);SRVR:BLUPR19MB0404;BCL:0;PCL:0;RULEID:;SRVR:BLUPR19MB0404; X-Microsoft-Exchange-Diagnostics: 1;BLUPR19MB0404;4:Zuss0h/kiJSRwaTTFhc7it/ruopZs61mc1LG0ylDe+akP9TwXqihf/xW8gvXEU1U/UfblmHn78+efcTFtIFqIFXRLqoIohMtdIej88nm4fdpfDG6yGnUcDACekGpZNQoJ/stPU0CJ5K2pixKITmrl9DJ0dojEP2qEjXnfndoWJi0kxNZXx9Bo2C3+VOI/CqlFvAQqhfAgbxHjqHAvvb9ccSFae1jMIeaaEPFJAaw6diptTEpA3jwf9rAeMG244XTT+Ye2lfdvuB/znNqwgfMCw== X-Forefront-PRVS: 0879599414 X-Microsoft-Exchange-Diagnostics: =?utf-8?q?1=3BBLUPR19MB0404=3B23=3AFjezGBb?= =?utf-8?q?0+NVYRcessxtIHMpol7l3YszRuObPMcq9m6MX+3jwzhy+U6UgMmuk11d0ETpqWsYH?= =?utf-8?q?QSeEMoi6tPQS7r/CuC+oRwF640AVvhou54d15GN0i3abANZzCRDP/+9bQ824GxIbY?= =?utf-8?q?9Lmzaz8Sr6EGaBQcB9L9qQlhBnC+6WShtvuOSL9Kk8HwPTvd0MfyznPmR+FcdOej8?= =?utf-8?q?a0Xtoc8eBB1yFjkXalXQDeik6gWAiMflHlv+BE5JDju9cJZfG/eh+We3MSsgYvv+H?= =?utf-8?q?MRQNQPEtDeLH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rxZwnpM/oPCxlg31f1bti/SmwK0Bz6768Cf5c2t4E3ASvv6kXl4VRYJdc=;7:2pOGFEma9ux7LLEcsUIoyNLN4TSLszCt3zIujWeqYXqba3HeT3D1Z7no1xe1G8pQUpxag4Oq4p2+pmLUIhMwTJAU2v6zXBtA6it4qUtpw4iwERnVbic0L2OHSCyVpMKHNE7GH9c4DAvzIAcX+SNQOw== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: microsemi.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Dec 2018 22:29:01.0198 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ebee3029-8533-48a7-159f-08d65c936310 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.221];Helo=[AUSMBX1.microsemi.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR19MB0404 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: Murthy Bhat - fix a formatting issue. Reviewed-by: Mahesh Rajashekhara Reviewed-by: Scott Teel Reviewed-by: Dave Carroll Reviewed-by: Kevin Barnett Signed-off-by: Murthy Bhat Signed-off-by: Don Brace --- drivers/scsi/smartpqi/smartpqi_init.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c index 7ece16495a09..6716d30dc5ef 100644 --- a/drivers/scsi/smartpqi/smartpqi_init.c +++ b/drivers/scsi/smartpqi/smartpqi_init.c @@ -5833,7 +5833,12 @@ static ssize_t pqi_unique_id_show(struct device *dev, spin_unlock_irqrestore(&ctrl_info->scsi_device_list_lock, flags); - return snprintf(buffer, PAGE_SIZE, "%16phN", uid); + return snprintf(buffer, PAGE_SIZE, + "%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X\n", + uid[0], uid[1], uid[2], uid[3], + uid[4], uid[5], uid[6], uid[7], + uid[8], uid[9], uid[10], uid[11], + uid[12], uid[13], uid[14], uid[15]); } static ssize_t pqi_lunid_show(struct device *dev, From patchwork Fri Dec 7 22:29:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Don Brace X-Patchwork-Id: 10718963 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 19BD81750 for ; Fri, 7 Dec 2018 22:29:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 088F42F0A8 for ; Fri, 7 Dec 2018 22:29:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F14632F2D9; Fri, 7 Dec 2018 22:29:22 +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 89C322F0A8 for ; Fri, 7 Dec 2018 22:29:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726093AbeLGW3M (ORCPT ); Fri, 7 Dec 2018 17:29:12 -0500 Received: from mail-eopbgr720074.outbound.protection.outlook.com ([40.107.72.74]:6057 "EHLO NAM05-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726065AbeLGW3M (ORCPT ); Fri, 7 Dec 2018 17:29:12 -0500 Received: from BN6PR19CA0071.namprd19.prod.outlook.com (2603:10b6:404:e3::33) by DM5PR19MB1420.namprd19.prod.outlook.com (2603:10b6:3:145::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1404.19; Fri, 7 Dec 2018 22:29:07 +0000 Received: from BN1AFFO11FD025.protection.gbl (2a01:111:f400:7c10::152) by BN6PR19CA0071.outlook.office365.com (2603:10b6:404:e3::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1404.18 via Frontend Transport; Fri, 7 Dec 2018 22:29:07 +0000 Authentication-Results: spf=pass (sender IP is 208.19.99.221) 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.221 as permitted sender) receiver=protection.outlook.com; client-ip=208.19.99.221; helo=AUSMBX1.microsemi.net; Received: from AUSMBX1.microsemi.net (208.19.99.221) by BN1AFFO11FD025.mail.protection.outlook.com (10.58.52.85) 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:29:07 +0000 Received: from AUSMBX2.microsemi.net (10.201.34.32) by AUSMBX1.microsemi.net (10.201.34.31) 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:29:06 -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:29:05 -0600 Subject: [PATCH 10/20] smartpqi: wake up drives after os resumes from suspend From: Don Brace To: , , , , , , , , , , , CC: Date: Fri, 7 Dec 2018 16:29:05 -0600 Message-ID: <154422174585.1218.16702694893501412742.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.221;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(7916004)(396003)(39860400002)(346002)(376002)(136003)(2980300002)(199004)(189003)(44832011)(8936002)(103116003)(11346002)(53936002)(486006)(446003)(476003)(5660300001)(126002)(2906002)(8676002)(9686003)(186003)(316002)(14444005)(305945005)(97736004)(356004)(230700001)(77096007)(26005)(81166006)(47776003)(81156014)(106466001)(106002)(336012)(4326008)(68736007)(33896004)(2201001)(33716001)(50466002)(69596002)(23676004)(58126008)(2486003)(575784001)(86362001)(110136005)(16576012)(76176011)(478600001)(921003)(83996005)(2101003)(1121003);DIR:OUT;SFP:1101;SCL:1;SRVR:DM5PR19MB1420;H:AUSMBX1.microsemi.net;FPR:;SPF:Pass;LANG:en;PTR:InfoDomainNonexistent;A:1;MX:1; X-Microsoft-Exchange-Diagnostics: 1;BN1AFFO11FD025;1:HPReKj3g4bpIxq107sM0C8uiQ5Fzh8izgnP5KTmOCEUHl91fLw+m3hc8b/G0dkW+YUFPm4mA/JcpsWVPJ0PzcCceut6RIhybFdUxQbUmo9YOU8KC+dS/7GCNnPSA8sHi X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5aa829c9-b138-4ffb-8ed4-08d65c9366e9 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390098)(7020095)(4652040)(8989299)(5600074)(711020)(4608076)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060);SRVR:DM5PR19MB1420; X-Microsoft-Exchange-Diagnostics: 1;DM5PR19MB1420;3:Pp2JcpDLqEA+wtlxLyz0SzIWnsR4GgG09PgejU7Sr6/12XJH2Na9FfSnDVC4jpYFYPaMJQEbeAuPrL2iMfkBz7TuXZFengf/FlmoJ7YGGabgH12+ae76tSI+1hWvmt6VghXyDxmOG2MfFlMg8sq7M94w8ysXb11rtCYLYMGTSAW7HcPDOWDp3D0aVZyzjKNCKXM7WtVte4MJ5MzPkLVE4Gj4XGdiMm0SUD+9CUouoGVe8JU1jpRn0OYeLC6fSyjaMI534wnx0kZCt/0WWL7tg2YkRu8vsawafvW8TWMQa2GrAyGTriYp7RR72YMdWOWuqsOC27siJ4jJEPVgJU4kX/J+nF+MrOwftNaPT1MLdmo=;25:JL61d4lWnL6Fy54lXTdxU0tyAetpU5JqwglLlU6RtM+dQSlEY37H3Fn7velqrW5vLp5E7ji6eAmJ0MnqYNEsQLABoR8RVLx4ad8KLK1t35ZqcS2aniMuoC4ZywP7gzfojGrhOLR7hHQBMOVg4EtC0OOX6RIV+JXSaLxu3M1OOHzisWVd0U58pIY/CCpv3B/UIuWFeWzhWzG7VAR1tcL6J6AnZzpVt14ik6lnuNT7/NDLp+JhgON3Yt3mqYjUMk6/kl87rZmZk5IZArp5tiE7PFyRGaTjyixv1hscxrWbWkV9Q2LYs2bVHj114usJUYeAdVNYi1NEyCQjZ/Fl921SGg== X-MS-TrafficTypeDiagnostic: DM5PR19MB1420: X-Microsoft-Exchange-Diagnostics: 1;DM5PR19MB1420;31:RfxDgvX19clV5XbeL+0yU/gELvi7k0bS1PTvSIyvbLlZgX7Q+Xyv6lsfE86vDTPHKvA3nQAdd7YJbdvD3TAwQZSg0gIbn4XwLF4b6KYM5qoj/hvazU2QjmhQTsOjRGtCbeO/jL0SbXy1Lk+bYjOXBL86L+3o4dEr7iiweD6IF2vKTlNWKCeQhr7DDcDCIVqyR6p+CMyOOYjo4QnAa8pA5zKu/WaSRgdo6EqWTYY51zc=;20:j+KCdDmOHPLeP+zGgs6tF+WAy5XNFFxRuQxRtRtYEOIB0/APtkdj0rbBxtPZPJ4nNTXtgMrZ9Ip//XBCgrUXWbD5uqrotNZjcAautLVUjXk8wU2pPXW/ouY/9FxzHKWTXAZeTc+i0RLcv2kFLLthd7CAzJTFl9RFNdmSfudkCAmhj+KJv8Cs2Q/jpRE+QbVGPqCBoDqNNQk1iLcesvJh5MXcrq+PrJIxwmqqTMxcvFRNhh4YvyHhylhsGX0KUveNp4vwpzvr/f6QnakN+qsIuD8aI0yoCR7NvAQhvjRi3Y7uXkAl8IcHQnfJzp+Cq/62r4+ImroUfKI57XQao6JoH0TEmjyoMaIY/ZA5Ucranl+7U/Htn/kyUKtMSFXfpuis7g8oMWis+3ehWPs1aVyqcvZBiHSTYJDT/SpBN5y2XkDZoNP5W8aQhMNByaDOKObNYnBFgjVJyFkRXCfhOmvLFX3pNOHgynDHhrVfDcaqMTphm9D3E2hxhcRY7SiJ5Iga 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)(10201501046)(3231455)(999002)(944501520)(52105112)(93006095)(93004095)(3002001)(6055026)(148016)(149066)(150057)(6041310)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123558120)(20161123564045)(201708071742011)(7699051)(76991095);SRVR:DM5PR19MB1420;BCL:0;PCL:0;RULEID:;SRVR:DM5PR19MB1420; X-Microsoft-Exchange-Diagnostics: 1;DM5PR19MB1420;4:8Fme4Ad7mYnYbIYdDbQrmcOLuA59rLjdNyu/l58rPF5ue1wX+lDnDRlGAlwcWdFkUMF/cdduYdibYgIxIuq/yqnU5kudBWxfz2fzrPLD/ELRGosF+XjCD6OENheYFehpTRb5CxJ1gREa8aoxUwOimDGQDc+y3ISLhz+CdS5iiIhzVCluFlISo+5yNK2nxJCJ6pc2T2I7EC+TVk4mF9be2ECZdqI8cGP1/c3gywgYhHXE3v4sE+aQvacvDIlNkiAJiXtG6cYWE+rQNEEuN9fQ6Q== X-Forefront-PRVS: 0879599414 X-Microsoft-Exchange-Diagnostics: =?utf-8?q?1=3BDM5PR19MB1420=3B23=3AJmPQ/XI?= =?utf-8?q?73B3Qr4uYWc2kFtYJeu/WNNYzfzvjm0FhbNyQ+WqKDXvXoNhZqWGNI/l3GnAobE6v?= =?utf-8?q?9yMUkubWT40S8tFP3xn3U5vi0jt1CKF1ZvsfqIaBhKmema7ukPiExCzvO5e4j87x/?= =?utf-8?q?0TBwh2gXSzcP4+ClRjCFKu1aNPpMquqOOeaSKr2Ts0TLSG6BNfN7ahTPJIBHHHXmD?= =?utf-8?q?kIIIJKllB/0K/yd/eZLz1IcFsYfYtOgqPAIhM96gkCXgzGfSjuSYDRfTGHS/4yLOO?= =?utf-8?q?H5O6uTN9kWT0zncqBx9cr06nsRVxSSe4BTh+HyXH6rYIsnCKgY966kP1/yjIRXYnt?= =?utf-8?q?Y4R2gvDMekyc90k7ule+BO0jDfSxtoP39Buk1xO7SggPXbhc7ZKj0jZlEKOs394eN?= =?utf-8?q?TYFLlIZYfsocOkloYoiuTwW/C/pB9987AwHANJna5FdzGofvWs6qD0GsecHll7DKP?= =?utf-8?q?71Fw/AdgSKe4yloqpjpXSO0mvWYYHQJyTsysy45v5aOQb8Z1YhWtMOim7BDnph+fe?= =?utf-8?q?BX/1F0o6AFUwlr3M/Ma9x9XSaSEFFijYDPcrpsamwwuKBTwbVO35/vlLBhSctymxX?= =?utf-8?q?eH7eku7I7G7ECFh7aZ5oqf5wE5vFDLYKGxvNfXZZm47cj++d3P3/0oorTLJupmCGF?= =?utf-8?q?sQ487bnimTEytoJvjur44JRFY19pVPPPPqGHmncoCqM2Df4WcHEfmvhCpWyGypuhz?= =?utf-8?q?GXYGks97lw2nujIUHNSrTNuG62S4iX3gJVKR9T1YLTjsD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aHOPCTv0wg0PfsoWpAPY+fWa9eltLmu8WRdfFLf2kZStSueNOAV1V46D6y6NEnkfqxroHp/AryI8Eu6mTac/0ag2HXGDx2Mg30qc21lNuP9MZeRW2Z3cT0JDLJB+qC3HHRU65ygXPA5MI03eJmObZzoitSdovnIeU87vRl5aXMM5IP/tHiUAHdpXT6HI5I7p63bsf0P7WxxijQH3LqcQ+0ohOi10IV6HzJzjBBjtu2w4eRF/XqKz1rUhBNGEiCyKUojlMDjE+fUTcrcNL+2dqkPYr7pbijlz9jyv6L/aTWOz37pQrchFS1hTrDOiQO7vD4l46Gg+EzPq3IY9aLH8PBlovG0iioQ8QpqHkpBPEscAOadEVgL/jPzFDzf25CLxZ3Th+S2dp3EXbGw==;5:beS7AOqoD2Dpg9PL1hgQe4PN712sB3bOWiNQ/kDTgH49s5NkCCPY3HbtfKgL34pfFfsx44uMOZE4b4m8fsBdFq5niOhQy6JlIWUH09CASoiC++bqS3T3UGu0ppglg/aA7ZBy4k8OAAT/Ati0Oasuwy4x+3q+WBUSv7uizQKpy04=;7:4IJeH6fcxEZutRTtjW+cMXMG+avNcGG9E4tXZkiU3Hj19H2tsic3WF7YuXOK4uWVjYoMjoqwVm5uDVNYR6/l/p2PoxfDBSrPQjQKslwXnVQKj0SjCOlkUh1GFDo8G/IAxBnnA0GKdzag38OLIQsoow== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: microsemi.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Dec 2018 22:29:07.4940 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5aa829c9-b138-4ffb-8ed4-08d65c9366e9 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.221];Helo=[AUSMBX1.microsemi.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR19MB1420 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 - set allow_restart option during scsi_device init. This allows the kernel to send a START/STOP Unit command to the drive if it encounters a 4/2 check condition in sense data. Reviewed-by: Murthy Bhat Reviewed-by: Mahesh Rajashekhara Reviewed-by: Kevin Barnett Signed-off-by: Dave Carroll Signed-off-by: Don Brace --- drivers/scsi/smartpqi/smartpqi_init.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c index 6716d30dc5ef..acde0abbbf43 100644 --- a/drivers/scsi/smartpqi/smartpqi_init.c +++ b/drivers/scsi/smartpqi/smartpqi_init.c @@ -5434,6 +5434,8 @@ static int pqi_slave_alloc(struct scsi_device *sdev) } if (pqi_is_logical_device(device)) pqi_disable_write_same(sdev); + else + sdev->allow_restart = 1; } spin_unlock_irqrestore(&ctrl_info->scsi_device_list_lock, flags); From patchwork Fri Dec 7 22:29:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Don Brace X-Patchwork-Id: 10718969 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 4D7DE18B8 for ; Fri, 7 Dec 2018 22:29:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3CB202F2E1 for ; Fri, 7 Dec 2018 22:29:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3124E2F2E3; Fri, 7 Dec 2018 22:29:39 +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 EA6C72F2CF for ; Fri, 7 Dec 2018 22:29:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726101AbeLGW3h (ORCPT ); Fri, 7 Dec 2018 17:29:37 -0500 Received: from mail-eopbgr680065.outbound.protection.outlook.com ([40.107.68.65]:61568 "EHLO NAM04-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726065AbeLGW3h (ORCPT ); Fri, 7 Dec 2018 17:29:37 -0500 Received: from MWHPR19CA0074.namprd19.prod.outlook.com (2603:10b6:320:1f::12) by BN6PR19MB0929.namprd19.prod.outlook.com (2603:10b6:404:75::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1404.18; Fri, 7 Dec 2018 22:29:14 +0000 Received: from BN1AFFO11FD005.protection.gbl (2a01:111:f400:7c10::182) by MWHPR19CA0074.outlook.office365.com (2603:10b6:320:1f::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1404.18 via Frontend Transport; Fri, 7 Dec 2018 22:29:14 +0000 Authentication-Results: spf=pass (sender IP is 208.19.99.221) 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.221 as permitted sender) receiver=protection.outlook.com; client-ip=208.19.99.221; helo=AUSMBX1.microsemi.net; Received: from AUSMBX1.microsemi.net (208.19.99.221) by BN1AFFO11FD005.mail.protection.outlook.com (10.58.52.65) 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:29:13 +0000 Received: from AUSMBX2.microsemi.net (10.201.34.32) by AUSMBX1.microsemi.net (10.201.34.31) 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:29:12 -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:29:12 -0600 Subject: [PATCH 11/20] smartpqi: enhance numa node detection From: Don Brace To: , , , , , , , , , , , CC: Date: Fri, 7 Dec 2018 16:29:12 -0600 Message-ID: <154422175200.1218.8971234676113295433.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.221;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(7916004)(396003)(346002)(376002)(136003)(39860400002)(2980300002)(189003)(199004)(69596002)(76176011)(2486003)(305945005)(33896004)(186003)(23676004)(2201001)(2906002)(478600001)(47776003)(86362001)(575784001)(8936002)(8676002)(81156014)(103116003)(77096007)(26005)(97736004)(106466001)(5660300001)(81166006)(58126008)(230700001)(4326008)(33716001)(110136005)(106002)(50466002)(316002)(446003)(16576012)(44832011)(336012)(9686003)(68736007)(356004)(486006)(126002)(53936002)(11346002)(476003)(921003)(83996005)(2101003)(1121003);DIR:OUT;SFP:1101;SCL:1;SRVR:BN6PR19MB0929;H:AUSMBX1.microsemi.net;FPR:;SPF:Pass;LANG:en;PTR:InfoDomainNonexistent;MX:1;A:1; X-Microsoft-Exchange-Diagnostics: 1;BN1AFFO11FD005;1:eyhA5tIrBOExWStE54nz9Dy/d2iSxmi7sY+fwGmpKOKoMjJLi1HPAD4IkxlWmAdptvo3ph2fq81VzudCOK8z+h3ISCr12WLjuagmhwY4tD2pimeGzpdxvfIRBwaMQWgj X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: bcc4aeee-60dd-42f8-7d21-08d65c936a98 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390098)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4608076)(2017052603328)(7153060);SRVR:BN6PR19MB0929; X-Microsoft-Exchange-Diagnostics: 1;BN6PR19MB0929;3:x15FTiKORJaMqKAkGnjQ2VI0abrNEEU4j0cPn5O8S7+Dd4Goi8dB6Hs54wrrei4xs1lqgqMY09/YvNQGXAw7FxZSgahc5rQwXesiFKfVIhFlc8h4pwfFrUjtYOiwy+ZUuCF9KoF+KUCbMyLjQOLkg4pbD9afDmhP4C14OltQgUNe7l9bBn7JKns9yGeib4z6YOU5vM67AhiW0n03/XS1xZ+5S57Ed1OZRa4Bv524CGTdVy3lQoLEPB7pROqqKIZ480ACOgoJ150GZCibPMK4D7VZvUKqtPY5bghAKGylg2YOGiaKXOIU5pQ1pb6k4yCjuUdFwSXJis5EJyJz+jkZr/ZYXy00c6yoRG0LZe6aobk=;25:VswoH4vjKmq5xNBxryJJ0g/p4wYom/+STDY5FkmRRrNT0jEgoXxroFy0NiKwkr7i+C2Vza+pA3kmHHrnK3lPSHVZhrMueeCuCEaybIcYVtpUwzSdBofnsIEx78lpV5EaeLBslg8355Mcx0XsyvfTEGO8Qcsifw4CSWP4AlvNVivIgvqzZBLvWNRKQsQlenDZ1Ckc1pkd7LgyL/JjiZ82XjRxYeGt/x8C9i9x96g90BAO9dAUrxhjrGR9twaGSr1+P/6jOrBdNK8JIRpXj5WSJlLBksolpMjXcUHdY7ZvlM+GmEuuLzlkfs/EC7Z8II6IGnxBTkq4/lsHAFnDXMm2Vw== X-MS-TrafficTypeDiagnostic: BN6PR19MB0929: X-Microsoft-Exchange-Diagnostics: 1;BN6PR19MB0929;31:zwpE/V7B3LInAIwy1539AYQEnoCTiRSmU54xz6n4NxIZKemPLIq8G+ULmm+YEdVyXkwZpi32Ui/LPYWUl1Kt5hV+hMZ7wvRayj6bpHFkkrShyckaKwVb87MkfWsmS+nO+zSd9sOSM7nxvp6W6J23OTxMudb11AKjRMuGgRoW8xyiybDQ6V3ZLV/SKteBpZcRjZ2wEKiUuCTdA/WqvhF/nzItbU5Tv5Xo9Gfgawsr9Vs=;20:b6X9MQD/agUdt+HSE07egL9hmUAwvlfMGMkRVg/wQRg/o/0JnMUrbzth/6AZPdXM338aduJXNSRFMKBwX3Fi2XLSU9nM3eJADhcXwn1BAoit5T2rTrjx2nZyr1OJRsuyaiEUtQCt6Hieva4EBXXhspxXnWBThc/p8qzcwNKU37JNL7ZPWCRtbyAkKAuN0SMy51loj4nibrLK15EvuqaVAxStN9Uu+ZvInRHBBd03IgT/94jbowzLirlOZCvRZZlu1/aWczjCKiAmW7xTTbyNxfSKpNPAhhDqebCdfdSFUHfuppkuDY5mPIo9gS01y8bkV3XpqbWEnZ4PoOm2oYb5U2LRUsOla0DK8iv9Eamt5/cxaSfiv32k9medJqHwDGUyhqQW5Nsr54jdkiqgOIw6G6+jCsCijPSmoxjH/o6rLpue01CKg1pMBF1bX+JUMp+ju4R5hRKxNwDP6lPfQdUcfqJXuKjsFvbWIMbO0an7rMfBYX/dracidANvvdZWROWU 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)(10201501046)(3002001)(93006095)(93004095)(3231455)(999002)(944501520)(52105112)(6055026)(148016)(149066)(150057)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(20161123560045)(20161123564045)(201708071742011)(7699051)(76991095);SRVR:BN6PR19MB0929;BCL:0;PCL:0;RULEID:;SRVR:BN6PR19MB0929; X-Microsoft-Exchange-Diagnostics: 1;BN6PR19MB0929;4:R3y1zDrtca3RP3XHolSLM/ZB4pj47qV7Frt3hior/KliAxJ/9SGjenjvDHnIISxDosCsG+370Yc62PbWBHIG32CRP7OwN7mSeaaHJiARtADvvgTw0hKCF6cgYdsQ1TPHJ33oHIFIBDLJZNMjs6HajnsLHlDp+Le3BjOozVe0Iqm/FHomo2cTMHkAGc0d38yB2D9xqxjRVukc4fm8/AidBdUp9eQRSo35hNP4kYffM9Bg2wNqjzT6W7wN0oN5GY2xUz5cV1bD/jSFQEedS7FbNA== X-Forefront-PRVS: 0879599414 X-Microsoft-Exchange-Diagnostics: =?utf-8?q?1=3BBN6PR19MB0929=3B23=3A0KRX1KO?= =?utf-8?q?3cvOs+hH/ByDEtvX6VISfI+Nh5uarFHKL5R6e9XUNSIeQ9fcqeFLx7CeaKU89OhhE?= =?utf-8?q?7K3N2YqmXJ6FubCWEqXYVtkk8+2uxbZzUGunPvzv1M/2cS6KQmVXR/2ZnQxVj3Hpl?= =?utf-8?q?l4h88EXIoMUk+8LfyKqEuzWPTBPXDvz0+tHT8fHBYe3sLirlu56+ZcLhe9zXbwin4?= =?utf-8?q?WTE+Ygox5+l25hZR72I7W9Ni24WPhCu4i2dp9VKTzUQ3+JuRIU5Hm6PiTyjqRFJJe?= =?utf-8?q?fYkjJe2O5x8WT4u02EkwDixiJPEiMrdEGzkkU9V71g35xpJERdDusM11fkUc0HFCy?= =?utf-8?q?x/UvusQirdUlPGNg4AoeCMTnP6wifivWS5bhl7iLddyjfocMkKRCEiENO3f/zwjJ7?= =?utf-8?q?ckd7A0clWq9AYi1iqn/64fzzZu2pBpYha0x6ykRjIL3gu2lvPwb+1qDBLwwT0sT9g?= =?utf-8?q?z4/Dx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put: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: microsemi.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Dec 2018 22:29:13.6579 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bcc4aeee-60dd-42f8-7d21-08d65c936a98 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.221];Helo=[AUSMBX1.microsemi.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR19MB0929 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: Sagar Biradar - set pci_dev->dev to 0 only if the node is NO_NUMA_NODE. If not, do not reset the value but retain it. Reviewed-by: Murthy Bhat Reviewed-by: Mahesh Rajashekhara Reviewed-by: Dave Carroll Reviewed-by: Scott Teel Reviewed-by: Kevin Barnett Signed-off-by: Sagar Biradar Signed-off-by: Don Brace --- drivers/scsi/smartpqi/smartpqi_init.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c index acde0abbbf43..a98b3de40c74 100644 --- a/drivers/scsi/smartpqi/smartpqi_init.c +++ b/drivers/scsi/smartpqi/smartpqi_init.c @@ -7131,7 +7131,7 @@ static int pqi_pci_probe(struct pci_dev *pci_dev, const struct pci_device_id *id) { int rc; - int node; + int node, cp_node; struct pqi_ctrl_info *ctrl_info; pqi_print_ctrl_info(pci_dev, id); @@ -7149,8 +7149,12 @@ static int pqi_pci_probe(struct pci_dev *pci_dev, "controller device ID matched using wildcards\n"); node = dev_to_node(&pci_dev->dev); - if (node == NUMA_NO_NODE) - set_dev_node(&pci_dev->dev, 0); + if (node == NUMA_NO_NODE) { + cp_node = cpu_to_node(0); + if (cp_node == NUMA_NO_NODE) + cp_node = 0; + set_dev_node(&pci_dev->dev, cp_node); + } ctrl_info = pqi_alloc_ctrl_info(node); if (!ctrl_info) { From patchwork Fri Dec 7 22:29:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Don Brace X-Patchwork-Id: 10718965 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 EAD691750 for ; Fri, 7 Dec 2018 22:29:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D85C42F0A8 for ; Fri, 7 Dec 2018 22:29:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CBF342F2D9; Fri, 7 Dec 2018 22:29:24 +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 63E962F0A8 for ; Fri, 7 Dec 2018 22:29:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726093AbeLGW3Y (ORCPT ); Fri, 7 Dec 2018 17:29:24 -0500 Received: from mail-eopbgr760087.outbound.protection.outlook.com ([40.107.76.87]:25856 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726073AbeLGW3X (ORCPT ); Fri, 7 Dec 2018 17:29:23 -0500 Received: from MWHPR19CA0066.namprd19.prod.outlook.com (2603:10b6:300:94::28) by CY4PR19MB1415.namprd19.prod.outlook.com (2603:10b6:903:144::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1404.22; Fri, 7 Dec 2018 22:29:20 +0000 Received: from BN1AFFO11FD016.protection.gbl (2a01:111:f400:7c10::194) by MWHPR19CA0066.outlook.office365.com (2603:10b6:300:94::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1404.19 via Frontend Transport; Fri, 7 Dec 2018 22:29:20 +0000 Authentication-Results: spf=pass (sender IP is 208.19.99.221) 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.221 as permitted sender) receiver=protection.outlook.com; client-ip=208.19.99.221; helo=AUSMBX1.microsemi.net; Received: from AUSMBX1.microsemi.net (208.19.99.221) by BN1AFFO11FD016.mail.protection.outlook.com (10.58.52.76) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.1404.13 via Frontend Transport; Fri, 7 Dec 2018 22:29:20 +0000 Received: from AUSMBX2.microsemi.net (10.201.34.32) by AUSMBX1.microsemi.net (10.201.34.31) 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:29:18 -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:29:18 -0600 Subject: [PATCH 12/20] smartpqi: add support for huawei controllers From: Don Brace To: , , , , , , , , , , , CC: Date: Fri, 7 Dec 2018 16:29:18 -0600 Message-ID: <154422175816.1218.13628875971646330704.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.221;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(7916004)(346002)(136003)(376002)(39860400002)(396003)(2980300002)(189003)(199004)(81166006)(2201001)(97736004)(69596002)(86362001)(81156014)(103116003)(44832011)(126002)(11346002)(336012)(106466001)(5660300001)(476003)(486006)(230700001)(50466002)(478600001)(8676002)(446003)(33716001)(33896004)(68736007)(9686003)(316002)(53936002)(16576012)(76176011)(356004)(186003)(58126008)(26005)(110136005)(23676004)(2486003)(47776003)(106002)(8936002)(2906002)(4326008)(305945005)(77096007)(921003)(1121003)(83996005)(2101003);DIR:OUT;SFP:1101;SCL:1;SRVR:CY4PR19MB1415;H:AUSMBX1.microsemi.net;FPR:;SPF:Pass;LANG:en;PTR:InfoDomainNonexistent;MX:1;A:1; X-Microsoft-Exchange-Diagnostics: 1;BN1AFFO11FD016;1:U4IgmhbZ2Wml6s4Oi9h5rTdWqF1WxhILCdpZ8LgibfI+Ms3c2ou47BIk9M4pV5Ewofj0sbKqKLvb1RNxsenroaSdoU3yn9021FqGnwVutoijFDBef9ggeIxncEPrj0Lw X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e0d806a3-247c-40d4-22b4-08d65c936e94 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390098)(7020095)(4652040)(8989299)(5600074)(711020)(4608076)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060);SRVR:CY4PR19MB1415; X-Microsoft-Exchange-Diagnostics: 1;CY4PR19MB1415;3:0Zbn4uR5X+fzvk7/NgGTOw9fUW0ZM1YvMkPd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HsQ5jdS4y4OJCSk0fnKRmH/Fpns06QqRdrXb/Hsvv9O+qZRfXzOvJk4eVa0zTkibaO9FXUscynQ5gJxUVk/62VOvmX+M0wAGef7pgwZv3r3FxDNSneiuCAZXbKQTldaOV7BuhPRWHnnILgIn+BSxNAu/wK/FDKtHzhUAM3b1CZbNnz7yu3Ie4PsBj7Jq7zVwr3+92mrK1CyVux1jmaYE3nndjXiuChWNX3pGvuvqKi13n+s2SKpB0hfkkevtZ64rlV9E6JGWXPHC9oH/cr3Untl3fCzxaUSItoGYLfvfZiA/WqRu6hUxqrgXjXuv/q++R3tMnoZHf5/Kr3ukLLpLoycenC/3IP89x8zyWkNY4uKUED8nLSgWckB0K4RxkPEMQmAU+B2SuyGloESom0B2fIbusv X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3231455)(999002)(944501520)(52105112)(93006095)(93004095)(3002001)(10201501046)(6055026)(148016)(149066)(150057)(6041310)(20161123564045)(20161123560045)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051)(76991095);SRVR:CY4PR19MB1415;BCL:0;PCL:0;RULEID:;SRVR:CY4PR19MB1415; X-Microsoft-Exchange-Diagnostics: 1;CY4PR19MB1415;4:RMctigDraOMK6RRuMADNc3NKNYrRurp3mRsjicpjcCq2dCP5Em0ZrwCldUgmKLyZTbCwg77wcBmSlxgRejyTWVFKwvg9fHbztA5SQq6Q3Lw0kJI7gRKFyJ2x70aBtFrS9bab7lsD8LFhwjvc3ggBK+xx9BAIDy/w0qs1VrvsfTHbZJlmmNE12dGUfy9q8w9I5P3yhKPUe1I4llxIekHrBaGKxiELvvIn48pSQCejBwvPvNaeU7pr4IZ+16SE0rOSeGxJjB8RuqC/Ofki4q40NA== X-Forefront-PRVS: 0879599414 X-Microsoft-Exchange-Diagnostics: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5lD22bXFoW2DGMCdWqPsuCYj4iryWaZSaXxORQfOQsgWWEgWbLKnmBib/r8nyimHdWSM/qqkm0S5uOIj14n6p4Hz+Lv/7gF3n1xbwC4+unjf3gUKMcOa6zSOHmy7IIoZGIb8g2hqrByu4/12o1FFhEoazgztv0p02HsWDi4zwGZ0zHPkDuqLIv83F7AQPqeWCh1kRWFtHhodKud72NVDVuYRcTA==;5:RzTEGKr2v8CL8U03VfH6QC5Sx6roX/ftpUG8eMnoeK2vZ6pzV4q09jfDYDxTdCf+dLb0bi4s/sd7LfGtrvhnsuilCAtKLeWGgf7oOi5G9yFvwNCg3otMYPeR92h7eb2NWODEXntHazlcR0pRl7D6zpUiQi64ChdIBrzWz4RdbMs=;7:NZvClDY7dp9B3OE6RHdlxmYUMbfifx+lG1Zhjg+mXWl9CQRJaNHvMUNexpeISfYUC23i9l2vOM/vwLNUA26NugtGvBOQ9SYLUedm6IgjvT1/tZGvM7P0oo27G/9d1Gb2C8uATSMj3XCnl4Uxw8P90A== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: microsemi.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Dec 2018 22:29:20.3403 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e0d806a3-247c-40d4-22b4-08d65c936e94 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.221];Helo=[AUSMBX1.microsemi.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR19MB1415 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: Ajish Koshy Reviewed-by: Murthy Bhat Reviewed-by: Mahesh Rajashekhara Reviewed-by: Dave Carroll Reviewed-by: Scott Teel Reviewed-by: Kevin Barnett Signed-off-by: Ajish Koshy Signed-off-by: Don Brace --- drivers/scsi/smartpqi/smartpqi_init.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c index a98b3de40c74..c5640b379505 100644 --- a/drivers/scsi/smartpqi/smartpqi_init.c +++ b/drivers/scsi/smartpqi/smartpqi_init.c @@ -7382,6 +7382,30 @@ static const struct pci_device_id pqi_pci_id_table[] = { PCI_DEVICE_SUB(PCI_VENDOR_ID_ADAPTEC2, 0x028f, 0x1bd4, 0x004c) }, + { + PCI_DEVICE_SUB(PCI_VENDOR_ID_ADAPTEC2, 0x028f, + 0x19e5, 0xd227) + }, + { + PCI_DEVICE_SUB(PCI_VENDOR_ID_ADAPTEC2, 0x028f, + 0x19e5, 0xd228) + }, + { + PCI_DEVICE_SUB(PCI_VENDOR_ID_ADAPTEC2, 0x028f, + 0x19e5, 0xd229) + }, + { + PCI_DEVICE_SUB(PCI_VENDOR_ID_ADAPTEC2, 0x028f, + 0x19e5, 0xd22a) + }, + { + PCI_DEVICE_SUB(PCI_VENDOR_ID_ADAPTEC2, 0x028f, + 0x19e5, 0xd22b) + }, + { + PCI_DEVICE_SUB(PCI_VENDOR_ID_ADAPTEC2, 0x028f, + 0x19e5, 0xd22c) + }, { PCI_DEVICE_SUB(PCI_VENDOR_ID_ADAPTEC2, 0x028f, PCI_VENDOR_ID_ADAPTEC2, 0x0110) From patchwork Fri Dec 7 22:29:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Don Brace X-Patchwork-Id: 10718967 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 98ABD109C for ; Fri, 7 Dec 2018 22:29:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 848CC2F0A8 for ; Fri, 7 Dec 2018 22:29:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 781802F2E3; Fri, 7 Dec 2018 22:29:38 +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 2072E2F0A8 for ; Fri, 7 Dec 2018 22:29:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726095AbeLGW3g (ORCPT ); Fri, 7 Dec 2018 17:29:36 -0500 Received: from mail-eopbgr730074.outbound.protection.outlook.com ([40.107.73.74]:39200 "EHLO NAM05-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726073AbeLGW3g (ORCPT ); Fri, 7 Dec 2018 17:29:36 -0500 Received: from BN6PR19CA0110.namprd19.prod.outlook.com (2603:10b6:404:a0::24) by DM5PR19MB0938.namprd19.prod.outlook.com (2603:10b6:3:32::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1404.22; Fri, 7 Dec 2018 22:29:32 +0000 Received: from BN1BFFO11FD017.protection.gbl (2a01:111:f400:7c10::1:133) by BN6PR19CA0110.outlook.office365.com (2603:10b6:404:a0::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1404.17 via Frontend Transport; Fri, 7 Dec 2018 22:29:30 +0000 Authentication-Results: spf=pass (sender IP is 208.19.100.23) 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.100.23 as permitted sender) receiver=protection.outlook.com; client-ip=208.19.100.23; helo=AVMBX3.microsemi.net; Received: from AVMBX3.microsemi.net (208.19.100.23) by BN1BFFO11FD017.mail.protection.outlook.com (10.58.144.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.1404.13 via Frontend Transport; Fri, 7 Dec 2018 22:29:26 +0000 Received: from AVMBX3.microsemi.net (10.100.34.33) by AVMBX3.microsemi.net (10.100.34.33) 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 14:29:25 -0800 Received: from [127.0.1.1] (10.238.32.34) by avmbx3.microsemi.net (10.100.34.33) with Microsoft SMTP Server id 15.1.1531.3 via Frontend Transport; Fri, 7 Dec 2018 14:29:24 -0800 Subject: [PATCH 13/20] smartpqi: check for null device pointers From: Don Brace To: , , , , , , , , , , , CC: Date: Fri, 7 Dec 2018 16:29:24 -0600 Message-ID: <154422176445.1218.16736923839560332932.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.100.23;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(7916004)(376002)(346002)(39860400002)(136003)(396003)(2980300002)(189003)(199004)(33896004)(106466001)(47776003)(486006)(186003)(77096007)(97736004)(26005)(44832011)(478600001)(476003)(103116003)(2486003)(23676004)(8936002)(356004)(126002)(69596002)(8676002)(68736007)(81166006)(81156014)(76176011)(9686003)(316002)(50466002)(230700001)(16576012)(58126008)(106002)(110136005)(53936002)(5660300001)(305945005)(446003)(4326008)(2906002)(86362001)(11346002)(33716001)(14444005)(2201001)(336012)(921003)(1121003)(2101003)(83996005);DIR:OUT;SFP:1101;SCL:1;SRVR:DM5PR19MB0938;H:AVMBX3.microsemi.net;FPR:;SPF:Pass;LANG:en;PTR:InfoDomainNonexistent;MX:1;A:1; X-Microsoft-Exchange-Diagnostics: 1;BN1BFFO11FD017;1:AadgM7dFmj8XVCmpuuBuVE1KLN9QjMlJo7cPj4t0fS+oChzkJdrc9x7d+ck0AMEyOni5Y4bEKWAyHXK6OP+iva1bxN4NWJxcr6UCHtq39n2AVEQpivE9cF5yN/DeATlw X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e095ce25-59c5-47df-8fd2-08d65c93725b X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390098)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4608076)(2017052603328)(7153060);SRVR:DM5PR19MB0938; X-Microsoft-Exchange-Diagnostics: 1;DM5PR19MB0938;3:brnX3KWXVFcnper6n3I4WZw+B0Gs6XeTp9ihJtHLqteW31cCMrKuht7dHrhwI+1ynnOKkfLIE3SB1HHdqqEvCfbAtmMtGVBxnu0tO2DlW1egeJbqrUvDFMKA/V/p+KnMyXrLSALjmMHNSSwoHwO4IJNBTl7IHTvLdsA7/BLF9/2DUD3ylC8aqycrO4UCLvFYyLITM4M5slETqBz+NGFi2pa/h9EdVpSQ79QELtQn0q/bsle7fFssLBKhAZlMv9FZ3ipfvj1UMXp+YauY99Vxne/XfzWysJ55G5XAiKqOHpXTaqyJYk+JnOWU6bWvcStkJR6IdROrBrug2U/W//ItMVi3WJgkDwqAfPP0wg6aPZY=;25:gdOK+q4FEub59+QOXXw9KKTUh49olLymL/JlxEYug68Ixu+r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YUImeFjKefTGVdlCIw9bdj0SSWqHxJyt98yRLbUz+huxS7VXayDv4+m/kwwy/aKHzMWCnZD/4oL1vJzxOPk+pH9cOO5Aozb0O68bOe1SVonxEsrpVdmeC2cTc32oStZk= X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(93004095)(3002001)(10201501046)(3231455)(999002)(944501520)(52105112)(6055026)(148016)(149066)(150057)(6041310)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123558120)(20161123564045)(201708071742011)(7699051)(76991095);SRVR:DM5PR19MB0938;BCL:0;PCL:0;RULEID:;SRVR:DM5PR19MB0938; X-Microsoft-Exchange-Diagnostics: 1;DM5PR19MB0938;4:XfhYlu7Ptewhiv8S7ycB+6lHr5wXjiQ0QuHCdPW+BnvEEZg20pZWue60FmOwyq3LmkwdXIVPNwK1tLXWq+8GZHlsMyPeGsBkgfAfAIGP8fdAd3Qqq3dwSooBhJvmNXnFXXP55M+wT/N+Dyz4J5ubNJZtEXAaC8rVfPuGeZhy7BZzaFjb/6ydijxviOksM9szw6pqTaKdMDrCPxkBBGgQTz7G0h2Aq5XEJE74ejm/QZ9HgamWmCc7funTHhouXspaMof3fuyGV9sekBuQXA6zHg== X-Forefront-PRVS: 0879599414 X-Microsoft-Exchange-Diagnostics: =?utf-8?q?1=3BDM5PR19MB0938=3B23=3AVyBe/+l?= =?utf-8?q?3mugPS5Jnk8mZLrv/pHsR7WyZ6s3LDAsSpdm7uDoVsmP9iVr7nnNpAaIv67Hvxk8m?= =?utf-8?q?Dds3IRYdCevrC+usfndj6S2yb8yIAAYMr2gc7PUUFAaeF4mPdg5cgC4+YcfZN+Fsd?= =?utf-8?q?7tWf0IIL7smqFtIg74lSPBmCcYFdhG7g0eqbA30TEPYKlODkVwf+gkhPqS2aAyd26?= =?utf-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ugCyMLnq7D/+P6fUxLyRKWmvLToxIEQbRJ8aPVAedoP5tlBL4iNcsqND8NIf6DC3uLw13ucm5OwlQkZCsZq3PYkttzo7NKqcAi3INAM7OwxjKrnj2uD6BP4VZHlw=;7:ZVoUPvLAvmGEif0QMHFKcVOMqiBLqEtfVodv9nmWKItMogeapxf6s5MChOCnDTKjE8ULhRkWYF+DdxAVXmJMksMUPFZoy4Dy4wHANjoUDcsO8GM7NKdo1uDbLxQ8aaDBh7Z62DIZgVFXGwSWn74kAQ== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: microsemi.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Dec 2018 22:29:26.6647 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e095ce25-59c5-47df-8fd2-08d65c93725b 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.23];Helo=[AVMBX3.microsemi.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR19MB0938 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: Mahesh Rajashekhara - wait on all outstanding I/O to complete before the device is removed. - check for null device pointers in IO entry/completion functions. Reviewed-by: Scott Teel Reviewed-by: Murthy Bhat Reviewed-by: Dave Carroll Reviewed-by: Kevin Barnett Signed-off-by: Mahesh Rajashekhara Signed-off-by: Don Brace --- drivers/scsi/smartpqi/smartpqi.h | 2 + drivers/scsi/smartpqi/smartpqi_init.c | 65 +++++++++++++++++++++++++++++++-- 2 files changed, 64 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/smartpqi/smartpqi.h b/drivers/scsi/smartpqi/smartpqi.h index a39c324dedab..4f52b5be3693 100644 --- a/drivers/scsi/smartpqi/smartpqi.h +++ b/drivers/scsi/smartpqi/smartpqi.h @@ -862,6 +862,7 @@ struct pqi_scsi_dev { u8 volume_offline : 1; bool aio_enabled; /* only valid for physical disks */ bool in_reset; + bool in_remove; bool device_offline; u8 vendor[8]; /* bytes 8-15 of inquiry data */ u8 model[16]; /* bytes 16-31 of inquiry data */ @@ -1063,6 +1064,7 @@ struct pqi_ctrl_info { struct mutex lun_reset_mutex; bool controller_online; bool block_requests; + bool in_shutdown; u8 inbound_spanning_supported : 1; u8 outbound_spanning_supported : 1; u8 pqi_mode_enabled : 1; diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c index c5640b379505..5f7ae5946ddc 100644 --- a/drivers/scsi/smartpqi/smartpqi_init.c +++ b/drivers/scsi/smartpqi/smartpqi_init.c @@ -74,6 +74,8 @@ static int pqi_aio_submit_io(struct pqi_ctrl_info *ctrl_info, struct scsi_cmnd *scmd, u32 aio_handle, u8 *cdb, unsigned int cdb_length, struct pqi_queue_group *queue_group, struct pqi_encryption_info *encryption_info, bool raid_bypass); +static int pqi_device_wait_for_pending_io(struct pqi_ctrl_info *ctrl_info, + struct pqi_scsi_dev *device, unsigned long timeout_secs); /* for flags argument to pqi_submit_raid_request_synchronous() */ #define PQI_SYNC_FLAGS_INTERRUPTABLE 0x1 @@ -317,6 +319,17 @@ static inline bool pqi_device_in_reset(struct pqi_scsi_dev *device) return device->in_reset; } +static inline void pqi_device_remove_start(struct pqi_scsi_dev *device) +{ + device->in_remove = true; +} + +static inline bool pqi_device_in_remove(struct pqi_ctrl_info *ctrl_info, + struct pqi_scsi_dev *device) +{ + return device->in_remove & !ctrl_info->in_shutdown; +} + static inline void pqi_schedule_rescan_worker_with_delay( struct pqi_ctrl_info *ctrl_info, unsigned long delay) { @@ -1487,9 +1500,24 @@ static int pqi_add_device(struct pqi_ctrl_info *ctrl_info, return rc; } +#define PQI_PENDING_IO_TIMEOUT_SECS 20 + static inline void pqi_remove_device(struct pqi_ctrl_info *ctrl_info, struct pqi_scsi_dev *device) { + int rc; + + pqi_device_remove_start(device); + + rc = pqi_device_wait_for_pending_io(ctrl_info, device, + PQI_PENDING_IO_TIMEOUT_SECS); + if (rc) + dev_err(&ctrl_info->pci_dev->dev, + "scsi %d:%d:%d:%d removing device with %d outstanding commands\n", + ctrl_info->scsi_host->host_no, device->bus, + device->target, device->lun, + atomic_read(&device->scsi_cmds_outstanding)); + if (pqi_is_logical_device(device)) scsi_remove_device(device->sdev); else @@ -5042,7 +5070,17 @@ void pqi_prep_for_scsi_done(struct scsi_cmnd *scmd) { struct pqi_scsi_dev *device; + if (!scmd->device) { + set_host_byte(scmd, DID_NO_CONNECT); + return; + } + device = scmd->device->hostdata; + if (!device) { + set_host_byte(scmd, DID_NO_CONNECT); + return; + } + atomic_dec(&device->scsi_cmds_outstanding); } @@ -5059,9 +5097,16 @@ static int pqi_scsi_queue_command(struct Scsi_Host *shost, device = scmd->device->hostdata; ctrl_info = shost_to_hba(shost); + if (!device) { + set_host_byte(scmd, DID_NO_CONNECT); + pqi_scsi_done(scmd); + return 0; + } + atomic_inc(&device->scsi_cmds_outstanding); - if (pqi_ctrl_offline(ctrl_info)) { + if (pqi_ctrl_offline(ctrl_info) || pqi_device_in_remove(ctrl_info, + device)) { set_host_byte(scmd, DID_NO_CONNECT); pqi_scsi_done(scmd); return 0; @@ -5214,12 +5259,23 @@ static void pqi_fail_io_queued_for_device(struct pqi_ctrl_info *ctrl_info, } static int pqi_device_wait_for_pending_io(struct pqi_ctrl_info *ctrl_info, - struct pqi_scsi_dev *device) + struct pqi_scsi_dev *device, unsigned long timeout_secs) { + unsigned long timeout; + + timeout = (timeout_secs * HZ) + jiffies; + while (atomic_read(&device->scsi_cmds_outstanding)) { pqi_check_ctrl_health(ctrl_info); if (pqi_ctrl_offline(ctrl_info)) return -ENXIO; + if (timeout_secs != NO_TIMEOUT) { + if (time_after(jiffies, timeout)) { + dev_err(&ctrl_info->pci_dev->dev, + "timed out waiting for pending IO\n"); + return -ETIMEDOUT; + } + } usleep_range(1000, 2000); } @@ -5345,7 +5401,8 @@ static int pqi_device_reset(struct pqi_ctrl_info *ctrl_info, msleep(PQI_LUN_RESET_RETRY_INTERVAL_MSECS); } if (rc == 0) - rc = pqi_device_wait_for_pending_io(ctrl_info, device); + rc = pqi_device_wait_for_pending_io(ctrl_info, + device, NO_TIMEOUT); return rc == 0 ? SUCCESS : FAILED; } @@ -7189,6 +7246,8 @@ static void pqi_pci_remove(struct pci_dev *pci_dev) if (!ctrl_info) return; + ctrl_info->in_shutdown = true; + pqi_remove_ctrl(ctrl_info); } From patchwork Fri Dec 7 22:29:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Don Brace X-Patchwork-Id: 10718971 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 7113C109C for ; Fri, 7 Dec 2018 22:29:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5F1FB2F0A8 for ; Fri, 7 Dec 2018 22:29:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 533372F2E3; Fri, 7 Dec 2018 22:29:39 +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 C69832F0A8 for ; Fri, 7 Dec 2018 22:29:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726110AbeLGW3i (ORCPT ); Fri, 7 Dec 2018 17:29:38 -0500 Received: from mail-eopbgr730074.outbound.protection.outlook.com ([40.107.73.74]:39200 "EHLO NAM05-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726093AbeLGW3h (ORCPT ); Fri, 7 Dec 2018 17:29:37 -0500 Received: from BL2PR19CA0009.namprd19.prod.outlook.com (2603:10b6:201:f::19) by DM5PR19MB0938.namprd19.prod.outlook.com (2603:10b6:3:32::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1404.22; Fri, 7 Dec 2018 22:29:33 +0000 Received: from BN1BFFO11FD006.protection.gbl (2a01:111:f400:7c10::1:152) by BL2PR19CA0009.outlook.office365.com (2603:10b6:201:f::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1404.20 via Frontend Transport; Fri, 7 Dec 2018 22:29:33 +0000 Authentication-Results: spf=pass (sender IP is 208.19.100.23) 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.100.23 as permitted sender) receiver=protection.outlook.com; client-ip=208.19.100.23; helo=AVMBX3.microsemi.net; Received: from AVMBX3.microsemi.net (208.19.100.23) by BN1BFFO11FD006.mail.protection.outlook.com (10.58.144.69) 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:29:33 +0000 Received: from AVMBX2.microsemi.net (10.100.34.32) by AVMBX3.microsemi.net (10.100.34.33) 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 14:29:31 -0800 Received: from [127.0.1.1] (10.238.32.34) by avmbx2.microsemi.net (10.100.34.32) with Microsoft SMTP Server id 15.1.1531.3 via Frontend Transport; Fri, 7 Dec 2018 14:29:31 -0800 Subject: [PATCH 14/20] smartpqi: allow for larger raid maps From: Don Brace To: , , , , , , , , , , , CC: Date: Fri, 7 Dec 2018 16:29:31 -0600 Message-ID: <154422177108.1218.16653108167308174979.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.100.23;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(979002)(7916004)(376002)(346002)(39860400002)(136003)(396003)(2980300002)(189003)(199004)(33896004)(106466001)(47776003)(486006)(186003)(77096007)(97736004)(26005)(44832011)(478600001)(476003)(103116003)(2486003)(23676004)(8936002)(356004)(126002)(69596002)(8676002)(68736007)(81166006)(81156014)(76176011)(9686003)(316002)(50466002)(230700001)(16576012)(58126008)(106002)(110136005)(53936002)(5660300001)(305945005)(446003)(4326008)(2906002)(86362001)(11346002)(33716001)(14444005)(2201001)(336012)(921003)(1121003)(2101003)(83996005)(969003)(989001)(999001)(1009001)(1019001);DIR:OUT;SFP:1101;SCL:1;SRVR:DM5PR19MB0938;H:AVMBX3.microsemi.net;FPR:;SPF:Pass;LANG:en;PTR:InfoDomainNonexistent;MX:1;A:1; X-Microsoft-Exchange-Diagnostics: 1;BN1BFFO11FD006;1:8or5j1p6/nAhemraiZeLLwBbYJTPpjSnzy2EsFeOrm0TRjgemkOciaV8R1oZjVIMP7N/v3eSWUEwzoUHu9KipVI2p/Lb+IPafEFCtMh06sfhD9sJ0QphioO6AdEJeFvu X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 665f1f14-3544-42d9-1c6c-08d65c93763f X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390098)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4608076)(2017052603328)(7153060);SRVR:DM5PR19MB0938; X-Microsoft-Exchange-Diagnostics: 1;DM5PR19MB0938;3:gjuIaR+xAhtvo9iHVP1N86nyz4is98H+3W/kVVmehwb6GkotQeP8jdND8dmofNIzv2mUnRl5gf0PIGZoPvM2CwqNJW8CqUj086TXlPO1YetuBkVpxp82zVaMqok0Qivr26OjTeoX1DV2EFlx80AabW3FNQshZgTElDgbqBSYflAPUZbthVQmTibjIGeYZD8e0KHusTUQxNlGIYxESqi6VlHbq7utGzRnKv4nqvLqAO8evoSx4eU7CCqWY8lQ0dH52dfymxBuf6+sHLTYY7MvGJLAsgqRh9O/8SC4kiel5fHdn51B2Fi/BuhRWPVeYItA91h+s2Ou74XecV43SpawfoU/CljLa3SU1WAxde97PGk=;25:AAiEFQKp+WW/nMaP5pjsg5vTe4R0Em/2pFgDGrwUVTj3YMAnwJtmyZCt4bC7SszJyU8p8SlSim3y4X8WF6LsGYK1XCsmlEf/yBc0Bva+plmi+02fSW+I7HdotN49eexhZNjsbpG46MxlJ6FmFVvvGvlxYmhWrdx2rTvA8b+4eml4wMUw8JZ9CommxfT81CkOehOXmGVYr2Aqvb1Ymgkxe6EeEeYy8AI3UgTzsYYFlGjRjCAVx3uBFW7jktP6iA0C1BfdnPtXDHY+AdcMug9Xi4Yh6O+uGLzJSO7tsyWa/zj66W14HFOu23FQCNFlpxurD3hbHqNMs7KTscnWxvnQlQ== X-MS-TrafficTypeDiagnostic: DM5PR19MB0938: X-Microsoft-Exchange-Diagnostics: 1;DM5PR19MB0938;31:ttjqtehU28yaHomJ7ZRj5W4NPpZv8PNyP0AXoqcVUcZWFSjuzpnS5/Z0tjsg5U/jIaNzPOuBBIeNWRvVcG9RtOl5lGc77NdJpXvgcDzOw2xYV79pnACW7ubZf2AUam3Tw0vzahOn6P4g2RcTvfEAR+WnMY+Je2IZDCn8vqnko27ZJrs0piYyQeAG/xJZzsYXEmbEkXx7xt8pLjX+nxzwVdqTkTbu73YDnVWgwADhJ0w=;20:EN2GqemeX7Rk+qf9VZO0luDfFK5MOI/wXxsj+r5SkM3695rpez3Yd0S9VHuvzRdYuUREGHml0nakfExTqfhgrtmYms6NovKXAv3abq97z4JfwPgTLHewvOzOBvhx6E54KXcx2Q+Eyz8LunyMPfLM/w4PDoaFkkeAtB3U+/9fIpNQJGs/SUAgfHG08LslbfkqB0re1M5+5Gvgl1OaPc3lHje1s5LquO3TxsU2L/wIuAEHjXE418N4kFN98skoGTlBF3waKjLlQ4dcBFyNg0TGEWL/AM0vFygGKUNJcHUxci+zjtMpS/C4QI3fZYPSTpDroXbRx/vyAGdK/p7ALDphFXd60IosiaTQ5O9YawXCqD6rkuEuhKelGNJ8H+E5r1i8ctQRaekm64hoWSDh/bIzK7Fn/1H6mwzPcavjOfbX45mOJZM81LBXAeYatSGxvrXhU/yEA+PwI+6WLF6e1xZdB0hbR+SkXU+h0JwH5eHlIlYPClpLJ7aN2vu08hrBOBCwDLSH2vO41zOZcF91qSrlfU9eoFLhu8UBS6Jlh6/yXvv77EYcBpBP17qycFYyOloHEwtp2sz1+iYONRC+u7i1fbXtQkZdoe4vo398sG8IZL4= X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(93004095)(3002001)(10201501046)(3231455)(999002)(944501520)(52105112)(6055026)(148016)(149066)(150057)(6041310)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123558120)(20161123564045)(201708071742011)(7699051)(76991095);SRVR:DM5PR19MB0938;BCL:0;PCL:0;RULEID:;SRVR:DM5PR19MB0938; X-Microsoft-Exchange-Diagnostics: 1;DM5PR19MB0938;4:ih5yT7WxlTY/y9nMzV7LkjXij7LdVKeQCPF6bdn47mYFMtocDCY7yxl65iRauJEakbP4KNqrGw6A99xUHmyl1GAklpmUO/u/CyuYopfcYgrve0jWisLLoMm5Dfxq6+1QoD1+GTBncgWcy2Dt3GCdARA5zW0BJfoP3h3rD54emkNmZoGz7tQOCRu2CxArMN5m6Ugep96snRlN7ZzRN+qos7F5htO3yKdG85ddqD9PmpAmhfJvFd4fKHbR6sefG/GDmFNe1YCk7D1Mg49oftf+Rg== X-Forefront-PRVS: 0879599414 X-Microsoft-Exchange-Diagnostics: =?utf-8?q?1=3BDM5PR19MB0938=3B23=3AQku7eQB?= =?utf-8?q?RuXy3b1rrfHK/Hu6d0gQdTLZJNdXfRQ9EoYiZDzjl1yAkWGE6xSzR+ZUQGCM2THYK?= =?utf-8?q?VUdhtgxMOQPKiOW9lpZvkroBVvc+8aikwucujs2RdX3soHaB6azLIA+Hn7CLN/pjI?= =?utf-8?q?s7WFPJjPoEsjkBStCf3NE+Hm6jodWoftssDt19mPD/sIJJr81FPFf2IwU6n/CLHWD?= =?utf-8?q?gqKX1yGaNrJLM80nUt7py9ZHjTfmaKjgKLB80xfgJUlB1czuaJWFTzdX5CadkbWKj?= =?utf-8?q?2hPxcjOsHx+xX0ydGlZru7aDmHofrOPQFEKfVWe5aktkFUtgdv8IPd3zLIlDOtk8O?= =?utf-8?q?+2WzCo3Z/KNE6cCwLzA+56BSr4qYiB5aezI3cQQv9FGHWuGlFO6NPBtmZnS/bhqLE?= =?utf-8?q?I5yg3KizuIwCdTdeNXBMYpo7BjJHwS1ncOxDbJTPJKTp6c5C7buSIgh2ZbSol97+c?= =?utf-8?q?YLtodmP/IavSvrxhnKFieSKxGuKNpcdnU/FuV8n/HJEkHMRAGFZjm8WHUgOk5fi/z?= =?utf-8?q?nTBY2gMECQaxTTxjCD8I6zyGIzcqABWsrzetuoD2Q6E0eJIbGiSYB6lWEYYmY/sAl?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amDiagnosticMetadata: NSPM X-OriginatorOrg: microsemi.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Dec 2018 22:29:33.1111 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 665f1f14-3544-42d9-1c6c-08d65c93763f 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.23];Helo=[AVMBX3.microsemi.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR19MB0938 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: Ajish Koshy Reviewed-by: Murthy Bhat Reviewed-by: Mahesh Rajashekhara Reviewed-by: Dave Carroll Reviewed-by: Scott Teel Reviewed-by: Kevin Barnett Signed-off-by: Ajish Koshy Signed-off-by: Don Brace --- drivers/scsi/smartpqi/smartpqi_init.c | 59 ++++++++++++++++----------------- 1 file changed, 28 insertions(+), 31 deletions(-) diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c index 5f7ae5946ddc..45c797bc1483 100644 --- a/drivers/scsi/smartpqi/smartpqi_init.c +++ b/drivers/scsi/smartpqi/smartpqi_init.c @@ -1115,8 +1115,6 @@ static int pqi_validate_raid_map(struct pqi_ctrl_info *ctrl_info, char *err_msg; u32 raid_map_size; u32 r5or6_blocks_per_row; - unsigned int num_phys_disks; - unsigned int num_raid_map_entries; raid_map_size = get_unaligned_le32(&raid_map->structure_size); @@ -1125,22 +1123,6 @@ static int pqi_validate_raid_map(struct pqi_ctrl_info *ctrl_info, goto bad_raid_map; } - if (raid_map_size > sizeof(*raid_map)) { - err_msg = "RAID map too large"; - goto bad_raid_map; - } - - num_phys_disks = get_unaligned_le16(&raid_map->layout_map_count) * - (get_unaligned_le16(&raid_map->data_disks_per_row) + - get_unaligned_le16(&raid_map->metadata_disks_per_row)); - num_raid_map_entries = num_phys_disks * - get_unaligned_le16(&raid_map->row_cnt); - - if (num_raid_map_entries > RAID_MAP_MAX_ENTRIES) { - err_msg = "invalid number of map entries in RAID map"; - goto bad_raid_map; - } - if (device->raid_level == SA_RAID_1) { if (get_unaligned_le16(&raid_map->layout_map_count) != 2) { err_msg = "invalid RAID-1 map"; @@ -1179,27 +1161,45 @@ static int pqi_get_raid_map(struct pqi_ctrl_info *ctrl_info, struct pqi_scsi_dev *device) { int rc; - enum dma_data_direction dir; - struct pqi_raid_path_request request; + u32 raid_map_size; struct raid_map *raid_map; raid_map = kmalloc(sizeof(*raid_map), GFP_KERNEL); if (!raid_map) return -ENOMEM; - rc = pqi_build_raid_path_request(ctrl_info, &request, - CISS_GET_RAID_MAP, device->scsi3addr, raid_map, - sizeof(*raid_map), 0, &dir); + rc = pqi_send_scsi_raid_request(ctrl_info, CISS_GET_RAID_MAP, + device->scsi3addr, raid_map, sizeof(*raid_map), + 0, NULL, NO_TIMEOUT); + if (rc) goto error; - rc = pqi_submit_raid_request_synchronous(ctrl_info, &request.header, 0, - NULL, NO_TIMEOUT); + raid_map_size = get_unaligned_le32(&raid_map->structure_size); - pqi_pci_unmap(ctrl_info->pci_dev, request.sg_descriptors, 1, dir); + if (raid_map_size > sizeof(*raid_map)) { - if (rc) - goto error; + kfree(raid_map); + + raid_map = kmalloc(raid_map_size, GFP_KERNEL); + if (!raid_map) + return -ENOMEM; + + rc = pqi_send_scsi_raid_request(ctrl_info, CISS_GET_RAID_MAP, + device->scsi3addr, raid_map, raid_map_size, + 0, NULL, NO_TIMEOUT); + if (rc) + goto error; + + if (get_unaligned_le32(&raid_map->structure_size) + != raid_map_size) { + dev_warn(&ctrl_info->pci_dev->dev, + "Requested %d bytes, received %d bytes", + raid_map_size, + get_unaligned_le32(&raid_map->structure_size)); + goto error; + } + } rc = pqi_validate_raid_map(ctrl_info, device, raid_map); if (rc) @@ -2459,9 +2459,6 @@ static int pqi_raid_bypass_submit_scsi_cmd(struct pqi_ctrl_info *ctrl_info, (map_row * total_disks_per_row) + first_column; } - if (unlikely(map_index >= RAID_MAP_MAX_ENTRIES)) - return PQI_RAID_BYPASS_INELIGIBLE; - aio_handle = raid_map->disk_data[map_index].aio_handle; disk_block = get_unaligned_le64(&raid_map->disk_starting_blk) + first_row * strip_size + From patchwork Fri Dec 7 22:29:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Don Brace X-Patchwork-Id: 10718975 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 4F2DE18B8 for ; Fri, 7 Dec 2018 22:29:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3ECCE2F2CF for ; Fri, 7 Dec 2018 22:29:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 31EF72F2E3; Fri, 7 Dec 2018 22:29:47 +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 BADF42F2CF for ; Fri, 7 Dec 2018 22:29:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726114AbeLGW3q (ORCPT ); Fri, 7 Dec 2018 17:29:46 -0500 Received: from mail-eopbgr730051.outbound.protection.outlook.com ([40.107.73.51]:63392 "EHLO NAM05-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726093AbeLGW3q (ORCPT ); Fri, 7 Dec 2018 17:29:46 -0500 Received: from CY4PR19CA0030.namprd19.prod.outlook.com (2603:10b6:903:103::16) by SN1PR19MB0414.namprd19.prod.outlook.com (2a01:111:e400:5964::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1404.19; Fri, 7 Dec 2018 22:29:42 +0000 Received: from BN1BFFO11FD024.protection.gbl (2a01:111:f400:7c10::1:191) by CY4PR19CA0030.outlook.office365.com (2603:10b6:903:103::16) 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:29:42 +0000 Authentication-Results: spf=pass (sender IP is 208.19.100.23) 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.100.23 as permitted sender) receiver=protection.outlook.com; client-ip=208.19.100.23; helo=AVMBX3.microsemi.net; Received: from AVMBX3.microsemi.net (208.19.100.23) by BN1BFFO11FD024.mail.protection.outlook.com (10.58.144.87) 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:29:40 +0000 Received: from AVMBX2.microsemi.net (10.100.34.32) by AVMBX3.microsemi.net (10.100.34.33) 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 14:29:38 -0800 Received: from [127.0.1.1] (10.238.32.34) by avmbx2.microsemi.net (10.100.34.32) with Microsoft SMTP Server id 15.1.1531.3 via Frontend Transport; Fri, 7 Dec 2018 14:29:38 -0800 Subject: [PATCH 15/20] smartpqi: do not offline disks for transient did no connect conditions From: Don Brace To: , , , , , , , , , , , CC: Date: Fri, 7 Dec 2018 16:29:37 -0600 Message-ID: <154422177779.1218.7573258041248951917.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.100.23;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(7916004)(346002)(396003)(376002)(39860400002)(136003)(2970300002)(199004)(189003)(76176011)(16576012)(81156014)(446003)(305945005)(106002)(23676004)(2486003)(2201001)(126002)(11346002)(110136005)(44832011)(4326008)(476003)(26005)(230700001)(97736004)(2906002)(86362001)(486006)(33716001)(58126008)(14444005)(8936002)(186003)(77096007)(9686003)(316002)(81166006)(53936002)(47776003)(356004)(478600001)(336012)(68736007)(5660300001)(103116003)(8676002)(33896004)(50466002)(106466001)(69596002)(921003)(2101003)(1121003)(83996005);DIR:OUT;SFP:1101;SCL:1;SRVR:SN1PR19MB0414;H:AVMBX3.microsemi.net;FPR:;SPF:Pass;LANG:en;PTR:InfoDomainNonexistent;A:1;MX:3; X-Microsoft-Exchange-Diagnostics: 1;BN1BFFO11FD024;1:aa7JrBxPAOfSECOW1cETZHBUnE05K+H3jbgyNgsy10yiAzOz/+Zm8scSuA93RY/D9QAEN6GItQ1MBrS++1LFW9GskYg7bcwnzasOPWOLSZuGMksxu0Vqhs7sNpeqoJK9 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4863c316-3295-4e1d-0499-08d65c937a9d X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390098)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4608076)(2017052603328)(7153060);SRVR:SN1PR19MB0414; X-Microsoft-Exchange-Diagnostics: 1;SN1PR19MB0414;3:IGvkhmV4sjbfWTNAdCaFtxpJBL2gm/ZXqK+qlifRRT3XLvKfxJKvec+uuIGj0kVqZuaPU+YnV554ea8C8rc5c8pw3dw/QF1LVq6+O36Jus5X5muPp90rxs8ExQAXhCqq8dcQz17HQvKkxVdO6u8SqxJv1lDG+sgG3k5sp6wLCvM5fgBFWDHNbLU6/SkCw681JAAuFvXIRo2oPMWGgFyqf+Y3hOMz2XvDBQgQrmsCOLnTInjQV0v+qj37c69pt+BkVVUr+mgD7DOKIVa5M9X5/tjj4/nXmhPMDEshpr9eX9e+9i9QGtZQ9OJx3LKSMBwPO24e35E01capJDbh/x/2dlxFZS3qXC64Xwnb6f0zwJI=;25:2g54VgABJrhituMopHzcXgWgl0xX1/gWw369nooIplhd5rk+QAG5pb1H2W8/cNoIIfvXEds/vfrRXINMP9wC1khtI8EcfLg41oc8++6y73ihYIGi+38IYMZYa0WX9U7XRsa7KtkTTRnJThGeszEJav90U9LfUr+b0C5JqBg4QMj+TOqwh4lDjM/nc1rDQcrq5T37mO89UFrZaJo8AsxQwXaxW3o0LiL6vhFhMvloj0lGGomqd5/ZWyARbqM6AIDvF5fO//7tMNl5T3NDVxVrtLTp9r8SCbpvwveRJLLsOR2YrCSMWmQd2YLQe71154pBSD580Nf6IcDFNsyJbz5M/VhHRxedjkT68Kq89ZadfWI= X-MS-TrafficTypeDiagnostic: SN1PR19MB0414: X-Microsoft-Exchange-Diagnostics: 1;SN1PR19MB0414;31:2iyuo15p462LZIKrr6UpSKnAYvcf0EzvOUbXPV1JJPtGv12ou2cdgivj+GF1w6Vs++R4BriD+iW7K1ySMQcF5f/fMnV5cLrItNoVjEsXTlEQat36fTqgY49/bfYZmIx77q/hDGXCJ2b3qw3Ck5gvkcfLeQqJXwJ4NmUuBcQD/VTO7i5JDumGE41dnWcUInRa/Cqu1cjAIW4SqXAK42kHrqYfnr0WjHadJ6LrsmVsCfw=;20:SbgdQ7R3sYDEWV/tvfFj1lF2bK8iKBDt7xCy8QQ7lQjRb+heLPxGHkPIJ7ge80eTWuXF+IFHdq46lMptjx+OYYg2wp1B+Xv2K6kN5h6TB9qqPG1jVp0npnzjU+Ou4qxfCQ9+7YozXQ5tqq3n2eFk2aXK+o4MeJykSG1V8h6gWDUYoXuEhmQdO6DvifwHIm9rnrjsiDDqsn8StFYp1k546iKChExQ7ZzhFGXLT8LfDNg7jPFkBCDBCKaP/JQ7F19aS1mQfIZRnXgsA8s3GDFkswZSeia0TKGPngOqQd1FR6iD9glL0NH3RzhnNeEM8vgv54RJ3/0Lh3OIrI2mrdT4Np5bPJsuJR04YhPqEv/RYjV4zm87ItOJhQxmr+zqyBrik/xWlbo/OKikxYxhPSwmi6YhmyL3bLgo3KG3cT850VRlBpD0L37HBudO++NQrLyjE0H7HEeMmqeBE+mPybPc65Rcb745ysxcaxn8L2KU9Ev1rgdl+PnMHaLbQ/p+nqFEKpAnksaTZgCy91C8RVsRBpaH/M+MmA2K/ADzS66AiSOOKxGAnsLmbABGjuxdTVWxilpEeim6YQB3D9QvzR8oH7YWp2O8L+djKxBy8L7RNMs= X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3231455)(999002)(944501520)(52105112)(3002001)(93006095)(93004095)(10201501046)(6055026)(148016)(149066)(150057)(6041310)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123558120)(201708071742011)(7699051)(76991095);SRVR:SN1PR19MB0414;BCL:0;PCL:0;RULEID:;SRVR:SN1PR19MB0414; X-Microsoft-Exchange-Diagnostics: 1;SN1PR19MB0414;4:NgNea1Y/rKMlV/5178DerO0kMwAXtsRFVkS94Xtp905gKtRptt7R2idgJT8Nnp1OY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diagnostics: 1;SN1PR19MB0414;6:RgvOZyid9p/YLvGpkPcwyn/e6fDQRZb4TXCrvPfP90UAi/Dbj/mVl0k8/cVOF/r7o7w0V25oieouqhH+HjJBx5ZT+kXpnoh6AaQmxAQpxbFnKQe4CBzyZ8r5NJeD9vHw8zG+ob05pBct3FFZAJAn4ujDqxhU3zWG0JXpFYpdCV1MkUXVc5/iMM6Z47WZKYBymxmUHg6Wrx+aq6/im8Bu0q5l7UDEH3UNyhdcdztGHD0ZhjfHvrltXwnL3nhuhO+Ce8dqeNGuS9Ro4L3sU4s2cHYyOok0FNu54ezy8AHe5w8mVsHRtI9nFSBxmF+EjFscIKBeIh1TofvinggUEeniMFiJwsrtBYvYLp8nj5sDVUQ8Mln+QExjg416s8Zy7+fsOVwoqBQv183snvMznNimeCkO3p1E7CEio69riVbRdMco2AGhn8AzlIed0yPxpznBtNcMIVkBMj29qHceH6rGTg==;5:Y6HJOS9U3hVH9y7MVw8JiyELZYjlrsgrkez51CHQEsiluE6nKZD0BZ7WGfW51tYsRZ6TU4vdGL/FKSox/QLKNJmFMirll6v8gKmXI07l9vU31Pn/Wzpc7YxcEROExEblBAf8fuSf/qnQkTdNKB7hJjGvovO1+qLfNx9gDEnHGSA=;7:qHKw5djLj1uX8wLHiTe69n5UWLpkVERDvwVmHxw8yOBB1/DYiVBqfDQotCu90fAXBdTGA/imUcEohsUp0ZXh7UiEdXPRhhAmlixUdFivhSoxtD0+b62hRS1cNMzvqtKEh1RgF12y/KY5J3p69zYqEQ== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: microsemi.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Dec 2018 22:29:40.5156 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4863c316-3295-4e1d-0499-08d65c937a9d 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.23];Helo=[AVMBX3.microsemi.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR19MB0414 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 Reviewed-by: Murthy Bhat Reviewed-by: Mahesh Rajashekhara Reviewed-by: Scott Teel Reviewed-by: Kevin Barnett Signed-off-by: Dave Carroll Signed-off-by: Don Brace --- drivers/scsi/smartpqi/smartpqi_init.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c index 45c797bc1483..f146ebf3921f 100644 --- a/drivers/scsi/smartpqi/smartpqi_init.c +++ b/drivers/scsi/smartpqi/smartpqi_init.c @@ -1686,6 +1686,7 @@ static void pqi_scsi_update_device(struct pqi_scsi_dev *existing_device, new_device->raid_bypass_configured; existing_device->raid_bypass_enabled = new_device->raid_bypass_enabled; + existing_device->device_offline = false; /* To prevent this from being freed later. */ new_device->raid_map = NULL; @@ -2589,10 +2590,9 @@ static inline void pqi_take_device_offline(struct scsi_device *sdev, char *path) return; device->device_offline = true; - scsi_device_set_state(sdev, SDEV_OFFLINE); ctrl_info = shost_to_hba(sdev->host); pqi_schedule_rescan_worker(ctrl_info); - dev_err(&ctrl_info->pci_dev->dev, "offlined %s scsi %d:%d:%d:%d\n", + dev_err(&ctrl_info->pci_dev->dev, "re-scanning %s scsi %d:%d:%d:%d\n", path, ctrl_info->scsi_host->host_no, device->bus, device->target, device->lun); } From patchwork Fri Dec 7 22:29:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Don Brace X-Patchwork-Id: 10718977 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 B3E7C1750 for ; Fri, 7 Dec 2018 22:29:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A17632F2CF for ; Fri, 7 Dec 2018 22:29:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8F9342F2E3; Fri, 7 Dec 2018 22:29:55 +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 23E892F2CF for ; Fri, 7 Dec 2018 22:29:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726110AbeLGW3y (ORCPT ); Fri, 7 Dec 2018 17:29:54 -0500 Received: from mail-eopbgr760055.outbound.protection.outlook.com ([40.107.76.55]:36800 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726093AbeLGW3y (ORCPT ); Fri, 7 Dec 2018 17:29:54 -0500 Received: from MWHPR19CA0093.namprd19.prod.outlook.com (2603:10b6:320:1f::31) by BN6PR19MB1412.namprd19.prod.outlook.com (2603:10b6:404:126::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1404.20; Fri, 7 Dec 2018 22:29:50 +0000 Received: from BN1BFFO11FD016.protection.gbl (2a01:111:f400:7c10::1:192) by MWHPR19CA0093.outlook.office365.com (2603:10b6:320:1f::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1404.18 via Frontend Transport; Fri, 7 Dec 2018 22:29:50 +0000 Authentication-Results: spf=pass (sender IP is 208.19.100.23) 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.100.23 as permitted sender) receiver=protection.outlook.com; client-ip=208.19.100.23; helo=AVMBX3.microsemi.net; Received: from AVMBX3.microsemi.net (208.19.100.23) by BN1BFFO11FD016.mail.protection.outlook.com (10.58.144.79) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.1404.13 via Frontend Transport; Fri, 7 Dec 2018 22:29:49 +0000 Received: from AVMBX2.microsemi.net (10.100.34.32) by AVMBX3.microsemi.net (10.100.34.33) 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 14:29:45 -0800 Received: from [127.0.1.1] (10.238.32.34) by avmbx2.microsemi.net (10.100.34.32) with Microsoft SMTP Server id 15.1.1531.3 via Frontend Transport; Fri, 7 Dec 2018 14:29:45 -0800 Subject: [PATCH 16/20] smartpqi: correct volume status From: Don Brace To: , , , , , , , , , , , CC: Date: Fri, 7 Dec 2018 16:29:45 -0600 Message-ID: <154422178499.1218.16408444752147164193.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.100.23;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(7916004)(136003)(376002)(39860400002)(346002)(396003)(2980300002)(189003)(199004)(81166006)(2201001)(486006)(81156014)(58126008)(8936002)(16576012)(97736004)(44832011)(8676002)(336012)(230700001)(110136005)(446003)(106002)(33716001)(68736007)(86362001)(476003)(316002)(126002)(9686003)(77096007)(356004)(11346002)(186003)(76176011)(2906002)(26005)(4326008)(106466001)(33896004)(50466002)(305945005)(5660300001)(69596002)(478600001)(53936002)(47776003)(2486003)(103116003)(23676004)(921003)(2101003)(1121003)(83996005);DIR:OUT;SFP:1101;SCL:1;SRVR:BN6PR19MB1412;H:AVMBX3.microsemi.net;FPR:;SPF:Pass;LANG:en;PTR:InfoDomainNonexistent;MX:1;A:1; X-Microsoft-Exchange-Diagnostics: 1;BN1BFFO11FD016;1:JMJB5ipaDtCe58tZ9lZIqC5+dP7c/irxq/awRdMeNQcFmA2Tzkc+UmER4fobzzcz5sweYagdAXHGCsJH/lQGvAmctDpplnz990shuThZLhDo7U409PdHstvskBnGCGFe X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a4d6b96a-21d9-4aa9-5dc6-08d65c937fcb X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390098)(7020095)(4652040)(8989299)(5600074)(711020)(4608076)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060);SRVR:BN6PR19MB1412; X-Microsoft-Exchange-Diagnostics: 1;BN6PR19MB1412;3:BmzvXf04qb/cdAkxKKPAJ3Y9FbcTpG+1q5zOiK1AKAdmGtVdBeNXKXbDC/UYolOxgt6mKASUle7rrshcRmjowB4uzJs4eXUUh6YmqSb+78o+pOddqo8ouJ4LO87EEx9VZuh7DMy4YUfTYC3jCrs6ncjLhT3pLyGOXfPdZAVpWtx8SwmLCd+KWvJjcUPKp1HsDN0OSNThZ1p31zi7xUZgCH0cDPqIT1axYE6QBxe8xP538WikEdL09QVkqWsOnNh8g6FlE/ePyWSLXhpsQXuF4gshukQp08rPpFtmkiyfvxskNHokjhDqJvIfxwOCNgTbmzT8lqtIgHQ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H8rEZqUjBhl1xOOVKQ6NgMultvTjaH+uJXCj1AaGTKtAvyKYPgxDnbkxcOaOF9pYk0kAIAVPWXulSTPtZ6Xe7ewOx4zRyDaQpQORQ6BwaXi1o73B5ucwXBaNZhYiMCcCJeGHeHxPQAgWjO2GJ0s9HUusK78sICz+ndQskSpLNR8ui6p+FdBoFCNrGIMv2Co+poHppqIj35CGkU+0nxRFtT/LlA19Wxqgtb/ss3yE= X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(10201501046)(3002001)(93006095)(93004095)(3231455)(999002)(944501520)(52105112)(6055026)(148016)(149066)(150057)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123558120)(20161123562045)(201708071742011)(7699051)(76991095);SRVR:BN6PR19MB1412;BCL:0;PCL:0;RULEID:;SRVR:BN6PR19MB1412; X-Microsoft-Exchange-Diagnostics: 1;BN6PR19MB1412;4:E5z6wujXSVYMF/pxAclkSoavFqic/iwV4bQ8ofE2b2udHPtPYNXCw2rhXuBgjmfBTR7IEvTMEueoHNooCBJMTJquOVDtyzRZM2b5jNIO4jcRVoU1O0Ahn/r0Eey5UHHDIaNYNiERb03plMlCrfrBHIoNw4QONho6SDEI10XFOhD90UGJ17FafDTxxdx1qe01Rv5RSa1W//esAJ3rrckbu5a6JBphdctQLi6xFd1gdmnWBsjFhU3sFef5wdKvNrWl2vf06/FTVF7simPGfzsauA== X-Forefront-PRVS: 0879599414 X-Microsoft-Exchange-Diagnostics: =?utf-8?q?1=3BBN6PR19MB1412=3B23=3Arin0aJC?= =?utf-8?q?/Yc3UfBLaS9hzj1jUNsXn/A3iDuZVlkBBRKMTCZPSwW93LBgYRAB/MtpxqbjYoQHo?= =?utf-8?q?pVz88eBnX/0QYNb311uGblTF7kf9BymwD9l1KRlB2UTJ4eKc6M/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A+bBV+DWkF?= =?utf-8?q?fIPiis6X/+X4w1N/X1P7oTe/UpxcvcNxh6AwLUaV3oH88dcjUgHiPweBaywgcMZae?= =?utf-8?q?LxwtX0jgKw2TjMXBbryX0zmwzt/vTJNAOyC/muKMjwnIaAtlvE7Ncg419qkPa7gSB?= =?utf-8?q?p24osWJi20VZRSpw7CSi2BIBfP54CE/TGRzxtXX?= X-Microsoft-Antispam-Message-Info: rmpkpTgrimkPMYuaYldioZn/SMuEa3SX9PNBplBIRtBMhCKiIR6pr1aJaPGZCGaFEhjPEhes+VyxBxifuURlixUgSvLILCiutoNq4uJ9L3pf4kr87AaH7phdfbwBtizAivQdn3fTXnaDIDtxJI+05DoKife70pApks6i46eCeUybpN5N+lGyQLeTDh+hbjfzSNfskkjhfS42oElszTnmxBpRazRNar1D5G7kMTGag6dM185Yu7QEmyjTKR8Li2aIbZS0U6eGqCZsOheqsKF41nqE4r560rSTTMtdwBGZeVUk8ik+D1FcaZp6epcEIWniKsZzWyV/x8HD5AQVKO3wXbqHrhvuvB8ua5RAKhnf9rk= X-Microsoft-Exchange-Diagnostics: 1;BN6PR19MB1412;6:k1rlIwVRjk/cQ2HYjxCuArYafP6ayMEFYb7Q1S+k2YbX9er5HseLXMzQJ7XGw7qaKpDHZX5HobhRbnc76BVUhUuQ4BpOatIKHCAEcDobB2E/gPqQa5vEMyRLCOpeOxaWPEdAZYLsLsYGCe6cBBB9uiKO16ZJm2zLhe3irBzqFgY84lyxZLiQktWSogx+9wxzTsMdEmHHj4YFx1k7uXwA3Ow2/XStV9WnM60VXQ/wh3J3LtikKQ90VTL0My0dIfhXV/w53jTqyBUais2raer1uG42G5iLT302PBa3wahnUzOz0GfEoRNlT5vHC+Hc1iVsWlo+iPFNCa+fFAvV9dLphBPorCsAUwWPe2qKT6pCfbuDqbWXJW0Iv4jJ4J1cscHrLGWYi2Xk9IZXs7vlM7kCnKaSHKRww383IITBHXKK9McInkjbb5zQcPtJeUCl38JuLpuWmyaDlhVuk9hC9o+fkQ==;5:hYL1Venh3mRL5W9ECt0uUs4F6GBga7MKK6eZUhDUB4tv9z+0x7pyrn8s0VrlrMTgzI7rJk+fBNSG9X7VtUtkDtK0ydtscpeClaPZNEANPF7IPhbTYDQB8LEYUvwdIpItMLadqEmideq7knaEjPrRJHaBNJni26hkyzKKh/kyNWA=;7:Zu4S1PnxppWQjt5S8561wS7WciO3CVuwMBgZynMa5tP/C2x4/8fGMtD+RZYe6TQi9xIazqugw9fHf7HLI3WgSFyD1ShAqXNQR//Jei3f5R6YEYb6bcBmL1a4rmpVXLEdPCsCq6//f/eH5NCsHS32qQ== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: microsemi.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Dec 2018 22:29:49.2079 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a4d6b96a-21d9-4aa9-5dc6-08d65c937fcb 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.23];Helo=[AVMBX3.microsemi.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR19MB1412 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 - fix race condition when a unit is deleted after an RLL, and before we have gotten the LV_STATUS page of the unit. - In this case we will get a standard inquiry, rather than the desired page. This will result in a unit presented which no longer exists. - If we ask for LV_STATUS, insure we get LV_STATUS Reviewed-by: Murthy Bhat Reviewed-by: Mahesh Rajashekhara Reviewed-by: Scott Teel Reviewed-by: Kevin Barnett Signed-off-by: Dave Carroll Signed-off-by: Don Brace --- drivers/scsi/smartpqi/smartpqi_init.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c index f146ebf3921f..bee14fc8a35e 100644 --- a/drivers/scsi/smartpqi/smartpqi_init.c +++ b/drivers/scsi/smartpqi/smartpqi_init.c @@ -1270,6 +1270,9 @@ static void pqi_get_volume_status(struct pqi_ctrl_info *ctrl_info, if (rc) goto out; + if (vpd->page_code != CISS_VPD_LV_STATUS) + goto out; + page_length = offsetof(struct ciss_vpd_logical_volume_status, volume_status) + vpd->page_length; if (page_length < sizeof(*vpd)) From patchwork Fri Dec 7 22:29:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Don Brace X-Patchwork-Id: 10718979 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 D20FC1750 for ; Fri, 7 Dec 2018 22:30:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C06DB2ABF4 for ; Fri, 7 Dec 2018 22:30:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B3D732F2E3; Fri, 7 Dec 2018 22:30:03 +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 3736C2F2E1 for ; Fri, 7 Dec 2018 22:30:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726077AbeLGWaD (ORCPT ); Fri, 7 Dec 2018 17:30:03 -0500 Received: from mail-eopbgr740075.outbound.protection.outlook.com ([40.107.74.75]:40833 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726008AbeLGWaC (ORCPT ); Fri, 7 Dec 2018 17:30:02 -0500 Received: from MWHPR19CA0095.namprd19.prod.outlook.com (2603:10b6:320:1f::33) by BN6PR19MB0932.namprd19.prod.outlook.com (2603:10b6:404:75::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1404.21; Fri, 7 Dec 2018 22:29:57 +0000 Received: from BN1BFFO11FD016.protection.gbl (2a01:111:f400:7c10::1:140) by MWHPR19CA0095.outlook.office365.com (2603:10b6:320:1f::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1404.19 via Frontend Transport; Fri, 7 Dec 2018 22:29:56 +0000 Authentication-Results: spf=pass (sender IP is 208.19.100.23) 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.100.23 as permitted sender) receiver=protection.outlook.com; client-ip=208.19.100.23; helo=AVMBX3.microsemi.net; Received: from AVMBX3.microsemi.net (208.19.100.23) by BN1BFFO11FD016.mail.protection.outlook.com (10.58.144.79) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.1404.13 via Frontend Transport; Fri, 7 Dec 2018 22:29:56 +0000 Received: from AVMBX2.microsemi.net (10.100.34.32) by AVMBX3.microsemi.net (10.100.34.33) 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 14:29:52 -0800 Received: from [127.0.1.1] (10.238.32.34) by avmbx2.microsemi.net (10.100.34.32) with Microsoft SMTP Server id 15.1.1531.3 via Frontend Transport; Fri, 7 Dec 2018 14:29:52 -0800 Subject: [PATCH 17/20] smartpqi: correct lun reset issues From: Don Brace To: , , , , , , , , , , , CC: Date: Fri, 7 Dec 2018 16:29:51 -0600 Message-ID: <154422179177.1218.6693507854725315677.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.100.23;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(7916004)(376002)(136003)(346002)(396003)(39860400002)(2980300002)(189003)(199004)(5660300001)(478600001)(2201001)(103116003)(476003)(356004)(68736007)(4326008)(50466002)(86362001)(97736004)(58126008)(126002)(110136005)(8676002)(106002)(47776003)(16576012)(53936002)(336012)(2870700001)(2486003)(9686003)(8936002)(11346002)(446003)(23676004)(2906002)(14444005)(186003)(33716001)(44832011)(76176011)(81166006)(33896004)(81156014)(69596002)(106466001)(77096007)(486006)(26005)(316002)(305945005)(921003)(2101003)(1121003)(83996005);DIR:OUT;SFP:1101;SCL:1;SRVR:BN6PR19MB0932;H:AVMBX3.microsemi.net;FPR:;SPF:Pass;LANG:en;PTR:InfoDomainNonexistent;MX:1;A:1; X-Microsoft-Exchange-Diagnostics: 1;BN1BFFO11FD016;1:sqMxNKUaMmLpqyDJULkue5YtBsZyq2zOrxZ6d9MpTmFoCzlSwreYSGZRQcnPtqdM40uRgil979kKbxthuNq5zhkjjtrhx2Nuq2F+8MZHXlB8A2VJ5CfubuysDU+mQRTT X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: dd74ef53-3c1d-435d-6f31-08d65c9383e4 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390098)(7020095)(4652040)(8989299)(5600074)(711020)(4608076)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060);SRVR:BN6PR19MB0932; X-Microsoft-Exchange-Diagnostics: 1;BN6PR19MB0932;3:PTlAYIpEeRRFBWspuoLZMTV87jj+xQT8bIq5m/pPsDxFncPWiVkXGiT1zPNWzULN87EvB4SHfehvzkREz4dfD5OZZyez5O4uQq58yzM1rvvRsGd7apPYfN3ng6yRAoOb2btl4qw8owxrRLcOXuozM7kVbbj5GcViuvZoHfua0hf85bL8LukBv4KsUPd+Pmry8EY+YRLFcur7TILsBbUQk5GaMBSHivVQYUXVd8AquH7UZTZJ9iOqhMHa/1M89O7z2ynXSdz1Uf1s5xyqTftnNzq0Q4I1D85N9hbNVKPUM+NiwO+SYLBZKOdcd25Mf14gFgTTeWg/b+co62SlYh+QT/q/oDZo0fC1p9HRxodsXm8=;25:0j7sgHXUT7FjpyEVTdkGgI7XYCBai6FZD2v4Op8tQzmnF0lCDuZ+R8FpoVbm0R+Wp6U2dL5bSUxz9+WrLk74FJacv/+H+/Txm6t8NTklgN2iiNSSKgr78N51iwS6JfSxlxngNcmwWws798DLZZ5HJrBYCZ3ZSBAAwCKQJWHFSnAw4Kw/Gr7mNRdPbRWYWomy6h7ejjItUDtqFrUL3z+UMKNP3Th6zr8BZbLvGVwgwY5Z2bd3ew2SEJAwKewh7RWiKdcW9nxCCZgTqKUBJbzctLGvTjM8Q7fLPl8uRcxTjlpPg1aNks+kzUoVujAmsl2LzFV1z+OCT8ZAUmfWSNBwQw== X-MS-TrafficTypeDiagnostic: BN6PR19MB0932: X-Microsoft-Exchange-Diagnostics: 1;BN6PR19MB0932;31:1yEjMrunoDfIcdXmQLR2ZUA1x/f6V9souGD8YfRK4WiG9z8Q988zWnnHVrEyPBV4jtOPvxii6ZOF6WKTvXMIxrjMk+9N5DxE8SeVkkVp416Bgim09Yt3LILa5slKElSyjkho3S4G/j+9ig+QGIxmtMocIc2UmojGMgi/simeE4ADZnOTIyKidfcDv/XIK42e6dXMtiYho6DL4RgG15C08Ck78t/ROpnDaiuVegrvV3Y=;20:XU+6a6TcVb78wi164Ip0ZP+7FYw9h4OSzjGDQJz4xsiQqd9085DGjLn8QiyjHbDgMqEE8jt7F6o8lNShFvOwHj/fPjutFhEAZQyGLPJTPiq+qTG5CKHl6MCwPYXAdoCW0+9P/H43Lw/PjdfGgRF+jD5Ihp9/Rb400e8W0TmvwSV9g5OVZI1v/HgwN/xFsaU2mLTjexHHXWBtz3qKowSdAoorODfrhWEjzek/EPTEzNo3nPX4rbtUMr57pb79aUamGDlDyuQ1bYVd2oiJ7lwvpM8rTg8CczZqctvvsdo3x9BLpdzXml7Y5qmuxBvlyzkuSTRm/20Nszs+hXOv+XFhUQjVZy8GnLRI3HaS7nymZ8IV33tCk9aDT9xgfwXMC3EAxOh5/7oi4RdsSM0sPubcaFYOxVEMoWwCE2RenP43QdyAMriEelCiNaAhYxaZu3mhI5gEN6JVTxItZUJHym+BmS+Gzm+7HYHVyEoDfyEzGoFhVZ3xRLoto+E5kOmBQvgt7G8qXcmIlQHeb1ioWKpnS0JjXY0zsX0E51QmJ81mF3kBzyqiA+ArIKwIF/HyBSseZE8CkmSPN88o8FpWgHfSRnKNozKT9oZBCgsNGbYAxxM= X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(10201501046)(3002001)(93006095)(93004095)(3231455)(999002)(944501520)(52105112)(6055026)(148016)(149066)(150057)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(20161123560045)(20161123564045)(201708071742011)(7699051)(76991095);SRVR:BN6PR19MB0932;BCL:0;PCL:0;RULEID:;SRVR:BN6PR19MB0932; X-Microsoft-Exchange-Diagnostics: 1;BN6PR19MB0932;4:+jZGDeloJqbVzDHXwJzqWPNSsYMveLc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V5bA8HI//4K+980+KmTgn2xOtP9rQ= X-Microsoft-Exchange-Diagnostics: 1;BN6PR19MB0932;6:DMEmGzqUiFjweaqmmDB9WQ/PmHBrX+b45JbqdhdwQfLjMU1E9xNv6OVMIle420fM+JuOwZUeoUUNSPjKvqRGRMhahsQnCrcNYgfcVty/l0eddZw5JkAmlQWb/pyTZszJ1jm3+qEhBJAfqmXfBRXwqbssrRlQknaW6llEh7L5bXbUilqHxZ87ABxJ+4nofsWwAagaJfqLawk6ICAaTE38xKimAc9u4oGq+zZHxLniQIFFHRFn6e+RMHb3raXg7qPrPbCVu8fHhCKJIMyVO3MjTVMWMPUmNDI5uBpY0eDrK1A9ChWcM89lx4iBiHuCzgneZlJ30mv8YdHn9rsL2L2VMAOInpokWXT3P/kH6NL+JL26pFTLlVwQzAtj5N4SmJAwxKc8qAsJf8XCKmdlOibd4eiFu46hVwCjLQACXxfzkxOnrpdr+4Z78CT5fcREcS6SuJDBm6zQ/J1EypPpdAbw5Q==;5:4/9OT6j4f9EAfebjbyAyn99zFKMmB71aU8OlsF+Wa6nfkmv6uBztqKAb1Egg3f7nZKuCpKEO9Js16raQ1hfLAOkA0t3vtyMCvFS6NmoqO6h9ipnxowonzpDVI70190zrdM6lNj4wUSezDNQftHEvIlm3HpPATYlKGQajPhUOQJs=;7:5ldjryWEP/o+/bt/jBGl2kroTuQyUA1MniiIXtT0RDzZTspJRF7WX6jmwCYQz6Wd+05colcFCW3XZDdfXYNvR3btpMXpOM0liwyBhQcHNcSK41hQzgQyjnDGkASfmk4ZDEHy1lAIMj7XY/jZ5+LOqQ== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: microsemi.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Dec 2018 22:29:56.0831 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: dd74ef53-3c1d-435d-6f31-08d65c9383e4 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.23];Helo=[AVMBX3.microsemi.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR19MB0932 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: Kevin Barnett Problem: The Linux kernel takes a logical volume offline after a LUN reset. This is generally accompanied by this message in the dmesg output: Device offlined - not ready after error recovery Root Cause: The root cause is a "quirk" in the timeout handling in the Linux SCSI layer. The Linux kernel places a 30-second timeout on most media access commands (reads and writes) that it send to device drivers. When a media access command times out, the Linux kernel goes into error recovery mode for the LUN that was the target of the command that timed out. Every command that timed out is kept on a list inside of the Linux kernel to be retried later. The kernel attempts to recover the command(s) that timed out by issuing a LUN reset followed by a TEST UNIT READY. If the LUN reset and TEST UNIT READY commands are successful, the kernel retries the command(s) that timed out. Each SCSI command issued by the kernel has a result field associated with it. This field indicates the final result of the command (success or error). When a command times out, the kernel places a value in this result field indicating that the command timed out. The "quirk" is that after the LUN reset and TEST UNIT READY commands are completed, the kernel checks each command on the timed-out command list before retrying it. If the result field is still "timed out", the kernel treats that command as not having been successfully recovered for a retry. If the number of commands that are in this state are greater than two, the kernel takes the LUN offline. Fix: When our RAIDStack receives a LUN reset, it simply waits until all outstanding commands complete. Generally, all of these outstanding commands complete successfully. Therefore, the fix in the smartpqi driver is to always set the command result field to indicate success when a request completes successfully. This normally isn’t necessary because the result field is always initialized to success when the command is submitted to the driver. So when the command completes successfully, the result field is left untouched. But in this case, the kernel changes the result field behind the driver’s back and then expects the field to be changed by the driver as the commands that timed-out complete. Reviewed-by: Dave Carroll Reviewed-by: Scott Teel Signed-off-by: Kevin Barnett Signed-off-by: Don Brace --- drivers/scsi/smartpqi/smartpqi_init.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c index bee14fc8a35e..2f2a07a38dad 100644 --- a/drivers/scsi/smartpqi/smartpqi_init.c +++ b/drivers/scsi/smartpqi/smartpqi_init.c @@ -2841,6 +2841,9 @@ static unsigned int pqi_process_io_intr(struct pqi_ctrl_info *ctrl_info, switch (response->header.iu_type) { case PQI_RESPONSE_IU_RAID_PATH_IO_SUCCESS: case PQI_RESPONSE_IU_AIO_PATH_IO_SUCCESS: + if (io_request->scmd) + io_request->scmd->result = 0; + /* fall through */ case PQI_RESPONSE_IU_GENERAL_MANAGEMENT: break; case PQI_RESPONSE_IU_VENDOR_GENERAL: From patchwork Fri Dec 7 22:29:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Don Brace X-Patchwork-Id: 10718981 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 7D8C9109C for ; Fri, 7 Dec 2018 22:30:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6CA652ABF4 for ; Fri, 7 Dec 2018 22:30:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 604CB2F2E1; Fri, 7 Dec 2018 22:30:06 +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 E46802ABF4 for ; Fri, 7 Dec 2018 22:30:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726078AbeLGWaF (ORCPT ); Fri, 7 Dec 2018 17:30:05 -0500 Received: from mail-eopbgr750074.outbound.protection.outlook.com ([40.107.75.74]:10392 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726070AbeLGWaF (ORCPT ); Fri, 7 Dec 2018 17:30:05 -0500 Received: from MWHPR19CA0065.namprd19.prod.outlook.com (2603:10b6:300:94::27) by CY1PR19MB0410.namprd19.prod.outlook.com (2a01:111:e400:c448::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1404.18; Fri, 7 Dec 2018 22:30:01 +0000 Received: from BN1BFFO11FD010.protection.gbl (2a01:111:f400:7c10::1:195) by MWHPR19CA0065.outlook.office365.com (2603:10b6:300:94::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1404.19 via Frontend Transport; Fri, 7 Dec 2018 22:30:01 +0000 Authentication-Results: spf=pass (sender IP is 208.19.100.23) 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.100.23 as permitted sender) receiver=protection.outlook.com; client-ip=208.19.100.23; helo=AVMBX3.microsemi.net; Received: from AVMBX3.microsemi.net (208.19.100.23) by BN1BFFO11FD010.mail.protection.outlook.com (10.58.144.73) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.1404.13 via Frontend Transport; Fri, 7 Dec 2018 22:30:00 +0000 Received: from AVMBX2.microsemi.net (10.100.34.32) by AVMBX3.microsemi.net (10.100.34.33) 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 14:29:59 -0800 Received: from [127.0.1.1] (10.238.32.34) by avmbx2.microsemi.net (10.100.34.32) with Microsoft SMTP Server id 15.1.1531.3 via Frontend Transport; Fri, 7 Dec 2018 14:29:58 -0800 Subject: [PATCH 18/20] smartpqi: add module param to disable irq affinity From: Don Brace To: , , , , , , , , , , , CC: Date: Fri, 7 Dec 2018 16:29:58 -0600 Message-ID: <154422179851.1218.10349207247849277036.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.100.23;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(7916004)(136003)(39860400002)(376002)(346002)(396003)(2980300002)(189003)(199004)(53936002)(69596002)(81166006)(8676002)(9686003)(33716001)(11346002)(446003)(8936002)(476003)(86362001)(336012)(478600001)(2201001)(126002)(97736004)(68736007)(76176011)(2906002)(81156014)(47776003)(14444005)(50466002)(106466001)(33896004)(103116003)(44832011)(110136005)(23676004)(2486003)(5660300001)(230700001)(305945005)(26005)(356004)(106002)(186003)(316002)(16576012)(58126008)(4326008)(486006)(77096007)(921003)(1121003)(2101003)(83996005);DIR:OUT;SFP:1101;SCL:1;SRVR:CY1PR19MB0410;H:AVMBX3.microsemi.net;FPR:;SPF:Pass;LANG:en;PTR:InfoDomainNonexistent;MX:1;A:1; X-Microsoft-Exchange-Diagnostics: 1;BN1BFFO11FD010;1:O3ajkXB5022CW5cT9+N6A7Hbi0UryuEdO68BPU4VJQPIzC2kVld+eCfI+73ok/UkI3NwUZ5giHSucyZPI+J/k5obn3PoIReeK9W7UpmZp7/oM0h3TVjsiIGjMJ66tZ5I X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1ecce72b-822e-417e-2a43-08d65c9386a3 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390098)(7020095)(4652040)(8989299)(5600074)(711020)(4608076)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060);SRVR:CY1PR19MB0410; X-Microsoft-Exchange-Diagnostics: 1;CY1PR19MB0410;3:6GLFmxcQzi5EhDqqFtgoye5vNyRqMk7PTFd5aKMltodtAb/AhbtGQqQRX31CW6R76OaXguKWmcO3KxyV0kMSpb1FrjlEJHZQZAA/RvRpAT9QjyHZbct2rqtIRv6NQpBEF8RTWWYCbJQoPPgkElVwJ4SLfAP3fcHuX06PxOJ0PdvL6lVJv1ks5nza7fTypRTvsmpw8ZXY19E3PPHi2XqqBBC2wNSKm/t6KmaEpiPgmcvk5ICqkJzN5bHjUxfzipK5OS7a4qy2byKQYuiiVRkgpXHBADUpsYv8ujXMyhsX2MsO9/V4VX/UH8sU2+CcyAMW+v3NRhw+VZFtuZS/K9hmWQVT9kn6VUK3QViOmenTOFA=;25:9rFzRWJzHl07yPlArk/t4Refq0SS1b4E3RbAeK4DeTSmpPJx+DLYh1a6RYtyCFcpL8Kn1o9h3k0nAF20RHneiKz/SnNCckp34TIgCv+n2+7wxRo6IMYWm+dsyQD6GQsHYsSRK2wZxcluEXdGd6dVuG4q/3v64uB8rBopYBNnruQtKNLFqQVL0mL5fXj+7lymywkID9HGX5s9pj0Xm9+/zoYO+abL5/5LQgAptaHmjv9qWwCTfUqdwy16kwUXia8xlO+TVLJyA3Mu/yIfn3Siw1Dvybw1jcYfwEjgtzisPw+XWkxnWX7RYxWCrphRyeq771fFA//YIL81RWu7VPr1JHEVv6NKOmI/o5ikdGCtE+Y= X-MS-TrafficTypeDiagnostic: CY1PR19MB0410: X-Microsoft-Exchange-Diagnostics: 1;CY1PR19MB0410;31:sQndVoR3/U6//pqHdqNpmSDjvGhzaNl0ejVGV4lms92aAkqjKzrwEW7oaw/8TSps+7BNTZQxl+pXXy1AETIZAGzf9J3H1sRSNqGQYf0BmuJTLtjO3lZbNdO9rWaWBWsW/MCUykmEAzkhbaP+lEx/AYKFXuY6G2pqs91rQgmoz1Gw7FmmiF/hHY2PhahItSlJxpNy5PmtbJJnAlSUO+T0mFk87GZDm7oGGOTtEJMMAYM=;20:0RmCGyaZYAWks1IhUny40CW1JDBk7+goncvYKGFOkxgqQWckfUYR5tblEOykpXIUGT45dsDt7mj/3xjFYoduw176YebonG1d5TnljRr9YIajkH8kS+1ohKgItdvxCogaeBZI0EbFKLSRuILaRnEXdWkaBbXdZN87gBJTeu8+rohuSIaTyhS9uhAR5GRr9eDw7TNfd8gXHLpvMBEng/OnU3gEIdit1+WAtN3g3fCWIClpbtOCjUPEdkt5BhfJ9d7EfS7EKRkV7BalYTTIFd1cmfBgTFcWbqg1nhLsAeakDHeakpme4/HjD9Xv4/iOE3UZvig4zK4ijL7lF71dGH1dh5GI0sSYycni1NLwl3PXrMVRNK0dJVxdBcGGbqlSEXpIJwdsV/rFGAuAknU2PTmP/dqBeR3kzwywrnD2+0xdMbudR+op32jWopF/KvZKL+fDvgvKjU3boIfMxuOx7XHvRE6Rggpq6RJ38xPd3kKd5/DlVzhnO7MnGk64dUM9Qa/EMlNBJRVtajMMB0qUKA95kpE/a0vJsP5ejnANaCehomsjGmPRmLTTRP1WTtogQsvcj9yqj4yCVGI+VBNq2SlSdm0FcQHy8OhFrZ3tczsLifQ= X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3231455)(999002)(944501520)(52105112)(93006095)(93004095)(3002001)(10201501046)(6055026)(148016)(149066)(150057)(6041310)(20161123564045)(20161123560045)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051)(76991095);SRVR:CY1PR19MB0410;BCL:0;PCL:0;RULEID:;SRVR:CY1PR19MB0410; X-Microsoft-Exchange-Diagnostics: 1;CY1PR19MB0410;4:JxfK/5jlX+jMLEJYvA0Qq2oO1BjT1si/5oOX42ZfHkOp5t5nsPtDx87jPbPy2I1mpnrwhxOY1YE0OYH1+BmOPI9ObE7X483j7p5NxWqMWngkh6zNybkw2wfTuSH0Utc0O1ItGrjAuQ3/V5Ym5P8HLDbq/pA0oTlAH1J761Pt/BTpjOqmojcC9MbQFUXhcnoLw6XnLFFFTnq92iyfIzThAnvew9j/syJ86ogEmWsrhkVhRZU+TaRDzSkTIAsvmm8ycdnvo35XBJWCkVfMczlvHg== X-Forefront-PRVS: 0879599414 X-Microsoft-Exchange-Diagnostics: =?utf-8?q?1=3BCY1PR19MB0410=3B23=3AJbdFbVP?= =?utf-8?q?8NcS/LVcwTSog35DJB8aN74NIXKaAXdQsLuMreI1kETokfXwBq/NLhZkBhpoD3jrO?= =?utf-8?q?8+7nd0gUt76og/vFGOXBhvtMXbJpc+45N1X01Q3tZW8IZLWbCmhueHofpPe+cGWHN?= =?utf-8?q?idZUj9b0FRomjl4s8pujRwyUjtqxWOgJDtM6zObDgwz4XN+86Kkuy63NjBlmuQfm4?= =?utf-8?q?f04zYkQ0CtvILdEGPPTQrH/VBZ5kEDmn61YKhqpkuoKr7ENJlTiRJwFLzWgtHuJvY?= =?utf-8?q?WKCMr3JBwDFIx+kBXVzJb+CaYqHlHos6dXx8dqURhu3Ejn0ASc3lgi8W4to6GEA5C?= =?utf-8?q?cn7XgxQqoqT6qQqr7L9eaw+H9+W4SMf8cyJ7aezq6UB1GrdQzBIuKllHx7COXgHe5?= =?utf-8?q?jFJN0YsqZrvitaJVyl9U9aglukOn0UiDiGtdYsM7a0o5V3ctaaGBY72phELd5RBFq?= =?utf-8?q?DA4kJkNulmPTX3MrqEyMXo8N+NRykxghXXiEfAnsd9nIkC7dqCDh6dO1R36mS08n7?= =?utf-8?q?jeoDA5G5wiY7126SIXYOcO+EHfzrzTv+K0pHxPvga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3DlD1bgI9+L6p9yTFvwllDt9okbOcgog15MEsq8CCnySlVjZTb/W60sgNy+2Jwybh8ac3l2iFWG8NLLoxJHB0/HbI3pobxuuwRF8ugmlcUEoeBg= X-Microsoft-Exchange-Diagnostics: 1;CY1PR19MB0410;6:E9lO2UxaqKXO9EQ1unyGWLswT4HbL0G12tJzurvIIRrAFDyljhpwCa6PjFbb83JtsOOW6TYdEgG0UlfsqcOYRbjiEUehG6erVckXAwsKNTeGF8883TeWINHVD/UX8LXLJmE5eUczF6BIuEyu7D4SDwDB5tQocxNYZn+AlBHkQ6mZKQUACDJLIlywJsUqzhq2z/kPa9oDWpp/FY+aVs1u7NwwzyrulCXhGKOngEgRgkeVwp84BEUYEYDDYYN0y08fLBMEaVw9KvUq0inim8w6NEn8oZKLonVCUjvk6m2AK3x8H6cRMl/bm1E2SWsSlkZu5fe+sQ6ruwP45n8flKMfDeI+zHw4gyOZyJc2syFTc1quU+h8+gcTmaCrjl5neiJZ8/dNqVcY7AjNGapNrMmQbbIfFSgsSiiVaRlZpoHzalB0Gqa0mJ8Dv2ajp5P+BH77heuq++yOURhtvjmLOKUMdQ==;5:gYbf1nlMnFWvhhwJWtAX0jyblbDqiM7UMjKpouzaeLxDUxrC9FL2fPEPGnlVNVKKogIJ17pJDT1AUnIgfaFja3aSu3XCox97BfJtCV0sVTwL+CgJWbI9g/sn7x9gXmOreqZVAe56BshZoVHDyCJskea5HEyjST2OyC1oAQXvv9w=;7:q3dWsJ2j0POFgDtDAX8A4x9taaRDG0n26E+g86YwqryQSFAHGtmlZCYDRSdJaNd2mx9EP6Wh6eJjwXlngMFm6XynOm9esaM8WZgW+c2BlyvOdGatP/kO8xQAMQUc1YhV3Kr2csQ+TvoaYf6OLXnrtA== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: microsemi.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Dec 2018 22:30:00.6885 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1ecce72b-822e-417e-2a43-08d65c9386a3 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.23];Helo=[AVMBX3.microsemi.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR19MB0410 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 The PCI_IRQ_AFFINITY flag prevents customers from changing the smp_affinity and smp_affinity_list entries. Add a module parameter to allow this flag to be turned off. Reviewed-by: Scott Teel Reviewed-by: Murthy Bhat Reviewed-by: Mahesh Rajashekhara Reviewed-by: Dave Carroll Reviewed-by: Kevin Barnett Signed-off-by: Don Brace --- drivers/scsi/smartpqi/smartpqi_init.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c index 2f2a07a38dad..f9812281988c 100644 --- a/drivers/scsi/smartpqi/smartpqi_init.c +++ b/drivers/scsi/smartpqi/smartpqi_init.c @@ -144,6 +144,11 @@ MODULE_PARM_DESC(lockup_action, "Action to take when controller locked up.\n" "\t\tSupported: none, reboot, panic\n" "\t\tDefault: none"); +static bool pqi_disable_irq_affinity; +module_param(pqi_disable_irq_affinity, bool, 0644); +MODULE_PARM_DESC(pqi_disable_irq_affinity, + "\t\tTurn off managed irq affinity. Allows smp_affinity to be changed."); + static char *raid_levels[] = { "RAID-0", "RAID-4", @@ -3276,10 +3281,14 @@ static void pqi_free_irqs(struct pqi_ctrl_info *ctrl_info) static int pqi_enable_msix_interrupts(struct pqi_ctrl_info *ctrl_info) { int num_vectors_enabled; + unsigned int flags = PCI_IRQ_MSIX; + + if (!pqi_disable_irq_affinity) + flags |= PCI_IRQ_AFFINITY; num_vectors_enabled = pci_alloc_irq_vectors(ctrl_info->pci_dev, PQI_MIN_MSIX_VECTORS, ctrl_info->num_queue_groups, - PCI_IRQ_MSIX | PCI_IRQ_AFFINITY); + flags); if (num_vectors_enabled < 0) { dev_err(&ctrl_info->pci_dev->dev, "MSI-X init failed with error %d\n", @@ -5507,7 +5516,11 @@ static int pqi_map_queues(struct Scsi_Host *shost) { struct pqi_ctrl_info *ctrl_info = shost_to_hba(shost); - return blk_mq_pci_map_queues(&shost->tag_set, ctrl_info->pci_dev, 0); + if (!pqi_disable_irq_affinity) + return blk_mq_pci_map_queues(&shost->tag_set, + ctrl_info->pci_dev, 0); + else + return 0; } static int pqi_getpciinfo_ioctl(struct pqi_ctrl_info *ctrl_info, From patchwork Fri Dec 7 22:30:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Don Brace X-Patchwork-Id: 10718985 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 1392B109C for ; Fri, 7 Dec 2018 22:30:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 01F382ABF4 for ; Fri, 7 Dec 2018 22:30:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E9C4E2F2E1; Fri, 7 Dec 2018 22:30:21 +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 9E7CD2ABF4 for ; Fri, 7 Dec 2018 22:30:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726081AbeLGWaU (ORCPT ); Fri, 7 Dec 2018 17:30:20 -0500 Received: from mail-eopbgr680054.outbound.protection.outlook.com ([40.107.68.54]:62380 "EHLO NAM04-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726070AbeLGWaT (ORCPT ); Fri, 7 Dec 2018 17:30:19 -0500 Received: from MWHPR19CA0056.namprd19.prod.outlook.com (2603:10b6:300:94::18) by MWHPR19MB0942.namprd19.prod.outlook.com (2603:10b6:300:a4::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1404.22; Fri, 7 Dec 2018 22:30:08 +0000 Received: from BN1BFFO11FD025.protection.gbl (2a01:111:f400:7c10::1:116) by MWHPR19CA0056.outlook.office365.com (2603:10b6:300:94::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1404.17 via Frontend Transport; Fri, 7 Dec 2018 22:30:08 +0000 Received-SPF: Pass (protection.outlook.com: domain of microsemi.com designates 208.19.100.23 as permitted sender) receiver=protection.outlook.com; client-ip=208.19.100.23; helo=AVMBX3.microsemi.net; Received: from AVMBX3.microsemi.net (208.19.100.23) by BN1BFFO11FD025.mail.protection.outlook.com (10.58.144.88) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.1404.13 via Frontend Transport; Fri, 7 Dec 2018 22:30:07 +0000 Received: from AVMBX2.microsemi.net (10.100.34.32) by AVMBX3.microsemi.net (10.100.34.33) 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 14:30:06 -0800 Received: from [127.0.1.1] (10.238.32.34) by avmbx2.microsemi.net (10.100.34.32) with Microsoft SMTP Server id 15.1.1531.3 via Frontend Transport; Fri, 7 Dec 2018 14:30:05 -0800 Subject: [PATCH 19/20] smartpqi: add smp_utils support From: Don Brace To: , , , , , , , , , , , CC: Date: Fri, 7 Dec 2018 16:30:05 -0600 Message-ID: <154422180514.1218.12509690407248653605.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.100.23;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(7916004)(396003)(39860400002)(346002)(136003)(376002)(2980300002)(189003)(199004)(23676004)(103116003)(47776003)(230700001)(81166006)(58126008)(81156014)(8936002)(316002)(110136005)(8676002)(5660300001)(97736004)(2486003)(16576012)(305945005)(50466002)(33716001)(106002)(106466001)(69596002)(68736007)(2906002)(9686003)(53936002)(336012)(4326008)(2201001)(26005)(77096007)(4744004)(356004)(126002)(446003)(11346002)(14444005)(575784001)(476003)(486006)(6346003)(76176011)(478600001)(86362001)(33896004)(44832011)(186003)(921003)(83996005)(2101003)(1121003);DIR:OUT;SFP:1101;SCL:1;SRVR:MWHPR19MB0942;H:AVMBX3.microsemi.net;FPR:;SPF:Pass;LANG:en;PTR:InfoDomainNonexistent;MX:1;A:1; X-Microsoft-Exchange-Diagnostics: 1;BN1BFFO11FD025;1:s67w05o+7BXb59e6rLmr8C8mXtZu4y3T9AYGiRthDRggzKhi+7xy8bryJz367Q5DuGnzrA8AT73PtWYf9e5JqmFkgP5c8fivFl1q0EaHZ8n8LaTLBxEEnDFx1b3OkTjh X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6206a1dd-8ac7-4421-3cf6-08d65c938ad9 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390098)(7020095)(4652040)(8989299)(5600074)(711020)(4608076)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060);SRVR:MWHPR19MB0942; X-Microsoft-Exchange-Diagnostics: 1;MWHPR19MB0942;3:1+vvJM3MrupzsewL0EcT+cwPEYbCRIPHhB9TPJALow8c7SMLpND+/yYYIhfOkG/zxwY2yHsPsv0MPYY9XXGMc9dmkjGyMYylSMnmZXuNGYGeakpT5fbq8TLOlfqQFHqqQQByO+uRsrzEeq4C/v3Yrub8La3KmtudHI7ZJONLDLHRqOX7Yj0BSs21EVgtQhfGzLgjQzn/rUg/e2Eg0HlLBW64hfr3+E2/K4BMjTWtdXPM9ANs9Wlxsh24KtOZws+kfenlJQJWbYZo3/r8A8Xwh0k1YuysAuk63+Yxvgmvy/6r8MRWyfdnuBZRRSfWRPYCoflxiHEmIQlyP/j6ooYblV9cH15ewb6tLRL2uunWMEg=;25:5PauVU2qLong4T0Cm16nHzn4UiYUQzxdCeS+Li+3iHpDsbwa25re6ea5LxU4+ED040YE3fCkAPkp8pOcFZ2K8mpm1HKa1/cpE+lW3t6LLvwcmTagC/zi/1G57LdK/NHlPpv0NVip5waleEPslc8Pw3J8bulIL0dy/3alT55xESIu2iUFqG1MQCKD2EkWXYhyEskMGV7pkOTW7ihk6wo16JfLRB9cyJZLXaSPfoNWn6mNKN7vJPqVSNL4B9RGkhXBlP2Euzy6ij8fbLD5HB2T10JNPaM1cnftbYadoWZOUfzW/hFynKF5PbL3YWXvuKIPYSBhyR+zigYLEsrQk2yRWA== X-MS-TrafficTypeDiagnostic: MWHPR19MB0942: X-Microsoft-Exchange-Diagnostics: 1;MWHPR19MB0942;31:EUyfHvLaMhLz7RdxN9Wl5leckiU0dwSb4HmSUm9STsUvFYXAVCQvS0ClVpMFz13RNg69nTeukj0YojypC6gK9Jg16DYreONA/poaEotzllJlN1ry1mxoTyn0HZB9Pj1wVWblIyflKi+SKY6WFRmKu1wGK9zo2GQBXYk1tPYBLKLrMxys7O0VhTFh7dC7mFE3NDYfcLZpn/Vo5XKCZ9BFbrzcenTvjEZZD3gtwY4aj9I=;20:IyEw1ne2oI7jAVYhBn+KjoUVIE7DZzZnBXLkmk8KVh1SSZHS2pFdP504NBn/dEMwkdMEn3KWWFaNKiDOe1m5dF91qEWFXNudgV/K+Ji4rwc4Ad8EyEd0yvhtg9C7Qv6RR2SEtL73X4IBFLXcaAKZXuqr/uQax9M6Fh2ojVQzuWRI3JLQYdI1x8+9N7h3UVUaqgtNDw9Zx43XszjMo+n88+GvwuaYEGEg6WrK3l86UnXn2uRmfcuIgt10WoR+oNjD5+3/QCdSxWAV64whRUiDz2/NyuRwY4seelVF/4aV3O8GabNmIttOhtTfeYqdE0E0yELpd7zeL1/5FqyWYUG7M8R9DneIZjWuOH2jQWXQc/d/nde50yoC7WDIiIBbcscMyW1qc9ctZ76wHj0nE3OPJkITSoZkvtAKrKO6rtN8rNGvnqOVFzEILKkaaCy3Z/MBc8OnjZUrCP5lg5MsnK6sCkDH7OqiSc8dLqmZvsiSPxeinPsI2HQqz1FD4yP5U6ZZeavalIRWm2oPBFJwo9jCEgdsl94TSCy7kNznvFza/vSFsBRXUXtaNRDuhRKU47yWhzuPQKq7WHEi9OA5VEC8OgE5h3guLWConJOjnAYrWXM= 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)(3231455)(999002)(944501520)(52105112)(93006095)(93004095)(3002001)(10201501046)(6055026)(148016)(149066)(150057)(6041310)(20161123564045)(20161123560045)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051)(76991095);SRVR:MWHPR19MB0942;BCL:0;PCL:0;RULEID:;SRVR:MWHPR19MB0942; X-Microsoft-Exchange-Diagnostics: 1;MWHPR19MB0942;4:FrJfGzzO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i9C4qjQsmD8yCVOeT5yjSeeugB9w+2wUH8RUHfTlYKpmHaDnkwFjh40Jvloamd1RyXCWmqc/2TO5632WlTpQzCaII/DA+UDQzDjIrjA7YFz+cniOvaIodc+fX0g68w3w= X-Microsoft-Exchange-Diagnostics: 1;MWHPR19MB0942;6:VQeIJ4lc7SNll8rkj2jQbY8B/sgQys4Lrtn7LzeuGPBo9fYKE/SA2v4HUhibPwhKskM3YMgRXtAA2K95EcoVShiTSMfI1A6p692hM++THV31ki24Ph1sjQCptxnposxoLBEkFjFEGbcRhrZQl4rt+iKrA3/ob9aPmYkYatb57x0ppd/nNVQ5Z+01VaEb1u/9vzCaW6U2Ck/OuocmQVtzDovzg8IoS2fJ1LnV1e2as8DfOI+uK19XU1NkCwqXl4ISPDzY2H+112Eoc5Yre76C4B2c+PN5mEarYQaOVBhQ4Vzehj0wEMl4MiICXaQMp3tpPx5QSlQuobzbJ/NTtB64aE+7HQILnS7TQ/dc8N3QvIdwF3aDlZtB0JCjPuYmxBRma5rG9OXzbDrfY/GMJGBWH0C2XRt8pfOk08byu3mKg/+NoBNw9M05OGyfHf6tp/9jr7Uu72kKzlFMUhhrGTSt+A==;5:1yGHrf0lgoDJlLkmCvxi1yqe6KqFvqDuLzKoBBIEpCStZLdG4+NoyW+Zr+bf1Ztfo5lDNKAaUj72546EBCvR/ErUMJWHB0rdLDU1Es0+O6h6kWkLpiuuPKvHMMDV3pRlb779X9x50HV2t6sxU3SqJnziuHLbs3K+ue6rZQC93A8=;7:EPP1kZrkGRc9EwPCVatAfkRmvOiAcAHsy/Yd+2nsHpHvatp9f1PWu2GJMclwJR4j1HCJadAWKfCF6pZsFxtJ7NrnzEHoRe6+qEGA1BBLbZ1hw5ihXSh7IgxLv9lFaBHnPjpOI4JgyVVCfq8djVlOdw== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: microsemi.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Dec 2018 22:30:07.7538 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6206a1dd-8ac7-4421-3cf6-08d65c938ad9 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.23];Helo=[AVMBX3.microsemi.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR19MB0942 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 Reviewed-by: Scott Benesh Reviewed-by: Mahesh Rajashekhara Reviewed-by: Scott Teel Reviewed-by: Dave Carroll Reviewed-by: Kevin Barnett Signed-off-by: Don Brace --- drivers/scsi/smartpqi/smartpqi.h | 89 +++++++++++++ drivers/scsi/smartpqi/smartpqi_init.c | 131 ++++++++++++------- drivers/scsi/smartpqi/smartpqi_sas_transport.c | 164 +++++++++++++++++++++++- 3 files changed, 324 insertions(+), 60 deletions(-) diff --git a/drivers/scsi/smartpqi/smartpqi.h b/drivers/scsi/smartpqi/smartpqi.h index 4f52b5be3693..ba499a636f43 100644 --- a/drivers/scsi/smartpqi/smartpqi.h +++ b/drivers/scsi/smartpqi/smartpqi.h @@ -21,6 +21,9 @@ #if !defined(_SMARTPQI_H) #define _SMARTPQI_H +#include +#include + #pragma pack(1) #define PQI_DEVICE_SIGNATURE "PQI DREG" @@ -855,6 +858,7 @@ struct pqi_scsi_dev { u8 unique_id[16]; u8 is_physical_device : 1; u8 is_external_raid_device : 1; + u8 is_expander_smp_device : 1; u8 target_lun_valid : 1; u8 device_gone : 1; u8 new_device : 1; @@ -964,6 +968,7 @@ struct pqi_sas_node { struct pqi_sas_port { struct list_head port_list_entry; u64 sas_address; + struct pqi_scsi_dev *device; struct sas_port *port; int next_phy_index; struct list_head phy_list_head; @@ -1129,11 +1134,14 @@ enum pqi_ctrl_mode { #define BMIC_WRITE 0x27 #define BMIC_SENSE_CONTROLLER_PARAMETERS 0x64 #define BMIC_SENSE_SUBSYSTEM_INFORMATION 0x66 +#define BMIC_CSMI_PASSTHRU 0x68 #define BMIC_WRITE_HOST_WELLNESS 0xa5 #define BMIC_FLUSH_CACHE 0xc2 #define BMIC_SET_DIAG_OPTIONS 0xf4 #define BMIC_SENSE_DIAG_OPTIONS 0xf5 +#define CSMI_CC_SAS_SMP_PASSTHRU 0X17 + #define SA_FLUSH_CACHE 0x1 #define MASKED_DEVICE(lunid) ((lunid)[3] & 0xc0) @@ -1160,6 +1168,10 @@ struct bmic_identify_controller { u8 reserved3[32]; }; +#define SA_EXPANDER_SMP_DEVICE 0x05 +/*SCSI Invalid Device Type for SAS devices*/ +#define PQI_SAS_SCSI_INVALID_DEVTYPE 0xff + struct bmic_identify_physical_device { u8 scsi_bus; /* SCSI Bus number on controller */ u8 scsi_id; /* SCSI ID on this bus */ @@ -1240,6 +1252,50 @@ struct bmic_identify_physical_device { u8 padding_to_multiple_of_512[9]; }; +struct bmic_smp_request { + u8 frame_type; + u8 function; + u8 allocated_response_length; + u8 request_length; + u8 additional_request_bytes[1016]; +}; + +struct bmic_smp_response { + u8 frame_type; + u8 function; + u8 function_result; + u8 response_length; + u8 additional_response_bytes[1016]; +}; + +struct bmic_csmi_ioctl_header { + __le32 header_length; + u8 signature[8]; + __le32 timeout; + __le32 control_code; + __le32 return_code; + __le32 length; +}; + +struct bmic_csmi_smp_passthru { + u8 phy_identifier; + u8 port_identifier; + u8 connection_rate; + u8 reserved; + __be64 destination_sas_address; + __le32 request_length; + struct bmic_smp_request request; + u8 connection_status; + u8 reserved1[3]; + __le32 response_length; + struct bmic_smp_response response; +}; + +struct bmic_csmi_smp_passthru_buffer { + struct bmic_csmi_ioctl_header ioctl_header; + struct bmic_csmi_smp_passthru parameters; +}; + struct bmic_flush_cache { u8 disable_flag; u8 system_power_action; @@ -1263,6 +1319,36 @@ struct bmic_diag_options { #pragma pack() +static inline struct pqi_ctrl_info *shost_to_hba(struct Scsi_Host *shost) +{ + void *hostdata = shost_priv(shost); + + return *((struct pqi_ctrl_info **)hostdata); +} + +static inline bool pqi_ctrl_offline(struct pqi_ctrl_info *ctrl_info) +{ + return !ctrl_info->controller_online; +} + +static inline void pqi_ctrl_busy(struct pqi_ctrl_info *ctrl_info) +{ + atomic_inc(&ctrl_info->num_busy_threads); +} + +static inline void pqi_ctrl_unbusy(struct pqi_ctrl_info *ctrl_info) +{ + atomic_dec(&ctrl_info->num_busy_threads); +} + +static inline bool pqi_ctrl_blocked(struct pqi_ctrl_info *ctrl_info) +{ + return ctrl_info->block_requests; +} + +void pqi_sas_smp_handler(struct bsg_job *job, struct Scsi_Host *shost, + struct sas_rphy *rphy); + int pqi_add_sas_host(struct Scsi_Host *shost, struct pqi_ctrl_info *ctrl_info); void pqi_delete_sas_host(struct pqi_ctrl_info *ctrl_info); int pqi_add_sas_device(struct pqi_sas_node *pqi_sas_node, @@ -1271,6 +1357,9 @@ void pqi_remove_sas_device(struct pqi_scsi_dev *device); struct pqi_scsi_dev *pqi_find_device_by_sas_rphy( struct pqi_ctrl_info *ctrl_info, struct sas_rphy *rphy); void pqi_prep_for_scsi_done(struct scsi_cmnd *scmd); +int pqi_csmi_smp_passthru(struct pqi_ctrl_info *ctrl_info, + struct bmic_csmi_smp_passthru_buffer *buffer, size_t buffer_length, + struct pqi_raid_error_info *error_info); extern struct sas_function_template pqi_sas_transport_functions; diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c index f9812281988c..8d94028d0a9d 100644 --- a/drivers/scsi/smartpqi/smartpqi_init.c +++ b/drivers/scsi/smartpqi/smartpqi_init.c @@ -193,13 +193,6 @@ static inline bool pqi_scsi3addr_equal(u8 *scsi3addr1, u8 *scsi3addr2) return memcmp(scsi3addr1, scsi3addr2, 8) == 0; } -static inline struct pqi_ctrl_info *shost_to_hba(struct Scsi_Host *shost) -{ - void *hostdata = shost_priv(shost); - - return *((struct pqi_ctrl_info **)hostdata); -} - static inline bool pqi_is_logical_device(struct pqi_scsi_dev *device) { return !device->is_physical_device; @@ -210,11 +203,6 @@ static inline bool pqi_is_external_raid_addr(u8 *scsi3addr) return scsi3addr[2] != 0; } -static inline bool pqi_ctrl_offline(struct pqi_ctrl_info *ctrl_info) -{ - return !ctrl_info->controller_online; -} - static inline void pqi_check_ctrl_health(struct pqi_ctrl_info *ctrl_info) { if (ctrl_info->controller_online) @@ -253,11 +241,6 @@ static inline void pqi_ctrl_unblock_requests(struct pqi_ctrl_info *ctrl_info) scsi_unblock_requests(ctrl_info->scsi_host); } -static inline bool pqi_ctrl_blocked(struct pqi_ctrl_info *ctrl_info) -{ - return ctrl_info->block_requests; -} - static unsigned long pqi_wait_if_ctrl_blocked(struct pqi_ctrl_info *ctrl_info, unsigned long timeout_msecs) { @@ -287,16 +270,6 @@ static unsigned long pqi_wait_if_ctrl_blocked(struct pqi_ctrl_info *ctrl_info, return remaining_msecs; } -static inline void pqi_ctrl_busy(struct pqi_ctrl_info *ctrl_info) -{ - atomic_inc(&ctrl_info->num_busy_threads); -} - -static inline void pqi_ctrl_unbusy(struct pqi_ctrl_info *ctrl_info) -{ - atomic_dec(&ctrl_info->num_busy_threads); -} - static inline void pqi_ctrl_wait_until_quiesced(struct pqi_ctrl_info *ctrl_info) { while (atomic_read(&ctrl_info->num_busy_threads) > @@ -477,6 +450,13 @@ static int pqi_build_raid_path_request(struct pqi_ctrl_info *ctrl_info, cdb[6] = cmd; put_unaligned_be16(cdb_length, &cdb[7]); break; + case BMIC_CSMI_PASSTHRU: + request->data_direction = SOP_BIDIRECTIONAL; + cdb[0] = BMIC_WRITE; + cdb[5] = CSMI_CC_SAS_SMP_PASSTHRU; + cdb[6] = cmd; + put_unaligned_be16(cdb_length, &cdb[7]); + break; default: dev_err(&ctrl_info->pci_dev->dev, "unknown command 0x%c\n", cmd); @@ -718,6 +698,13 @@ static int pqi_flush_cache(struct pqi_ctrl_info *ctrl_info, return rc; } +int pqi_csmi_smp_passthru(struct pqi_ctrl_info *ctrl_info, + struct bmic_csmi_smp_passthru_buffer *buffer, size_t buffer_length, + struct pqi_raid_error_info *error_info) +{ + return pqi_send_ctrl_raid_with_error(ctrl_info, BMIC_CSMI_PASSTHRU, + buffer, buffer_length, error_info); +} #define PQI_FETCH_PTRAID_DATA (1UL<<31) @@ -1303,6 +1290,9 @@ static int pqi_get_device_info(struct pqi_ctrl_info *ctrl_info, u8 *buffer; unsigned int retries; + if (device->is_expander_smp_device) + return 0; + buffer = kmalloc(64, GFP_KERNEL); if (!buffer) return -ENOMEM; @@ -1590,6 +1580,14 @@ static enum pqi_find_result pqi_scsi_find_entry(struct pqi_ctrl_info *ctrl_info, return DEVICE_NOT_FOUND; } +static inline const char *pqi_device_type(struct pqi_scsi_dev *device) +{ + if (device->is_expander_smp_device) + return "Enclosure SMP "; + + return scsi_device_type(device->devtype); +} + #define PQI_DEV_INFO_BUFFER_LENGTH 128 static void pqi_dev_info(struct pqi_ctrl_info *ctrl_info, @@ -1625,7 +1623,7 @@ static void pqi_dev_info(struct pqi_ctrl_info *ctrl_info, count += snprintf(buffer + count, PQI_DEV_INFO_BUFFER_LENGTH - count, " %s %.8s %.16s ", - scsi_device_type(device->devtype), + pqi_device_type(device), device->vendor, device->model); @@ -1670,6 +1668,8 @@ static void pqi_scsi_update_device(struct pqi_scsi_dev *existing_device, existing_device->is_physical_device = new_device->is_physical_device; existing_device->is_external_raid_device = new_device->is_external_raid_device; + existing_device->is_expander_smp_device = + new_device->is_expander_smp_device; existing_device->aio_enabled = new_device->aio_enabled; memcpy(existing_device->vendor, new_device->vendor, sizeof(existing_device->vendor)); @@ -1726,6 +1726,14 @@ static inline void pqi_fixup_botched_add(struct pqi_ctrl_info *ctrl_info, device->keep_device = false; } +static inline bool pqi_is_device_added(struct pqi_scsi_dev *device) +{ + if (device->is_expander_smp_device) + return device->sas_port != NULL; + + return device->sdev != NULL; +} + static void pqi_update_device_list(struct pqi_ctrl_info *ctrl_info, struct pqi_scsi_dev *new_device_list[], unsigned int num_new_devices) { @@ -1820,7 +1828,7 @@ static void pqi_update_device_list(struct pqi_ctrl_info *ctrl_info, } else { pqi_dev_info(ctrl_info, "removed", device); } - if (device->sdev) + if (pqi_is_device_added(device)) pqi_remove_device(ctrl_info, device); list_del(&device->delete_list_entry); pqi_free_device(device); @@ -1842,7 +1850,7 @@ static void pqi_update_device_list(struct pqi_ctrl_info *ctrl_info, /* Expose any new devices. */ list_for_each_entry_safe(device, next, &add_list, add_list_entry) { - if (!device->sdev) { + if (!pqi_is_device_added(device)) { pqi_dev_info(ctrl_info, "added", device); rc = pqi_add_device(ctrl_info, device); if (rc) { @@ -1859,7 +1867,12 @@ static void pqi_update_device_list(struct pqi_ctrl_info *ctrl_info, static bool pqi_is_supported_device(struct pqi_scsi_dev *device) { - bool is_supported = false; + bool is_supported; + + if (device->is_expander_smp_device) + return true; + + is_supported = false; switch (device->devtype) { case TYPE_DISK: @@ -1893,6 +1906,24 @@ static inline bool pqi_skip_device(u8 *scsi3addr) return false; } +static inline bool pqi_is_device_with_sas_address(struct pqi_scsi_dev *device) +{ + if (!device->is_physical_device) + return false; + + if (device->is_expander_smp_device) + return true; + + switch (device->devtype) { + case TYPE_DISK: + case TYPE_ZBC: + case TYPE_ENCLOSURE: + return true; + } + + return false; +} + static inline bool pqi_expose_device(struct pqi_scsi_dev *device) { return !device->is_physical_device || @@ -2007,9 +2038,14 @@ static int pqi_update_scsi_devices(struct pqi_ctrl_info *ctrl_info) memcpy(device->scsi3addr, scsi3addr, sizeof(device->scsi3addr)); device->is_physical_device = is_physical_device; - if (!is_physical_device) + if (is_physical_device) { + if (phys_lun_ext_entry->device_type == + SA_EXPANDER_SMP_DEVICE) + device->is_expander_smp_device = true; + } else { device->is_external_raid_device = pqi_is_external_raid_addr(scsi3addr); + } /* Gather information about the device. */ rc = pqi_get_device_info(ctrl_info, device); @@ -2042,30 +2078,23 @@ static int pqi_update_scsi_devices(struct pqi_ctrl_info *ctrl_info) device->wwid = phys_lun_ext_entry->wwid; if ((phys_lun_ext_entry->device_flags & REPORT_PHYS_LUN_DEV_FLAG_AIO_ENABLED) && - phys_lun_ext_entry->aio_handle) + phys_lun_ext_entry->aio_handle) { device->aio_enabled = true; + device->aio_handle = + phys_lun_ext_entry->aio_handle; + } + if (device->devtype == TYPE_DISK || + device->devtype == TYPE_ZBC) { + pqi_get_physical_disk_info(ctrl_info, + device, id_phys); + } } else { memcpy(device->volume_id, log_lun_ext_entry->volume_id, sizeof(device->volume_id)); } - switch (device->devtype) { - case TYPE_DISK: - case TYPE_ZBC: - case TYPE_ENCLOSURE: - if (device->is_physical_device) { - device->sas_address = - get_unaligned_be64(&device->wwid); - if (device->devtype == TYPE_DISK || - device->devtype == TYPE_ZBC) { - device->aio_handle = - phys_lun_ext_entry->aio_handle; - pqi_get_physical_disk_info(ctrl_info, - device, id_phys); - } - } - break; - } + if (pqi_is_device_with_sas_address(device)) + device->sas_address = get_unaligned_be64(&device->wwid); new_device_list[num_valid_devices++] = device; } @@ -2108,7 +2137,7 @@ static void pqi_remove_all_scsi_devices(struct pqi_ctrl_info *ctrl_info) if (!device) break; - if (device->sdev) + if (pqi_is_device_added(device)) pqi_remove_device(ctrl_info, device); pqi_free_device(device); } diff --git a/drivers/scsi/smartpqi/smartpqi_sas_transport.c b/drivers/scsi/smartpqi/smartpqi_sas_transport.c index b209a35e482e..0e4ef215115f 100644 --- a/drivers/scsi/smartpqi/smartpqi_sas_transport.c +++ b/drivers/scsi/smartpqi/smartpqi_sas_transport.c @@ -17,9 +17,11 @@ */ #include +#include #include #include #include +#include #include "smartpqi.h" static struct pqi_sas_phy *pqi_alloc_sas_phy(struct pqi_sas_port *pqi_sas_port) @@ -97,14 +99,32 @@ static int pqi_sas_port_add_rphy(struct pqi_sas_port *pqi_sas_port, identify = &rphy->identify; identify->sas_address = pqi_sas_port->sas_address; - identify->initiator_port_protocols = SAS_PROTOCOL_STP; - identify->target_port_protocols = SAS_PROTOCOL_STP; + + if (pqi_sas_port->device && + pqi_sas_port->device->is_expander_smp_device) { + identify->initiator_port_protocols = SAS_PROTOCOL_SMP; + identify->target_port_protocols = SAS_PROTOCOL_SMP; + } else { + identify->initiator_port_protocols = SAS_PROTOCOL_STP; + identify->target_port_protocols = SAS_PROTOCOL_STP; + } return sas_rphy_add(rphy); } +static struct sas_rphy *pqi_sas_rphy_alloc(struct pqi_sas_port *pqi_sas_port) +{ + if (pqi_sas_port->device && + pqi_sas_port->device->is_expander_smp_device) + return sas_expander_alloc(pqi_sas_port->port, + SAS_FANOUT_EXPANDER_DEVICE); + + return sas_end_device_alloc(pqi_sas_port->port); +} + static struct pqi_sas_port *pqi_alloc_sas_port( - struct pqi_sas_node *pqi_sas_node, u64 sas_address) + struct pqi_sas_node *pqi_sas_node, u64 sas_address, + struct pqi_scsi_dev *device) { int rc; struct pqi_sas_port *pqi_sas_port; @@ -127,6 +147,7 @@ static struct pqi_sas_port *pqi_alloc_sas_port( pqi_sas_port->port = port; pqi_sas_port->sas_address = sas_address; + pqi_sas_port->device = device; list_add_tail(&pqi_sas_port->port_list_entry, &pqi_sas_node->port_list_head); @@ -146,7 +167,7 @@ static void pqi_free_sas_port(struct pqi_sas_port *pqi_sas_port) struct pqi_sas_phy *next; list_for_each_entry_safe(pqi_sas_phy, next, - &pqi_sas_port->phy_list_head, phy_list_entry) + &pqi_sas_port->phy_list_head, phy_list_entry) pqi_free_sas_phy(pqi_sas_phy); sas_port_delete(pqi_sas_port->port); @@ -176,7 +197,7 @@ static void pqi_free_sas_node(struct pqi_sas_node *pqi_sas_node) return; list_for_each_entry_safe(pqi_sas_port, next, - &pqi_sas_node->port_list_head, port_list_entry) + &pqi_sas_node->port_list_head, port_list_entry) pqi_free_sas_port(pqi_sas_port); kfree(pqi_sas_node); @@ -206,13 +227,14 @@ int pqi_add_sas_host(struct Scsi_Host *shost, struct pqi_ctrl_info *ctrl_info) struct pqi_sas_port *pqi_sas_port; struct pqi_sas_phy *pqi_sas_phy; - parent_dev = &shost->shost_gendev; + parent_dev = &shost->shost_dev; pqi_sas_node = pqi_alloc_sas_node(parent_dev); if (!pqi_sas_node) return -ENOMEM; - pqi_sas_port = pqi_alloc_sas_port(pqi_sas_node, ctrl_info->sas_address); + pqi_sas_port = pqi_alloc_sas_port(pqi_sas_node, + ctrl_info->sas_address, NULL); if (!pqi_sas_port) { rc = -ENODEV; goto free_sas_node; @@ -254,11 +276,12 @@ int pqi_add_sas_device(struct pqi_sas_node *pqi_sas_node, struct pqi_sas_port *pqi_sas_port; struct sas_rphy *rphy; - pqi_sas_port = pqi_alloc_sas_port(pqi_sas_node, device->sas_address); + pqi_sas_port = pqi_alloc_sas_port(pqi_sas_node, + device->sas_address, device); if (!pqi_sas_port) return -ENOMEM; - rphy = sas_end_device_alloc(pqi_sas_port->port); + rphy = pqi_sas_rphy_alloc(pqi_sas_port); if (!rphy) { rc = -ENODEV; goto free_sas_port; @@ -329,6 +352,128 @@ static int pqi_sas_phy_speed(struct sas_phy *phy, return -EINVAL; } +#define CSMI_IOCTL_TIMEOUT 60 +#define SMP_CRC_FIELD_LENGTH 4 + +static struct bmic_csmi_smp_passthru_buffer * +pqi_build_csmi_smp_passthru_buffer(struct sas_rphy *rphy, + struct bsg_job *job) +{ + struct bmic_csmi_smp_passthru_buffer *smp_buf; + struct bmic_csmi_ioctl_header *ioctl_header; + struct bmic_csmi_smp_passthru *parameters; + u32 req_size; + u32 resp_size; + + smp_buf = kzalloc(sizeof(*smp_buf), GFP_KERNEL); + if (!smp_buf) + return NULL; + + req_size = job->request_payload.payload_len; + resp_size = job->reply_payload.payload_len; + + ioctl_header = &smp_buf->ioctl_header; + put_unaligned_le32(sizeof(smp_buf->ioctl_header), + &ioctl_header->header_length); + put_unaligned_le32(CSMI_IOCTL_TIMEOUT, &ioctl_header->timeout); + put_unaligned_le32(CSMI_CC_SAS_SMP_PASSTHRU, + &ioctl_header->control_code); + put_unaligned_le32(sizeof(smp_buf->parameters), &ioctl_header->length); + + parameters = &smp_buf->parameters; + parameters->phy_identifier = rphy->identify.phy_identifier; + parameters->port_identifier = 0; + parameters->connection_rate = 0; + put_unaligned_be64(rphy->identify.sas_address, + ¶meters->destination_sas_address); + + if (req_size > SMP_CRC_FIELD_LENGTH) + req_size -= SMP_CRC_FIELD_LENGTH; + + put_unaligned_le32(req_size, ¶meters->request_length); + + put_unaligned_le32(resp_size, ¶meters->response_length); + + sg_copy_to_buffer(job->request_payload.sg_list, + job->reply_payload.sg_cnt, ¶meters->request, + req_size); + + return smp_buf; +} + +static unsigned int pqi_build_sas_smp_handler_reply( + struct bmic_csmi_smp_passthru_buffer *smp_buf, struct bsg_job *job, + struct pqi_raid_error_info *error_info) +{ + sg_copy_from_buffer(job->reply_payload.sg_list, + job->reply_payload.sg_cnt, &smp_buf->parameters.response, + le32_to_cpu(smp_buf->parameters.response_length)); + + job->reply_len = le16_to_cpu(error_info->sense_data_length); + memcpy(job->reply, error_info->data, + le16_to_cpu(error_info->sense_data_length)); + + return job->reply_payload.payload_len - + get_unaligned_le32(&error_info->data_in_transferred); +} + +void pqi_sas_smp_handler(struct bsg_job *job, struct Scsi_Host *shost, + struct sas_rphy *rphy) +{ + int rc; + struct pqi_ctrl_info *ctrl_info = shost_to_hba(shost); + struct bmic_csmi_smp_passthru_buffer *smp_buf; + struct pqi_raid_error_info error_info; + unsigned int reslen = 0; + + pqi_ctrl_busy(ctrl_info); + + if (job->reply_payload.payload_len == 0) { + rc = -ENOMEM; + goto out; + } + + if (!rphy) { + rc = -EINVAL; + goto out; + } + + if (rphy->identify.device_type != SAS_FANOUT_EXPANDER_DEVICE) { + rc = -EINVAL; + goto out; + } + + if (job->request_payload.sg_cnt > 1 || job->reply_payload.sg_cnt > 1) { + rc = -EINVAL; + goto out; + } + + if (pqi_ctrl_offline(ctrl_info)) { + rc = -ENXIO; + goto out; + } + + if (pqi_ctrl_blocked(ctrl_info)) { + rc = -EBUSY; + goto out; + } + + smp_buf = pqi_build_csmi_smp_passthru_buffer(rphy, job); + if (!smp_buf) { + rc = -ENOMEM; + goto out; + } + + rc = pqi_csmi_smp_passthru(ctrl_info, smp_buf, sizeof(*smp_buf), + &error_info); + if (rc) + goto out; + + reslen = pqi_build_sas_smp_handler_reply(smp_buf, job, &error_info); +out: + bsg_job_done(job, rc, reslen); + pqi_ctrl_unbusy(ctrl_info); +} struct sas_function_template pqi_sas_transport_functions = { .get_linkerrors = pqi_sas_get_linkerrors, .get_enclosure_identifier = pqi_sas_get_enclosure_identifier, @@ -338,4 +483,5 @@ struct sas_function_template pqi_sas_transport_functions = { .phy_setup = pqi_sas_phy_setup, .phy_release = pqi_sas_phy_release, .set_phy_speed = pqi_sas_phy_speed, + .smp_handler = pqi_sas_smp_handler, }; From patchwork Fri Dec 7 22:30:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Don Brace X-Patchwork-Id: 10718983 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 92C45109C for ; Fri, 7 Dec 2018 22:30:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 81A322ABF4 for ; Fri, 7 Dec 2018 22:30:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 754F92F2E1; Fri, 7 Dec 2018 22:30:20 +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 032452ABF4 for ; Fri, 7 Dec 2018 22:30:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726080AbeLGWaT (ORCPT ); Fri, 7 Dec 2018 17:30:19 -0500 Received: from mail-eopbgr740059.outbound.protection.outlook.com ([40.107.74.59]:52320 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726078AbeLGWaT (ORCPT ); Fri, 7 Dec 2018 17:30:19 -0500 Received: from BL2PR19CA0017.namprd19.prod.outlook.com (2603:10b6:201:f::27) by BY2PR19MB0407.namprd19.prod.outlook.com (2a01:111:e400:5a2c::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1404.22; Fri, 7 Dec 2018 22:30:14 +0000 Received: from BY2FFO11FD008.protection.gbl (2a01:111:f400:7c0c::198) by BL2PR19CA0017.outlook.office365.com (2603:10b6:201:f::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1404.17 via Frontend Transport; Fri, 7 Dec 2018 22:30:14 +0000 Authentication-Results: spf=pass (sender IP is 208.19.100.22) 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.100.22 as permitted sender) receiver=protection.outlook.com; client-ip=208.19.100.22; helo=AVMBX2.microsemi.net; Received: from AVMBX2.microsemi.net (208.19.100.22) by BY2FFO11FD008.mail.protection.outlook.com (10.1.14.159) 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:30:13 +0000 Received: from AVMBX2.microsemi.net (10.100.34.32) by AVMBX2.microsemi.net (10.100.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 14:30:12 -0800 Received: from [127.0.1.1] (10.238.32.34) by avmbx2.microsemi.net (10.100.34.32) with Microsoft SMTP Server id 15.1.1531.3 via Frontend Transport; Fri, 7 Dec 2018 14:30:12 -0800 Subject: [PATCH 20/20] smartpqi: bump driver version From: Don Brace To: , , , , , , , , , , , CC: Date: Fri, 7 Dec 2018 16:30:12 -0600 Message-ID: <154422181213.1218.17848053689323117522.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.100.22;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(7916004)(346002)(39860400002)(396003)(136003)(376002)(2980300002)(199004)(189003)(33896004)(76176011)(23676004)(2486003)(446003)(476003)(126002)(103116003)(8676002)(81166006)(81156014)(8936002)(106002)(356004)(316002)(69596002)(97736004)(16576012)(26005)(47776003)(186003)(77096007)(336012)(486006)(11346002)(2906002)(58126008)(44832011)(110136005)(5660300001)(9686003)(68736007)(53936002)(4326008)(478600001)(230700001)(106466001)(2201001)(86362001)(33716001)(50466002)(575784001)(305945005)(921003)(1121003)(83996005)(2101003);DIR:OUT;SFP:1101;SCL:1;SRVR:BY2PR19MB0407;H:AVMBX2.microsemi.net;FPR:;SPF:Pass;LANG:en;PTR:InfoDomainNonexistent;A:1;MX:1; X-Microsoft-Exchange-Diagnostics: 1;BY2FFO11FD008;1:P4FfqYM16hc6ee7s34+2qO1lF5nVIr06zUvMCQdeUmJ7HZSDjbOm8fTQTOIrGiuC4BzaO0xmvgkD672YpIslhnn0IYYiIe2ogah3haGqjDBlbChP1ET7yLiXJjRGG8uK X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8c7893ad-d898-4124-4cee-08d65c938e65 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390098)(7020095)(4652040)(8989299)(5600074)(711020)(4608076)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060);SRVR:BY2PR19MB0407; X-Microsoft-Exchange-Diagnostics: 1;BY2PR19MB0407;3:yVwOpog6JFz1EjmfgPKmUxFPhEZFtos/Co5BozdHH8/VHbiPh+cBy1SQpZj1c+OkzgFCPsEkBIxEe1pMHWJvMd3BmXrzYeNizioGnqekQkkv/6wpE6UtHcOGbxRWKJf2gyjT8JoWuQELksbaNvI4F13EsRoevcV4E+5PC80at7rLkLTDO7uuCd0VtEcgKVI5xFLzyL10E2oS8w2E45etASMUxEdSIV49z74fwT/Rc79wDs3FslnQEZbzjaJQgxe397S0z20XNjYrNSr5GbCRgW0dHUX68YkTYMhwOANkXOMlnVSAU6dy7fOdMP3koN7sQzE1xktZI4IM5jiDGpuYl5JnR9rZydAhLKUHAueH8Bk=;25:QzmMBR/emgAZ2db+kzo5Ki5Ad6vxTwKdyp1AYoaVwq7ppNGFtk6hbetqYU7goJNvwoqmtCruk6mVV1w/yPRx4QQDfLPAJCptBHrqES0ijME4aG6kZbyMLgHnC4JNvg2IzDJz50BAOLV9Unx3mTViAUDjvdQyL694XKuawBXFJq5rvd0LPl1+L/huKcs07ZeV//fjgqXwfvR4HFi6kW8uVHddB29w+KkKxq3lJQT3fmoWRwizsU7/NvrlZ7uek4Xx6/nPzGYaLJvotZFkIJldHLKhfnuOTtD9ZXMbprEXo6XgJaZIa3Yb+/ZnqpI+MeGyi65PZdfwEnaw910oNUYryA== X-MS-TrafficTypeDiagnostic: BY2PR19MB0407: X-Microsoft-Exchange-Diagnostics: 1;BY2PR19MB0407;31:IXaW/HDqwlnimD8t1t4CP/mn5HRnj9frqCqHp4okBpqIhZP+uCUVf3z9vvFHtRqYZ4+Bxjp1+13KMVHsCqWHNFyZNCvJXQhOVqH/TCp8SCgO7y5/TC3X/6kiX75Tvmc/buUrcMOERoR09JDh84tvKYUA6EsXgfVklkQDnk2PSillh0ouQO74TaiimTzLPMviTiBtZC6UWmDQdE3dGxVNOFtQ4yavXsECEsB8MbII62Y=;20:PkhYVXbkgBSyp0KBxELhUIiRkzHGZa1jIAIgH5ZeHFkXKzp9dp3fpL3Kuhgq4BJFB+G++jfaDNtQIlbp4yzyN0CB4z33sYCuK+BRTt/4DaZJQxyio+ZLJDi1O3lR7dpvICnYbbeYQAkPPb9wk83xRbetJLMUz7rGAaUETTyGdXWo88FqP2835jTi2CzvzWUDi8flkuJUyP7Rd/CR8DWKKTiKAwrWG1oDAIYFTsP1Rsr4doOzkYvoudhHn2L4BLq7D7WGaSC074z1a0JyZ9Sst9rJNhRzILJUxvglXXK0w/BUGfghIjjcOcj4izVccLOnLEFGjEmFPkUhVGH2J5DzyD+A8ShAJaxTGdtzHJ95Nr4AZEk3R9sQy9cUa4uQy1aygHbXELkPDxrG4kvFPd304UJrs+ZoHwZZuEO5h27+kqQ+4TPa0BsCgxucq4ABW5v5O5weQAIc765htYCOplBD12uAURDLGEtskuUw2Cxvz6ZpjuW+OOYyIivp+4+aVT3MJvxhrXFAUy9M6d6zubV/z3vgr6VD8anK1ZCaRCLULWLQEy/Vquj0wbCSOmqanDcMx8WgndTNr9/vwO7vvcaiThmfwcpFvOrm0CZ1K0QACBY= X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(10201501046)(3002001)(93006095)(93004095)(3231455)(999002)(944501520)(52105112)(6055026)(148016)(149066)(150057)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(20161123560045)(20161123564045)(201708071742011)(7699051)(76991095);SRVR:BY2PR19MB0407;BCL:0;PCL:0;RULEID:;SRVR:BY2PR19MB0407; X-Microsoft-Exchange-Diagnostics: 1;BY2PR19MB0407;4:1FiT+OnDeHC9YkaoZdVfCP/Fc96ErjIa9h9JDsKSalzFA1ulFBDBDPPT+O6Nwf8Kpf2qkfyH6y6aNVJpIe+R2jZ1kswBC6OhS09QeKuAQBu+WXVh9SUPVzayKNfNAfqTQWpQ+brlni0zvTQa03Cq/hsE1ay7dcLEPaQVEagy1xUj6IZTLIzgwjnJ0v/llNEPJ4/xNKQl5h6ldlhL10cr6DnmzexHOV8W1MNhy9by6OmeriOlw3BGQsmP/qbNGhWcLg7SMFAXwFB9goutJpHKMw== X-Forefront-PRVS: 0879599414 X-Microsoft-Exchange-Diagnostics: =?utf-8?q?1=3BBY2PR19MB0407=3B23=3AFBbR9O3?= =?utf-8?q?d6XuPR/Jg7PZ7ApvQOgsfEBcpvEThIbEri/F2ehT0OLPVKsbM/h22We0ZFl7tSqfd?= =?utf-8?q?sUV/KHakG0Jp3WScl9JqKs4QKzBuI17bNCPPxWb2/n3Lq0oWKmf+AbHdBPkKJyTnL?= =?utf-8?q?o9EE9lnYpNy94K0x0qZLS/6l0BdOYzX+hhRKHzLm6wZAi7isHqJIrp39YD348gCAu?= =?utf-8?q?6oZ0fwWzUqpZSrlZCPJo1M7PLkR2eaP8cmKUgisVcrhYUte4jB0HvChtdEuMZ5m33?= =?utf-8?q?qxFGRCnKhP7lVcns5/ja19gWEv4FmIkhwbqiDYpQhSwD476M7lAQ9YPneM6POli1D?= =?utf-8?q?el4LfawaILtYWpayTqRxJly2NwOQ3jnScXgqNc4Z0MZzlZ7O4DFxg7opN2pfyjW1E?= =?utf-8?q?chQOXFls9VrW3czNNBOMwXW7RQaxlokZw/0vRI+AN9xnCUHEBSNPgluZC/sUV7kan?= =?utf-8?q?5tlLVqsusyVxl4O49OwVKzl6ktoFy6jwo/TKW9QkQW77mEDG/xhgbo8t37/I50Z0P?= =?utf-8?q?cFiOLH56wbMoB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Ob8NX01St9oGazmy9aU/44XnL4muLbuxjtxfyfmtlocvnitMw1HdZwvYnrtRrCCnRZMCBFSDpGEOWeGG6VNrhXvFPHosXljor9kqKkkU3ELi47mInS+lT+MOQ7JgKuMKcdK0z7YucyVJo+bNpn0aPzt8= X-Microsoft-Exchange-Diagnostics: 1;BY2PR19MB0407;6:xcXZE9fOUaY+eoKn0K5BrQC5nuinyA2AVJ9lhyppAhMpwIKucDwx1AoaC3+Q2yZ8FJ6v7hBYeAqfOc3mt3QNRVA9WhxfiW8J//Q4hSvBI9ogWJ8AFV5RDIHC/W7mkQNU0wHemEoWLzyoEZphFBjyeImEaHCoAr6A6D3fkxSeCY59HC/QSqOqwHLX44EWrprNsC4zdDzWgpwAzermfAzwVPeqOeYM7RbVcjyWYSRYi6MNsjdE3tqYqoz6TUicGA/ouuhVqqE1z9IF4VqD+/jkSDb8FdAkZEgTh8i8rScW2eZnay672LbjAItjgPXE0g5SVBTP1iXl0QyJU70PA5sRnWYdBtv75e/KZN3EqHQrWc8PdKtHNQXRlUKc6fy+CryujukiHMgTymmBQXqgSdhwmIJsk+J4DjFfW+p6bmOn6z4cCKDc23ibFyqOhAK75v8kL8vZGhmfjRlAWEybY9hK9w==;5:Ux2f+mH3KSaiv/oeJl0YI83GgQLTCxj2r5wTLWL/Hrni/fq5RDNcExCMBXAMlpTSSyppIV+nOb+/Esoad+epL4zNkZyg30/oM9/JwN19Hor74N32xnDNN+8Tl/oW3r2JBLNXyZzzTP3EfEiyx7X+ZUXEl0xJmvkNd+Tni/xNnxE=;7:UvdFcYLJohjMZ0WvOxVNijxF9zRHo8gdqrIV0ksCQBQHa7SpCEKBCdVga4XUB42Nzsc7OCCbVDZMhvuPGX8QUx4UnLheGMKQ6YwN8Nr6XjN65yqKsPMplfiTSjbyIdNoLE6uic4sJj3CcPpQKP82BQ== SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: microsemi.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Dec 2018 22:30:13.8142 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8c7893ad-d898-4124-4cee-08d65c938e65 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.22];Helo=[AVMBX2.microsemi.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR19MB0407 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 Reviewed-by: Gerry Morong Reviewed-by: Dave Carroll Signed-off-by: Don Brace --- drivers/scsi/smartpqi/smartpqi_init.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c index 8d94028d0a9d..1b0fa974b4a7 100644 --- a/drivers/scsi/smartpqi/smartpqi_init.c +++ b/drivers/scsi/smartpqi/smartpqi_init.c @@ -40,11 +40,11 @@ #define BUILD_TIMESTAMP #endif -#define DRIVER_VERSION "1.1.4-130" +#define DRIVER_VERSION "1.2.4-065" #define DRIVER_MAJOR 1 -#define DRIVER_MINOR 1 +#define DRIVER_MINOR 2 #define DRIVER_RELEASE 4 -#define DRIVER_REVISION 130 +#define DRIVER_REVISION 65 #define DRIVER_NAME "Microsemi PQI Driver (v" \ DRIVER_VERSION BUILD_TIMESTAMP ")"