Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3570613yba; Tue, 16 Apr 2019 14:16:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqwJHPVsoPq8r0sL5glX+ZBJUiKweOVj2+PY7tW2nYWSD6cBQM3Wf/30znrzfCOybL/7e+oi X-Received: by 2002:a17:902:bc85:: with SMTP id bb5mr58273230plb.310.1555449388515; Tue, 16 Apr 2019 14:16:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555449388; cv=none; d=google.com; s=arc-20160816; b=fonCTcflGl8S457rXQcopeZTnxhUn1cUIm8clu3BvQebK2ez+D+S0sw1hYjf/q7fyh tCmy0BHxxfQsVsJtBMBYfwS/Huox2sJ5BRM3nl1RtvFbd3Z48wn6Nt+lS6PQoN5/W5Re /2x+aFp41tP36OWmiENJTCyh1CXVcLjGbuDv5YM5BkOmKrUuRZrrWTNZB63fepXizUHf /UY2xvOx9yJQ2Q55E74N49VDZxQgaQfIDimkd5E4vsV4MK6U9ZTqig2CrlTsBoYR7u/R 8i+IIVFVN3cc6xupwA0DAyGw9e4U3L0pnjkAJIriooSowgBz7XQpTbxVNHBirG9bzK/q qH1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=OU2nSMmt5htbg6+q1msxmMt8aeMJWwleorLRoerjeR4=; b=LrBuXRLc3jeF7cEGWSrfKStlUMSExSAy8ZCpFGBk0pM57HCO7AW/kg9vBIsbzi9WvE KBpIzmLSc3k7fanIX7hDfPGX8hAVsAwitznioa4b7nZ+agUSKxpADrSl/4FRHgd0wvu3 IAK3FxbThjzYEiaK/F6xUGFZSdkXGa3Z5bqx1N6CXIkIpP0Rym09obJg9yRwREzmuSLs Pdle91FgQfjHfV6x6xtHUe9Lwn0aiIgnnwqhponN8I+qyQpszy+hHaut/CtbyX61gtEr B//gWE6qmsj5A1kN1BOcAUMEtAG1txA4BGzJgj75dzE+EMKTQHU02DurFRH5hwwpu68N tl7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=b3KajffQ; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f23si48795636pfn.136.2019.04.16.14.16.12; Tue, 16 Apr 2019 14:16:28 -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=fail header.i=@gmail.com header.s=20161025 header.b=b3KajffQ; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728622AbfDPVOQ (ORCPT + 99 others); Tue, 16 Apr 2019 17:14:16 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:33727 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727136AbfDPVOQ (ORCPT ); Tue, 16 Apr 2019 17:14:16 -0400 Received: by mail-pg1-f194.google.com with SMTP id k19so10951208pgh.0; Tue, 16 Apr 2019 14:14:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=OU2nSMmt5htbg6+q1msxmMt8aeMJWwleorLRoerjeR4=; b=b3KajffQ9aP+3ncagGjPE22931SX/MgceA+6oJec+mTIF0ISBnJV2s7XoJLRrss81q cclSmEgeaMR2wcrXJ2iNWrALryx8xf2jXe+dnBBXkhSRoVoV+0HyjpBSTBtak/5jmE4i vz8JllSwgkifnPsJ1latKIeNY0VpgYHNxKsu+qVdlPK/KSzmKFlDwKd/VmWXI9aHfJru 4OktXKqBB9MIEM3I11DeYrSlSR5E2tSoxLDuw/dIpMbKSySpU9C+EVkpFtckFXEbnKMh 5mrHRa/tDRRtFjKEG1jrrVdQd4Uwo0EfvvSEN/TiyCyNXw/Sbx7PNPhckwLRzL6iiksw RXkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=OU2nSMmt5htbg6+q1msxmMt8aeMJWwleorLRoerjeR4=; b=tZGb1Kdxs+ckXYEKB29CMbBcw2bgD6lHSxwNbu3Svxo7ybwEsixTS+JmKQSguMFn3r G4JSGrlMJfdIe3pdRz9EZuhomV2+IJgl17e4grmq5peww02lrv0IgWlrlOvrqwUezTfW x14EQBTjp+ola9zQTuMxBJ1aZkvUHP7vwFIZkRdaQMRqyIeXFZdLkupX158opl+zsjQU PhymsZgTdH26cv5z8VGefv4yx3jhg/+wAscZWXGm4sJQihRtrkz/mcZHv2R2tduXxAng avCHB4kDr1YgWe+qVIFwyhawIs4y8q6I2X7RrwfYxntF3wJRtxLWNXK6mquROgPU+kh7 UxRA== X-Gm-Message-State: APjAAAVBKoYgmKJYOck+cRzqiKao0TwGnSgnkNfAzintYAMAVF1JtkKZ YJSRoCSZLvSmhox51Ei1f08= X-Received: by 2002:aa7:9a89:: with SMTP id w9mr77416934pfi.213.1555449255384; Tue, 16 Apr 2019 14:14:15 -0700 (PDT) Received: from localhost ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id m7sm70388306pgg.62.2019.04.16.14.14.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Apr 2019 14:14:14 -0700 (PDT) Date: Tue, 16 Apr 2019 14:14:13 -0700 From: Guenter Roeck To: Wolfram Sang Cc: Jerry Hoemann , Wolfram Sang , linux-watchdog@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Wim Van Sebroeck , linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 06/16] watchdog: hpwdt: drop warning after calling watchdog_init_timeout Message-ID: <20190416211413.GB26442@roeck-us.net> References: <20190416102515.12269-1-wsa+renesas@sang-engineering.com> <20190416102515.12269-7-wsa+renesas@sang-engineering.com> <20190416203431.GA20072@anatevka> <20190416205003.GA8268@kunai> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190416205003.GA8268@kunai> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 16, 2019 at 10:50:03PM +0200, Wolfram Sang wrote: > Hi Jerry, > > > I applied patches 1,2 & 6 in testing. > > > > Note, that hpwdt is passing NULL as the third parameter to watchdog_init_timeout(). > > > > The second patch in this series is using "dev" as input to dev_err and dev_warn. > > > > This results in the following in dmesg when trying to load hpwdt w/ an invalid soft_margin: > > > > > > [ 80.848160] (NULL device *): driver supplied timeout (4294967295) out of range > > [ 80.855429] (NULL device *): falling back to default timeout (30) > > Thank you for this report. Yes, using 'dev' blindly is a bug. > > > if the call in hpwdt driver is changed to: > > > > if (watchdog_init_timeout(&hpwdt_dev, soft_margin, &dev->dev)) > > > > > > We see the message like we'd desire: > > > > [ 2061.167100] hpwdt 0000:01:00.0: driver supplied timeout (4294967295) out of range > > [ 2061.174633] hpwdt 0000:01:00.0: falling back to default timeout (30) > > The above observation makes sense, but I think we should fix the core > code and not the hpwdt driver. My suggestion would be to add something > like this to watchdog_init_timeout(): > > struct device *err_dev = dev ?: wdd->parent; > > And then use err_dev for all the printing. Guenter? > That is a good idea, and we should do that. Unfortunately, wdd->parent can also be NULL, either because there is no parent device (e.g. softdog.c), or because the driver author forgot to set ->parent. So we still need a fallback. Does it make sense to print watchdog_info->identity if both dev and wdd->parent are NULL ? Guenter