Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3550977yba; Tue, 16 Apr 2019 13:51:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqwNDweXp6Xc066up1nTFG9DqtobQUyBK6NOzDhtfL7tpuy1KjHra1coD1ffwsLbHshZmAvG X-Received: by 2002:aa7:938b:: with SMTP id t11mr46391964pfe.67.1555447871449; Tue, 16 Apr 2019 13:51:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555447871; cv=none; d=google.com; s=arc-20160816; b=EjR2itP3BiBSC5RO52fMAuEQc77P0vb1kmS1WaI8RbOKhO8cK+T4j8XNOVxNMIcGGT z+/ptc5W4FCxmwYKrAdqqCji/YkmwhjJowMRO+QrzZjbpfZVuaWxFZNZ6bgcT+TzwJz8 ZkHj514O2+QujCscsrCFQcYq5H1Kdhdn0J1oCevZa9vrn6WVpuDAB7nhNFpmgocKF9aj 2rMAwrfCqbXxzFuZCdPLT1tGP0shvvgz4w8k2bazUalpqb9sfdD8lPFgpJg95kPtbY/y LOyy2QFvhf2bcXT2cMAvg6tFnmrWmfTgoUPZayjIRzO2bAg8AfSRu4HMgM4vnOXf2pD1 araw== 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; bh=2tsI90W7xPE+YFhq/huQ0VieF3E9BAtsLnjy+QA5390=; b=W2cI+sC2QyDvKbifrVw05j8nLce0caJZ8Jza/OgxXvQgLnYbP2TO04yLxrkcCvFQmr +sz63rKd4xxTwwC4n7yizfcY2pgFe3mZiTywHmzv+m6U7XXIIoIoBM2RHcY/JHfODzGo RQRtVJb0jWnc1UKF9b6Ob4hVJN6hNWagGbitSM5LqoY3Y8NOuPcrJ+ugsdGvvEC2Bg8T x16k4kqoC4w5lxqVguixvfhIgtm32tOewuP3xnU+TJaRmJLmDe7/UyfVidh834v1a3kO zZH6V/gi4WalPvEdjxzEH5g9Gy7Hh4Y3SjJrOGXJQYHurFgLnmn369FC6ThSX4gspOwW 43aA== ARC-Authentication-Results: i=1; mx.google.com; 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 r9si23044216pgv.504.2019.04.16.13.50.55; Tue, 16 Apr 2019 13:51:11 -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; 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 S1730078AbfDPUuH (ORCPT + 99 others); Tue, 16 Apr 2019 16:50:07 -0400 Received: from sauhun.de ([88.99.104.3]:52604 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728000AbfDPUuG (ORCPT ); Tue, 16 Apr 2019 16:50:06 -0400 Received: from localhost (p54B332D3.dip0.t-ipconnect.de [84.179.50.211]) by pokefinder.org (Postfix) with ESMTPSA id D5ABD2C3637; Tue, 16 Apr 2019 22:50:03 +0200 (CEST) Date: Tue, 16 Apr 2019 22:50:03 +0200 From: Wolfram Sang To: Jerry Hoemann Cc: Wolfram Sang , linux-watchdog@vger.kernel.org, linux-renesas-soc@vger.kernel.org, Guenter Roeck , 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: <20190416205003.GA8268@kunai> References: <20190416102515.12269-1-wsa+renesas@sang-engineering.com> <20190416102515.12269-7-wsa+renesas@sang-engineering.com> <20190416203431.GA20072@anatevka> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="huq684BweRXVnRxX" Content-Disposition: inline In-Reply-To: <20190416203431.GA20072@anatevka> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --huq684BweRXVnRxX Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Jerry, > I applied patches 1,2 & 6 in testing. >=20 > Note, that hpwdt is passing NULL as the third parameter to watchdog_init_= timeout(). >=20 > The second patch in this series is using "dev" as input to dev_err and de= v_warn. >=20 > This results in the following in dmesg when trying to load hpwdt w/ an in= valid soft_margin: >=20 >=20 > [ 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: >=20 > if (watchdog_init_timeout(&hpwdt_dev, soft_margin, &dev->dev)) >=20 >=20 > We see the message like we'd desire: >=20 > [ 2061.167100] hpwdt 0000:01:00.0: driver supplied timeout (4294967295) o= ut 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 =3D dev ?: wdd->parent; And then use err_dev for all the printing. Guenter? Regards, Wolfram --huq684BweRXVnRxX Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEOZGx6rniZ1Gk92RdFA3kzBSgKbYFAly2P/cACgkQFA3kzBSg Kba5QRAAsCrgIJWS6eg2cA75jqiE2VtTWnfb4b1dQB1HtNSdE78SMuVoap75g5PS JAgLewDV9qw0OYl392InLSHjy7UV1TGT9WXhTHbLGW5QTqyUM99EgdwbJwQgcROG FvkXFNXLO3QJTiXsPpVJbJZsKXHlItC7RweTha6Q6MQ9pEEs9Vh6zpKB3JxmlWHQ SuunJu+xl3SepuP9HIkVD8opHqRIwO7pLsehlHMkGzBTeVynYW22w9THkaqJZkK5 9Ze4Ctj8V+5ItmgY8rRSetlRuYksP4likMAAKdFkB6JitpawR3JQGuRpC/7namEo sMT1n9gVC6yOax4WsGLaCNFmmrXsmxsrsUvwt2h8/5Q3LvixGzHlNZOzbA829xUD ai6i9T+EE/J7B7wN7/XToHSimqpEoru4Qq6BaGXQ4MDY30gFdNPKMx8Og0F/jl/I umXT2+IGXihmrQuH7VAn33SwJLgxmplO6dAGVBJQwWNspkvPgdyQ963oSVhnnsfA BWgxoZB/PCiOVxEkD0iShSzbQKP+xuEmD9k0aVSGtLPANMPRYj8gHFdU9q5Px+XM OxXvYh35c3fxWCGplca+8K9Ihol1+pz3kfkEO8VEKpyFINhi7n7j0v/vwg71iLK4 1RB+bWXSHN3sKI4z6B6vR56jx2wP8GrEbIKNSBbW5/zb1uQBQ7g= =qbKk -----END PGP SIGNATURE----- --huq684BweRXVnRxX--