Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp1143078pxv; Fri, 9 Jul 2021 19:22:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyMuVa0cNPLnBShtu0aWigj8OGRgcAh+ZCn3c2TRuG4CrD2Y+r7waPMwL77UkYE1JkZgy6a X-Received: by 2002:a17:907:72c9:: with SMTP id du9mr25820167ejc.497.1625883737210; Fri, 09 Jul 2021 19:22:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625883737; cv=none; d=google.com; s=arc-20160816; b=yO1aMPmCjetQIHD91y5U7BoyvtUVCljHa54UZOqRdVVM2g5pQ3llB6nCkABtG/Ricu DRnZ8Tz5enihErDnDHKWTjiu9EJBlEDekVyvNir8ziB/ttHYzlC0ZchslknyV8Az3ypl NQStU7jos+vOwjYc7Le2UWWUtU+CqkxHrDTq8Noi6zBDD3Wp5ic/SNDPMBrKcRSWlQKP Z47Vb39DScRAXzfYDH3R77qB8Ab6+p8H2Eq8ixJEy1ZDp+yxLE1LOGCgkhir7F9cYU5t hry2F/k8LvGT5qy7BTzSIWtjHJs+GHt1ql7p2aPzYKIFu7RX4/M2F9p6iQVTfRWhHDAG 0AqQ== 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=CELojBeDCW2F9UUwGNZlOxxlg/Pcxk9VlhiK6OJBZRE=; b=PxWGtfmXl7QTmafc0FqkVIN0Yq6qr8jIkqLrLqBMqZulTTAN2g/9TX12f41vNlgk+a hw5PcKpopJq75nSD3y9thuFZfrIA6nbZ/PvYXIiaNEiLB6AJuyc14tXeZRyEmvlwlBWY trrmewiESaHVNyt5NqC+TBUijiraerCQ+OsB4nU16QcwbAX2wX3UYLi36EabDSJjJxx5 2puEUcbjDSEcDr0un5MITDwbSzIAzmWKxTCB4stoqkMtzopva+drLKpATVzAFf+I9V1N dpGloLJYKaI3lWouvyRf1NfOkakkc1WrWSujO9jTVmd+WINYMnlXJ3ZfJrvQ41FdhQgE A1DA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=iyLL8FHU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o17si4888427eji.157.2021.07.09.19.21.54; Fri, 09 Jul 2021 19:22:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=iyLL8FHU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.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: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232330AbhGJCWQ (ORCPT + 99 others); Fri, 9 Jul 2021 22:22:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:37792 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232248AbhGJCVa (ORCPT ); Fri, 9 Jul 2021 22:21:30 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 618DC613F4; Sat, 10 Jul 2021 02:18:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1625883526; bh=DgZ4n4lwkY8rKPLEC+ZeOpoHkFCXVKuTIhJRxg1Tq7A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iyLL8FHUuk0mE/eube0Eqe1tJSZ/3+pBUxBwTQcHuWKPr6znBMOLXVo4Z1PH3wSqS 4HIVUSBwLXhDdMFWCl4qQmpZFQixks9HP4/s3HPkhc2yTL+Fw0zyURuoiUuJ/l9bjl NMtd4g4S/viPKM+pGnvk7fwSD9oGjFE08juERP2gonMqyfBgd0JIHXROyKb6AaCvI1 7Eg2rYIjteblAYdHVMcbcWL1ageN0BdYwiZ0n3I0HTf/45FlcIBjwYt9CkLdB/RgFW CjZLXFB6yzJV64FusSHddERF9vSfGcY6+1eZjjkh4IgP+itURGlgPEs0jRpXalVsuj v7Xq5TM82NhTQ== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Chandrakanth Patil , Tomas Henzl , kernel test robot , Sumit Saxena , "Martin K . Petersen" , Sasha Levin , megaraidlinux.pdl@broadcom.com, linux-scsi@vger.kernel.org Subject: [PATCH AUTOSEL 5.13 042/114] scsi: megaraid_sas: Handle missing interrupts while re-enabling IRQs Date: Fri, 9 Jul 2021 22:16:36 -0400 Message-Id: <20210710021748.3167666-42-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210710021748.3167666-1-sashal@kernel.org> References: <20210710021748.3167666-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Chandrakanth Patil [ Upstream commit 9bedd36e9146b34dda4d6994e3aa1d72bc6442c1 ] 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 the driver will not see the interrupts which leads to I/O timeout. This issue only happens when there are many I/O completions on a single reply queue. This forces the driver to switch between the interrupt and IRQ context. Make the driver 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/ Link: https://lore.kernel.org/r/20210528131307.25683-5-chandrakanth.patil@broadcom.com Cc: Tomas Henzl Reported-by: kernel test robot Signed-off-by: Chandrakanth Patil Signed-off-by: Sumit Saxena Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/megaraid/megaraid_sas_fusion.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c index 8bf7db921758..123fa271c27f 100644 --- a/drivers/scsi/megaraid/megaraid_sas_fusion.c +++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c @@ -3739,6 +3739,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); } } } @@ -3770,6 +3771,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; @@ -3786,6 +3788,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; @@ -3794,8 +3797,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++) - complete_cmd_fusion(instance, MSIxIndex, NULL); + for (MSIxIndex = 0 ; MSIxIndex < count; MSIxIndex++) { + irq_ctx = &instance->irq_context[MSIxIndex]; + complete_cmd_fusion(instance, MSIxIndex, irq_ctx); + } } /** -- 2.30.2