Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ee7cbabb authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* git://git.kernel.org/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog:
  [WATCHDOG] removed unused #include <version.h>
  [WATCHDOG] at91rm9200_wdt.c: fix misleading indentation
  [WATCHDOG] mpc8xxx_wdt: fix modular build
  [WATCHDOG] hpwdt.c kdebug support
  [WATCHDOG] Add support for the IDT RC32434 watchdog
  [WATCHDOG] Add support for the built-int RDC R-321x SoC watchdog
  [WATHDOG] delete unused driver mpc8xx_wdt.c
  [WATCHDOG] Fix s3c2410_wdt driver coding style issues
  [WATCHDOG] Clean out header of s3c2410_wdt driver.
  [WATCHDOG] Fix NULL usage in s3c2410_wdt driver.
parents a152db71 3ccd3ec6
Loading
Loading
Loading
Loading
+20 −4
Original line number Diff line number Diff line
@@ -465,6 +465,16 @@ config PC87413_WDT

	  Most people will say N.

config RDC321X_WDT
	tristate "RDC R-321x SoC watchdog"
	depends on X86_RDC321X
	help
	  This is the driver for the built in hardware watchdog
	  in the RDC R-321x SoC.

	  To compile this driver as a module, choose M here: the
	  module will be called rdc321x_wdt.

config 60XX_WDT
	tristate "SBC-60XX Watchdog Timer"
	depends on X86
@@ -633,6 +643,16 @@ config SBC_EPX_C3_WATCHDOG

# MIPS Architecture

config RC32434_WDT
	tristate "IDT RC32434 SoC Watchdog Timer"
	depends on MIKROTIK_RB532
	help
	  Hardware driver for the IDT RC32434 SoC built-in
	  watchdog timer.

	  To compile this driver as a module, choose M here: the
	  module will be called rc32434_wdt.

config INDYDOG
	tristate "Indy/I2 Hardware Watchdog"
	depends on SGI_HAS_INDYDOG
@@ -692,10 +712,6 @@ config MPC5200_WDT
	tristate "MPC5200 Watchdog Timer"
	depends on PPC_MPC52xx

config 8xx_WDT
	tristate "MPC8xx Watchdog Timer"
	depends on 8xx

config 8xxx_WDT
	tristate "MPC8xxx Platform Watchdog Timer"
	depends on PPC_8xx || PPC_83xx || PPC_86xx
+2 −1
Original line number Diff line number Diff line
@@ -75,6 +75,7 @@ obj-$(CONFIG_HP_WATCHDOG) += hpwdt.o
obj-$(CONFIG_SC1200_WDT) += sc1200wdt.o
obj-$(CONFIG_SCx200_WDT) += scx200_wdt.o
obj-$(CONFIG_PC87413_WDT) += pc87413_wdt.o
obj-$(CONFIG_RDC321X_WDT) += rdc321x_wdt.o
obj-$(CONFIG_60XX_WDT) += sbc60xxwdt.o
obj-$(CONFIG_SBC8360_WDT) += sbc8360.o
obj-$(CONFIG_SBC7240_WDT) += sbc7240_wdt.o
@@ -94,6 +95,7 @@ obj-$(CONFIG_SBC_EPX_C3_WATCHDOG) += sbc_epx_c3.o
# M68KNOMMU Architecture

# MIPS Architecture
obj-$(CONFIG_RC32434_WDT) += rc32434_wdt.o
obj-$(CONFIG_INDYDOG) += indydog.o
obj-$(CONFIG_WDT_MTX1) += mtx-1_wdt.o
obj-$(CONFIG_WDT_RM9K_GPI) += rm9k_wdt.o
@@ -104,7 +106,6 @@ obj-$(CONFIG_TXX9_WDT) += txx9wdt.o
# PARISC Architecture

