Skip to content

Commit

Permalink
Merge master.kernel.org:/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog
Browse files Browse the repository at this point in the history
* master.kernel.org:/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog:
  [WATCHDOG] improve machzwd detection
  [WATCHDOG] use ENOTTY instead of ENOIOCTLCMD in ioctl()
  [WATCHDOG] s3c24XX nowayout
  [WATCHDOG] pnx4008: add cpu_relax()
  [WATCHDOG] pnx4008_wdt.c - spinlock fixes.
  [WATCHDOG] pnx4008_wdt.c - remove patch
  [WATCHDOG] pnx4008_wdt.c - nowayout patch
  [WATCHDOG] pnx4008: add watchdog support
  [WATCHDOG] i8xx_tco remove pci_find_device.
  [WATCHDOG] alim remove pci_find_device
  • Loading branch information
Linus Torvalds committed Oct 2, 2006
2 parents 0235497 + 11dc101 commit b65d04a
Show file tree
Hide file tree
Showing 48 changed files with 472 additions and 73 deletions.
11 changes: 11 additions & 0 deletions arch/arm/mach-pnx4008/clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -735,6 +735,16 @@ static struct clk uart6_ck = {
.enable_reg = UARTCLKCTRL_REG,
};

static struct clk wdt_ck = {
.name = "wdt_ck",
.parent = &per_ck,
.flags = NEEDS_INITIALIZATION,
.round_rate = &on_off_round_rate,
.set_rate = &on_off_set_rate,
.enable_shift = 0,
.enable_reg = TIMCLKCTRL_REG,
};

/* These clocks are visible outside this module
* and can be initialized
*/
Expand Down Expand Up @@ -765,6 +775,7 @@ static struct clk *onchip_clks[] = {
&uart4_ck,
&uart5_ck,
&uart6_ck,
&wdt_ck,
};

static int local_clk_enable(struct clk *clk)
Expand Down
11 changes: 11 additions & 0 deletions drivers/char/watchdog/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,17 @@ config OMAP_WATCHDOG
Support for TI OMAP1610/OMAP1710/OMAP2420 watchdog. Say 'Y' here to
enable the OMAP1610/OMAP1710 watchdog timer.

config PNX4008_WATCHDOG
tristate "PNX4008 Watchdog"
depends on WATCHDOG && ARCH_PNX4008
help
Say Y here if to include support for the watchdog timer
in the PNX4008 processor.
This driver can be built as a module by choosing M. The module
will be called pnx4008_wdt.

Say N if you are unsure.

# X86 (i386 + ia64 + x86_64) Architecture

config ACQUIRE_WDT
Expand Down
1 change: 1 addition & 0 deletions drivers/char/watchdog/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ obj-$(CONFIG_S3C2410_WATCHDOG) += s3c2410_wdt.o
obj-$(CONFIG_SA1100_WATCHDOG) += sa1100_wdt.o
obj-$(CONFIG_MPCORE_WATCHDOG) += mpcore_wdt.o
obj-$(CONFIG_EP93XX_WATCHDOG) += ep93xx_wdt.o
obj-$(CONFIG_PNX4008_WATCHDOG) += pnx4008_wdt.o

# X86 (i386 + ia64 + x86_64) Architecture
obj-$(CONFIG_ACQUIRE_WDT) += acquirewdt.o
Expand Down
2 changes: 1 addition & 1 deletion drivers/char/watchdog/acquirewdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ static int acq_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
}

default:
return -ENOIOCTLCMD;
return -ENOTTY;
}
}

Expand Down
2 changes: 1 addition & 1 deletion drivers/char/watchdog/advantechwdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ advwdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
}

default:
return -ENOIOCTLCMD;
return -ENOTTY;
}
return 0;
}
Expand Down
12 changes: 8 additions & 4 deletions drivers/char/watchdog/alim1535_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ static int ali_ioctl(struct inode *inode, struct file *file,
return put_user(timeout, p);

default:
return -ENOIOCTLCMD;
return -ENOTTY;
}
}

Expand Down Expand Up @@ -330,17 +330,20 @@ static int __init ali_find_watchdog(void)
u32 wdog;

/* Check for a 1535 series bridge */
pdev = pci_find_device(PCI_VENDOR_ID_AL, 0x1535, NULL);
pdev = pci_get_device(PCI_VENDOR_ID_AL, 0x1535, NULL);
if(pdev == NULL)
return -ENODEV;
pci_dev_put(pdev);

/* Check for the a 7101 PMU */
pdev = pci_find_device(PCI_VENDOR_ID_AL, 0x7101, NULL);
pdev = pci_get_device(PCI_VENDOR_ID_AL, 0x7101, NULL);
if(pdev == NULL)
return -ENODEV;

if(pci_enable_device(pdev))
if(pci_enable_device(pdev)) {
pci_dev_put(pdev);
return -EIO;
}

ali_pci = pdev;

Expand Down Expand Up @@ -447,6 +450,7 @@ static void __exit watchdog_exit(void)
/* Deregister */
unregister_reboot_notifier(&ali_notifier);
misc_deregister(&ali_miscdev);
pci_dev_put(ali_pci);
}

module_init(watchdog_init);
Expand Down
17 changes: 11 additions & 6 deletions drivers/char/watchdog/alim7101_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ static int fop_ioctl(struct inode *inode, struct file *file, unsigned int cmd, u
case WDIOC_GETTIMEOUT:
return put_user(timeout, p);
default:
return -ENOIOCTLCMD;
return -ENOTTY;
}
}

Expand Down Expand Up @@ -333,6 +333,7 @@ static void __exit alim7101_wdt_unload(void)
/* Deregister */
misc_deregister(&wdt_miscdev);
unregister_reboot_notifier(&wdt_notifier);
pci_dev_put(alim7101_pmu);
}

static int __init alim7101_wdt_init(void)
Expand All @@ -342,7 +343,8 @@ static int __init alim7101_wdt_init(void)
char tmp;

printk(KERN_INFO PFX "Steve Hill <[email protected]>.\n");
alim7101_pmu = pci_find_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M7101,NULL);
alim7101_pmu = pci_get_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M7101,
NULL);
if (!alim7101_pmu) {
printk(KERN_INFO PFX "ALi M7101 PMU not present - WDT not set\n");
return -EBUSY;
Expand All @@ -351,21 +353,23 @@ static int __init alim7101_wdt_init(void)
/* Set the WDT in the PMU to 1 second */
pci_write_config_byte(alim7101_pmu, ALI_7101_WDT, 0x02);

ali1543_south = pci_find_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1533, NULL);
ali1543_south = pci_get_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1533,
NULL);
if (!ali1543_south) {
printk(KERN_INFO PFX "ALi 1543 South-Bridge not present - WDT not set\n");
return -EBUSY;
goto err_out;
}
pci_read_config_byte(ali1543_south, 0x5e, &tmp);
pci_dev_put(ali1543_south);
if ((tmp & 0x1e) == 0x00) {
if (!use_gpio) {
printk(KERN_INFO PFX "Detected old alim7101 revision 'a1d'. If this is a cobalt board, set the 'use_gpio' module parameter.\n");
return -EBUSY;
goto err_out;
}
nowayout = 1;
} else if ((tmp & 0x1e) != 0x12 && (tmp & 0x1e) != 0x00) {
printk(KERN_INFO PFX "ALi 1543 South-Bridge does not have the correct revision number (???1001?) - WDT not set\n");
return -EBUSY;
goto err_out;
}

if(timeout < 1 || timeout > 3600) /* arbitrary upper limit */
Expand Down Expand Up @@ -404,6 +408,7 @@ static int __init alim7101_wdt_init(void)
err_out_miscdev:
misc_deregister(&wdt_miscdev);
err_out:
pci_dev_put(alim7101_pmu);
return rc;
}

Expand Down
2 changes: 1 addition & 1 deletion drivers/char/watchdog/at91_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ static int at91_wdt_ioctl(struct inode *inode, struct file *file,
return 0;

default:
return -ENOIOCTLCMD;
return -ENOTTY;
}
}

