From patchwork Tue Dec 5 02:02:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ching Huang X-Patchwork-Id: 10092607 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 0D06660327 for ; Tue, 5 Dec 2017 10:03:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EFE2E29490 for ; Tue, 5 Dec 2017 10:03:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E4D2829495; Tue, 5 Dec 2017 10:03:42 +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=unavailable 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 8233229490 for ; Tue, 5 Dec 2017 10:03:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753312AbdLEKCa (ORCPT ); Tue, 5 Dec 2017 05:02:30 -0500 Received: from mail-it0-f41.google.com ([209.85.214.41]:45839 "EHLO mail-it0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753309AbdLEKCZ (ORCPT ); Tue, 5 Dec 2017 05:02:25 -0500 Received: by mail-it0-f41.google.com with SMTP id z6so169851iti.4 for ; Tue, 05 Dec 2017 02:02:25 -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:cc:date:message-id:mime-version :content-transfer-encoding; bh=Cpn1P7rNsj7MC387slj5EgO0XcJrq1K1c3oZDiiyfjw=; b=n2Kki6P/Qbz35ErCNuSG3xs9Wmgz/zuCstBta4Mzm0q9We/zmvdWgfj4AkMwlKPT3w NvOkzKv+G3IotTbk4C6NKIfnhoSqv2bK7lLmusMluNax+y29+chgy24ZUx51wuzeBO7f AN773ZYltzIX2NqH6NOPA37C9YlYrHCCq8vfaeGHr4BY3IoVvGRhEQSJ4y84NMJ3warJ yboDwCXvjt1lwTue4cTomse+Puk16/91e2HPR7l3xJzauZTlKB8nSwkvpTzoWf5np1zY 01hkNQ/eFovBgQtHd1ULwO8czrUCu75LCgluvCExkiefb6ZvZyKRaLZJHit0Z6QgMxRa CYIw== 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:cc:date:message-id:mime-version :content-transfer-encoding; bh=Cpn1P7rNsj7MC387slj5EgO0XcJrq1K1c3oZDiiyfjw=; b=GHVUGf0FBsYT1KHD8DS9bUzdHhj25NIEWT/DZFwJNpzdlIrMZTEjsZupT/kEfamI3u lrjM11o7kH8GHenu0c7tH4/siatGteGo1/SrL+o0YnOyyc9FBxlmngLoH0K7JQdl/8qT +tLlQyBPG818LRRC3fWukeqn2ob6ELdbuTtJa165+OH2RteW3rJ2L2LG3DULeB7+d7eh 2u9WRG4tARLzLG5Ad0vUvvbfypoGp6HHPjWAIZepWp4lbgPk7ckF/ISTOPNeVHQM7Xl0 P8PYbtHwqwGgtbOxkqcCs348KD1NjCtFJCNgRH0SEFyXpI5LYs3MND41SOdOaDrpfj0j q/Qw== X-Gm-Message-State: AKGB3mJTFjnl/qY51JEy5s2t16sD6nYtdObvIrOdiiyIZFs1i/2epi0n W8mvoekBA5dldl6YJQmx0UDObA== X-Google-Smtp-Source: AGs4zMZewOO4OV/GJT8K5gDx+sS+K0p/2WkuoCxYDAZyr/1gQsUqZrLEtEhRl9ozVKUKOu9/B8nLjw== X-Received: by 10.36.34.12 with SMTP id o12mr8336337ito.115.1512468145236; Tue, 05 Dec 2017 02:02:25 -0800 (PST) Received: from [192.168.0.105] (60-248-88-209.HINET-IP.hinet.net. [60.248.88.209]) by smtp.gmail.com with ESMTPSA id k19sm5057863ioc.75.2017.12.05.02.02.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Dec 2017 02:02:24 -0800 (PST) Subject: [PATCH 11/17] scsi: arcmsr: fix clear doorbell queue on ACB_ADAPTER_TYPE_B controller From: Ching Huang To: martin.petersen@oracle.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: James.Bottomley@HansenPartnership.com, sfr@canb.auug.org.au Date: Tue, 05 Dec 2017 10:02:16 +0800 Message-ID: <1512439336.4577.63.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-12-05 11:45:52.000000000 +0800 +++ b/drivers/scsi/arcmsr/arcmsr_hba.c 2017-12-05 11:45:34.000000000 +0800 @@ -4196,10 +4196,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: {