Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp1143056pxv; Fri, 9 Jul 2021 19:22:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyx8+xlstRyKH/8NcHqWVAm6xfAfBbDbDb7qbGuQTTCa50DnoEcTfM8E6CNTXCwI46/LChv X-Received: by 2002:aa7:da49:: with SMTP id w9mr2993024eds.47.1625883734477; Fri, 09 Jul 2021 19:22:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625883734; cv=none; d=google.com; s=arc-20160816; b=dMdGD74rrlTOrApkfnfdNYLePc7eAcfJNFza+WyASngmZ1fG2fpykqFvomqiGs3/VJ MlKXiwck9xVoeeCnWLmMxzl3B5/sr7c3OisAedJsNS8c18WTN7At9Qh/o3gVbFmQjHpo jLsOc0TaM/X069AhFZo1AGkHncrQQzJ2zCqOBWyXWx7Lt+keqUYkpwA2/txJZsNc91+r u6UO1YGp/PFfO2IYK2R8ApYqXUBbe+3Q/Xb4omj81DqYY7yewrL4USe8y24JNWY3rl1A nHUnSRMx5Fp4HdV306MbvBA+SIhkY5ujjqj0A1Z7x2FrFPAyqnPPIEvIFvscTfQ0PuXT Kj3g== 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=afdPO20K7G2JMK5D5V507+VT1zJDitwZVVahSwIJr34=; b=ycvl8NNMm0+EYMArSjfiW3WQbQjQiNPt6rllg8I6msErnlvFJUD8qNfo1AFuy7sEC0 soD8kgE2JAoqnoubGfEshDe3XXmClBMNEyC0K3FmkOj1KCBehXwX+lnbRE9hMiB5FBoJ RSIlmOmxjUl+RQtVHm7aI6R/BCYtcaBhCbb7MxAMWsoi0NeDTNDF9zye96kKgUF6h5Y4 vPN12UplBeEv/QZXJT+aKETCGnlwtRe3nZGwuam4ZNDLBwSzDcZClbs4PQ9SPbXaO3I3 oYv6stWzT3KaCXVVMWDn3vYyiHV/Rdtvshxh1/GbIjmOTkeuPwEYcaAkfnMzn/O84a0B wEbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Io8nl7/M"; 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 hv21si773786ejc.609.2021.07.09.19.21.51; Fri, 09 Jul 2021 19:22:14 -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="Io8nl7/M"; 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 S231956AbhGJCVt (ORCPT + 99 others); Fri, 9 Jul 2021 22:21:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:37850 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231879AbhGJCVM (ORCPT ); Fri, 9 Jul 2021 22:21:12 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 40A4B613D1; Sat, 10 Jul 2021 02:18:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1625883507; bh=HXXsm6bDL23ZwcCamIIW0m6ncof559sel1rCAX8ztzU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Io8nl7/MFpyrZhnaOsrJGLvOA786UIJ/EccOL3zPTgxKImhdDRI4G00yd3nEqMii9 eZM8rxlVo9I/04EghOtYLJh0AfMlO2OLYcevU4wfNBN44r2oa07PZv3AR6WS+bOxHP pdYemckiDXqLru1jl2lCL76jDGTRqUh+Cxwu3do1E96Jr9YIb5Q3qykywJ6yMJvk4i kHGVkW4tNSFVvBDfFH6rLOLDYmCqQgV6z5LcBwPcfCdBTfKRvrA8L2yub7JGIW4xIQ ETlKh7lFUI0a789PtdYDX6NlDquGNKcOXwJyONsEmJkuT/N8d+hnRLdnunoNMBReGo pgR0W+MTxH0Sw== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: ching Huang , "Martin K . Petersen" , Sasha Levin , linux-scsi@vger.kernel.org Subject: [PATCH AUTOSEL 5.13 028/114] scsi: arcmsr: Fix doorbell status being updated late on ARC-1886 Date: Fri, 9 Jul 2021 22:16:22 -0400 Message-Id: <20210710021748.3167666-28-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: ching Huang [ Upstream commit d9a231226f28261a787535e08d0c78669e1ad010 ] It is possible for the IOP to be delayed in updating the doorbell status. The doorbell status should not be 0 so loop until the value changes. Link: https://lore.kernel.org/r/afdfdf7eabecf14632492c4987a6b9ac6312a7ad.camel@areca.com.tw Signed-off-by: ching Huang Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/arcmsr/arcmsr_hba.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/arcmsr/arcmsr_hba.c b/drivers/scsi/arcmsr/arcmsr_hba.c index 930972cda38c..42e494a7106c 100644 --- a/drivers/scsi/arcmsr/arcmsr_hba.c +++ b/drivers/scsi/arcmsr/arcmsr_hba.c @@ -2419,10 +2419,17 @@ static void arcmsr_hbaD_doorbell_isr(struct AdapterControlBlock *pACB) static void arcmsr_hbaE_doorbell_isr(struct AdapterControlBlock *pACB) { - uint32_t outbound_doorbell, in_doorbell, tmp; + uint32_t outbound_doorbell, in_doorbell, tmp, i; struct MessageUnit_E __iomem *reg = pACB->pmuE; - in_doorbell = readl(®->iobound_doorbell); + if (pACB->adapter_type == ACB_ADAPTER_TYPE_F) { + for (i = 0; i < 5; i++) { + in_doorbell = readl(®->iobound_doorbell); + if (in_doorbell != 0) + break; + } + } else + in_doorbell = readl(®->iobound_doorbell); outbound_doorbell = in_doorbell ^ pACB->in_doorbell; do { writel(0, ®->host_int_status); /* clear interrupt */ -- 2.30.2