Re: [PATCH 1/3] watchdog_dev: Add support for having more then 1 watchdog

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> Also having this support in watchdog_dev makes developing watchdog drivers
> for watchdog hardware which happens to often be found on systems with
> multiple watchdogs a lot easier.

See the patches I posted. I (biased as ever ;)) think they way I've done
it is better, but its also produced no feedback so I'll resend them again
shortly if others also need them.

For x86 we need them as some systems can have both a TCO timer and a
management engine timer.


> +static struct miscdevice watchdog_miscdev[MAX_WATCHDOGS] = { {
> +	.minor		= WATCHDOG_MINOR,
> +	.name		= "watchdog",
> +	.fops		= &watchdog_fops,
> +}, {

The way I did it was to support a legacy /dev/watchdog and a proper range
of watchdogs on their own dynamic major.

> +	.minor		= 212,
> +	.name		= "watchdog1",

Also for submitted patches please don't go taking minor numbers from
miscdev which are statically allocating them without properly registering
them first...


> +	/* Find our watchdog_device */
> +	for (idx = 0; idx < MAX_WATCHDOGS; idx++)
> +		if (watchdog_miscdev[idx].minor == iminor(inode)) {
> +			wdd = wdd_list[idx];
> +			break;
> +		}

Locking model ?


> +	/* No need to lock */
> +	for (idx = 0; idx < MAX_WATCHDOGS; idx++)
> +		if (wdd_list[idx] == watchdog)
> +			break;

What about a parallel open ?

Alan
--
To unsubscribe from this list: send the line "unsubscribe linux-watchdog" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux