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

_______________________________________________
lm-sensors mailing list
lm-sensors@xxxxxxxxxxxxxx
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors


[Index of Archives]     [Linux Kernel]     [Linux Hardware Monitoring]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux