Linux-Watchdog Archive on lore.kernel.org
 help / color / Atom feed
* Question about pc87413_wdt.ko
@ 2019-07-29 14:38 Mark Balantzyan
  2019-07-29 14:54 ` Guenter Roeck
  0 siblings, 1 reply; 2+ messages in thread
From: Mark Balantzyan @ 2019-07-29 14:38 UTC (permalink / raw)
  To: linux; +Cc: wim, linux-watchdog

Hi Guenter,

My name is Mark, we corresponded in the recent past concerning a different 
kernel module.

I would just like to ask a question about pc87413_wdt.ko. In 
pc87413_wdt.c, the function pc87413_init() calls pc87413_swc_base_addr() 
and swc_base_addr gets assigned to. But pc87413_open() calls pc87413_refresh() 
which has spinlocks around swc_base_addr. There may be a use before 
initialization, so spinlocks get in the way. Is there a case possible 
where a bug/race condition may be occurring here? Or is there a hardware 
synchronization somewhere?

Thank you,
Mark

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Question about pc87413_wdt.ko
  2019-07-29 14:38 Question about pc87413_wdt.ko Mark Balantzyan
@ 2019-07-29 14:54 ` Guenter Roeck
  0 siblings, 0 replies; 2+ messages in thread
From: Guenter Roeck @ 2019-07-29 14:54 UTC (permalink / raw)
  To: Mark Balantzyan; +Cc: wim, linux-watchdog

On Mon, Jul 29, 2019 at 07:38:12AM -0700, Mark Balantzyan wrote:
> Hi Guenter,
> 
> My name is Mark, we corresponded in the recent past concerning a different
> kernel module.
> 
> I would just like to ask a question about pc87413_wdt.ko. In pc87413_wdt.c,
> the function pc87413_init() calls pc87413_swc_base_addr() and swc_base_addr
> gets assigned to. But pc87413_open() calls pc87413_refresh() which has
> spinlocks around swc_base_addr. There may be a use before initialization, so
> spinlocks get in the way. Is there a case possible where a bug/race
> condition may be occurring here? Or is there a hardware synchronization
> somewhere?
> 
Yes, the misc device should only be created after all resources are in place.
Question though is if that really matters, ie if anyone is still using the
driver. If so, I'd rather see the driver converted to use the watchdog 
subsystem.

Thanks,
Guenter

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-29 14:38 Question about pc87413_wdt.ko Mark Balantzyan
2019-07-29 14:54 ` Guenter Roeck

Linux-Watchdog Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-watchdog/0 linux-watchdog/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-watchdog linux-watchdog/ https://lore.kernel.org/linux-watchdog \
		linux-watchdog@vger.kernel.org linux-watchdog@archiver.kernel.org
	public-inbox-index linux-watchdog


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-watchdog


AGPL code for this site: git clone https://public-inbox.org/ public-inbox