From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754246AbdA3Tyv convert rfc822-to-8bit (ORCPT ); Mon, 30 Jan 2017 14:54:51 -0500 Received: from mail-sn1nam02on0119.outbound.protection.outlook.com ([104.47.36.119]:17367 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754126AbdA3Tyr (ORCPT ); Mon, 30 Jan 2017 14:54:47 -0500 From: Hartley Sweeten To: Guenter Roeck CC: "linux-watchdog@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "Mika Westerberg" , Wim Van Sebroeck Subject: RE: [PATCH 2/2] watchdog: ts72xx_wdt: convert driver to watchdog core Thread-Topic: [PATCH 2/2] watchdog: ts72xx_wdt: convert driver to watchdog core Thread-Index: AQHSexnS/9DId7O2dkCiVb0d7a+lHaFRYF0AgAACS5A= Date: Mon, 30 Jan 2017 19:17:54 +0000 Message-ID: References: <20170130165548.40965-1-hsweeten@visionengravers.com> <20170130165548.40965-3-hsweeten@visionengravers.com> <20170130190138.GB11199@roeck-us.net> In-Reply-To: <20170130190138.GB11199@roeck-us.net> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=HartleyS@visionengravers.com; x-originating-ip: [184.183.19.121] x-ms-office365-filtering-correlation-id: 74bcb45b-ae8b-4ad0-5335-08d44944b168 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:SN1PR0101MB1566; x-microsoft-exchange-diagnostics: 1;SN1PR0101MB1566;7:JlF5+hN6Xa7/tTMBof0q3YiqGkxDxm5PMmkmDMqdMXqJrigU1G+JLBwZ8vQlF1sG39qjObVS/dJWzPsUScD4N7JHHyg/P5jVV94w9f7Z96+YTiwiBEQHJXtls51VIGFTqt2rY8+nnnkIC3g3XA0v/cbLZBjVvtLiQTmcgjuBz5E/W0T9MUuTYHiXzjdhJFs50x/HejRltbMNP15vNPP2XBO2x8TyXFIP2SQn5GTuRqPUDyNIlJttM/VnSju0ssHZkeft+vJARHdP9gYUOHZDtFGp/pk0Eguz27s8zCrF8DIRjQexm2uHmyn2sRZYYCABnUnMX4o0rQui7b57e6caCqHvboWRoeTBu/N0JgTYEVFBcpeAqDSzigPtYVK4jCoGSEGCKZSwFuHU7c2nGsgrXnL+3xlQ4dq2yKv4K0aXxXCBw4Vj5yi3P7jxx44sgy2cWD2yEK0ldumD4wMNPM0lgg== x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040375)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6041248)(2016111802025)(20161123560025)(20161123555025)(20161123564025)(20161123562025)(20161123558021)(6072148)(6043046);SRVR:SN1PR0101MB1566;BCL:0;PCL:0;RULEID:;SRVR:SN1PR0101MB1566; x-forefront-prvs: 0203C93D51 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(7916002)(39410400002)(39450400003)(39840400002)(189002)(377454003)(199003)(24454002)(38730400001)(86362001)(5660300001)(122556002)(8936002)(110136003)(81166006)(81156014)(77096006)(92566002)(80792005)(25786008)(7696004)(9686003)(54906002)(6436002)(97736004)(229853002)(3280700002)(8676002)(2950100002)(6916009)(66066001)(189998001)(2900100001)(55016002)(99286003)(6506006)(50986999)(53936002)(4326007)(74316002)(305945005)(7736002)(105586002)(54356999)(3660700001)(106356001)(76176999)(106116001)(2906002)(33656002)(102836003)(3846002)(101416001)(68736007)(6116002);DIR:OUT;SFP:1102;SCL:1;SRVR:SN1PR0101MB1566;H:SN1PR0101MB1565.prod.exchangelabs.com;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-OriginatorOrg: visionengravers.com X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Jan 2017 19:17:54.7659 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: d698601f-af92-4269-8099-fd6f11636477 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR0101MB1566 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Monday, January 30, 2017 12:02 PM, Guenter Roeck wrote: > On Mon, Jan 30, 2017 at 09:55:48AM -0700, H Hartley Sweeten wrote: >> Cleanup this driver and convert it to use the watchdog framework API. >> >> Signed-off-by: H Hartley Sweeten >> Cc: Mika Westerberg >> Cc: Wim Van Sebroeck >> Cc: Guenter Roeck >> --- >> drivers/watchdog/ts72xx_wdt.c | 447 +++++++++--------------------------------- >> 1 file changed, 93 insertions(+), 354 deletions(-) >> -#define TS72XX_WDT_DEFAULT_TIMEOUT 8 >> - >> -static int timeout = TS72XX_WDT_DEFAULT_TIMEOUT; >> -module_param(timeout, int, 0); >> -MODULE_PARM_DESC(timeout, "Watchdog timeout in seconds. " >> - "(1 <= timeout <= 8, default=" >> - __MODULE_STRING(TS72XX_WDT_DEFAULT_TIMEOUT) >> - ")"); > > Same question as with patch #1 - are you sure you want to take this away ? Again, not a problem leaving it in. > You might just drop the limits instead (also see below). >> + wdd->min_timeout = 1; >> + wdd->max_timeout = 8; > > With such a low maximum timeout, it might make sense to use the core > to be able to support larger timeouts. Agree. I'll update and test this for the next version. >> + wdd->timeout = 8; >> + wdd->parent = &pdev->dev; >> >> - /* make sure that the watchdog is disabled */ >> - ts72xx_wdt_stop(wdt); > > Are you sure this is no longer needed ? If there is a means to detect if the > watchdog is running, it might make sense to set the WDOG_HW_RUNNING flag instead > if it is running and let the core handle the ping until the watchdog device > is opened. A patch to make sure this watchdog is disabled early during the kernel uncompress will soon be applied. Arnd Bergmann has it in his todo folder: [PATCH] ARM: ep93xx: Disable TS-72xx watchdog before uncompressing The bootloader currently enables the watchdog for 8 seconds and it needs to be disabled just in case the uncompress takes longer. I don't have a problem leaving it in here it's just not necessary. >> + watchdog_set_nowayout(wdd, nowayout); >> >> - error = misc_register(&ts72xx_wdt_miscdev); >> - if (error) { >> - dev_err(&pdev->dev, "failed to register miscdev\n"); >> - return error; >> - } >> + watchdog_set_drvdata(wdd, priv); >> + >> + ret = watchdog_register_device(wdd); > > devm_watchdog_register_device() ? I'll update this. Thanks, Hartley