Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp3426859pxb; Mon, 4 Apr 2022 16:39:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxBJea84opesQCe2ZYCifVH3iUSF4N4GFwQX441aaOlzdTNLswoJEBd07SOUArCkBDs1wuW X-Received: by 2002:a17:90a:c792:b0:1ca:4d2f:3f1b with SMTP id gn18-20020a17090ac79200b001ca4d2f3f1bmr763861pjb.86.1649115547848; Mon, 04 Apr 2022 16:39:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649115547; cv=none; d=google.com; s=arc-20160816; b=0d5gEHzduQUwBEVekDCkG8g9RRrdjg7Y7OlOqo+ElG9ETj0WPmLtwDkJK5TksTFID8 s9nirSb9TPWuhxfthA9j9YAjuVf8YSoYzDpbUQYfAIyVk4bzk9dJS7ycPOmxRDOIYPBY oLrkFI+PHfgrr29d/y4UxEHdpnqXChFHR50irF7f9O8KJ3VHsB0amPljXU78MYgfoj82 8EmRFEwgA+HKImblDj09wIwyuhjhjtxq9rYwoX9Wl3TCs4bZJVaqdq7EOMpQ7d09Woeu rIOp//McS1Q7INf5k4JHbDdbKFMGah3l1QAqdrn7oTRZDB9eFeljq/pNi+gvIdn+Jivc xkfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=vvlnvKJHR0iSHSjeh+7xqZNSajEtVMSHX0xzty4//oQ=; b=yYbo2B/lVaar5tguu2PLsu56lmvuhPxk6aSWFd/LNnGJulxnt1fKAqNaCVoZhhaHGj 0TguSePgxrKm3p0zlxAU16fzRCQNytpaPp0BeEvBzzSqjLZEURjf73GV1TVtDgqikU8Q xhYfCTVBxwrxE+yWQvsNbNblIpt7MckdhgTqAsZzL6sEp2LUzfq3+JGJrS6HVfDQKRc0 NL+0TziYap/yfRw2nxJqMRnGT7ysF9u8VCtKVW1ndldmECoZFf+fvwIn06sMgQ0g3MQ6 j5v0q/cQ58W4yIDw9TM2KT+HYoE+WIug0W0kgMPzyY3OcbfMPXqv4KYzFpzNmUesDF/H TuUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=UFKTEYRQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id b11-20020a63d80b000000b003992df1385bsi3857940pgh.684.2022.04.04.16.39.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Apr 2022 16:39:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=UFKTEYRQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 135EF50041; Mon, 4 Apr 2022 16:31:44 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347460AbiDAOcz (ORCPT + 99 others); Fri, 1 Apr 2022 10:32:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37676 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347370AbiDAOcE (ORCPT ); Fri, 1 Apr 2022 10:32:04 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E380C3701B; Fri, 1 Apr 2022 07:28:30 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 6FDDBB824FD; Fri, 1 Apr 2022 14:28:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9E371C2BBE4; Fri, 1 Apr 2022 14:28:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1648823308; bh=DnxBeLDL/TbMR8vRR9AfYgYySywbj68aFx2ZC6Q6A1Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UFKTEYRQjF5LZQrYa/2lvqgC80wb3Wyz/60ZQ4flA8fI4HJCSIw1ovPMhsEzNcYAF yJlCiSeZPqvx1CAaze6HrVzA6tcTGophCj8ShynNO9gSWifRKhGBFCU71RnKaCBaTx HLMj/a+9LHay4IK2ZA1ZZUy+UJWcH5aV50KAk7qOnAcxCIx4Q1c6w7Os1OIgbundbZ wysV9sMmY9C7OFM8mYwO3Kc0jZsztZXtstvkmbBDowSVvbgRjO6v1CNixGDFofF3fb 0J2x2ZEJDC12YF6O1Yj2tMZo3z24guJHZiv2agDKPbPUbssrcjd9F0nKo2GBhMuXSP E7+FEh9TfGO8Q== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Mahesh Rajashekhara , Kevin Barnett , Scott Benesh , Scott Teel , Don Brace , "Martin K . Petersen" , Sasha Levin , jejb@linux.ibm.com, storagedev@microchip.com, linux-scsi@vger.kernel.org Subject: [PATCH AUTOSEL 5.17 050/149] scsi: smartpqi: Fix kdump issue when controller is locked up Date: Fri, 1 Apr 2022 10:23:57 -0400 Message-Id: <20220401142536.1948161-50-sashal@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220401142536.1948161-1-sashal@kernel.org> References: <20220401142536.1948161-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Mahesh Rajashekhara [ Upstream commit 3ada501d602abf02353445c03bb3258146445d90 ] Avoid dropping into shell if the controller is in locked up state. Driver issues SIS soft reset to bring back the controller to SIS mode while OS boots into kdump mode. If the controller is in lockup state, SIS soft reset does not work. Since the controller lockup code has not been cleared, driver considers the firmware is no longer up and running. Driver returns back an error code to OS and the kdump fails. Link: https://lore.kernel.org/r/164375212337.440833.11955356190354940369.stgit@brunhilda.pdev.net Reviewed-by: Kevin Barnett Reviewed-by: Scott Benesh Reviewed-by: Scott Teel Signed-off-by: Mahesh Rajashekhara Signed-off-by: Don Brace Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/smartpqi/smartpqi_init.c | 39 ++++++++++++++++----------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/drivers/scsi/smartpqi/smartpqi_init.c b/drivers/scsi/smartpqi/smartpqi_init.c index 2db9f874cc51..f3749e508673 100644 --- a/drivers/scsi/smartpqi/smartpqi_init.c +++ b/drivers/scsi/smartpqi/smartpqi_init.c @@ -7855,6 +7855,21 @@ static int pqi_force_sis_mode(struct pqi_ctrl_info *ctrl_info) return pqi_revert_to_sis_mode(ctrl_info); } +static void pqi_perform_lockup_action(void) +{ + switch (pqi_lockup_action) { + case PANIC: + panic("FATAL: Smart Family Controller lockup detected"); + break; + case REBOOT: + emergency_restart(); + break; + case NONE: + default: + break; + } +} + static int pqi_ctrl_init(struct pqi_ctrl_info *ctrl_info) { int rc; @@ -7879,8 +7894,15 @@ static int pqi_ctrl_init(struct pqi_ctrl_info *ctrl_info) * commands. */ rc = sis_wait_for_ctrl_ready(ctrl_info); - if (rc) + if (rc) { + if (reset_devices) { + dev_err(&ctrl_info->pci_dev->dev, + "kdump init failed with error %d\n", rc); + pqi_lockup_action = REBOOT; + pqi_perform_lockup_action(); + } return rc; + } /* * Get the controller properties. This allows us to determine @@ -8605,21 +8627,6 @@ static int pqi_ofa_ctrl_restart(struct pqi_ctrl_info *ctrl_info, unsigned int de return pqi_ctrl_init_resume(ctrl_info); } -static void pqi_perform_lockup_action(void) -{ - switch (pqi_lockup_action) { - case PANIC: - panic("FATAL: Smart Family Controller lockup detected"); - break; - case REBOOT: - emergency_restart(); - break; - case NONE: - default: - break; - } -} - static struct pqi_raid_error_info pqi_ctrl_offline_raid_error_info = { .data_out_result = PQI_DATA_IN_OUT_HARDWARE_ERROR, .status = SAM_STAT_CHECK_CONDITION, -- 2.34.1