From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1423109AbbEON5e (ORCPT ); Fri, 15 May 2015 09:57:34 -0400 Received: from mout.kundenserver.de ([212.227.126.187]:60122 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030270AbbEON53 (ORCPT ); Fri, 15 May 2015 09:57:29 -0400 From: Arnd Bergmann To: fu.wei@linaro.org Cc: Suravee.Suthikulpanit@amd.com, linaro-acpi@lists.linaro.org, linux-watchdog@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, tekkamanninja@gmail.com, graeme.gregory@linaro.org, al.stone@linaro.org, hanjun.guo@linaro.org, timur@codeaurora.org, ashwin.chaugule@linaro.org, linux@roeck-us.net, vgandhi@codeaurora.org, wim@iguana.be, jcm@redhat.com, leo.duran@amd.com, corbet@lwn.net Subject: Re: [PATCH 5/6] Watchdog: introdouce ARM SBSA watchdog driver Date: Fri, 15 May 2015 15:57:13 +0200 Message-ID: <2621121.Z4lZCvqDlK@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) In-Reply-To: <1431689090-3125-2-git-send-email-fu.wei@linaro.org> References: <=fu.wei@linaro.org> <1431689090-3125-1-git-send-email-fu.wei@linaro.org> <1431689090-3125-2-git-send-email-fu.wei@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:EFSa/X5a3HztHkc8OvKRUR2CpsP9b046V5SQ8WxEtQb83uy1cfb JrRWZMVhmScoYM0PKMJOAPn4gevJP+k42ZkaSnDTw+dbt5fpRLu4yC7G9c/K7DP+QYsp4T0 DAdfAq2RJQwoziqROu20ll7HH5U1A0h5XlRZKPEfUFqX5F3zOqCM+liWbZ10yCpf9pPnGwj 1+nEYacCb2Pt/loKmg7iQ== X-UI-Out-Filterresults: notjunk:1; Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Friday 15 May 2015 19:24:49 fu.wei@linaro.org wrote: > From: Fu Wei > > (1)Use linux kernel watchdog framework > (2)Work with FDT on ARM64 > (3)Use "pretimeout" in watchdog framework > (4)In first timeout(WS0), do panic to save system context > (5)support geting timeout and pretimeout from > parameter and FDT at the driver init stage. > > Signed-off-by: Fu Wei The patch looks good overall. Please try to describe in the patch in full sentences in the changelog, as we normally do. A few tiny details that I'd do differently, but don't have to change if the watchdog maintainer is fine with your version: > +struct sbsa_gwdt { > + struct watchdog_device wdd; > + u32 clk; > + void __iomem *refresh_base; > + void __iomem *control_base; > +#ifdef CONFIG_PM_SLEEP > + spinlock_t lock; > + u8 pm_status_store; > +#endif > +}; I would drop the #ifdef here, and favor readability over saving a few bytes. > + /* > + * Try to determine the frequency from the cp15 interface > + */ > + clk = arch_timer_get_cntfrq(); > + if (!clk) { > + dev_err(dev, "System Counter frequency not available\n"); > + return -EINVAL; > + } Is it guaranteed that the same clock feeds the arch timer and the watchdog? Maybe it would be better to use the clk API to read the frequency, so we can avoid this dependency. > + > + pr_debug("sbsa_gwdt: ioremap %s frame 0x%llx(size: %llu)-->%p.\n", > + res->name, (unsigned long long)res->start, > + (unsigned long long)(res->end - res->start + 1), rf_base); > + > + res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "control"); > + cf_base = devm_ioremap_resource(dev, res); > + if (IS_ERR(rf_base)) > + return PTR_ERR(rf_base); > + > + pr_debug("sbsa_gwdt: ioremap %s frame 0x%llx(size: %llu)-->%p.\n", > + res->name, (unsigned long long)res->start, > + (unsigned long long)(res->end - res->start + 1), cf_base); I would probably drop the various pr_debug() calls here. Once the driver works fine, they are normally not that useful any more. Arnd