From patchwork Thu May 15 04:31:59 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 30216 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f198.google.com (mail-ob0-f198.google.com [209.85.214.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 95D7F20446 for ; Thu, 15 May 2014 04:32:33 +0000 (UTC) Received: by mail-ob0-f198.google.com with SMTP id va2sf2795169obc.9 for ; Wed, 14 May 2014 21:32:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=v3MOixPvM1Wk0T2cXBVIcc6OJBSLbk49zPVLhGv8Jtk=; b=FpAYEng5kPH+ZftCMuqinFZbdA7foKAFqVKtwE5fdVs5J6oXD29quHWygSy4GZWiOz WhKnUONVidnPlPI82DnsKQd6vbnNBAgKkb49irfapxre8TSnaJGs9GdrPZiEVSq4QeFd RTnoqO3wjwLTN0dEQHRSENQTGpf6w4nNhYIPf+N712Ct9PZH3ZwxOzZ+30ZiBD0/wUw5 ch/pVtJz5Kip4Eb4aoIkjKBDiYe32eIOcCJM0t8l7UBG5EuglwBwlsCduHaHAk9LYdBw 0/9g3cWl7Lexgxo9W44viaGfCpej2pJVT0COUEjg7HI5qKTy42+yr8Iv+om04jsb1t6l puOQ== X-Gm-Message-State: ALoCoQnuuWkXV+kL2R9LjdoAXMbzFkwZcUOz5jtQyntehP+4vMgcl4wLaTJXPspt9dDg56hbIcMP X-Received: by 10.43.90.198 with SMTP id bj6mr3323522icc.16.1400128352567; Wed, 14 May 2014 21:32:32 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.106.201 with SMTP id e67ls66520qgf.94.gmail; Wed, 14 May 2014 21:32:32 -0700 (PDT) X-Received: by 10.220.92.135 with SMTP id r7mr6480241vcm.11.1400128352441; Wed, 14 May 2014 21:32:32 -0700 (PDT) Received: from mail-ve0-f173.google.com (mail-ve0-f173.google.com [209.85.128.173]) by mx.google.com with ESMTPS id v2si706067vet.142.2014.05.14.21.32.32 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 14 May 2014 21:32:32 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.173 as permitted sender) client-ip=209.85.128.173; Received: by mail-ve0-f173.google.com with SMTP id pa12so624605veb.4 for ; Wed, 14 May 2014 21:32:32 -0700 (PDT) X-Received: by 10.220.250.203 with SMTP id mp11mr6567833vcb.2.1400128352334; Wed, 14 May 2014 21:32:32 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.221.72 with SMTP id ib8csp291918vcb; Wed, 14 May 2014 21:32:31 -0700 (PDT) X-Received: by 10.68.197.39 with SMTP id ir7mr9561218pbc.78.1400128351563; Wed, 14 May 2014 21:32:31 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ha2si4067430pac.36.2014.05.14.21.32.31; Wed, 14 May 2014 21:32:31 -0700 (PDT) Received-SPF: none (google.com: linux-watchdog-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751030AbaEOEca (ORCPT + 1 other); Thu, 15 May 2014 00:32:30 -0400 Received: from mail-wi0-f181.google.com ([209.85.212.181]:37419 "EHLO mail-wi0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750733AbaEOEc3 (ORCPT ); Thu, 15 May 2014 00:32:29 -0400 Received: by mail-wi0-f181.google.com with SMTP id n15so3484137wiw.14 for ; Wed, 14 May 2014 21:32:28 -0700 (PDT) X-Received: by 10.180.206.205 with SMTP id lq13mr29246913wic.11.1400128348727; Wed, 14 May 2014 21:32:28 -0700 (PDT) Received: from localhost ([213.122.173.131]) by mx.google.com with ESMTPSA id gi8sm7603038wib.8.2014.05.14.21.32.25 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 14 May 2014 21:32:27 -0700 (PDT) From: Viresh Kumar To: wim@iguana.be Cc: linux-watchdog@vger.kernel.org, linux-arm-kernel@lists.infradead.org, arun.ramamurthy@broadcom.com, Viresh Kumar , Subject: [PATCH] watchdog: sp805: Set watchdog_device->timeout from ->set_timeout() Date: Thu, 15 May 2014 10:01:59 +0530 Message-Id: X-Mailer: git-send-email 2.0.0.rc2 Sender: linux-watchdog-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-watchdog@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: viresh.kumar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.173 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Implementation of ->set_timeout() is supposed to set 'timeout' field of 'struct watchdog_device' passed to it. sp805 was rather setting this in a local variable. Fix it. Cc: # 2.6.36+ Reported-by: Arun Ramamurthy Signed-off-by: Viresh Kumar Reviewed-by: Guenter Roeck --- Greg, This driver was introduced in 2.6.36 and WDIOC_GETTIMEOUT is broken since then. So added it for such an old stable release. Not sure if it should only be worth applying to 3.0+ drivers/watchdog/sp805_wdt.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/watchdog/sp805_wdt.c b/drivers/watchdog/sp805_wdt.c index 47629d2..c1b03f4 100644 --- a/drivers/watchdog/sp805_wdt.c +++ b/drivers/watchdog/sp805_wdt.c @@ -59,7 +59,6 @@ * @adev: amba device structure of wdt * @status: current status of wdt * @load_val: load value to be set for current timeout - * @timeout: current programmed timeout */ struct sp805_wdt { struct watchdog_device wdd; @@ -68,7 +67,6 @@ struct sp805_wdt { struct clk *clk; struct amba_device *adev; unsigned int load_val; - unsigned int timeout; }; static bool nowayout = WATCHDOG_NOWAYOUT; @@ -98,7 +96,7 @@ static int wdt_setload(struct watchdog_device *wdd, unsigned int timeout) spin_lock(&wdt->lock); wdt->load_val = load; /* roundup timeout to closest positive integer value */ - wdt->timeout = div_u64((load + 1) * 2 + (rate / 2), rate); + wdd->timeout = div_u64((load + 1) * 2 + (rate / 2), rate); spin_unlock(&wdt->lock); return 0;