From patchwork Wed Dec 19 08:45:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ching Huang X-Patchwork-Id: 10736907 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 C9D5813AD for ; Wed, 19 Dec 2018 08:45:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B1EF02AA1F for ; Wed, 19 Dec 2018 08:45:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A03132AF00; Wed, 19 Dec 2018 08:45:53 +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 37C512AA1F for ; Wed, 19 Dec 2018 08:45:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728211AbeLSIpu (ORCPT ); Wed, 19 Dec 2018 03:45:50 -0500 Received: from mail-it1-f193.google.com ([209.85.166.193]:36974 "EHLO mail-it1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727960AbeLSIpu (ORCPT ); Wed, 19 Dec 2018 03:45:50 -0500 Received: by mail-it1-f193.google.com with SMTP id b5so8283370iti.2 for ; Wed, 19 Dec 2018 00:45:49 -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=KPs1z8W9DxRbdbZ1U32ivf/6EzPqQhb6/E45VHEIBPo=; b=hgtiqqFRxYp/SgXIncNJvbCAAEGDgFM/yTs4p0VvNDJMcCoQ4obgLlht0KweIpcvtt Eb9y+Bxrbv9qahCAPQweWSi0/kl8q22X4r8czdYH9xtpejP/yWdttE+aaQIHduALHnWU XVjwRSlpbZF2s06tPxQe4V7X6OflzBQ1FzOoaFK00wuhmlg+cNGi79yqYnTNOJnl6ogO pGYA9xCRqoUYpRJaKGQD8j087yU8gxYuqZslGiyRCAqVxX982rB70W55+L5vckk8qX4A 7ktaYAjP2h/XpPIIwn+92a2Crm05XMnPGdnCWZlMhyABXq6OWA4zedMzQFJH7AuHVs53 JvEg== 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=KPs1z8W9DxRbdbZ1U32ivf/6EzPqQhb6/E45VHEIBPo=; b=H6vr4JH7fSxGOrH/JI49DRWJBhLzv0sOLBzQU0N//+sp/WsLGgn4EzrPX7wwG1T8U3 L4MrSe1Tb2XLKqJaRVpvuuwE2+6lQ44SvHgWxIPj8nnrBKfsaq6aomUkxvXm+Vj046Ht 4ZDso0undLrCnQL4mJqU/TQZubJyv5YRwcPpkqIal053xpH48H02R871Ewbdu63SFOTO R9KmyeDpgvtZIau5hMfoiKDwKbZX9wCB9/MWVswKoj1OqOjomkxYXxN0TsyxFVhmat3k zSLfgIhtqCxBwRkYTCWz6/p4ZG1pajbhM5RTQkATqzmpxeb2qlbwIF2X4k+/0BW84BlJ C3Ag== X-Gm-Message-State: AA+aEWa7NrDDqtRPHP69IcE/X5+2zlpX2HXY782Ggc7/tf2NxhU0DyFN 53V8PSc3EPMduQt0fyZdSqJlFg== X-Google-Smtp-Source: AFSGD/VFGJepoPdjx8afDt7UCcO0IZ0e1du3O3Bh5p/pvbeG/E0sSk7XSYD5NqUN6rhYCzlFy3BMJg== X-Received: by 2002:a24:bc1:: with SMTP id 184mr6115613itd.50.1545209149213; Wed, 19 Dec 2018 00:45:49 -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 b192sm2848377itb.12.2018.12.19.00.45.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 19 Dec 2018 00:45:48 -0800 (PST) Subject: [PATCH 6/12] scsi: arcmsr: Update for ACB_ADAPTER_TYPE_B 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:45:46 +0800 Message-ID: <1545209146.4457.32.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_B 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 2ff1c9a..3d2727c 100755 --- a/drivers/scsi/arcmsr/arcmsr_hba.c +++ b/drivers/scsi/arcmsr/arcmsr_hba.c @@ -1418,7 +1418,10 @@ static void arcmsr_done4abort_postqueue(struct AdapterControlBlock *acb) flag_ccb = reg->done_qbuffer[i]; if (flag_ccb != 0) { reg->done_qbuffer[i] = 0; - 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); @@ -2358,13 +2361,18 @@ static void arcmsr_hbaB_postqueue_isr(struct AdapterControlBlock *acb) struct ARCMSR_CDB *pARCMSR_CDB; struct CommandControlBlock *pCCB; bool error; + unsigned long cdb_phy_addr; + index = reg->doneq_index; while ((flag_ccb = reg->done_qbuffer[index]) != 0) { - reg->done_qbuffer[index] = 0; - 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); + reg->done_qbuffer[index] = 0; index++; index %= ARCMSR_MAX_HBB_POSTQUEUE; reg->doneq_index = index; @@ -3329,8 +3337,9 @@ static int arcmsr_hbaB_polling_ccbdone(struct AdapterControlBlock *acb, uint32_t flag_ccb, poll_ccb_done = 0, poll_count = 0; int index, rtn; bool error; - polling_hbb_ccb_retry: + unsigned long ccb_cdb_phy; +polling_hbb_ccb_retry: poll_count++; /* clear doorbell interrupt */ writel(ARCMSR_DOORBELL_INT_CLEAR_PATTERN, reg->iop2drv_doorbell); @@ -3356,7 +3365,10 @@ static int arcmsr_hbaB_polling_ccbdone(struct AdapterControlBlock *acb, index %= ARCMSR_MAX_HBB_POSTQUEUE; reg->doneq_index = index; /* check if command done with no error*/ - 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)) {