Expand Down
2 changes: 1 addition & 1 deletion drivers/char/watchdog/booke_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ static int booke_wdt_ioctl (struct inode *inode, struct file *file,
return -EINVAL;
return 0;
default:
return -ENOIOCTLCMD;
return -ENOTTY;
}

return 0;
Expand Down
2 changes: 1 addition & 1 deletion drivers/char/watchdog/cpu5wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ static int cpu5wdt_ioctl(struct inode *inode, struct file *file, unsigned int cm
}
break;
default:
return -ENOIOCTLCMD;
return -ENOTTY;
}
return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/char/watchdog/ep93xx_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ static int
ep93xx_wdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
unsigned long arg)
{
int ret = -ENOIOCTLCMD;
int ret = -ENOTTY;

switch (cmd) {
case WDIOC_GETSUPPORT:
Expand Down
2 changes: 1 addition & 1 deletion drivers/char/watchdog/eurotechwdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ static int eurwdt_ioctl(struct inode *inode, struct file *file,

switch(cmd) {
default:
return -ENOIOCTLCMD;
return -ENOTTY;

case WDIOC_GETSUPPORT:
return copy_to_user(argp, &ident, sizeof(ident)) ? -EFAULT : 0;
Expand Down
2 changes: 1 addition & 1 deletion drivers/char/watchdog/i6300esb.c
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ static int esb_ioctl (struct inode *inode, struct file *file,
return put_user(heartbeat, p);

default:
return -ENOIOCTLCMD;
return -ENOTTY;
}
}

Expand Down
35 changes: 20 additions & 15 deletions drivers/char/watchdog/i8xx_tco.c
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ static int i8xx_tco_ioctl (struct inode *inode, struct file *file,
}

default:
return -ENOIOCTLCMD;
return -ENOTTY;
}
}

Expand Down Expand Up @@ -406,18 +406,18 @@ static struct notifier_block i8xx_tco_notifier = {
* want to register another driver on the same PCI id.
*/
static struct pci_device_id i8xx_tco_pci_tbl[] = {
{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801AA_0, PCI_ANY_ID, PCI_ANY_ID, },
{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801AB_0, PCI_ANY_ID, PCI_ANY_ID, },
{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801BA_0, PCI_ANY_ID, PCI_ANY_ID, },
{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801BA_10, PCI_ANY_ID, PCI_ANY_ID, },
{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801CA_0, PCI_ANY_ID, PCI_ANY_ID, },
{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801CA_12, PCI_ANY_ID, PCI_ANY_ID, },
{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801DB_0, PCI_ANY_ID, PCI_ANY_ID, },
{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801DB_12, PCI_ANY_ID, PCI_ANY_ID, },
{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801E_0, PCI_ANY_ID, PCI_ANY_ID, },
{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801EB_0, PCI_ANY_ID, PCI_ANY_ID, },
{ PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ESB_1, PCI_ANY_ID, PCI_ANY_ID, },
{ 0, }, /* End of list */
{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801AA_0) },
{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801AB_0) },
{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801BA_0) },
{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801BA_10) },
{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801CA_0) },
{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801CA_12) },
{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801DB_0) },
{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801DB_12) },
{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801E_0) },
{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82801EB_0) },
{ PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ESB_1) },
{ }, /* End of list */
};
MODULE_DEVICE_TABLE (pci, i8xx_tco_pci_tbl);

Expand All @@ -434,12 +434,11 @@ static unsigned char __init i8xx_tco_getdevice (void)
* Find the PCI device
*/

