From patchwork Fri May 21 10:25:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chandrakanth patil X-Patchwork-Id: 445041 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, MIME_HEADER_CTYPE_ONLY, SPF_HELO_NONE, SPF_PASS, T_TVD_MIME_NO_HEADERS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CBDE8C43461 for ; Fri, 21 May 2021 10:27:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A9D10613CE for ; Fri, 21 May 2021 10:27:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233375AbhEUK2q (ORCPT ); Fri, 21 May 2021 06:28:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232748AbhEUK2P (ORCPT ); Fri, 21 May 2021 06:28:15 -0400 Received: from mail-pl1-x641.google.com (mail-pl1-x641.google.com [IPv6:2607:f8b0:4864:20::641]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9A178C061346 for ; Fri, 21 May 2021 03:26:46 -0700 (PDT) Received: by mail-pl1-x641.google.com with SMTP id v12so10727824plo.10 for ; Fri, 21 May 2021 03:26:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=trD0HR5ofX2zNaBcRboTUg0QwmGCTdH42uzh+rhcgOw=; b=S6m1nWrkhwYCWEr+TMUsOGvbgFCkKjuqGxtYUNCDTUMiuadVNgj2IgpA1mqrytWX/B yQHyOw3Ke7uPlfIPTOIOEZkZOcEo6s7BZUA/8IyYHwkOgipahJ5J8WJhQ5W0vZq8D0P+ 323YzGxts+ErypQVsNZ8Bb6fXl1wnk2AuF/2U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=trD0HR5ofX2zNaBcRboTUg0QwmGCTdH42uzh+rhcgOw=; b=ae6zqpsGa0RHr1uyXXfb+UkO4pxDdd8i6xkTNB2/McqQeP9XQTy1LCQBmeMZb3Q1Ni 1qs0xWCU7G0cxwICWkbBen/qTXC1dSqDp65PXdjmNA23jTZ8UKZovtfzDHU9NnBRyX14 TxuzSysLOa077KqCEnIHCBjhV5LVdHjc0ScFENT5TmIcZkR64ZCWPTQpSpBpsKodobUa Mx8DzV8LA4K8wNYvHA3qXUkydAc5ARD/ijuybo4xRgJgFbbvWrxJhbI66EuwlFHpLQgu aEXVj0G4uh++CnuuVZ4mpWoZGJgZvDQwstpTh/4LlB1ZC36itAkwUI1uhR9pykk5ue0N Eplg== X-Gm-Message-State: AOAM531bXHmt4O60ruapQaTQEnF/+J1ocbJvuHVWHOiu0kOz2J6di4tZ S+UvQBIByg5uVDjPgMuWuFvTr5CvVRhI5UYyfjyX786aMvbLELxG5REYVVpjvrRYFqRfmIdRqWX qh0GUxgqf0LG7zk0bkB8TmWIA0hCtuGZkn849Et/r7fChJdwmvm92zg2CQGr/soHh0vFgIk9QfM OVnbSo7keQHFSuH9E= X-Google-Smtp-Source: ABdhPJwbfbkYy6QFnvN7f5XReqTU+R+Saz6vExDlV4NPGNOWk2qSocEB37p9bNS4R3gefA/ZgzE5yg== X-Received: by 2002:a17:902:e8c8:b029:ee:f249:e416 with SMTP id v8-20020a170902e8c8b02900eef249e416mr11352335plg.3.1621592805575; Fri, 21 May 2021 03:26:45 -0700 (PDT) Received: from dhcp-10-123-20-83.dhcp.broadcom.net ([192.19.234.250]) by smtp.gmail.com with ESMTPSA id j3sm4197858pfe.98.2021.05.21.03.26.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 May 2021 03:26:45 -0700 (PDT) From: Chandrakanth Patil To: linux-scsi@vger.kernel.org Cc: kashyap.desai@broadcom.com, sumit.saxena@broadcom.com, Chandrakanth Patil , Tomas Henzl Subject: [PATCH v2 4/5] megaraid_sas: Handle missing interrupts while re-enabling IRQs Date: Fri, 21 May 2021 15:55:47 +0530 Message-Id: <20210521102548.11156-5-chandrakanth.patil@broadcom.com> X-Mailer: git-send-email 2.18.1 In-Reply-To: <20210521102548.11156-1-chandrakanth.patil@broadcom.com> References: <20210521102548.11156-1-chandrakanth.patil@broadcom.com> Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org While reenabling the IRQ after irq poll there may be a small window for the firmware to post the replies with interrupts raised. In that case, driver will not see the interrupts which lead to IOs timeout. This issue hits only when there is a high IOs completion on a single reply queue, which forces the driver to switch between the interrupt and IRQ context. To fix this, driver will process the reply queue one more time after enabling the IRQ. Link: https://lore.kernel.org/linux-scsi/20201102072746.27410-1-sreekanth.reddy@broadcom.com/ Cc: Tomas Henzl Signed-off-by: Chandrakanth Patil Signed-off-by: Sumit Saxena Reported-by: kernel test robot --- drivers/scsi/megaraid/megaraid_sas_fusion.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c index f79c19010c92..8b8d68e75318 100644 --- a/drivers/scsi/megaraid/megaraid_sas_fusion.c +++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c @@ -3745,6 +3745,7 @@ static void megasas_sync_irqs(unsigned long instance_addr) if (irq_ctx->irq_poll_scheduled) { irq_ctx->irq_poll_scheduled = false; enable_irq(irq_ctx->os_irq); + complete_cmd_fusion(instance, irq_ctx->MSIxIndex, irq_ctx); } } } @@ -3776,6 +3777,7 @@ int megasas_irqpoll(struct irq_poll *irqpoll, int budget) irq_poll_complete(irqpoll); irq_ctx->irq_poll_scheduled = false; enable_irq(irq_ctx->os_irq); + complete_cmd_fusion(instance, irq_ctx->MSIxIndex, irq_ctx); } return num_entries; @@ -3792,6 +3794,7 @@ megasas_complete_cmd_dpc_fusion(unsigned long instance_addr) { struct megasas_instance *instance = (struct megasas_instance *)instance_addr; + struct megasas_irq_context *irq_ctx = NULL; u32 count, MSIxIndex; count = instance->msix_vectors > 0 ? instance->msix_vectors : 1; @@ -3800,8 +3803,10 @@ megasas_complete_cmd_dpc_fusion(unsigned long instance_addr) if (atomic_read(&instance->adprecovery) == MEGASAS_HW_CRITICAL_ERROR) return; - for (MSIxIndex = 0 ; MSIxIndex < count; MSIxIndex++) + for (MSIxIndex = 0 ; MSIxIndex < count; MSIxIndex++) { + irq_ctx = &instance->irq_context[MSIxIndex]; complete_cmd_fusion(instance, MSIxIndex, NULL); + } } /**