From patchwork Mon Nov 2 07:27:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sreekanth Reddy X-Patchwork-Id: 11873079 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 694101130 for ; Mon, 2 Nov 2020 07:27:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 312BB2074F for ; Mon, 2 Nov 2020 07:27:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="Aowf62SK" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727802AbgKBH1P (ORCPT ); Mon, 2 Nov 2020 02:27:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39574 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727306AbgKBH1P (ORCPT ); Mon, 2 Nov 2020 02:27:15 -0500 Received: from mail-pf1-x443.google.com (mail-pf1-x443.google.com [IPv6:2607:f8b0:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 53A0CC0617A6 for ; Sun, 1 Nov 2020 23:27:15 -0800 (PST) Received: by mail-pf1-x443.google.com with SMTP id b3so10352451pfo.2 for ; Sun, 01 Nov 2020 23:27:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id; bh=dhFdrvHWwxYBKPuqqcU9aSa5UXMmf+0cS7+mTTR9LsQ=; b=Aowf62SKU+rf+Z/t4G0wplFK4Wb2YMY91CFc3xL50aVP3Lmu4FSZfrS8Xt1rGco7gQ JYJa9eiWX6Eq3HGEY99cJIj/QjwC7dHCcdA2bXllwUu+Cx0f+LRZPTFG4fJ1JXzQ8ePe ID9CSfsnZnFX9MT+5jxy/sebtKU0H6BzPU9DI= 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; bh=dhFdrvHWwxYBKPuqqcU9aSa5UXMmf+0cS7+mTTR9LsQ=; b=rfqPYE5AVfX9TlgD0tkQpW1cQI9qEQLZtGZihh+qny/Vc+MhWdNqvYvze06yrTSW94 HLa64qbST3Y03AuR3ohGmmLElsV9sNz1Ygn4BuGQ5p7edsbiiy1OHl9+HzQstTxzbyJm VXz6p8iy/fMHlNzUdRmSoMBWf9jGkS+m1bUS6EXtdQG/6UWekW+Qh/X3DlPcTV/A8Elv l/v43VXWTRuF3PgM76YLe81xR1mIwfNLMb3ohSK11g6Q06iuHe48erGNSk/QIHNi4/lm Z+GA2MKpypT5KCjqtIzML4v7HFAeTEALqTE5lCGs4vODutOSfJHpTuA7oNGFZ/U5cov6 wthA== X-Gm-Message-State: AOAM530JDjDaSbPor/Npnjrc5T9ot9r4oIxEtJoUrecEhP6R6vZZb1Lb XNhB3qVV5FW8pA+KFefuoqUU2w== X-Google-Smtp-Source: ABdhPJxfimp0z4QQd7H81G8Rc9gvC7tibAqpclxkE7C2h2XS1BoP8NCLmeJ6XJQDRX3EKZZuPiZ3KA== X-Received: by 2002:a17:90a:7188:: with SMTP id i8mr16320360pjk.76.1604302034715; Sun, 01 Nov 2020 23:27:14 -0800 (PST) Received: from dhcp-10-123-20-36.dhcp.broadcom.net ([192.19.252.250]) by smtp.gmail.com with ESMTPSA id n12sm10793720pjt.16.2020.11.01.23.27.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Nov 2020 23:27:13 -0800 (PST) From: Sreekanth Reddy To: martin.petersen@oracle.com Cc: linux-scsi@vger.kernel.org, sathya.prakash@broadcom.com, suganath-prabu.subramani@broadcom.com, thenzl@redhat.com, Sreekanth Reddy Subject: [PATCH] mpt3sas: Fix timeouts observed while reenabling IRQ Date: Mon, 2 Nov 2020 12:57:46 +0530 Message-Id: <20201102072746.27410-1-sreekanth.reddy@broadcom.com> X-Mailer: git-send-email 2.18.4 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org While reenabling the IRQ after irq poll there may be small time window where HBA firmware has posted some replies and raise the interrupts but driver has not received the interrupts. So we may observe IO timeouts as the driver has not processed the replies as interrupts got missed while reenabling the IRQ. So, to fix this issue, the driver has to go for one more round of processing the reply descriptors from reply descriptor post queue after enabling the IRQ. Signed-off-by: Sreekanth Reddy Reported-by: Tomas Henzl Reviewed-by: Tomas Henzl --- drivers/scsi/mpt3sas/mpt3sas_base.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c index b096917..a0ab44d 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_base.c +++ b/drivers/scsi/mpt3sas/mpt3sas_base.c @@ -1740,6 +1740,13 @@ _base_irqpoll(struct irq_poll *irqpoll, int budget) reply_q->irq_poll_scheduled = false; reply_q->irq_line_enable = true; enable_irq(reply_q->os_irq); + /* + * Go for one more round of processing the + * reply descriptor post queue incase if HBA + * Firmware has posted some reply descriptors + * while reenabling the IRQ. + */ + _base_process_reply_queue(reply_q); } return num_entries;