Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752846AbbEROPW (ORCPT ); Mon, 18 May 2015 10:15:22 -0400 Received: from mail1.bemta3.messagelabs.com ([195.245.230.167]:5950 "EHLO mail1.bemta3.messagelabs.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751039AbbEROPQ convert rfc822-to-8bit (ORCPT ); Mon, 18 May 2015 10:15:16 -0400 X-Env-Sender: stwiss.opensource@diasemi.com X-Msg-Ref: server-9.tower-39.messagelabs.com!1431958502!21969097!1 X-Originating-IP: [94.185.165.51] X-StarScan-Received: X-StarScan-Version: 6.13.15; banners=-,-,- X-VirusChecked: Checked From: "Opensource [Steve Twiss]" To: Guenter Roeck CC: LINUXKERNEL , LINUXWATCHDOG , Wim Van Sebroeck , Alessandro Zummo , DEVICETREE , David Dajun Chen , Dmitry Torokhov , Ian Campbell , Kumar Gala , LINUXINPUT , Lee Jones , Liam Girdwood , Mark Brown , "Mark Rutland" , Pawel Moll , RTCLINUX , Rob Herring , Samuel Ortiz , Support Opensource Subject: RE: [PATCH V2 3/4] watchdog: da9062: DA9062 watchdog driver Thread-Topic: [PATCH V2 3/4] watchdog: da9062: DA9062 watchdog driver Thread-Index: AQHQjmaAk/e82jzsZEKEpHYCwGOkXZ18O9SAgABrP6CAAEjcgIAAFECwgABnT4CABEJgUA== Date: Mon, 18 May 2015 14:15:01 +0000 Message-ID: <6ED8E3B22081A4459DAC7699F3695FB7014B22B8C8@SW-EX-MBX02.diasemi.com> References: <6a51f163b99edfad9165ad29609abb072dbaa2b7.1431621833.git.stwiss.opensource@diasemi.com> <55555639.8090505@roeck-us.net> <6ED8E3B22081A4459DAC7699F3695FB7014B22B63A@SW-EX-MBX02.diasemi.com> <5555ED4F.5070003@roeck-us.net> <6ED8E3B22081A4459DAC7699F3695FB7014B22B6E2@SW-EX-MBX02.diasemi.com> <20150515202005.GA23133@roeck-us.net> In-Reply-To: <20150515202005.GA23133@roeck-us.net> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.20.26.77] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3357 Lines: 95 On 15 May 2015 21:20 Guenter Roeck, > > > > + > > > > +/* E_WDG_WARN interrupt handler */ > > > > +static irqreturn_t da9062_wdt_wdg_warn_irq_handler(int irq, void*data) > > > > +{ > > > > + struct da9062_watchdog *wdt = data; > > > > + > > > > + dev_notice(wdt->hw->dev, "Watchdog timeout warning trigger.\n"); > > > > + return IRQ_HANDLED; > > > > +} > > > > + > > > > On 15 May 2015 13:58 Guenter Roeck wrote: > > > > [...] > > > > > >>> + > > > >>> + irq = platform_get_irq_byname(pdev, "WDG_WARN"); > > > >>> + if (irq < 0) { > > > >>> + dev_err(wdt->hw->dev, "Failed to get IRQ.\n"); > > > >>> + ret = irq; > > > >>> + goto error; > > > > [...] > > > > > > > > > >> Also, is the interrupt mandatory ? All it does is to display a message. > > > >> Looks very optional to me. > > > > > > > > It is a place holder for something more application specific. > > > > I could remove it, but I figured it would just get re-added when somebody takes the > > > > driver and modifies it for their needs. > > > > > > > > If this is a problem however, it can go. > > > > Please advise .. > > > > > > > > > > Then this someone should add the code. For the time being, it just increases > > > kernel size and may cause the driver to fail for no good reason. Plus, given > > > the driver apparently works without interrupt, even then it should be > > > optional, and the driver does not have to fail loading if it is not supported on a > > > given platform. > > > > > > > Hi Guenter, > > > > I'm not sure if I got my previous point across there ... > > > > Leaving this in wouldn't really do any real harm I think. If this feature is not supported > > in somebody's platform then there wouldn't be a problem, the IRQ would fire (as a > > warning that the watchdog was about to time-out), the handler function would be > > executed, it would handle the IRQ -- and that would be it. Nothing would happen apart > > from a debug print. > > I didn't get my point across either. Problem is that your driver fails to load > if the interrupt is not there. With the interrupt really being optional, I don't > see the point in making it mandatory just to display a message if it fires. > Hi Guenter, Ok. I see now. It's not a mandatory interrupt and so it should not fail the whole driver upon an error from the devm_request_threaded_irq() request ... I will let it pass through if there is a problem and just display a debug message. Something like this: @@ -234,11 +234,9 @@ static int da9062_wdt_probe(struct platform_device *pdev) da9062_wdt_wdg_warn_irq_handler, IRQF_TRIGGER_LOW | IRQF_ONESHOT | IRQF_SHARED, "WDG_WARN", wdt); - if (ret) { - dev_err(wdt->hw->dev, + if (ret) + dev_dbg(wdt->hw->dev, "Failed to request watchdog device IRQ.\n"); - return ret; - } ret = watchdog_register_device(&wdt->wdtdev); if (ret < 0) { I think I've understood now. I guess this is it.. I'll send a PATCH V3 with this change. Regards, Steve -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/