Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp28263imm; Wed, 25 Jul 2018 21:48:44 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcOgt/BBzjjlLboxqy3BA4MuARAz/IIn6YPgSbYUQveNzKQ1/4QRv/DWUIRWuMY0SQo8DCK X-Received: by 2002:a17:902:aa87:: with SMTP id d7-v6mr448684plr.215.1532580524504; Wed, 25 Jul 2018 21:48:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532580524; cv=none; d=google.com; s=arc-20160816; b=j4c5s15vcQ6SFq4I1Kxxb77w8eKFnoCLOk5ykMiDvt+RkU+hzpKTWw3ZSMnJdCAmm2 Fakdgtoh9yZdGWweMIxnt/vRQ5iCKZwrR5SAk86cINa1Fl/SkWU9hduA1rPPObyZSOAW BFUq/dem1MWhlGOqVjfdHv94t5wZaY9np40CsiZkrMUaOgX+AspObne1oOK0ui25Wn/b I8hghbcIV1qMKa/KQbOeZ4UAAo3xs6SGbOXih9z01W5wtCVWU9zTNsviL2G5/iIvr61r Fl51K4LQ32waU6aYUtkE0BVLSpgK2Y1CQb0VK9Oryuc4WDz6mMdluUXgGWyXO95dvfQ1 cckg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=2ruvPz/UrriC/xjCGf3GPlAqlFGnNxF0Z8W1qR1KeOE=; b=NaP6vThg+mrQT011YG1q3KZxvPW+hS3ISX4Lte7c4ctBIwTZit7Lj+L6ileSlYud0t AMnKNabXk3F0BQTribwzdlzSNOTi7nNxvYTXdrvuegYf+HiOEqfF/vVSqPmDbe5dtZMR ECi/t5BhUm9oeqdNkhpgjf2+hc3adzIGwSNZyaBhX/0jSWNFPJuEUYXWv/cBgyblqE8m K4hQG9vMsa8SNuOjg5l+T/HI8ma0KS12lqfPRF6QFB4RYXhvhC4TPa/Jki3GUvu1mjVy dmxlb0VMNdBcQjiSH8LC5c67IZBNU4csV7OSLXKPz2FBoy1fMVU6zpTAEhdb5VoS8sEN KgQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=SK36VBrU; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n9-v6si388972pff.370.2018.07.25.21.48.28; Wed, 25 Jul 2018 21:48:44 -0700 (PDT) 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; dkim=pass header.i=@broadcom.com header.s=google header.b=SK36VBrU; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728693AbeGZGCh (ORCPT + 99 others); Thu, 26 Jul 2018 02:02:37 -0400 Received: from mail-oi0-f68.google.com ([209.85.218.68]:33160 "EHLO mail-oi0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728523AbeGZGCg (ORCPT ); Thu, 26 Jul 2018 02:02:36 -0400 Received: by mail-oi0-f68.google.com with SMTP id l10-v6so728059oii.0 for ; Wed, 25 Jul 2018 21:47:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=2ruvPz/UrriC/xjCGf3GPlAqlFGnNxF0Z8W1qR1KeOE=; b=SK36VBrUdHjnxIZPlPkyI3I7p91lhJMMlNTEZHj8bSXp5R5VQwjPphItm0dlzkmAZn BrXc4q6R/5503e0hDlP/7H9KMkPFycaqbjdx++gkNOj2k4QmyBizlb71jPq+HhcK2bv2 pbPNAGjs9bobUBfYWRywDxUQctAtj8rFM1pgk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=2ruvPz/UrriC/xjCGf3GPlAqlFGnNxF0Z8W1qR1KeOE=; b=PhRrR6cBCy3t6bIEKVtVs2LJrb2kjZgFM9fETX40jA9Jpw4KgnKxc9pe4YThUcw40A oM7/wJ6Lo05r5+oq+wek0Es/K9ZeZVULwI5Lgc7Zkzaj4Y3WAjPJPo6uHsIg0NM1Zohn whx7dC8BtR2YB20uJSZL0d5/WmPd76Fi07uofogYRpdNNh8hqlvZvHPxSLaf7TfPuwo9 5qnC+1sTZdHqEynrZOie5MJNyS0CbfC22yzDHMWitBcnH3Axw+AkDxN+5NIN9TM4+aGm c4Ok/pKJnHP0zKvOkml272B156EVWa+vtbaDlI0HiQNKPLLG88aY7AMglaszJcM8iBf1 kZKg== X-Gm-Message-State: AOUpUlHJLr7yABcfxCn04WiB0OvIoTd2mBUJAyMjbbzJ8auFPwXGDah+ PTG6B2hJ3izXcA1AZNba5kRdhIPkVP3+H9v1foOL2A== X-Received: by 2002:aca:ccc4:: with SMTP id c187-v6mr391003oig.282.1532580459026; Wed, 25 Jul 2018 21:47:39 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a9d:7592:0:0:0:0:0 with HTTP; Wed, 25 Jul 2018 21:47:37 -0700 (PDT) In-Reply-To: References: <1532335060-686-1-git-send-email-srinath.mannam@broadcom.com> From: Srinath Mannam Date: Thu, 26 Jul 2018 10:17:37 +0530 Message-ID: Subject: Re: [PATCH] watchdog: sp805: Add clock-frequency property To: Guenter Roeck Cc: wim@linux-watchdog.org, Ray Jui , Vladimir Olovyannikov , Vikram Prakash , Scott Branden , linux-watchdog@vger.kernel.org, Linux Kernel Mailing List , BCM Kernel Feedback Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Guenter, It was my mistake sorry for that. I thought to add as Rivewed-by your name.. Many changes are made based on your review comments and suggestions. So, Can I add your name in Reviewed list? I will modify and send next patchset. thank you. Regards, Srinath. On Thu, Jul 26, 2018 at 10:12 AM, Guenter Roeck wrote: > On 07/23/2018 01:37 AM, Srinath Mannam wrote: >> >> Use clock-frequency property given in _DSD object >> of ACPI device to calculate Watchdog rate as binding >> clock devices are not available as device tree. >> >> Note: There is no formal review process for _DSD >> properties >> >> Signed-off-by: Srinath Mannam >> Signed-off-by: Guenter Roeck > > > I just noticed this. This is completely inappropriate. It is > the equivalent of forging a signature on a check. > > _Never_ add a Signed-off-by: statement for anyone but yourself. > > Guenter > >> Reviewed-by: Guenter Roeck >> Reviewed-by: Ray Jui >> Reviewed-by: Scott Branden >> --- >> drivers/watchdog/sp805_wdt.c | 35 +++++++++++++++++++++++++---------- >> 1 file changed, 25 insertions(+), 10 deletions(-) >> >> diff --git a/drivers/watchdog/sp805_wdt.c b/drivers/watchdog/sp805_wdt.c >> index 9849db0..a896b1c 100644 >> --- a/drivers/watchdog/sp805_wdt.c >> +++ b/drivers/watchdog/sp805_wdt.c >> @@ -11,6 +11,7 @@ >> * warranty of any kind, whether express or implied. >> */ >> +#include >> #include >> #include >> #include >> @@ -22,6 +23,7 @@ >> #include >> #include >> #include >> +#include >> #include >> #include >> #include >> @@ -65,6 +67,7 @@ struct sp805_wdt { >> spinlock_t lock; >> void __iomem *base; >> struct clk *clk; >> + u64 rate; >> struct amba_device *adev; >> unsigned int load_val; >> }; >> @@ -80,7 +83,7 @@ static int wdt_setload(struct watchdog_device *wdd, >> unsigned int timeout) >> struct sp805_wdt *wdt = watchdog_get_drvdata(wdd); >> u64 load, rate; >> - rate = clk_get_rate(wdt->clk); >> + rate = wdt->rate; >> /* >> * sp805 runs counter with given value twice, after the end of >> first >> @@ -106,9 +109,7 @@ static int wdt_setload(struct watchdog_device *wdd, >> unsigned int timeout) >> static unsigned int wdt_timeleft(struct watchdog_device *wdd) >> { >> struct sp805_wdt *wdt = watchdog_get_drvdata(wdd); >> - u64 load, rate; >> - >> - rate = clk_get_rate(wdt->clk); >> + u64 load; >> spin_lock(&wdt->lock); >> load = readl_relaxed(wdt->base + WDTVALUE); >> @@ -118,7 +119,7 @@ static unsigned int wdt_timeleft(struct >> watchdog_device *wdd) >> load += wdt->load_val + 1; >> spin_unlock(&wdt->lock); >> - return div_u64(load, rate); >> + return div_u64(load, wdt->rate); >> } >> static int >> @@ -228,11 +229,25 @@ sp805_wdt_probe(struct amba_device *adev, const >> struct amba_id *id) >> if (IS_ERR(wdt->base)) >> return PTR_ERR(wdt->base); >> - wdt->clk = devm_clk_get(&adev->dev, NULL); >> - if (IS_ERR(wdt->clk)) { >> - dev_warn(&adev->dev, "Clock not found\n"); >> - ret = PTR_ERR(wdt->clk); >> - goto err; >> + if (adev->dev.of_node) { >> + wdt->clk = devm_clk_get(&adev->dev, NULL); >> + if (IS_ERR(wdt->clk)) { >> + dev_err(&adev->dev, "Clock not found\n"); >> + return PTR_ERR(wdt->clk); >> + } >> + wdt->rate = clk_get_rate(wdt->clk); >> + } else if (has_acpi_companion(&adev->dev)) { >> + /* >> + * When Driver probe with ACPI device, clock devices >> + * are not available, so watchdog rate get from >> + * clock-frequency property given in _DSD object. >> + */ >> + device_property_read_u64(&adev->dev, "clock-frequency", >> + &wdt->rate); >> + if (!wdt->rate) { >> + dev_err(&adev->dev, "no clock-frequency >> property\n"); >> + return -ENODEV; >> + } >> } >> wdt->adev = adev; >> >