From patchwork Wed Dec 19 08:48:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ching Huang X-Patchwork-Id: 10736909 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 D42F21399 for ; Wed, 19 Dec 2018 08:48:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BFD422ADFA for ; Wed, 19 Dec 2018 08:48:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B1AE22AF02; Wed, 19 Dec 2018 08:48:25 +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 267512ADFA for ; Wed, 19 Dec 2018 08:48:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728307AbeLSIsV (ORCPT ); Wed, 19 Dec 2018 03:48:21 -0500 Received: from mail-it1-f195.google.com ([209.85.166.195]:32950 "EHLO mail-it1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727716AbeLSIsV (ORCPT ); Wed, 19 Dec 2018 03:48:21 -0500 Received: by mail-it1-f195.google.com with SMTP id m8so10419220itk.0 for ; Wed, 19 Dec 2018 00:48:20 -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=91cK41622Bk30nY4GR93PRNznxMen4Yel0Dtj/7xX2Y=; b=mL0luIlFVzJcf8vj4/E4SbMghbqNLeICtYgWfLB/FY559V2fA4T85aENrqwMqD+DR7 gMWu5AjX4N5lmvy6b2A1Vz9AgUhW3WcVSGX7L4brTjeS2Z979WfBHg69YuLG/eXw76OJ CJ6MCDO3Q+73fgCBqntqPv4Mt65mtW1/Q9t5PA+W03vDUlo+zPBFXYzlRlMx0miwM7lV 4OPOU/3eXcvzvAAb22R9sTcOni536FbgALjBWIULzWJBpNZlqp4GTyqpY/4Zm/6sBSN0 2zuLCk8RnRt84G6izYW9NlmFevoRGamE4TS87aZu3eTffU122ChDvhxqXtRffowYZuM0 mZww== 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=91cK41622Bk30nY4GR93PRNznxMen4Yel0Dtj/7xX2Y=; b=UmtnK73PsdgY7ab0NC9NEzTMZcguVndfRAqwsyi6r4gnNMZp4fEOLD6422TdjIaIOZ vsmBvoXDRwPj7J21G2h+A3HNHH3l++TwY19ac8ncudMvft7vgjdXQ6rQznZfegTmIPNk 5gJa4lDzOjMcJNGjfTcDW4cFcSBwnh2XfOo93Lkgc45js1WpovJyou8wQ6CCNrpX0f8B /BKePWds6iG1hVsj/mjNt5Cfm/peK4qcVl+pA5LTA4hJRcKrlGJ/7PrzXWfTShqcOrpf Eq614XcBq2YayTzKnvVON04T24InZ9XPMM8lRn20nU+3XXAAoZrnn3FHj5QMTfaksv6u FyJA== X-Gm-Message-State: AA+aEWamdQvj5Jul7g8ereONGm7Y5UeMmWj7N/UryH6WyOpohPZiEzPw +KVE4IT6f32txygZnOfwUl4ang== X-Google-Smtp-Source: AFSGD/V/u840ciNhqwMR+gG8+aWHVuGMAcLz95CsCxu2ocLECKaQaqPJiaumky9uRwQKKYQ1WoMi8w== X-Received: by 2002:a24:ce42:: with SMTP id v63mr5683665itg.136.1545209299818; Wed, 19 Dec 2018 00:48:19 -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 u25sm7902103iob.23.2018.12.19.00.48.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 19 Dec 2018 00:48:19 -0800 (PST) Subject: [PATCH 7/12] scsi: arcmsr: Update for ACB_ADAPTER_TYPE_C 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:48:16 +0800 Message-ID: <1545209296.4457.35.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_C 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 3d2727c..39f3cd0 100755 --- a/drivers/scsi/arcmsr/arcmsr_hba.c +++ b/drivers/scsi/arcmsr/arcmsr_hba.c @@ -1438,7 +1438,9 @@ static void arcmsr_done4abort_postqueue(struct AdapterControlBlock *acb) /*need to do*/ flag_ccb = readl(®->outbound_queueport_low); ccb_cdb_phy = (flag_ccb & 0xFFFFFFF0); - pARCMSR_CDB = (struct ARCMSR_CDB *)(acb->vir2phy_offset+ccb_cdb_phy);/*frame must be 32 bytes aligned*/ + 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_MODE1) ? true : false; arcmsr_drain_donequeue(acb, pCCB, error); @@ -1786,12 +1788,8 @@ static void arcmsr_post_ccb(struct AdapterControlBlock *acb, struct CommandContr arc_cdb_size = (ccb->arc_cdb_size > 0x300) ? 0x300 : ccb->arc_cdb_size; ccb_post_stamp = (cdb_phyaddr | ((arc_cdb_size - 1) >> 6) | 1); - if (acb->cdb_phyaddr_hi32) { - writel(acb->cdb_phyaddr_hi32, &phbcmu->inbound_queueport_high); - writel(ccb_post_stamp, &phbcmu->inbound_queueport_low); - } else { - writel(ccb_post_stamp, &phbcmu->inbound_queueport_low); - } + writel(upper_32_bits(ccb->cdb_phyaddr), &phbcmu->inbound_queueport_high); + writel(ccb_post_stamp, &phbcmu->inbound_queueport_low); } break; case ACB_ADAPTER_TYPE_D: { @@ -2384,7 +2382,8 @@ static void arcmsr_hbaC_postqueue_isr(struct AdapterControlBlock *acb) struct MessageUnit_C __iomem *phbcmu; struct ARCMSR_CDB *arcmsr_cdb; struct CommandControlBlock *ccb; - uint32_t flag_ccb, ccb_cdb_phy, throttling = 0; + uint32_t flag_ccb, throttling = 0; + unsigned long ccb_cdb_phy; int error; phbcmu = acb->pmuC; @@ -2394,6 +2393,8 @@ static void arcmsr_hbaC_postqueue_isr(struct AdapterControlBlock *acb) while ((flag_ccb = readl(&phbcmu->outbound_queueport_low)) != 0xFFFFFFFF) { ccb_cdb_phy = (flag_ccb & 0xFFFFFFF0); + 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, @@ -3401,12 +3402,14 @@ static int arcmsr_hbaC_polling_ccbdone(struct AdapterControlBlock *acb, struct CommandControlBlock *poll_ccb) { struct MessageUnit_C __iomem *reg = acb->pmuC; - uint32_t flag_ccb, ccb_cdb_phy; + uint32_t flag_ccb; struct ARCMSR_CDB *arcmsr_cdb; bool error; struct CommandControlBlock *pCCB; uint32_t poll_ccb_done = 0, poll_count = 0; int rtn; + unsigned long ccb_cdb_phy; + polling_hbc_ccb_retry: poll_count++; while (1) { @@ -3425,7 +3428,9 @@ polling_hbc_ccb_retry: } flag_ccb = readl(®->outbound_queueport_low); ccb_cdb_phy = (flag_ccb & 0xFFFFFFF0); - arcmsr_cdb = (struct ARCMSR_CDB *)(acb->vir2phy_offset + ccb_cdb_phy);/*frame must be 32 bytes aligned*/ + 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); pCCB = container_of(arcmsr_cdb, struct CommandControlBlock, arcmsr_cdb); poll_ccb_done |= (pCCB == poll_ccb) ? 1 : 0; /* check ifcommand done with no error*/ @@ -3801,7 +3806,6 @@ static int arcmsr_iop_confirm(struct AdapterControlBlock *acb) } break; case ACB_ADAPTER_TYPE_C: { - if (cdb_phyaddr_hi32 != 0) { struct MessageUnit_C __iomem *reg = acb->pmuC; printk(KERN_NOTICE "arcmsr%d: cdb_phyaddr_hi32=0x%x\n", @@ -3816,7 +3820,6 @@ static int arcmsr_iop_confirm(struct AdapterControlBlock *acb) return 1; } } - } break; case ACB_ADAPTER_TYPE_D: { uint32_t __iomem *rwbuffer;