From patchwork Fri Nov 13 15:39:10 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Gonzalez X-Patchwork-Id: 7612371 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 8E03A9F392 for ; Fri, 13 Nov 2015 15:41:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A84B62061B for ; Fri, 13 Nov 2015 15:41:27 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D143C20772 for ; Fri, 13 Nov 2015 15:41:26 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZxGRu-0000uK-L4; Fri, 13 Nov 2015 15:39:38 +0000 Received: from mail1.bemta8.messagelabs.com ([216.82.243.208]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZxGRs-0000mI-5a for linux-arm-kernel@lists.infradead.org; Fri, 13 Nov 2015 15:39:36 +0000 Received: from [216.82.242.36] by server-16.bemta-8.messagelabs.com id 6A/63-02818-02406465; Fri, 13 Nov 2015 15:39:12 +0000 X-Env-Sender: Marc_Gonzalez@sigmadesigns.com X-Msg-Ref: server-7.tower-94.messagelabs.com!1447429151!5439197!1 X-Originating-IP: [195.215.56.170] X-StarScan-Received: X-StarScan-Version: 7.19.2; banners=-,-,- X-VirusChecked: Checked Received: (qmail 106807 invoked from network); 13 Nov 2015 15:39:12 -0000 Received: from 195-215-56-170-static.dk.customer.tdc.net (HELO CPH-EX1.SDESIGNS.COM) (195.215.56.170) by server-7.tower-94.messagelabs.com with AES128-SHA encrypted SMTP; 13 Nov 2015 15:39:12 -0000 Received: from [172.27.0.114] (172.27.0.114) by CPH-EX1.sdesigns.com (192.168.10.36) with Microsoft SMTP Server (TLS) id 14.1.339.1; Fri, 13 Nov 2015 16:39:10 +0100 Subject: Re: [PATCH] clocksource/drivers/tango-xtal: Replace code by clocksource_mmio_init To: Thomas Gleixner References: <1447412292-841-1-git-send-email-daniel.lezcano@linaro.org> <5645D5A0.1000502@sigmadesigns.com> <5645F0D0.4060503@linaro.org> <5645F616.9060707@sigmadesigns.com> From: Marc Gonzalez Message-ID: <5646041E.4040209@sigmadesigns.com> Date: Fri, 13 Nov 2015 16:39:10 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:41.0) Gecko/20100101 Firefox/41.0 SeaMonkey/2.38 MIME-Version: 1.0 In-Reply-To: X-Originating-IP: [172.27.0.114] X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151113_073936_318112_272DE092 X-CRM114-Status: GOOD ( 15.90 ) X-Spam-Score: -1.9 (-) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Daniel Lezcano , Arnd Bergmann , LKML , Linux ARM Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On 13/11/2015 16:26, Thomas Gleixner wrote: > On Fri, 13 Nov 2015, Marc Gonzalez wrote: >> On 13/11/2015 15:16, Daniel Lezcano wrote: >>> For example: >>> >>> struct clockcommon { >>> u32 mult; >>> u32 shift; >>> int rating; >>> void __iomem *base; >>> char *name; >>> int irq; >>> }; >>> >>> struct clocksource { >>> struct clockcommon common; /* MUST be the first field */ >>> cycle_t (*read)(struct clocksource *cs); >>> cycle_t mask; >>> ... >>> }; >> >> According to my notes, commit 369db4c952 grouped hot-path data >> into a single cache line (hence ____cacheline_aligned). >> >> (AFAIR, ARMv7 ARCH_MULTIPLATFORM assumes CACHE_LINE=64) >> >> Not sure how to make the two concepts (common base struct and >> grouping hot data) play nicely, without wasting a lot of space >> on padding. > > It wont play well. We are not going to change the layout of struct > clocksource because it will hurt the sane use cases for no reason. You are referring to Daniel's proposed reorg, right? What about my proposal? I inserted reg after maxadj, but it may be inserted anywhere in the struct. diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h index 278dd279a7a8..03807ca0d54e 100644 --- a/include/linux/clocksource.h +++ b/include/linux/clocksource.h @@ -74,6 +74,9 @@ struct clocksource { u32 shift; u64 max_idle_ns; u32 maxadj; +#ifdef CONFIG_CLKSRC_MMIO + void __iomem *reg; +#endif #ifdef CONFIG_ARCH_CLOCKSOURCE_DATA struct arch_clocksource_data archdata; #endif