while ((dev = pci_find_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
for_each_pci_dev(dev)
if (pci_match_id(i8xx_tco_pci_tbl, dev)) {
i8xx_tco_pci = dev;
break;
}
}

if (i8xx_tco_pci) {
/*
Expand All @@ -454,6 +453,7 @@ static unsigned char __init i8xx_tco_getdevice (void)
/* Something's wrong here, ACPIBASE has to be set */
if (badr == 0x0001 || badr == 0x0000) {
printk (KERN_ERR PFX "failed to get TCOBASE address\n");
pci_dev_put(i8xx_tco_pci);
return 0;
}

Expand All @@ -465,6 +465,7 @@ static unsigned char __init i8xx_tco_getdevice (void)
pci_read_config_byte (i8xx_tco_pci, 0xd4, &val1);
if (val1 & 0x02) {
printk (KERN_ERR PFX "failed to reset NO_REBOOT flag, reboot disabled by hardware\n");
pci_dev_put(i8xx_tco_pci);
return 0; /* Cannot reset NO_REBOOT bit */
}
}
Expand All @@ -476,6 +477,7 @@ static unsigned char __init i8xx_tco_getdevice (void)
if (!request_region (SMI_EN + 1, 1, "i8xx TCO")) {
printk (KERN_ERR PFX "I/O address 0x%04x already in use\n",
SMI_EN + 1);
pci_dev_put(i8xx_tco_pci);
return 0;
}
val1 = inb (SMI_EN + 1);
Expand Down Expand Up @@ -542,6 +544,7 @@ static int __init watchdog_init (void)
unreg_region:
release_region (TCOBASE, 0x10);
out:
pci_dev_put(i8xx_tco_pci);
return ret;
}

Expand All @@ -555,6 +558,8 @@ static void __exit watchdog_cleanup (void)
misc_deregister (&i8xx_tco_miscdev);
unregister_reboot_notifier(&i8xx_tco_notifier);
release_region (TCOBASE, 0x10);

pci_dev_put(i8xx_tco_pci);
}

module_init(watchdog_init);
Expand Down
2 changes: 1 addition & 1 deletion drivers/char/watchdog/ib700wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ ibwdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
break;

default:
return -ENOIOCTLCMD;
return -ENOTTY;
}
return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/char/watchdog/ibmasr.c
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ static int asr_ioctl(struct inode *inode, struct file *file,
}
}

return -ENOIOCTLCMD;
return -ENOTTY;
}

static int asr_open(struct inode *inode, struct file *file)
Expand Down
2 changes: 1 addition & 1 deletion drivers/char/watchdog/indydog.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ static int indydog_ioctl(struct inode *inode, struct file *file,

switch (cmd) {
default:
return -ENOIOCTLCMD;
return -ENOTTY;
case WDIOC_GETSUPPORT:
if (copy_to_user((struct watchdog_info *)arg,
&ident, sizeof(ident)))
Expand Down
2 changes: 1 addition & 1 deletion drivers/char/watchdog/ixp2000_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ static int
ixp2000_wdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
unsigned long arg)
{
int ret = -ENOIOCTLCMD;
int ret = -ENOTTY;
int time;

switch (cmd) {
Expand Down
2 changes: 1 addition & 1 deletion drivers/char/watchdog/ixp4xx_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ static int
ixp4xx_wdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
unsigned long arg)
{
int ret = -ENOIOCTLCMD;
int ret = -ENOTTY;
int time;

switch (cmd) {
Expand Down
5 changes: 2 additions & 3 deletions drivers/char/watchdog/machzwd.c
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ static int zf_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
break;

default:
return -ENOIOCTLCMD;
return -ENOTTY;
}

return 0;
Expand Down Expand Up @@ -426,8 +426,7 @@ static int __init zf_init(void)
printk(KERN_INFO PFX ": MachZ ZF-Logic Watchdog driver initializing.\n");

ret = zf_get_ZFL_version();
printk("%#x\n", ret);
if((!ret) || (ret != 0xffff)){
if ((!ret) || (ret == 0xffff)) {
printk(KERN_WARNING PFX ": no ZF-Logic found\n");
return -ENODEV;
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/char/watchdog/mixcomwd.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ static int mixcomwd_ioctl(struct inode *inode, struct file *file,
mixcomwd_ping();
break;
default:
return -ENOIOCTLCMD;
return -ENOTTY;
}
return 0;
}
Expand Down
Loading

0 comments on commit b65d04a

Please sign in to comment.