From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail.active-venture.com ([67.228.131.205]) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UhLvG-0000gC-Bo for kexec@lists.infradead.org; Tue, 28 May 2013 15:34:51 +0000 Date: Tue, 28 May 2013 08:34:52 -0700 From: Guenter Roeck Subject: Re: [PATCH v3] watchdog: Add hook for kicking in kdump path Message-ID: <20130528153452.GA21891@roeck-us.net> References: <1366233596-34681-1-git-send-email-dzickus@redhat.com> <87li8gaku0.fsf@xmission.com> <20130418130009.GH79013@redhat.com> <20130418134904.GC2767@roeck-us.net> <20130418135257.GL79013@redhat.com> <20130418145413.GA1980@roeck-us.net> <20130424144226.GI79013@redhat.com> <20130424152142.GA26864@roeck-us.net> <20130527191618.GD14258@spo001.leaseweb.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20130527191618.GD14258@spo001.leaseweb.com> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "kexec" Errors-To: kexec-bounces+dwmw2=twosheds.infradead.org@lists.infradead.org To: Wim Van Sebroeck Cc: Don Zickus , linux-watchdog@vger.kernel.org, kexec@lists.infradead.org, LKML , "Eric W. Biederman" , dyoung@redhat.com, vgoyal@redhat.com On Mon, May 27, 2013 at 09:16:18PM +0200, Wim Van Sebroeck wrote: > Hi Guenter, > > > > Hi Guenter, > > > > > > Is there an easy way to determine which driver is loaded for each > > > /dev/watchdogN device (from a script perspective). > > > > > > Basically, I wanted to determine the module that needs to be included in > > > the kdump initrd image. > > > > > Sometimes. For example, the iTCO_wdt driver has an entry in /sys/devices, and > > /sys/class/watchdog/watchdogX/device points to it. That is not always the case, > > howewver. In my system, for example, the MEI watchdog is active, but there is > > nothing I can find that would give me an indication that /dev/watchdog0 actually > > points to the MEI watchdog driver. > > > > Of course I might be missing something, and there might be some other means > > to identify the driver from userspace. Would be great, actually, as I am having > > the same problem. > > Only when you set the .parent field in the watchdog_device data you will get the > referal in the /sys/class/... tree. In iTCO_wdt.c you have the following code > that does that: iTCO_wdt_watchdog_dev.parent = dev->dev.parent; > > From the watchdog-kernel-api documentation: > * parent: set this to the parent device (or NULL) before calling > watchdog_register_device. > Hi Wim, unfortunately that only works if the driver is instantiated as platform driver, PCI driver, or similar, where a parent device exists. Some drivers are, however, instantiated directly from the init function (the BookE driver is an example). What is the recommended action in this case ? Convert it to a platform driver ? Thanks, Guenter _______________________________________________ kexec mailing list kexec@lists.infradead.org http://lists.infradead.org/mailman/listinfo/kexec From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail.active-venture.com ([67.228.131.205]:62948 "EHLO mail.active-venture.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934374Ab3E1Pe2 (ORCPT ); Tue, 28 May 2013 11:34:28 -0400 Date: Tue, 28 May 2013 08:34:52 -0700 From: Guenter Roeck To: Wim Van Sebroeck Cc: Don Zickus , "Eric W. Biederman" , linux-watchdog@vger.kernel.org, kexec@lists.infradead.org, LKML , vgoyal@redhat.com, dyoung@redhat.com Subject: Re: [PATCH v3] watchdog: Add hook for kicking in kdump path Message-ID: <20130528153452.GA21891@roeck-us.net> References: <1366233596-34681-1-git-send-email-dzickus@redhat.com> <87li8gaku0.fsf@xmission.com> <20130418130009.GH79013@redhat.com> <20130418134904.GC2767@roeck-us.net> <20130418135257.GL79013@redhat.com> <20130418145413.GA1980@roeck-us.net> <20130424144226.GI79013@redhat.com> <20130424152142.GA26864@roeck-us.net> <20130527191618.GD14258@spo001.leaseweb.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20130527191618.GD14258@spo001.leaseweb.com> Sender: linux-watchdog-owner@vger.kernel.org List-Id: linux-watchdog@vger.kernel.org On Mon, May 27, 2013 at 09:16:18PM +0200, Wim Van Sebroeck wrote: > Hi Guenter, > > > > Hi Guenter, > > > > > > Is there an easy way to determine which driver is loaded for each > > > /dev/watchdogN device (from a script perspective). > > > > > > Basically, I wanted to determine the module that needs to be included in > > > the kdump initrd image. > > > > > Sometimes. For example, the iTCO_wdt driver has an entry in /sys/devices, and > > /sys/class/watchdog/watchdogX/device points to it. That is not always the case, > > howewver. In my system, for example, the MEI watchdog is active, but there is > > nothing I can find that would give me an indication that /dev/watchdog0 actually > > points to the MEI watchdog driver. > > > > Of course I might be missing something, and there might be some other means > > to identify the driver from userspace. Would be great, actually, as I am having > > the same problem. > > Only when you set the .parent field in the watchdog_device data you will get the > referal in the /sys/class/... tree. In iTCO_wdt.c you have the following code > that does that: iTCO_wdt_watchdog_dev.parent = dev->dev.parent; > > From the watchdog-kernel-api documentation: > * parent: set this to the parent device (or NULL) before calling > watchdog_register_device. > Hi Wim, unfortunately that only works if the driver is instantiated as platform driver, PCI driver, or similar, where a parent device exists. Some drivers are, however, instantiated directly from the init function (the BookE driver is an example). What is the recommended action in this case ? Convert it to a platform driver ? Thanks, Guenter