Received: by 10.223.185.116 with SMTP id b49csp3016140wrg; Mon, 5 Mar 2018 12:31:22 -0800 (PST) X-Google-Smtp-Source: AG47ELscHPoMk+/tQ7br6z2Vs5dMYqXFGR0I+YA0N8mKpBSvG8GVXsdlbc6KKOr2Ua4Uk0jJ61p0 X-Received: by 10.101.101.138 with SMTP id u10mr12814424pgv.299.1520281882447; Mon, 05 Mar 2018 12:31:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520281882; cv=none; d=google.com; s=arc-20160816; b=NGmXyTQm1S4bXtiDKJE1e55AyVcY7cm4sEtqfg1J1QY8UrenXyMytPlvE1aO7W9PHZ Rm3O6E2SeQNLR5pzdNAFs7qjt8uP7uE8tcNpnvWreEtbtLWb1mwoPmbiVo9I/fqrRfKd 4WEKv4BCotgwPYwfly+b9apAVmEa9ApauvlfaFJGIVongVtcJD7at4dfyuwH80pSMMeC fB5xGiVgfhyEqiS1BgosuTCDJFK3/16hfWHmI9p/bXoBZBXXy8YbwBMmnsSTyeflS5ZZ 624v0RJa2FWxLTGFF6VzUEh9fJ+r3yrlgTA8ORUKijOuSfojfbsjs7i14KbNdoaVF4HE v1sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=qvDNmXgXiYXgaBONSmhgiLzVquYvRNkhsrkt4w0mesE=; b=Dkev4fOvBQng9ZVn8U0jxp21+eOfE2+jnN0p9tHHgcY2w0QwUdjzWG5+W0m/VYplH4 jWq7QyIv2JqyrDvrKoSynwZmAxY5o3mXJzhpeW2+r+lyvTNQBym1iXuGQClBj4EjEhjX a2FvLoD3OMg9pFSYxkLK90cMEOgxG5Ef4SBXwA2+0znOqGinw0IxqjaJOtklGMEEcpZq UthkPijvko6hHCrXsb7jgIHBx+s6tAcg+ezDjA+u1/ozcJCT8WuLWpn6MzkiKQyYWA1f eFAlMwnTVVx9iaEAsDu9SAkTymUyQaV+yzkVneoXB5kCBGeiJUasst3wWztTGjU/19Ox mQig== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v1si10675534pfg.288.2018.03.05.12.31.08; Mon, 05 Mar 2018 12:31:22 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753193AbeCEU2Q (ORCPT + 99 others); Mon, 5 Mar 2018 15:28:16 -0500 Received: from anholt.net ([50.246.234.109]:48110 "EHLO anholt.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753093AbeCEU2N (ORCPT ); Mon, 5 Mar 2018 15:28:13 -0500 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 Cc: linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Stefan Wahren , bcm-kernel-feedback-list@broadcom.com, Eric Anholt 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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 -- 2.16.2