From patchwork Thu Jan 17 03:45:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ching Huang X-Patchwork-Id: 10767497 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 439AA14E5 for ; Thu, 17 Jan 2019 03:45:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2CF4E2D8A3 for ; Thu, 17 Jan 2019 03:45:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1C2512D9DF; Thu, 17 Jan 2019 03:45:08 +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=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,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 A36E42D8A3 for ; Thu, 17 Jan 2019 03:45:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728252AbfAQDpH (ORCPT ); Wed, 16 Jan 2019 22:45:07 -0500 Received: from mail-pl1-f196.google.com ([209.85.214.196]:43090 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728152AbfAQDpG (ORCPT ); Wed, 16 Jan 2019 22:45:06 -0500 Received: by mail-pl1-f196.google.com with SMTP id gn14so4041441plb.10 for ; Wed, 16 Jan 2019 19:45:06 -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=rRQzgU5z/NPfrgHuTm6KB2ev9Kvfh2XOpogWLR16sW0=; b=VSDwgXPRL7nvx3InzaIyIsQE23gxqDSgXdfCmNA4OnDDpKM0LR8JiTiiluaxLz4uv3 OxLLi/sguygzU/1Zyd6qsAUznRr1zo34K2Qy5nUxE3Vbr2ud/PRtwDU2G+um/8UDYM+Y PS4y1BegoIOXFAZakosjoYvIQ3KUCfmktTwyPLj0pI1W2v5MoiIax0zI8v8kAi4iMl4G aAGGC7eopCGKE36ZlrwAPDIw3M8dKKAiFs/dDceVKLH8tCDRmftLo26svfTDTEF8/gR5 SLTB6b/4h00gz2B3pJcPYNc9MzHhPX3EQRVmuwBz0vPnkGCfhWs93r8bFqZoIt/FC4A/ gikw== 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=rRQzgU5z/NPfrgHuTm6KB2ev9Kvfh2XOpogWLR16sW0=; b=DvbOvgB27a4qPYCHwm59fNzW1bs+kxdPGXDRFYJAa+cw7xozwsfe/2PdUAhj1b2aI4 GO8c+1WMV3Qdin3zXekoxR3Ph/Cw7Z3E/1F6szzqyy9fknJ2XLiWohLm5MTtHlbJe/XT NZhn6GEcUa5d3dQkggrrRtExWEhIDlVJsz0ga+j7V42eOJvilQ5u17v9O0b96307rgeg 96NnIysjs6laOZ28XP7pZKhCK/hyvddOayprFrcwrdumChjURaxWC6fNaLs2y1Z5EWEU lQbIeTUxYtGfzw9ByqeP/CD9MvBsy9z7fnh8L7GV3XrSqXKhiGzdO0xaoVsBsUAa4i/2 Qe8Q== X-Gm-Message-State: AJcUukfYviSCIkDmI9puvYvgmQdNjBEAbWslpY1u8VtWk6A5dxRu6/pT bUQRfEr8PJVh2dlRgZYaiAWhsA== X-Google-Smtp-Source: ALg8bN5HR0uPxjHjxRvpxBsAh5HlMO/3slRbg4XfHYIHiIKVpmKl8wjjiOu1X/O+djHadlM9BtoMlA== X-Received: by 2002:a17:902:8e8a:: with SMTP id bg10mr13325644plb.192.1547696706020; Wed, 16 Jan 2019 19:45:06 -0800 (PST) Received: from [192.168.0.79] (60-248-88-209.HINET-IP.hinet.net. [60.248.88.209]) by smtp.gmail.com with ESMTPSA id w23sm253702pgc.72.2019.01.16.19.45.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Jan 2019 19:45:05 -0800 (PST) Subject: [PATCH 2/3] scsi: arcmsr: Fix suspend/resume of ACB_ADAPTER_TYPE_B part 2 From: Ching Huang To: martin.petersen@oracle.com, James.Bottomley@HansenPartnership.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: dan.carpenter@oracle.com, hch@infradead.org, colin.king@canonical.com Date: Thu, 17 Jan 2019 11:45:03 +0800 Message-ID: <1547696703.4339.21.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 suspend/resume of ACB_ADAPTER_TYPE_B part 2. Signed-off-by: Ching Huang diff --git a/drivers/scsi/arcmsr/arcmsr.h b/drivers/scsi/arcmsr/arcmsr.h index a94c513..b98c632 100755 --- a/drivers/scsi/arcmsr/arcmsr.h +++ b/drivers/scsi/arcmsr/arcmsr.h @@ -508,9 +508,9 @@ struct MessageUnit_A struct MessageUnit_B { uint32_t post_qbuffer[ARCMSR_MAX_HBB_POSTQUEUE]; - uint32_t done_qbuffer[ARCMSR_MAX_HBB_POSTQUEUE]; + volatile uint32_t done_qbuffer[ARCMSR_MAX_HBB_POSTQUEUE]; uint32_t postq_index; - uint32_t doneq_index; + volatile uint32_t doneq_index; uint32_t __iomem *drv2iop_doorbell; uint32_t __iomem *drv2iop_doorbell_mask; uint32_t __iomem *iop2drv_doorbell; diff --git a/drivers/scsi/arcmsr/arcmsr_hba.c b/drivers/scsi/arcmsr/arcmsr_hba.c index 5736434..88053b1 100755 --- a/drivers/scsi/arcmsr/arcmsr_hba.c +++ b/drivers/scsi/arcmsr/arcmsr_hba.c @@ -1113,7 +1113,11 @@ static int arcmsr_resume(struct pci_dev *pdev) switch (acb->adapter_type) { case ACB_ADAPTER_TYPE_B: { struct MessageUnit_B *reg = acb->pmuB; - reg->post_qbuffer[0] = 0; + uint32_t i; + for (i = 0; i < ARCMSR_MAX_HBB_POSTQUEUE; i++) { + reg->post_qbuffer[i] = 0; + reg->done_qbuffer[i] = 0; + } reg->postq_index = 0; reg->doneq_index = 0; break;