From patchwork Thu Jan 28 15:34:35 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sumit Saxena X-Patchwork-Id: 8151681 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 695F6BEEE5 for ; Thu, 28 Jan 2016 15:37:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7893B20373 for ; Thu, 28 Jan 2016 15:37:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 869702035B for ; Thu, 28 Jan 2016 15:37:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S967129AbcA1Pgz (ORCPT ); Thu, 28 Jan 2016 10:36:55 -0500 Received: from mail-pf0-f174.google.com ([209.85.192.174]:35212 "EHLO mail-pf0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966489AbcA1PgG (ORCPT ); Thu, 28 Jan 2016 10:36:06 -0500 Received: by mail-pf0-f174.google.com with SMTP id 65so25279552pfd.2 for ; Thu, 28 Jan 2016 07:36:05 -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=H07/ek/BVz2eLkWsThHVhDLEuZpWmMdCpa/jgxuDjoU=; b=Xy5n5IgF2N7SM1n5dGULPtJkyd7GppvXpqlLZUVI4pY9IYorTfCVtndhjdjhNw/OVd Lqd8iEgb0HWS4nZo9pYI7toNTvuoYS3DXfHusAOg5PRfrsRfZjNEoKlqiaQHfeizn/Rm vUCuYdNyJ6qlO7n4dmVXRvKnR+tJkje0HyzSI= 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=H07/ek/BVz2eLkWsThHVhDLEuZpWmMdCpa/jgxuDjoU=; b=XyLXh1By7s3216+n0+egbd664VKYayTToITP3l95Uwi21Wql0TbnXoVL+SSNWvMFcD VkunaM6ZoF0dIHGgcPDIXaHZETot1cc6prWgNZzOkZwTwLZ8hZzs435bZIHWZDR0K/s8 4y44Pnd+tqqZWMqOITqTjVHRrvtcotnKC3/k+8UsBTIVIY/Jxetqi2nG8Jt/1mnUvcyI QuxRpeI7fW0fs0+zGUfNXBtb6HzVA2FQKPKJCEEov3crHpwnTqVNsUlbO7UFToEakz81 SGLh2cdOEOVb5mG47NFf18Nzv0MleATMVL7R17DlwcyhYYK7b8cpIwcv+klxEY/jYxpw p/0A== X-Gm-Message-State: AG10YOSLnnQl87ZG/ICD2Eh2Umlbdco0WLvXf6pcdGduL/M8JapcGffQPRhv7FJqfLLrv7Rk X-Received: by 10.98.43.73 with SMTP id r70mr5467677pfr.4.1453995365446; Thu, 28 Jan 2016 07:36:05 -0800 (PST) Received: from host1.dhcp.avagotech.net ([192.19.239.250]) by smtp.gmail.com with ESMTPSA id y18sm17231752pfi.84.2016.01.28.07.36.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 28 Jan 2016 07:36:03 -0800 (PST) From: Sumit Saxena To: jbottomley@parallels.com, hch@infradead.org, martin.petersen@oracle.com, thenzl@redhat.com Cc: linux-scsi@vger.kernel.org, kashyap.desai@avagotech.com, sumit.saxena@avagotech.com, Uday Lingala Subject: [PATCH v2 14/15] megaraid_sas: SPERC OCR changes Date: Thu, 28 Jan 2016 21:04:35 +0530 Message-Id: <1453995276-24955-15-git-send-email-sumit.saxena@avagotech.com> X-Mailer: git-send-email 2.0.2 In-Reply-To: <1453995276-24955-1-git-send-email-sumit.saxena@avagotech.com> References: <1453995276-24955-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,RP_MATCHES_RCVD,T_DKIM_INVALID,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. There are no changes in this patch from last time sent patch. Signed-off-by: Uday Lingala Signed-off-by: Sumit Saxena Reviewed-by: Tomas Henzl --- drivers/scsi/megaraid/megaraid_sas_fusion.c | 73 +++++++---------------------- 1 file changed, 16 insertions(+), 57 deletions(-) diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c index e740e26..be9c3f1 100644 --- a/drivers/scsi/megaraid/megaraid_sas_fusion.c +++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c @@ -3462,52 +3462,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 */ @@ -3516,25 +3471,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); @@ -3591,6 +3549,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);