From patchwork Fri Oct 20 21:51:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Don Brace X-Patchwork-Id: 10021023 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id CB56A60234 for ; Fri, 20 Oct 2017 21:52:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BC4EA28F67 for ; Fri, 20 Oct 2017 21:52:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B10D328F6D; Fri, 20 Oct 2017 21:52: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=-6.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0AEC728F67 for ; Fri, 20 Oct 2017 21:52:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753132AbdJTVwT (ORCPT ); Fri, 20 Oct 2017 17:52:19 -0400 Received: from mail-co1nam03on0088.outbound.protection.outlook.com ([104.47.40.88]:2846 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752816AbdJTVwQ (ORCPT ); Fri, 20 Oct 2017 17:52:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mscc365.onmicrosoft.com; s=selector1-microsemi-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=Gdxw2cwzNjNgotVoBvbPUz01CBNb8X+KvbAcpo1MfWA=; b=M2ULHWhGIhK4BwxMlPqJak+n3xIXFBZeCvnlBXcBomAtGli9EGBwcLuzs0pTghho1LraCLk5A/z6gnF1jl0d5b6eAFwV4Fm3+O3q5FpOGiIRsr33y30Q8IDWju5+Csu2ljlFfZtIdsIqCs6r9BYtzbhYkOf0FW0mmRmAeMs+uGk= Received: from SN4PR0201CA0016.namprd02.prod.outlook.com (2603:10b6:803:2b::26) by CO1PR02MB142.namprd02.prod.outlook.com (2a01:111:e400:101e::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Fri, 20 Oct 2017 21:52:14 +0000 Received: from BY2FFO11FD021.protection.gbl (2a01:111:f400:7c0c::140) by SN4PR0201CA0016.outlook.office365.com (2603:10b6:803:2b::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.156.4 via Frontend Transport; Fri, 20 Oct 2017 21:52:13 +0000 Authentication-Results: spf=pass (sender IP is 208.19.100.21) smtp.mailfrom=microsemi.com; suse.com; dkim=none (message not signed) header.d=none;suse.com; dmarc=bestguesspass action=none header.from=microsemi.com; Received-SPF: Pass (protection.outlook.com: domain of microsemi.com designates 208.19.100.21 as permitted sender) receiver=protection.outlook.com; client-ip=208.19.100.21; helo=avsrvexchhts1.microsemi.net; Received: from avsrvexchhts1.microsemi.net (208.19.100.21) by BY2FFO11FD021.mail.protection.outlook.com (10.1.15.210) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.20.77.10 via Frontend Transport; Fri, 20 Oct 2017 21:52:13 +0000 Received: from [127.0.1.1] (10.238.32.34) by avsrvexchhts1.microsemi.net (10.100.34.105) with Microsoft SMTP Server id 14.3.361.1; Fri, 20 Oct 2017 14:51:34 -0700 Subject: [PATCH 05/12] hpsa: update discovery polling From: Don Brace To: , , , , , , , , , , CC: Date: Fri, 20 Oct 2017 16:51:32 -0500 Message-ID: <150853629251.28275.9986342028544381369.stgit@brunhilda> In-Reply-To: <150853443786.28275.17878578984391668998.stgit@brunhilda> References: <150853443786.28275.17878578984391668998.stgit@brunhilda> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:208.19.100.21; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916004)(376002)(39860400002)(346002)(2980300002)(438002)(189002)(199003)(5660300001)(81166006)(69596002)(106002)(106466001)(83506002)(2906002)(77096006)(356003)(230700001)(189998001)(23676002)(4326008)(316002)(68736007)(86362001)(81156014)(103116003)(110136005)(54356999)(305945005)(8676002)(47776003)(2950100002)(50986999)(9686003)(53936002)(33716001)(58126008)(104016004)(8936002)(33646002)(76176999)(15650500001)(2201001)(478600001)(50466002)(16576012)(97736004)(921003)(2101003)(83996005)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:CO1PR02MB142; H:avsrvexchhts1.microsemi.net; FPR:; SPF:Pass; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD021; 1:/DryK1y+Q48kF0eSwLu83aXiznaKivkjx4XxJYzj3+uFlzy4RiO4l/97zH5Juwd1CyttuhhK1WMESlaUPJFqnwsDKBhO6PBKy4XGbBf9c/jVsWhxzIccreu3cJ7wMnBj X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c027f561-2d34-4c7a-b13a-08d51804d289 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002)(4534020)(4602075)(4627075)(201703031133081)(201702281549075)(2017052603199); SRVR:CO1PR02MB142; X-Microsoft-Exchange-Diagnostics: 1; CO1PR02MB142; 3:xR9l4YjFaiUPDDfrRuCgD4kQ0Vu9SBbGqC1PvePDfqQICebppvNGamxyl0yl767fS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N8qxV9aIJbAJOi8YsVI+K3lFtCOc2qaQq2ZnUMVoLDZxFfJkO1CltcOfG+CPXIc6ZlUoLMzO753RQf9BoQFpPxUr6S3dqkqMyzG3Nls8Ry3qX/eE7t+2C4gF55iF1X52LtGMH6l8EHl5DgH3/R4Ja4ajiJdI2jiIbh+tg1wyf7xdQxvx0+/UY5f99/gnigH8Oqumod4d8DhZj0rDG0xIH8Alj5tUEmU0/TNMSJvA+TxPp6abbHWfIp3JOxL5Lz1VQihGoLHYVDSI6hbSlRCO0EBEHJouM6SPZLKx8KKWhGzLi/aljFyIxQq6MXfYR8CqAeCIPG+LeU/7ib2qFIvNUxnCbEkUtgwsbFv/5g7PBRJcUlM0gsqY0r64/pgt4X6EjB83R8C5y4 X-Exchange-Antispam-Report-Test: UriScan:(72170198267865); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(93006095)(93004095)(10201501046)(3002001)(100000703101)(100105400095)(3231020)(6055026)(6041248)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123560025)(20161123555025)(20161123562025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CO1PR02MB142; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CO1PR02MB142; X-Microsoft-Exchange-Diagnostics: 1; CO1PR02MB142; 4:2IXg7si0x/RfYHLU0O3eCo0ze2S1EB3OMyLKdpqfeYxiZqyHSiRw1U0C+PkQbGvo5Ua9ZtihbD39JcZCqER7LuFmPvxhUBA56pGG6/xiEbLI6l8DMotdwoZSiMAEhlB9fX4XdnFK7H22EkuRFbjjiYilqMnhQgTXK0zaR/7MfHbDxOOc9128pvlmqZebks3Y4GXI19JKxM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szdVl?= X-Microsoft-Exchange-Diagnostics: 1; CO1PR02MB142; 6:NZUTW1zgjN7ci8JVf3IqFhPe77CQGPE1TA6sdh6fVTa4XtqGvAHghDkSGi+T8Jr11ngpyI1iE5GkQgg3hVqmElRhFQCMznGAbbHaDJAZilxVSLoQwwa8vKa6/Kgxia3ioQq+C+I/pHkiYBGDEobt7hkRV5KNli0lW/UZRdRWeoxE+Kj4ht7MO1kbqNj2FRbJnJutjmKsxajC6w/+XQfWZadYy+2/UyqHGyZTMe1OjCPN/peNe/719dms3rttwEzNHzgH4tkvZrviP9zsW+NNKTboEiUJOvT2SCBmHTnTE6l+sJxsUPeW/BhDTnc79EtQt1LpOSqQDbesVzDTf7brYA==; 5:JkfB3E5Ql9W4JtcRpSbgA6YXWPaJf/PC1A5exIPzngP1SlwzMFv8aELbr6rgofwWWfQHU8g12iMVDI5ufzjxwEEdtD22lDho2RAXPG+svR0wcTAN5T1iaJ8X2eZGdTMzfcN5XWEMR8SDnxSAnj6CIA==; 24:Yu+mjlk07zisd2LoeDqX8NBSc1A77PXSDCCyS4QcBR13cpfuUs2Fhz2mgxP5DdywXvw5byMWnzpBP2u9HJyesGNsFhSA2/1It39hXl69tsk=; 7:c6KVV2cQIaNXfjFR+s31Id4CmTcc+zCTuLscD2P93kyvY7SrhNZQ17m1Kx2GfMwOUEgVJVa7rc4hlBNde1tJ32gFfBoJ4r5Zj831PJRvGJ2fLpSW2fNJh+riSK0Ix4b5aw1OH2X6IAoissV5QLhtPHSrHoq+46H4bh9nvHbzt3O0JFxDeFpDoph+V1AP7wDuq06ZEoyZb6ib+8YuwAfUWmbSbiMnnJTjkVOUDmoM+LU= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: microsemi.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Oct 2017 21:52:13.1784 (UTC) X-MS-Exchange-CrossTenant-Id: f267a5c8-86d8-4cc9-af71-1fd2c67c8fad X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f267a5c8-86d8-4cc9-af71-1fd2c67c8fad; Ip=[208.19.100.21]; Helo=[avsrvexchhts1.microsemi.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR02MB142 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: Bader Ali Saleh Correct a corner case where newly created volumes are not detected automatically on an external RAID controller that has no configured volumes during initial device discovery. The fix is to set the discovery_polling flag when an external RAID controller is detected. This causes a device rescan every 20-30 seconds, so that newly created volumes will be detected automatically. Reviewed-by: Scott Benesh Reviewed-by: Scott Teel Reviewed-by: Kevin Barnett Signed-off-by: Don Brace --- drivers/scsi/hpsa.c | 39 ++++++++++++++++++++++++++------------- drivers/scsi/hpsa_cmd.h | 2 ++ 2 files changed, 28 insertions(+), 13 deletions(-) diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c index 9c491c5..6056bbd 100644 --- a/drivers/scsi/hpsa.c +++ b/drivers/scsi/hpsa.c @@ -3472,6 +3472,30 @@ static void hpsa_get_sas_address(struct ctlr_info *h, unsigned char *scsi3addr, dev->sas_address = sa; } +static void hpsa_ext_ctrl_present(struct ctlr_info *h, + struct ReportExtendedLUNdata *physdev) +{ + u32 nphysicals; + int i; + + if (h->discovery_polling) + return; + + nphysicals = (get_unaligned_be32(physdev->LUNListLength) / 24) + 1; + + for (i = 0; i < nphysicals; i++) { + if (physdev->LUN[i].device_type == + BMIC_DEVICE_TYPE_CONTROLLER + && !is_hba_lunid(physdev->LUN[i].lunid)) { + dev_info(&h->pdev->dev, + "External controller present, activate discovery polling and disable rld caching\n"); + hpsa_disable_rld_caching(h); + h->discovery_polling = 1; + break; + } + } +} + /* Get a device id from inquiry page 0x83 */ static bool hpsa_vpd_page_supported(struct ctlr_info *h, unsigned char scsi3addr[], u8 page) @@ -4228,6 +4252,8 @@ static void hpsa_update_scsi_devices(struct ctlr_info *h) */ ndevs_to_allocate = nphysicals + nlogicals + MAX_EXT_TARGETS + 1; + hpsa_ext_ctrl_present(h, physdev_list); + /* Allocate the per device structures */ for (i = 0; i < ndevs_to_allocate; i++) { if (i >= HPSA_MAX_DEVICES) { @@ -4298,18 +4324,6 @@ static void hpsa_update_scsi_devices(struct ctlr_info *h) figure_bus_target_lun(h, lunaddrbytes, tmpdevice); this_device = currentsd[ncurrent]; - /* Turn on discovery_polling if there are ext target devices. - * Event-based change notification is unreliable for those. - */ - if (!h->discovery_polling) { - if (tmpdevice->external) { - h->discovery_polling = 1; - dev_info(&h->pdev->dev, - "External target, activate discovery polling.\n"); - } - } - - *this_device = *tmpdevice; this_device->physical_device = physical_device; @@ -8247,7 +8261,6 @@ static void hpsa_rescan_ctlr_worker(struct work_struct *work) if (h->drv_req_rescan || hpsa_offline_devices_ready(h)) { hpsa_perform_rescan(h); } else if (h->discovery_polling) { - hpsa_disable_rld_caching(h); if (hpsa_luns_changed(h)) { dev_info(&h->pdev->dev, "driver discovery polling rescan.\n"); diff --git a/drivers/scsi/hpsa_cmd.h b/drivers/scsi/hpsa_cmd.h index 78c3b64..21a726e 100644 --- a/drivers/scsi/hpsa_cmd.h +++ b/drivers/scsi/hpsa_cmd.h @@ -780,6 +780,8 @@ struct bmic_identify_physical_device { u8 phys_bay_in_box; /* phys drv bay this drive resides */ __le32 rpm; /* Drive rotational speed in rpm */ u8 device_type; /* type of drive */ +#define BMIC_DEVICE_TYPE_CONTROLLER 0x07 + u8 sata_version; /* only valid when drive_type is SATA */ __le64 big_total_block_count; __le64 ris_starting_lba;