Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934585AbdDFKpS (ORCPT ); Thu, 6 Apr 2017 06:45:18 -0400 Received: from mail-it0-f50.google.com ([209.85.214.50]:35102 "EHLO mail-it0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754844AbdDFKpH (ORCPT ); Thu, 6 Apr 2017 06:45:07 -0400 MIME-Version: 1.0 In-Reply-To: <20170405184229.GA29338@leverpostej> References: <20170331175105.8370-1-fu.wei@linaro.org> <20170331175105.8370-7-fu.wei@linaro.org> <20170405184229.GA29338@leverpostej> From: Fu Wei Date: Thu, 6 Apr 2017 18:45:06 +0800 Message-ID: Subject: Re: [PATCH v23 06/11] clocksource: arm_arch_timer: refactor MMIO timer probing. To: Mark Rutland Cc: "Rafael J. Wysocki" , Len Brown , Daniel Lezcano , Thomas Gleixner , Marc Zyngier , Lorenzo Pieralisi , Sudeep Holla , Hanjun Guo , linux-arm-kernel@lists.infradead.org, Linaro ACPI Mailman List , Linux Kernel Mailing List , ACPI Devel Maling List , rruigrok@codeaurora.org, "Abdulhamid, Harb" , Christopher Covington , Timur Tabi , G Gregory , Al Stone , Jon Masters , Wei Huang , Arnd Bergmann , Catalin Marinas , Will Deacon , Suravee Suthikulpanit , Leo Duran , Wim Van Sebroeck , Guenter Roeck , linux-watchdog@vger.kernel.org, Tomasz Nowicki , Christoffer Dall , Julien Grall Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1560 Lines: 56 Hi Mark, On 6 April 2017 at 02:42, Mark Rutland wrote: > On Sat, Apr 01, 2017 at 01:51:00AM +0800, fu.wei@linaro.org wrote: >> + arch_timer_mem_freq = arch_timer_mem_get_cntfrq(base); >> + if (!arch_timer_rate && arch_timer_mem_freq) { >> + arch_timer_rate = arch_timer_mem_freq; >> + } else if (!arch_timer_rate || arch_timer_rate != arch_timer_mem_freq) { >> + pr_err(FW_BUG "invalid MMIO frequency.\n"); >> + iounmap(base); >> + return -EINVAL; >> + } > > I thought I had previously mentioned that this last check has the > potential to break DT systems, which may be inadvertently relying on the > probe order. > > I agree we must do this check for ACPI, but I think that for DT it needs > to be relaxed. > > I'm happy to rework that locally, if you can address my comments on > patch 9. yes, you suggested that we keep the current frequency probing approach for DT, and use the new approach for ACPI. Because we try to merge the common code for MMIO timer. this become a little problem, sorry for that. I thinks for this code, maybe we can do : arch_timer_mem_freq = arch_timer_mem_get_cntfrq(base); if (!arch_timer_rate && arch_timer_mem_freq) { arch_timer_rate = arch_timer_mem_freq; } else if (!acpi_disabled && arch_timer_rate != arch_timer_mem_freq) { pr_err(FW_BUG "invalid MMIO frequency.\n"); iounmap(base); return -EINVAL; } Please correct me, if I miss something. Thanks :-) > > Thanks, > Mark. -- Best regards, Fu Wei Software Engineer Red Hat