From patchwork Wed Dec 19 08:43:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ching Huang X-Patchwork-Id: 10736905 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 1E3F36C2 for ; Wed, 19 Dec 2018 08:43:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0C7F22ADFA for ; Wed, 19 Dec 2018 08:43:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F36B02AF00; Wed, 19 Dec 2018 08:43:24 +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 8B4312ADFA for ; Wed, 19 Dec 2018 08:43:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727924AbeLSInU (ORCPT ); Wed, 19 Dec 2018 03:43:20 -0500 Received: from mail-it1-f193.google.com ([209.85.166.193]:52611 "EHLO mail-it1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727321AbeLSInT (ORCPT ); Wed, 19 Dec 2018 03:43:19 -0500 Received: by mail-it1-f193.google.com with SMTP id g76so8501327itg.2 for ; Wed, 19 Dec 2018 00:43:19 -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=ddJJKRBZKFVE0EAC9YSD6keBJ7y9nWFWSn8IjUTuVvY=; b=EWg6ueg6iZMTDACSnpvXdMYDELRXmuIizn4k+d7k2cnjE97lYBwQBtBsaBi16ipCVR zaaha3Rga8Gzb3gwjIbGkkSwc9lUhZJxnDe0A7NB7uEnZKHrPsGBMMHyuX7o76Q28K4t pkSuUMyhxlDsMLbHQEZSr+0D7I+7DLuAcpJ0N/YPEKd6zhamNGk+CrYXfi+62GAZDQLb o72WPA0SmDA0gWT8LG+vW9avrpNYEeAri+hGdqhdevVZp4iqrpz4fDESR9jxJn1fBE6z u6UlKBgOPtBjUu7UgAHrGHSCAV/V9FYalpxLO/BKBQ3mlxsmX4xWPXiZMEIbcViCgT09 FG5A== 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=ddJJKRBZKFVE0EAC9YSD6keBJ7y9nWFWSn8IjUTuVvY=; b=GEUEl3u7xuuS+hq+uRlCr3nvv1b9T8CpTrTDN2zp0azjMYUkZcJonX89ztxLqj8mFk wZ/mp4/ZVtpcgOTR2L+sYN11wDVkSO0GkGX4B1MEffmJIfPqmdDLT4B3CMtjO4h6OSVC P5+RvhcU9uuka3iWFaFDx4Qy4uSaVHf/Rn9vkN63Kiegyfvaz+pT3l1Z9zuNv3Fa4Lre qN+SNJZBSTJpY6Sa6wtaJYTXf0WP1mWImH6YHbMlp3Jn5JLXhn14XDpGu+4iHYEVNmRT X/dSMZNIkj8VQFrUflGgjSpjXuJIPRyI9VU9hBrzBxygVCy3IeVMEoiiWxhsb2imY7lA hlEw== X-Gm-Message-State: AA+aEWZ0/xXINSCikpIfweyxUJ+BFfgvFosjofQkaMdLhA9Q0NZL3OPG FaIxltbKh6lyXc8mkN7U9SDFtg== X-Google-Smtp-Source: AFSGD/WZM7H3zQ7NipGec4/iT6Zf5xZcuCl7lnLeSc0PIwl3yyqwC5yPc6GtXFh1sEcoBAB7GO/YrQ== X-Received: by 2002:a05:660c:fd2:: with SMTP id m18mr5831878itn.1.1545208998692; Wed, 19 Dec 2018 00:43:18 -0800 (PST) Received: from [192.168.0.130] (60-248-88-209.HINET-IP.hinet.net. [60.248.88.209]) by smtp.gmail.com with ESMTPSA id p19sm4245408itp.13.2018.12.19.00.43.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 19 Dec 2018 00:43:18 -0800 (PST) Subject: [PATCH 5/12] scsi: arcmsr: Update for ACB_ADAPTER_TYPE_A that ccb address can above 4GB 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: Wed, 19 Dec 2018 16:43:15 +0800 Message-ID: <1545208995.4457.29.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 Update for ACB_ADAPTER_TYPE_A that ccb address can above 4GB Signed-off-by: Ching Huang diff --git a/drivers/scsi/arcmsr/arcmsr_hba.c b/drivers/scsi/arcmsr/arcmsr_hba.c index 5353dbb..2ff1c9a 100755 --- a/drivers/scsi/arcmsr/arcmsr_hba.c +++ b/drivers/scsi/arcmsr/arcmsr_hba.c @@ -1382,10 +1382,12 @@ static void arcmsr_drain_donequeue(struct AdapterControlBlock *acb, struct Comma static void arcmsr_done4abort_postqueue(struct AdapterControlBlock *acb) { int i = 0; - uint32_t flag_ccb, ccb_cdb_phy; + uint32_t flag_ccb; struct ARCMSR_CDB *pARCMSR_CDB; bool error; struct CommandControlBlock *pCCB; + unsigned long ccb_cdb_phy, cdb_phy_hipart; + switch (acb->adapter_type) { case ACB_ADAPTER_TYPE_A: { @@ -1397,7 +1399,10 @@ static void arcmsr_done4abort_postqueue(struct AdapterControlBlock *acb) writel(outbound_intstatus, ®->outbound_intstatus);/*clear interrupt*/ while(((flag_ccb = readl(®->outbound_queueport)) != 0xFFFFFFFF) && (i++ < acb->maxOutstanding)) { - pARCMSR_CDB = (struct ARCMSR_CDB *)(acb->vir2phy_offset + (flag_ccb << 5));/*frame must be 32 bytes aligned*/ + ccb_cdb_phy = (flag_ccb << 5) & 0xffffffff; + if (acb->cdb_phyadd_hipart) + ccb_cdb_phy = ccb_cdb_phy | acb->cdb_phyadd_hipart; + pARCMSR_CDB = (struct ARCMSR_CDB *)(acb->vir2phy_offset + ccb_cdb_phy); pCCB = container_of(pARCMSR_CDB, struct CommandControlBlock, arcmsr_cdb); error = (flag_ccb & ARCMSR_CCBREPLY_FLAG_ERROR_MODE0) ? true : false; arcmsr_drain_donequeue(acb, pCCB, error); @@ -2333,8 +2338,13 @@ static void arcmsr_hbaA_postqueue_isr(struct AdapterControlBlock *acb) struct ARCMSR_CDB *pARCMSR_CDB; struct CommandControlBlock *pCCB; bool error; + unsigned long cdb_phy_addr; + while ((flag_ccb = readl(®->outbound_queueport)) != 0xFFFFFFFF) { - pARCMSR_CDB = (struct ARCMSR_CDB *)(acb->vir2phy_offset + (flag_ccb << 5));/*frame must be 32 bytes aligned*/ + cdb_phy_addr = (flag_ccb << 5) & 0xffffffff; + if (acb->cdb_phyadd_hipart) + cdb_phy_addr = cdb_phy_addr | acb->cdb_phyadd_hipart; + pARCMSR_CDB = (struct ARCMSR_CDB *)(acb->vir2phy_offset + cdb_phy_addr); pCCB = container_of(pARCMSR_CDB, struct CommandControlBlock, arcmsr_cdb); error = (flag_ccb & ARCMSR_CCBREPLY_FLAG_ERROR_MODE0) ? true : false; arcmsr_drain_donequeue(acb, pCCB, error); @@ -3258,7 +3268,9 @@ static int arcmsr_hbaA_polling_ccbdone(struct AdapterControlBlock *acb, uint32_t flag_ccb, outbound_intstatus, poll_ccb_done = 0, poll_count = 0; int rtn; bool error; - polling_hba_ccb_retry: + unsigned long ccb_cdb_phy; + +polling_hba_ccb_retry: poll_count++; outbound_intstatus = readl(®->outbound_intstatus) & acb->outbound_int_enable; writel(outbound_intstatus, ®->outbound_intstatus);/*clear interrupt*/ @@ -3276,7 +3288,10 @@ static int arcmsr_hbaA_polling_ccbdone(struct AdapterControlBlock *acb, goto polling_hba_ccb_retry; } } - arcmsr_cdb = (struct ARCMSR_CDB *)(acb->vir2phy_offset + (flag_ccb << 5)); + ccb_cdb_phy = (flag_ccb << 5) & 0xffffffff; + if (acb->cdb_phyadd_hipart) + ccb_cdb_phy = ccb_cdb_phy | acb->cdb_phyadd_hipart; + arcmsr_cdb = (struct ARCMSR_CDB *)(acb->vir2phy_offset + ccb_cdb_phy); ccb = container_of(arcmsr_cdb, struct CommandControlBlock, arcmsr_cdb); poll_ccb_done |= (ccb == poll_ccb) ? 1 : 0; if ((ccb->acb != acb) || (ccb->startdone != ARCMSR_CCB_START)) {