From patchwork Tue Mar 12 18:11:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Don Brace X-Patchwork-Id: 10849755 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 1C0C21850 for ; Tue, 12 Mar 2019 18:11:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 079C229842 for ; Tue, 12 Mar 2019 18:11:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EFFFD2984C; Tue, 12 Mar 2019 18:11: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 8DA0129842 for ; Tue, 12 Mar 2019 18:11:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728552AbfCLSLn (ORCPT ); Tue, 12 Mar 2019 14:11:43 -0400 Received: from esa2.microchip.iphmx.com ([68.232.149.84]:40569 "EHLO esa2.microchip.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727030AbfCLSLm (ORCPT ); Tue, 12 Mar 2019 14:11:42 -0400 X-IronPort-AV: E=Sophos;i="5.58,471,1544511600"; d="scan'208";a="27889498" Received: from unknown (HELO smtp.microsemi.com) ([208.19.99.222]) by esa2.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 12 Mar 2019 11:11:41 -0700 Received: from AUSMBX1.microsemi.net (10.201.34.31) 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; Tue, 12 Mar 2019 13:11:41 -0500 Received: from AUSMBX3.microsemi.net (10.201.34.33) 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; Tue, 12 Mar 2019 13:11:40 -0500 Received: from [127.0.1.1] (10.238.32.34) by ausmbx3.microsemi.net (10.201.34.33) with Microsoft SMTP Server id 15.1.1531.3 via Frontend Transport; Tue, 12 Mar 2019 13:11:40 -0500 Subject: [PATCH 2/4] hpsa: correct device id issues From: Don Brace To: , , , , , , , , , , , CC: Date: Tue, 12 Mar 2019 13:11:39 -0500 Message-ID: <155241429991.23182.4755393460676654569.stgit@brunhilda> In-Reply-To: <155241423734.23182.4742066781667397820.stgit@brunhilda> References: <155241423734.23182.4742066781667397820.stgit@brunhilda> User-Agent: StGit/0.19 MIME-Version: 1.0 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 correct a 'rare' race condition where a disk is failed after a device list has been obtained from the controller and before attempting to get the device id. Reviewed-by: Scott Teel Signed-off-by: Don Brace --- drivers/scsi/hpsa.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c index f311ab259a02..bd98a9667ce4 100644 --- a/drivers/scsi/hpsa.c +++ b/drivers/scsi/hpsa.c @@ -3967,14 +3967,18 @@ static int hpsa_update_device_info(struct ctlr_info *h, memset(this_device->device_id, 0, sizeof(this_device->device_id)); if (hpsa_get_device_id(h, scsi3addr, this_device->device_id, 8, - sizeof(this_device->device_id)) < 0) + sizeof(this_device->device_id)) < 0) { dev_err(&h->pdev->dev, - "hpsa%d: %s: can't get device id for host %d:C0:T%d:L%d\t%s\t%.16s\n", + "hpsa%d: %s: can't get device id for [%d:%d:%d:%d]\t%s\t%.16s\n", h->ctlr, __func__, h->scsi_host->host_no, - this_device->target, this_device->lun, + this_device->bus, this_device->target, + this_device->lun, scsi_device_type(this_device->devtype), this_device->model); + rc = HPSA_LV_FAILED; + goto bail_out; + } if ((this_device->devtype == TYPE_DISK || this_device->devtype == TYPE_ZBC) &&