Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp1144641pxv; Fri, 9 Jul 2021 19:25:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz2yoysgk61BmNb2Tsr97iu/9wgUcQLZQmzb8lGr7O8U/GJrtDe531qH6ol24MmDzR0Yz+x X-Received: by 2002:a05:6402:520c:: with SMTP id s12mr52079531edd.357.1625883935503; Fri, 09 Jul 2021 19:25:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625883935; cv=none; d=google.com; s=arc-20160816; b=hf4SdebP9FDxEPDYLvQKG1zEVPiNG8REiq7IdgqTyfWa2J7rja8WSUj2bCBaPhEt2z vxtFqbxoOALdOY7M5XaHU6UJZcrV7PgNZ0AttEA6Ttaxr6QqlUgFxo7vwU0nu/6Rj2zc J+T4wBTpNDZtPU4Hi/f+TVecZV4dTR2Z2cUeuiswzOH38iaMNVH09qSXXZaxZpc5GtFp 7JToYAhUmPEEzmrc69OeBW1MwfEtJneA0V8egHjDryKS2S6Lme2QyJyLwOANHq9X3Fjk i3K2yEBgMy9++Xb5j7T/TQGFWROc67mfDKgmH7gKAtTvq7nq2W/i2Ebc4inhtRc8QFRa jr+g== 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=G4foAYzGHTDaDfZKUnKRtwDWJfagIZVYAz7kE+EOYclMemSP2mib0JtErMMZhc1HKm uR/H015AT3sO4Y4/xaTOSjDTMyiUrGcdZO4SIkTGBL59qT3q518aJXMnQYxgNXgA9bpe p28es757JsjxrDXSu8JreV+oYx5O2p/oFh1cwDHsN/wimxsAvqCfgn7Sv5nTlitqDPO2 odST43ICFocl29nLV0i39b6d3KPMcDiqhZazlv5MW0wK8Y+xrsDDw7Rn2NdfWXE1LhCO o6kgoOGTBT0Oz93MxoUYJ1C914k3I047H8SGK7459qqYgHhFglFogpJga1qnGPw9htBq a+8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=RYqjXXwB; 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 h17si8644952edb.557.2021.07.09.19.25.12; Fri, 09 Jul 2021 19:25:35 -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=RYqjXXwB; 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 S233390AbhGJCZz (ORCPT + 99 others); Fri, 9 Jul 2021 22:25:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:42176 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232813AbhGJCZN (ORCPT ); Fri, 9 Jul 2021 22:25:13 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 63B19613D9; Sat, 10 Jul 2021 02:22:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1625883749; bh=HXXsm6bDL23ZwcCamIIW0m6ncof559sel1rCAX8ztzU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RYqjXXwB9ic+BLB2GNoyYoNk7sQtbAO6djs6wgaCbvvYpjrkh2R3XUWdY5qhJBn0c YET53rUzPaAc3orpxH0IkPjaxp2KFPZWapk/vIIY0hH/tC0hqr6eiTyv5x3yTBGgwF MeCMgJa1G99AUcvh/PqDeKrMuPa7m3Pk6sQQB7Rg3CTQWpwcrNmbzzmR3DxH7jZLEJ XH3dZe0RsrmNahykN812GxItKgpIEZIrIaT7jWtlTP4owv1a1xrmT/G+PVM91zfabm T1iLHm2dKC3oHYwsCeEXY34SGpkvdF6Q9qrABLqSo9givs7ICG+IGJLDvBNZbY4x7F 71sVUGrWTP4+w== 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.12 025/104] scsi: arcmsr: Fix doorbell status being updated late on ARC-1886 Date: Fri, 9 Jul 2021 22:20:37 -0400 Message-Id: <20210710022156.3168825-25-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210710022156.3168825-1-sashal@kernel.org> References: <20210710022156.3168825-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