From patchwork Mon Mar 5 20:28:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Anholt X-Patchwork-Id: 10259719 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 DAD4F60365 for ; Mon, 5 Mar 2018 20:30:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CA034288BD for ; Mon, 5 Mar 2018 20:30:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BE3E628BE9; Mon, 5 Mar 2018 20:30:40 +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=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 563E8288BD for ; Mon, 5 Mar 2018 20:30:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=1mLEXOZ54+KXJqlKkVqUtK6KegbMeJOWnFRQUVb9vAY=; b=SDa/NcERHoe9sRl2/e9iXbrq34 RK3LqYkSheJR4aBxT5XQS5n0AEu8QKRpq84mqd7+Wav8NuyPoJKZ6Wf17BvjKLcfi7DIcHlRiaFP4 2KkzYC2E+cqEL7FBenOSbUlHKPVUB5uz6fryPpnoLLk3JUwpceYgKrn6OVG3FB36P9aHqIUZH7RVQ dx9e8MKOWgk7Lh86YToDGyimG8OuERoodZpMF+HyhguRPlgBBdqNnjJmvw/cj33EA3HfgqEKfyYtT RFozlWsQpSLQBGqXJBXWUe1TOGq4eX0K6X/cvs9nBqwKS/hrJ8IT5hzQcpbsYfGUJOfdD5PZ45xPU IeA0SwQg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1eswkg-0000An-Jh; Mon, 05 Mar 2018 20:30:30 +0000 Received: from anholt.net ([50.246.234.109]) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1eswid-0006RW-Jk; Mon, 05 Mar 2018 20:28:27 +0000 Received: from localhost (localhost [127.0.0.1]) by anholt.net (Postfix) with ESMTP id 6584010A1549; Mon, 5 Mar 2018 12:28:12 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at anholt.net Received: from anholt.net ([127.0.0.1]) by localhost (kingsolver.anholt.net [127.0.0.1]) (amavisd-new, port 10024) with LMTP id xF9_iiaJrkee; Mon, 5 Mar 2018 12:28:10 -0800 (PST) Received: from eliezer.anholt.net (localhost [127.0.0.1]) by anholt.net (Postfix) with ESMTP id AD65210A15ED; Mon, 5 Mar 2018 12:28:07 -0800 (PST) Received: by eliezer.anholt.net (Postfix, from userid 1000) id 7A7DF2FE2177; Mon, 5 Mar 2018 12:28:06 -0800 (PST) From: Eric Anholt To: Florian Fainelli , Mark Rutland , Rob Herring , devicetree@vger.kernel.org, Greg Kroah-Hartman , Phil Elwell Subject: [PATCH 2/5] staging: vc04_services: Remove cache-line-size property. Date: Mon, 5 Mar 2018 12:28:03 -0800 Message-Id: <20180305202806.21219-3-eric@anholt.net> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180305202806.21219-1-eric@anholt.net> References: <20180305202806.21219-1-eric@anholt.net> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180305_122823_713350_9E11BC05 X-CRM114-Status: GOOD ( 13.19 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stefan Wahren , linux-kernel@vger.kernel.org, Eric Anholt , bcm-kernel-feedback-list@broadcom.com, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP This was just a way for the DT-passed value to get out of sync with what Linux has configured the ARM for. Signed-off-by: Eric Anholt --- .../interface/vchiq_arm/vchiq_2835_arm.c | 25 +++++++--------------- .../interface/vchiq_arm/vchiq_pagelist.h | 1 - 2 files changed, 8 insertions(+), 18 deletions(-) diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c index b59ef14890aa..e0e01c812036 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c @@ -77,7 +77,6 @@ struct vchiq_pagelist_info { }; static void __iomem *g_regs; -static unsigned int g_cache_line_size = sizeof(CACHE_LINE_SIZE); static unsigned int g_fragments_size; static char *g_fragments_base; static char *g_free_fragments; @@ -117,15 +116,7 @@ int vchiq_platform_init(struct platform_device *pdev, VCHIQ_STATE_T *state) if (err < 0) return err; - err = of_property_read_u32(dev->of_node, "cache-line-size", - &g_cache_line_size); - - if (err) { - dev_err(dev, "Missing cache-line-size property\n"); - return -ENODEV; - } - - g_fragments_size = 2 * g_cache_line_size; + g_fragments_size = 2 * cache_line_size(); /* Allocate space for the channels in coherent memory */ slot_mem_size = PAGE_ALIGN(TOTAL_SLOTS * VCHIQ_SLOT_SIZE); @@ -548,9 +539,9 @@ create_pagelist(char __user *buf, size_t count, unsigned short type) /* Partial cache lines (fragments) require special measures */ if ((type == PAGELIST_READ) && - ((pagelist->offset & (g_cache_line_size - 1)) || + ((pagelist->offset & (cache_line_size() - 1)) || ((pagelist->offset + pagelist->length) & - (g_cache_line_size - 1)))) { + (cache_line_size() - 1)))) { char *fragments; if (down_interruptible(&g_free_fragments_sema) != 0) { @@ -598,10 +589,10 @@ free_pagelist(struct vchiq_pagelist_info *pagelistinfo, g_fragments_size; int head_bytes, tail_bytes; - head_bytes = (g_cache_line_size - pagelist->offset) & - (g_cache_line_size - 1); + head_bytes = (cache_line_size() - pagelist->offset) & + (cache_line_size() - 1); tail_bytes = (pagelist->offset + actual) & - (g_cache_line_size - 1); + (cache_line_size() - 1); if ((actual >= 0) && (head_bytes != 0)) { if (head_bytes > actual) @@ -617,8 +608,8 @@ free_pagelist(struct vchiq_pagelist_info *pagelistinfo, (tail_bytes != 0)) { memcpy((char *)kmap(pages[num_pages - 1]) + ((pagelist->offset + actual) & - (PAGE_SIZE - 1) & ~(g_cache_line_size - 1)), - fragments + g_cache_line_size, + (PAGE_SIZE - 1) & ~(cache_line_size() - 1)), + fragments + cache_line_size(), tail_bytes); kunmap(pages[num_pages - 1]); } diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_pagelist.h b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_pagelist.h index a6c5f7cc78f0..bec411061554 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_pagelist.h +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_pagelist.h @@ -34,7 +34,6 @@ #ifndef VCHIQ_PAGELIST_H #define VCHIQ_PAGELIST_H -#define CACHE_LINE_SIZE 32 #define PAGELIST_WRITE 0 #define PAGELIST_READ 1 #define PAGELIST_READ_WITH_FRAGMENTS 2