Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp2932515pxy; Mon, 3 May 2021 11:10:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyIi75uzrY+Tr4q40ajDEYbmjIccH475kTKvhmbZgDuYCJtg3i04dvKY4P9jXxQU0B8jb03 X-Received: by 2002:a63:6ec1:: with SMTP id j184mr19416681pgc.364.1620065408554; Mon, 03 May 2021 11:10:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620065408; cv=none; d=google.com; s=arc-20160816; b=mcqKIl3JeGXveLeouy5YpLFzKBXLuhTv0T3UFQaNdC/ipd5lctXQvp9+AjYTcWYlt2 PPvtolABzsHlDINc7RkTVQ4HC+huzmCHqRwaD5jik6sP1JvirCWDsvhZEWOUux4Id4cT 288IJcuB8xP+y09j1RYy/NFyXmhR0MkqteLy0zMMJQF1Akd/lt4QKUa0MilE6pQ5drj3 egU7Df75gqX+/6N7ymiWUdaQixEqbuE3pP4+HJe+7PccQSHsoAMuSPfXa4Ws+4CtuXO7 QDvO2sBBvD0Dki8Rj7r1YLDbPzyT0lr+Dbh45hIZ+MUdwh6oClGoq48PFsyg347OMPz3 OFqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=QLGMN+DuY9Q8cY7i+SBjlrvpBLslkkAj2yt+VEgYt34=; b=Ak0XRlAAp584YQxu533UxoUX+JrAhn+2OYfLuxqkANhFa4/TVn3pFGHiKw8nVT2uot TqisTZzs3GVOimRs2yX3LtdbLJ8/xnKmFQwxzpggw/mDL43e7bJBc2I3HksOwEUCJ3ty ho1i+C6U9zg1rJoQri822B3L6uKZK83eTeWUMjNd+WKzxfWBcOIyGfWbh/3h3O0R0r28 NX0HrrN6NXNU5PupAYp48KlLjIdAu3Hku81XgmbIaaqzwJLah0hgEFQ7ZeR97Vm5EMsx R/fP9r43ozHANqSAm7wuQOAOAt57ApLvdcIvz2ZVGybAu/J7wT99mcyPtkOAeImErQ3b 2KcQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l11si474899plg.400.2021.05.03.11.09.55; Mon, 03 May 2021 11:10:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229848AbhECOkW (ORCPT + 99 others); Mon, 3 May 2021 10:40:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51436 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229835AbhECOkU (ORCPT ); Mon, 3 May 2021 10:40:20 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B7FA9C061761 for ; Mon, 3 May 2021 07:39:26 -0700 (PDT) Received: from gallifrey.ext.pengutronix.de ([2001:67c:670:201:5054:ff:fe8d:eefb] helo=[IPv6:::1]) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1ldZjJ-0003t5-6b; Mon, 03 May 2021 16:39:25 +0200 Subject: Re: [RESEND PATCH v3 2/3] watchdog: f71808e_wdt: migrate to new kernel watchdog API To: Guenter Roeck , Wim Van Sebroeck , linux-watchdog@vger.kernel.org Cc: kernel@pengutronix.de, linux-kernel@vger.kernel.org References: <35b474fa750fa11781509e94675fc90e28b2d514.1618310618.git-series.a.fatoum@pengutronix.de> <92b48338-4d9a-dc02-d8b5-198bd34c9f21@roeck-us.net> From: Ahmad Fatoum Message-ID: <9f326f40-08dd-ab2b-0a80-970d20c57d6a@pengutronix.de> Date: Mon, 3 May 2021 16:39:25 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: <92b48338-4d9a-dc02-d8b5-198bd34c9f21@roeck-us.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 2001:67c:670:201:5054:ff:fe8d:eefb X-SA-Exim-Mail-From: a.fatoum@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Guenter, On 03.05.21 16:31, Guenter Roeck wrote: >> -static struct fintek_wdt watchdog = { >> - .lock = __MUTEX_INITIALIZER(watchdog.lock), >> -}; >> +static struct fintek_wdt watchdog; > > This should really be allocated, and "watchdog" is a terrible variable name > even if static, especially given the previous patch. I can add a follow up patch to change this. I maintained the old state of things here to make review easier. > >> >> /* Super I/O functions */ >> static inline int superio_inb(int base, int reg) >> @@ -218,17 +206,9 @@ static inline void superio_exit(int base) >> release_region(base, 2); >> } >> >> -static int fintek_wdt_set_timeout(int timeout) >> +static int fintek_wdt_set_timeout(struct watchdog_device *wdd, unsigned int timeout) >> { >> - if (timeout <= 0 >> - || timeout > max_timeout) { >> - pr_err("watchdog timeout out of range\n"); >> - return -EINVAL; >> - } >> - >> - mutex_lock(&watchdog.lock); >> - >> - watchdog.timeout = timeout; >> + wdd->timeout = timeout; > > This needs to save the actual timeout, which differs from the > configured one if larger than 255. Oh, makes sense. Will changes with v4. Thanks, Ahmad -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |