Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp1146682pxv; Fri, 9 Jul 2021 19:29:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwZJcz9QX2MHxF21v8WBbkAoPaUIgd283QLzzahU9TGRuNU42i13ofUnliDQXqQb11yg641 X-Received: by 2002:aa7:d982:: with SMTP id u2mr49595057eds.230.1625884198344; Fri, 09 Jul 2021 19:29:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625884198; cv=none; d=google.com; s=arc-20160816; b=NrBTAOJNWqXZG+Wu3lcrureH0Hw9PneYJ816LbOuRug8Gx1sEvKoTRzBoJflBP0CSL q6honDMFWYoxgf/g98guey8PzPvLikCqH+Qco+yzz2ILR0UU/bnGlDAO0WaORxba8uBT uJxm/PHRQ18lrX+B0h/WkY2tpaq32xItEUlXlOvF02+0+gCK4yjln9n1N0xHhHQGo24i w2D29KXIx1c/ZNaP+nTWdsUsB/yNRMdUm86tmwS3TgXdsRj9dAHvI4qmsJApai72Vej5 nkMqDg6lX8U9Ih71nmS2j1qTIJ4a8ivnhlt/gp3dOewiWVD6BDrxK0BMT1Wj2pH5kxUS 0YYg== 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=Cz8uF7LPM0m/QHAi7FFwJsXChW+/NZgorumLFzI8ii4=; b=Ff1X+HeVG8nq06LJ5qYjyGScNUv/kngipBudvnXeq7uSoIxdPTZ0bpiu8Kc8Dy9KDE khYUPHCWvui34/Xh6WR9TO2u6yP83UMeg76K/kWw0QgpBLvBtnoZgVqYJWLrG4i2Cunn l7V/+XaGtF+SQslYP/w/43I66Fg8T/8h0+oLBVpCtPGNKDNepifITHhNwNJyoBCbMhDy KuAW8sqzjE8hrV5DXtDc4nlljepNdgimTeD4jguKwilsvzHYyuXFXkKmaU6YKZlou39U 4HrRvRIHYhFFUeuQFvYp+hu2IFW5MaRLZptnFihfZXrH6UX8ffuBfQkc+nUf4gd9kO53 uLWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=BNI99Wu+; 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 hs42si8525806ejc.477.2021.07.09.19.29.35; Fri, 09 Jul 2021 19:29:58 -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=BNI99Wu+; 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 S234383AbhGJCbY (ORCPT + 99 others); Fri, 9 Jul 2021 22:31:24 -0400 Received: from mail.kernel.org ([198.145.29.99]:41746 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232763AbhGJC2J (ORCPT ); Fri, 9 Jul 2021 22:28:09 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 07E3B613F7; Sat, 10 Jul 2021 02:24:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1625883899; bh=koMInF0pTJ4jH9nnaDMP7JTIKBlVOtHo4QGr2fpwcdI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BNI99Wu+5aER/vWlfeM0itQjQlfQ6RwYkQQ2K2wpVGWH8aHdbLXFDA6grZUm8UKUz Fn8QJaoQwzWwSKUteK5sAKKti+XXi1Y0yMs8SsYdhKMt7TQbGVMvGiTc0d5/tX6N/O xtTieQt8H2+GaI1A1mCFg2pbiLUUsZkk3m0vfgqLf0BR/kca4GcBQ1d429ZNIW2KEy Z1QH5sYMOreeTZd8E9ZWvqR3SozwGxwYsebDyoI4SGx5qmqZ07sllslcSxEvSTWE7/ dJzSCm69GC1+sjgXnb79Q5f49cSrJeoAWkwNuMI+TRQGsnSy5oEcqLs1ypU+g6v4Un t3M7J8/L9QtNg== 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.10 23/93] scsi: arcmsr: Fix doorbell status being updated late on ARC-1886 Date: Fri, 9 Jul 2021 22:23:17 -0400 Message-Id: <20210710022428.3169839-23-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210710022428.3169839-1-sashal@kernel.org> References: <20210710022428.3169839-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 4838f790dac7..9294a2c677b3 100644 --- a/drivers/scsi/arcmsr/arcmsr_hba.c +++ b/drivers/scsi/arcmsr/arcmsr_hba.c @@ -2424,10 +2424,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