From patchwork Fri Dec 18 13:27:07 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sumit Saxena X-Patchwork-Id: 7883961 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 1D17CBEEE5 for ; Fri, 18 Dec 2015 13:28:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 21D9E204A0 for ; Fri, 18 Dec 2015 13:28:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 15ABA2049D for ; Fri, 18 Dec 2015 13:28:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932386AbbLRN2t (ORCPT ); Fri, 18 Dec 2015 08:28:49 -0500 Received: from mail-pf0-f180.google.com ([209.85.192.180]:34110 "EHLO mail-pf0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932270AbbLRN2s (ORCPT ); Fri, 18 Dec 2015 08:28:48 -0500 Received: by mail-pf0-f180.google.com with SMTP id u7so2729680pfb.1 for ; Fri, 18 Dec 2015 05:28:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=avagotech.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=tuD8X5BgnBfqjM+Hme45zPPB4qvS8ZUlZHtdZhE2dc4=; b=FlmIaBo1lriN7OH8jFCpe2Y3bIOiQaYJdvvbf8lzXkRkpWGKAbQcBdVLccR5DuZaXE HMqeh81HCAfXbNGxWf2MYD6/7GMw2H/OZFV2K7RGVOzZxSfNHN9ijiUWSnRH2LxPiu1m gmOzRatPVGhAVZTvI0glemi/eRs+T1MxOmwIc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=tuD8X5BgnBfqjM+Hme45zPPB4qvS8ZUlZHtdZhE2dc4=; b=CCCOOdQO1c8g4oOeAqItXAyz81zDA8yDSb/xESNlTOD18on1aTxPAvNXmQpAsAjXIX 2KpWQHF7WMhAQs8gWou91dgK84l0yjY7BG+HUM1cHn58MUoTF1jT3nlOHUQLpHOGVnZY C5Zt1cfysKZwPjZY5I4s6WTjX86ZgHec2H9wtXan71ODDXYx6K2yUfJJckqAur5I2KfQ 2ZavOaHREoibVZh17YhkIcpb2xIj002QI8uGp9GGnZB62xkbPCnQII2JZ2XMrOu6hX/Y qiPSu8HPybeV75cWg5vr18BeSnRhLifd5sleDpRWAtqhEY4FZjO9TgKJYkkQwO9sED11 0FyQ== X-Gm-Message-State: ALoCoQnVsDj+rfCjNFTtSJEpdN/EF0FH9zaUBsI3NnF0OU7UThuuRoO8KE2xoimZGy4F5+LRg7s7fH/+sPZauWp2gUh8fUBa9g== X-Received: by 10.98.71.154 with SMTP id p26mr5170879pfi.65.1450445327897; Fri, 18 Dec 2015 05:28:47 -0800 (PST) Received: from host1.dhcp.avagotech.net ([192.19.239.250]) by smtp.gmail.com with ESMTPSA id 2sm18089348pfl.56.2015.12.18.05.28.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 18 Dec 2015 05:28:45 -0800 (PST) From: Sumit Saxena X-Google-Original-From: Sumit Saxena To: jbottomley@parallels.com, hch@infradead.org, martin.petersen@oracle.com Cc: linux-scsi@vger.kernel.org, kashyap.desai@avagotech.com, sumit.saxena@avagotech.com, Uday Lingala Subject: [PATCH 14/15] megaraid_sas: SPERC OCR changes Date: Fri, 18 Dec 2015 18:57:07 +0530 Message-Id: <1450445228-26571-15-git-send-email-Sumit.Saxena@avagotech.com> X-Mailer: git-send-email 2.0.2 In-Reply-To: <1450445228-26571-1-git-send-email-Sumit.Saxena@avagotech.com> References: <1450445228-26571-1-git-send-email-Sumit.Saxena@avagotech.com> Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch will do some fixes in OCR path of SRIOV enabled series of Avago controllers. 1)Removing late detection HB. 2)Change in the behavior if the FW found in READY/OPERAETIONAL state. Signed-off-by: Uday Lingala Signed-off-by: Sumit Saxena Reviewed-by: Tomas Henzl --- drivers/scsi/megaraid/megaraid_sas_fusion.c | 73 ++++++--------------------- 1 files changed, 16 insertions(+), 57 deletions(-) diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c index a973587..90217a2 100644 --- a/drivers/scsi/megaraid/megaraid_sas_fusion.c +++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c @@ -3472,52 +3472,7 @@ int megasas_reset_fusion(struct Scsi_Host *shost, int reason) /* Let SR-IOV VF & PF sync up if there was a HB failure */ if (instance->requestorId && !reason) { msleep(MEGASAS_OCR_SETTLE_TIME_VF); - /* Look for a late HB update after VF settle time */ - if (abs_state == MFI_STATE_OPERATIONAL && - (instance->hb_host_mem->HB.fwCounter != - instance->hb_host_mem->HB.driverCounter)) { - instance->hb_host_mem->HB.driverCounter = - instance->hb_host_mem->HB.fwCounter; - dev_warn(&instance->pdev->dev, "SR-IOV:" - "Late FW heartbeat update for " - "scsi%d.\n", - instance->host->host_no); - } else { - /* In VF mode, first poll for FW ready */ - for (i = 0; - i < (MEGASAS_RESET_WAIT_TIME * 1000); - i += 20) { - status_reg = - instance->instancet-> - read_fw_status_reg( - instance->reg_set); - abs_state = status_reg & - MFI_STATE_MASK; - if (abs_state == MFI_STATE_READY) { - dev_warn(&instance->pdev->dev, - "SR-IOV: FW was found" - "to be in ready state " - "for scsi%d.\n", - instance->host->host_no); - break; - } - msleep(20); - } - if (abs_state != MFI_STATE_READY) { - dev_warn(&instance->pdev->dev, "SR-IOV: " - "FW not in ready state after %d" - " seconds for scsi%d, status_reg = " - "0x%x.\n", - MEGASAS_RESET_WAIT_TIME, - instance->host->host_no, - status_reg); - megaraid_sas_kill_hba(instance); - instance->skip_heartbeat_timer_del = 1; - atomic_set(&instance->adprecovery, MEGASAS_HW_CRITICAL_ERROR); - retval = FAILED; - goto out; - } - } + goto transition_to_ready; } /* Now try to reset the chip */ @@ -3526,25 +3481,28 @@ int megasas_reset_fusion(struct Scsi_Host *shost, int reason) if (instance->instancet->adp_reset (instance, instance->reg_set)) continue; - +transition_to_ready: /* Wait for FW to become ready */ if (megasas_transition_to_ready(instance, 1)) { - dev_warn(&instance->pdev->dev, "Failed to " - "transition controller to ready " - "for scsi%d.\n", - instance->host->host_no); - continue; + dev_warn(&instance->pdev->dev, + "Failed to transition controller to ready for " + "scsi%d.\n", instance->host->host_no); + if (instance->requestorId && !reason) + goto fail_kill_adapter; + else + continue; } - megasas_reset_reply_desc(instance); megasas_fusion_update_can_queue(instance, OCR_CONTEXT); if (megasas_ioc_init_fusion(instance)) { dev_warn(&instance->pdev->dev, - "megasas_ioc_init_fusion() failed!" - " for scsi%d\n", - instance->host->host_no); - continue; + "megasas_ioc_init_fusion() failed! for " + "scsi%d\n", instance->host->host_no); + if (instance->requestorId && !reason) + goto fail_kill_adapter; + else + continue; } megasas_refire_mgmt_cmd(instance); @@ -3601,6 +3559,7 @@ int megasas_reset_fusion(struct Scsi_Host *shost, int reason) retval = SUCCESS; goto out; } +fail_kill_adapter: /* Reset failed, kill the adapter */ dev_warn(&instance->pdev->dev, "Reset failed, killing " "adapter scsi%d.\n", instance->host->host_no);