From patchwork Thu Nov 9 00:24:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ching Huang X-Patchwork-Id: 10050455 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B6E3B601EA for ; Thu, 9 Nov 2017 08:24:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A312929970 for ; Thu, 9 Nov 2017 08:24:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9606D29A1C; Thu, 9 Nov 2017 08:24:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.4 required=2.0 tests=BAYES_00, DATE_IN_PAST_06_12, DKIM_SIGNED,DKIM_VALID,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2882329970 for ; Thu, 9 Nov 2017 08:24:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753372AbdKIIY5 (ORCPT ); Thu, 9 Nov 2017 03:24:57 -0500 Received: from mail-io0-f177.google.com ([209.85.223.177]:49842 "EHLO mail-io0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753275AbdKIIY4 (ORCPT ); Thu, 9 Nov 2017 03:24:56 -0500 Received: by mail-io0-f177.google.com with SMTP id n137so8943728iod.6 for ; Thu, 09 Nov 2017 00:24:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=areca-com-tw.20150623.gappssmtp.com; s=20150623; h=subject:from:to:date:message-id:mime-version :content-transfer-encoding; bh=N3Rzcl1LeaavyzQk+RC/wsF9qM4eKRl1kZJqqUMX3dc=; b=QmXaZUoJA2tJ/do/JPivWVCupEYSPNIrySQnzX8S8YfNalW0Obxnmr7lUzaQcy2YpG 1S3BLleOtkAefWwdEdeFbIWaNyS10r9SSu7vhU+RbxqSQ2161XyHuAaCYnHn6s/YeB9b lat041LmkQ2IT7/w3N0oczGWQca0uMh4Qc1KaF4UeRPqXvalfLrvorNgR0sydLmDgCH8 3WP/14CcBPhQJG3IXdMJm4+L/Qr21smbx8MkspLmsSC5qCG6fYQGyymqvXGQUrMZjWmQ sLJrqgEMQ+b3z2Uyxi9OKHZIBC9+m+3D+oERpJT6xqCUo2lAnl1OsOC8tE038ymbwT+P WaYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:date:message-id:mime-version :content-transfer-encoding; bh=N3Rzcl1LeaavyzQk+RC/wsF9qM4eKRl1kZJqqUMX3dc=; b=ao3mkZDtGn5iQ2gDCasGkzSo9dWlKW3NBcoxHb/A3L9LSyv7yBDRAtc0NogjfC5sPM DonH9TYBD27BP9VhU2MeqzOgH+vshZ0YE1QMzwous4V4fMIKEnIJ3z3gBdkoF4yJAulz w9UeLi5t83q+gNfcjEaaEOK+ueiuKKnO8541wywKC6n/iOGqtzoG371Pkh54jb/tinhB LybqPOO+sc+fs+RL7CIZa3U5eS87BZLek5P8MAy095fNTH62Kv1/2cUQfsDtMHlOTRfV QTth0sKE3Li5IAz+jy2LrM7esViv/8sV9yKkk0toARNTqniuBPum8ZQwWOxcdMvaA4yW 54Aw== X-Gm-Message-State: AJaThX70jMNLg1O+xaWvCCqlEDvdJa60ST0cCI354t/W6UOHYNm4OgZL G1Bh0yScA73oZdCsKUi725i+Kw== X-Google-Smtp-Source: ABhQp+RNi5JP/KXqG8/6jBhfLjdGEiRFEpxfd+AR9nMnk+5Kp+h1+NiNwJGSnFRs3UZiNpCkZs9dOw== X-Received: by 10.107.7.22 with SMTP id 22mr4398594ioh.106.1510215896120; Thu, 09 Nov 2017 00:24:56 -0800 (PST) Received: from [192.168.0.106] (60-248-88-209.HINET-IP.hinet.net. [60.248.88.209]) by smtp.gmail.com with ESMTPSA id z2sm3461444ite.26.2017.11.09.00.24.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Nov 2017 00:24:55 -0800 (PST) Subject: [PATCH 10/13] scsi: arcmsr: fix clear doorbell queue on ACB_ADAPTER_TYPE_B controller From: Ching Huang To: martin.petersen@oracle.com, James.Bottomley@HansenPartnership.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, jthumshirn@suse.de, hare@suse.de, dan.carpenter@oracle.com, hch@infradead.org Date: Thu, 09 Nov 2017 08:24:53 +0800 Message-ID: <1510187093.4523.91.camel@Centos6.3-64> Mime-Version: 1.0 X-Mailer: Evolution 2.32.3 (2.32.3-37.el6) Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Ching Huang fix clear doorbell queue on ACB_ADAPTER_TYPE_B controller Signed-off-by: Ching Huang diff -uprN a/drivers/scsi/arcmsr/arcmsr_hba.c b/drivers/scsi/arcmsr/arcmsr_hba.c --- a/drivers/scsi/arcmsr/arcmsr_hba.c 2017-11-08 18:54:18.000000000 +0800 +++ b/drivers/scsi/arcmsr/arcmsr_hba.c 2017-11-08 18:54:58.000000000 +0800 @@ -4202,10 +4202,19 @@ static void arcmsr_clear_doorbell_queue_ case ACB_ADAPTER_TYPE_B: { struct MessageUnit_B *reg = acb->pmuB; - /*clear interrupt and message state*/ - writel(ARCMSR_MESSAGE_INT_CLEAR_PATTERN, reg->iop2drv_doorbell); + uint32_t outbound_doorbell, i; + writel(ARCMSR_DOORBELL_INT_CLEAR_PATTERN, reg->iop2drv_doorbell); writel(ARCMSR_DRV2IOP_DATA_READ_OK, reg->drv2iop_doorbell); /* let IOP know data has been read */ + for(i=0; i < 200; i++) { + msleep(20); + outbound_doorbell = readl(reg->iop2drv_doorbell); + if( outbound_doorbell & ARCMSR_IOP2DRV_DATA_WRITE_OK) { + writel(ARCMSR_DOORBELL_INT_CLEAR_PATTERN, reg->iop2drv_doorbell); + writel(ARCMSR_DRV2IOP_DATA_READ_OK, reg->drv2iop_doorbell); + } else + break; + } } break; case ACB_ADAPTER_TYPE_C: {