# POWERPC Architecture
obj-$(CONFIG_8xx_WDT) += mpc8xx_wdt.o
obj-$(CONFIG_MPC5200_WDT) += mpc5200_wdt.o
obj-$(CONFIG_8xxx_WDT) += mpc8xxx_wdt.o
obj-$(CONFIG_MV64X60_WDT) += mv64x60_wdt.o
+50 −43
Original line number Diff line number Diff line
@@ -116,6 +116,7 @@ static unsigned int reload; /* the computed soft_margin */
static int nowayout = WATCHDOG_NOWAYOUT;
static char expect_release;
static unsigned long hpwdt_is_open;
static unsigned int allow_kdump;

static void __iomem *pci_mem_addr;		/* the PCI-memory address */
static unsigned long __iomem *hpwdt_timer_reg;
@@ -356,7 +357,6 @@ asm(".text \n\t"
    "call       *%r12           \n\t"
    "pushfq                     \n\t"
    "popq        %r12           \n\t"
    "popfq                      \n\t"
    "movl       %eax, (%r9)     \n\t"
    "movl       %ebx, 4(%r9)    \n\t"
    "movl       %ecx, 8(%r9)    \n\t"
@@ -412,34 +412,6 @@ static int __devinit detect_cru_service(void)

#endif

/*
 *	NMI Handler
 */
static int hpwdt_pretimeout(struct notifier_block *nb, unsigned long ulReason,
			    void *data)
{
	unsigned long rom_pl;
	static int die_nmi_called;

	if (ulReason != DIE_NMI && ulReason != DIE_NMI_IPI)
		return NOTIFY_OK;

	spin_lock_irqsave(&rom_lock, rom_pl);
	if (!die_nmi_called)
		asminline_call(&cmn_regs, cru_rom_addr);
	die_nmi_called = 1;
	spin_unlock_irqrestore(&rom_lock, rom_pl);
	if (cmn_regs.u1.ral == 0) {
		printk(KERN_WARNING "hpwdt: An NMI occurred, "
		       "but unable to determine source.\n");
	} else {
		panic("An NMI occurred, please see the Integrated "
			"Management Log for details.\n");
	}

	return NOTIFY_STOP;
}

/*
 *	Watchdog operations
 */
@@ -483,6 +455,36 @@ static int hpwdt_change_timer(int new_margin)
	return 0;
}

/*
 *	NMI Handler
 */
static int hpwdt_pretimeout(struct notifier_block *nb, unsigned long ulReason,
				void *data)
{
	unsigned long rom_pl;
	static int die_nmi_called;

	if (ulReason != DIE_NMI && ulReason != DIE_NMI_IPI)
		return NOTIFY_OK;

	spin_lock_irqsave(&rom_lock, rom_pl);
	if (!die_nmi_called)
		asminline_call(&cmn_regs, cru_rom_addr);
	die_nmi_called = 1;
	spin_unlock_irqrestore(&rom_lock, rom_pl);
	if (cmn_regs.u1.ral == 0) {
		printk(KERN_WARNING "hpwdt: An NMI occurred, "
			"but unable to determine source.\n");
	} else {
		if (allow_kdump)
			hpwdt_stop();
		panic("An NMI occurred, please see the Integrated "
			"Management Log for details.\n");
	}

	return NOTIFY_STOP;
}

/*
 *	/dev/watchdog handling
 */
@@ -632,6 +634,7 @@ static int __devinit hpwdt_init_one(struct pci_dev *dev,
	/*
	 * First let's find out if we are on an iLO2 server. We will
	 * not run on a legacy ASM box.
	 * So we only support the G5 ProLiant servers and higher.
	 */
	if (dev->subsystem_vendor != PCI_VENDOR_ID_HP) {
		dev_warn(&dev->dev,
@@ -699,8 +702,9 @@ static int __devinit hpwdt_init_one(struct pci_dev *dev,

	printk(KERN_INFO
		"hp Watchdog Timer Driver: 1.00"
		", timer margin: %d seconds( nowayout=%d).\n",
		soft_margin, nowayout);
		", timer margin: %d seconds (nowayout=%d)"
		", allow kernel dump: %s (default = 0/OFF).\n",
		soft_margin, nowayout, (allow_kdump == 0) ? "OFF" : "ON");

	return 0;

@@ -755,6 +759,9 @@ MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
module_param(soft_margin, int, 0);
MODULE_PARM_DESC(soft_margin, "Watchdog timeout in seconds");

module_param(allow_kdump, int, 0);
MODULE_PARM_DESC(allow_kdump, "Start a kernel dump after NMI occurs");

module_param(nowayout, int, 0);
MODULE_PARM_DESC(nowayout, "Watchdog cannot be stopped once started (default="
		__MODULE_STRING(WATCHDOG_NOWAYOUT) ")");

drivers/watchdog/mpc8xx_wdt.c

deleted100644 → 0
+0 −170
Original line number Diff line number Diff line
/*
 * mpc8xx_wdt.c - MPC8xx watchdog userspace interface
 *
 * Author: Florian Schirmer <jolt@tuxbox.org>
 *
 * 2002 (c) Florian Schirmer <jolt@tuxbox.org> This file is licensed under
 * the terms of the GNU General Public License version 2. This program
 * is licensed "as is" without any warranty of any kind, whether express
 * or implied.
 */

#include <linux/fs.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/miscdevice.h>
#include <linux/module.h>
#include <linux/watchdog.h>
#include <asm/8xx_immap.h>
#include <linux/uaccess.h>
#include <linux/io.h>
#include <syslib/m8xx_wdt.h>

static unsigned long wdt_opened;
static int wdt_status;
static spinlock_t wdt_lock;

static void mpc8xx_wdt_handler_disable(void)
{
	volatile uint __iomem *piscr;
	piscr = (uint *)&((immap_t *)IMAP_ADDR)->im_sit.sit_piscr;

	if (!m8xx_has_internal_rtc)
		m8xx_wdt_stop_timer();
	else
		out_be32(piscr, in_be32(piscr) & ~(PISCR_PIE | PISCR_PTE));
	printk(KERN_NOTICE "mpc8xx_wdt: keep-alive handler deactivated\n");
}

static void mpc8xx_wdt_handler_enable(void)
{
	volatile uint __iomem *piscr;
	piscr = (uint *)&((immap_t *)IMAP_ADDR)->im_sit.sit_piscr;

	if (!m8xx_has_internal_rtc)
		m8xx_wdt_install_timer();
	else
		out_be32(piscr, in_be32(piscr) | PISCR_PIE | PISCR_PTE);
	printk(KERN_NOTICE "mpc8xx_wdt: keep-alive handler activated\n");
}

static int mpc8xx_wdt_open(struct inode *inode, struct file *file)
{
	if (test_and_set_bit(0, &wdt_opened))
		return -EBUSY;
	m8xx_wdt_reset();
	mpc8xx_wdt_handler_disable();
	return nonseekable_open(inode, file);
}

static int mpc8xx_wdt_release(struct inode *inode, struct file *file)
{
	m8xx_wdt_reset();
#if !defined(CONFIG_WATCHDOG_NOWAYOUT)
	mpc8xx_wdt_handler_enable();
#endif
	clear_bit(0, &wdt_opened);
	return 0;
}

static ssize_t mpc8xx_wdt_write(struct file *file, const char *data,
						size_t len, loff_t *ppos)
{
	if (len) {
		spin_lock(&wdt_lock);
		m8xx_wdt_reset();
		spin_unlock(&wdt_lock);
	}
	return len;
}

static long mpc8xx_wdt_ioctl(struct file *file,
					unsigned int cmd, unsigned long arg)
{
	int timeout;
	static struct watchdog_info info = {
		.options = WDIOF_KEEPALIVEPING,
		.firmware_version = 0,
		.identity = "MPC8xx watchdog",
	};

	switch (cmd) {
	case WDIOC_GETSUPPORT:
		if (copy_to_user((void *)arg, &info, sizeof(info)))
			return -EFAULT;
		break;

	case WDIOC_GETSTATUS:
	case WDIOC_GETBOOTSTATUS:
		if (put_user(wdt_status, (int *)arg))
			return -EFAULT;
		wdt_status &= ~WDIOF_KEEPALIVEPING;
		break;

	case WDIOC_GETTEMP:
		return -EOPNOTSUPP;

	case WDIOC_SETOPTIONS:
		return -EOPNOTSUPP;

	case WDIOC_KEEPALIVE:
		spin_lock(&wdt_lock);
		m8xx_wdt_reset();
		wdt_status |= WDIOF_KEEPALIVEPING;
		spin_unlock(&wdt_lock);
		break;

	case WDIOC_SETTIMEOUT:
		return -EOPNOTSUPP;

	case WDIOC_GETTIMEOUT:
		spin_lock(&wdt_lock);
		timeout = m8xx_wdt_get_timeout();
		spin_unlock(&wdt_lock);
		if (put_user(timeout, (int *)arg))
			return -EFAULT;
		break;

	default:
		return -ENOTTY;
	}

	return 0;
}

static const struct file_operations mpc8xx_wdt_fops = {
	.owner = THIS_MODULE,
	.llseek = no_llseek,
	.write = mpc8xx_wdt_write,
	.unlocked_ioctl = mpc8xx_wdt_ioctl,
	.open = mpc8xx_wdt_open,
	.release = mpc8xx_wdt_release,
};

static struct miscdevice mpc8xx_wdt_miscdev = {
	.minor = WATCHDOG_MINOR,
	.name = "watchdog",
	.fops = &mpc8xx_wdt_fops,
};

static int __init mpc8xx_wdt_init(void)
{
	spin_lock_init(&wdt_lock);
	return misc_register(&mpc8xx_wdt_miscdev);
}

static void __exit mpc8xx_wdt_exit(void)
{
	misc_deregister(&mpc8xx_wdt_miscdev);

	m8xx_wdt_reset();
	mpc8xx_wdt_handler_enable();
}

module_init(mpc8xx_wdt_init);
module_exit(mpc8xx_wdt_exit);

MODULE_AUTHOR("Florian Schirmer <jolt@tuxbox.org>");
MODULE_DESCRIPTION("MPC8xx watchdog driver");
MODULE_LICENSE("GPL");
MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
+10 −1
Original line number Diff line number Diff line
@@ -48,6 +48,7 @@ struct mpc8xxx_wdt_type {
};

static struct mpc8xxx_wdt __iomem *wd_base;
static int mpc8xxx_wdt_init_late(void);

static u16 timeout = 0xffff;
module_param(timeout, ushort, 0);
@@ -213,6 +214,12 @@ static int __devinit mpc8xxx_wdt_probe(struct of_device *ofdev,
	else
		timeout_sec = timeout / freq;

#ifdef MODULE
	ret = mpc8xxx_wdt_init_late();
	if (ret)
		goto err_unmap;
#endif

	pr_info("WDT driver for MPC8xxx initialized. mode:%s timeout=%d "
		"(%d seconds)\n", reset ? "reset" : "interrupt", timeout,
		timeout_sec);
@@ -280,7 +287,7 @@ static struct of_platform_driver mpc8xxx_wdt_driver = {
 * very early to start pinging the watchdog (misc devices are not yet
 * available), and later module_init() just registers the misc device.
 */
static int __init mpc8xxx_wdt_init_late(void)
static int mpc8xxx_wdt_init_late(void)
{
	int ret;

@@ -295,7 +302,9 @@ static int __init mpc8xxx_wdt_init_late(void)
	}
	return 0;
}
#ifndef MODULE
module_init(mpc8xxx_wdt_init_late);
#endif

static int __init mpc8xxx_wdt_init(void)
{
Loading