From: Anton Vorontsov <hidden> Date: 2008-06-02 17:38:22
Hi all,
No comments on the previous version for two weeks... resending once
again.
Changes since v3:
- None. Simply resending, plus adding Andrew Morton and linux-kernel
to Cc, since I'm constantly getting bounces from Wim Van Sebroeck's
email:
- - - -
[off-list ref]:
213.249.96.99 does not like recipient.
Remote host said: 450 Client host rejected: cannot find your hostname, [85.21.88.2]
Giving up on 213.249.96.99.
I'm not going to try again; this message has been in the queue too long.
- - - -
Not sure whose fault is it though.
Andrew, if Wim will not get this series and there will no objections,
could you please pick [WATCHDOG] ones?
Changes since v2:
- New patch to fix current driver's checkpatch issues;
- New patch supporting MPC8xx watchdogs;
- Removed MODULE_ALIAS("platform:mpc83xx_wdt"), since this driver is no
longer on the platform bus;
- When renaming the driver also mention what kind of CPUs we support.
Also give a pointer for BookE watchdog driver. Though BookE users will
not see the MPC8xxx driver at all, because we're explicitly listing the
CPU families in "depends on". But this tip might be useful for
developers.
- Scott Wood noticed that we don't need device_type anymore. I thought
that OpenFirmware defines this type, but google didn't prove that.
So I just removed the device_type.
Changes since v1:
- Scott Wood asked for mpc83xx_wdt on multiplatform kernels. Done via
OF platform driver;
- Kumar Gala asked for mpc83xx_wdt -> mpc8xxx_wdt rename. Done in two
steps;
- Segher Boessenkool noticed a negligence in the wdt device tree node.
Fixed by removing mpc83xx_wdt compatible entry.
--
Anton Vorontsov
email: cbouatmailru@gmail.com
irc://irc.freenode.net/bd2
From: Anton Vorontsov <hidden> Date: 2008-06-02 17:39:14
This patch simply converts mpc83xx_wdt to the OF platform driver so we
can directly work with the device tree without passing various stuff
through platform data.
Signed-off-by: Anton Vorontsov <redacted>
Acked-by: Stephen Rothwell <redacted>
---
drivers/watchdog/mpc83xx_wdt.c | 62 +++++++++++++++++++--------------------
1 files changed, 30 insertions(+), 32 deletions(-)
@@ -149,53 +150,42 @@ static struct miscdevice mpc83xx_wdt_miscdev = {.fops=&mpc83xx_wdt_fops,};-staticint__devinitmpc83xx_wdt_probe(structplatform_device*dev)+staticint__devinitmpc83xx_wdt_probe(structof_device*ofdev,+conststructof_device_id*match){-structresource*r;intret;-unsignedint*freq=dev->dev.platform_data;+u32freq=fsl_get_sys_freq();-/* get a pointer to the register memory */-r=platform_get_resource(dev,IORESOURCE_MEM,0);+if(!freq||freq==-1)+return-EINVAL;-if(!r){-ret=-ENODEV;-gotoerr_out;-}--wd_base=ioremap(r->start,sizeof(structmpc83xx_wdt));--if(wd_base==NULL){-ret=-ENOMEM;-gotoerr_out;-}+wd_base=of_iomap(ofdev->node,0);+if(!wd_base)+return-ENOMEM;ret=misc_register(&mpc83xx_wdt_miscdev);if(ret){-printk(KERN_ERR"cannot register miscdev on minor=%d "-"(err=%d)\n",-WATCHDOG_MINOR,ret);+pr_err("cannot register miscdev on minor=%d (err=%d)\n",+WATCHDOG_MINOR,ret);gotoerr_unmap;}/* Calculate the timeout in seconds */if(prescale)-timeout_sec=(timeout*0x10000)/(*freq);+timeout_sec=(timeout*0x10000)/freq;else-timeout_sec=timeout/(*freq);+timeout_sec=timeout/freq;-printk(KERN_INFO"WDT driver for MPC83xx initialized. "-"mode:%s timeout=%d (%d seconds)\n",-reset?"reset":"interrupt",timeout,timeout_sec);+pr_info("WDT driver for MPC83xx initialized. mode:%s timeout=%d "+"(%d seconds)\n",reset?"reset":"interrupt",timeout,+timeout_sec);return0;-err_unmap:iounmap(wd_base);-err_out:returnret;}-staticint__devexitmpc83xx_wdt_remove(structplatform_device*dev)+staticint__devexitmpc83xx_wdt_remove(structof_device*ofdev){misc_deregister(&mpc83xx_wdt_miscdev);iounmap(wd_base);
@@ -203,7 +193,16 @@ static int __devexit mpc83xx_wdt_remove(struct platform_device *dev)return0;}-staticstructplatform_drivermpc83xx_wdt_driver={+staticconststructof_device_idmpc83xx_wdt_match[]={+{+.compatible="mpc83xx_wdt",+},+{},+};+MODULE_DEVICE_TABLE(of,mpc83xx_wdt_match);++staticstructof_platform_drivermpc83xx_wdt_driver={+.match_table=mpc83xx_wdt_match,.probe=mpc83xx_wdt_probe,.remove=__devexit_p(mpc83xx_wdt_remove),.driver={
From: Anton Vorontsov <hidden> Date: 2008-06-02 17:39:33
On MPC86xx the watchdog could be enabled only at power-on-reset, and
could not be disabled afterwards. We must ping the watchdog from the
kernel until the userspace handles it.
MPC83xx CPUs are only differ in a way that watchdog could be disabled
once, but after it was enabled via software it becomes just the same
as MPC86xx.
Thus, to support MPC86xx I added the kernel timer which pings the
watchdog until the userspace opens it.
Since we implemented the timer, now we're able to implement proper
handling for the CONFIG_WATCHDOG_NOWAYOUT case, for MPC83xx and MPC86xx.
Also move the probe code into subsys_initcall, because we want start
pinging the watchdog ASAP, and misc devices are available in
subsys_initcall.
Signed-off-by: Anton Vorontsov <redacted>
---
drivers/watchdog/Kconfig | 4 +-
drivers/watchdog/mpc83xx_wdt.c | 80 ++++++++++++++++++++++++++++++++++++----
2 files changed, 74 insertions(+), 10 deletions(-)
@@ -51,6 +59,11 @@ module_param(reset, bool, 0);MODULE_PARM_DESC(reset,"Watchdog Interrupt/Reset Mode. ""0 = interrupt, 1 = reset");+staticintnowayout=WATCHDOG_NOWAYOUT;+module_param(nowayout,int,0);+MODULE_PARM_DESC(nowayout,"Watchdog cannot be stopped once started "+"(default="__MODULE_STRING(WATCHDOG_NOWAYOUT)")");+/**Wealwaysprescale,butifsomeonereallydoesn'twanttotheycansetthis*to0
@@ -70,6 +83,22 @@ static void mpc83xx_wdt_keepalive(void)spin_unlock(&wdt_spinlock);}+staticvoidmpc83xx_wdt_timer_ping(unsignedlongarg);+staticDEFINE_TIMER(wdt_timer,mpc83xx_wdt_timer_ping,0,0);++staticvoidmpc83xx_wdt_timer_ping(unsignedlongarg)+{+mpc83xx_wdt_keepalive();+/* We're pinging it twice faster than needed, just to be sure. */+mod_timer(&wdt_timer,jiffies+HZ*timeout_sec/2);+}++staticvoidmpc83xx_wdt_pr_warn(constchar*msg)+{+pr_crit("mpc83xx_wdt: %s, expect the %s soon!\n",msg,+reset?"reset":"machine check exception");+}+staticssize_tmpc83xx_wdt_write(structfile*file,constchar__user*buf,size_tcount,loff_t*ppos){
@@ -85,7 +114,8 @@ static int mpc83xx_wdt_open(struct inode *inode, struct file *file)return-EBUSY;/* Once we start the watchdog we can't stop it */-__module_get(THIS_MODULE);+if(nowayout)+__module_get(THIS_MODULE);/* Good, fire up the show */if(prescale)
@@ -97,13 +127,17 @@ static int mpc83xx_wdt_open(struct inode *inode, struct file *file)out_be32(&wd_base->swcrr,tmp);+del_timer_sync(&wdt_timer);+returnnonseekable_open(inode,file);}staticintmpc83xx_wdt_release(structinode*inode,structfile*file){-printk(KERN_CRIT"Unexpected close, not stopping watchdog!\n");-mpc83xx_wdt_keepalive();+if(!nowayout)+mpc83xx_wdt_timer_ping(0);+else+mpc83xx_wdt_pr_warn("watchdog closed");clear_bit(0,&wdt_is_open);return0;}
@@ -154,15 +188,25 @@ static int __devinit mpc83xx_wdt_probe(struct of_device *ofdev,conststructof_device_id*match){intret;+structdevice_node*np=ofdev->node;+structmpc83xx_wdt_type*wdt_type=match->data;u32freq=fsl_get_sys_freq();+boolenabled;if(!freq||freq==-1)return-EINVAL;-wd_base=of_iomap(ofdev->node,0);+wd_base=of_iomap(np,0);if(!wd_base)return-ENOMEM;+enabled=in_be32(&wd_base->swcrr)&SWCRR_SWEN;+if(!enabled&&wdt_type->hw_enabled){+pr_info("mpc83xx_wdt: could not be enabled in software\n");+ret=-ENOSYS;+gotoerr_unmap;+}+ret=misc_register(&mpc83xx_wdt_miscdev);if(ret){pr_err("cannot register miscdev on minor=%d (err=%d)\n",
@@ -172,13 +216,21 @@ static int __devinit mpc83xx_wdt_probe(struct of_device *ofdev,/* Calculate the timeout in seconds */if(prescale)-timeout_sec=(timeout*0x10000)/freq;+timeout_sec=(timeout*wdt_type->prescaler)/freq;elsetimeout_sec=timeout/freq;pr_info("WDT driver for MPC83xx initialized. mode:%s timeout=%d ""(%d seconds)\n",reset?"reset":"interrupt",timeout,timeout_sec);++/*+*Ifthewatchdogwaspreviouslyenabledorwe'rerunningon+*MPC86xx,weshouldpingthewdtfromthekerneluntilthe+*userspacehandlesit.+*/+if(enabled)+mpc83xx_wdt_timer_ping(0);return0;err_unmap:iounmap(wd_base);
From: Anton Vorontsov <hidden> Date: 2008-06-02 17:39:49
Rename the driver because now we support some MPC86xx processors.
There are no changes to the mpc83xx_wdt.c file, yet. When possible, we do
file renames and changes separately (because Linus once asked so, because
it helps git to track the renamed files).
Signed-off-by: Anton Vorontsov <redacted>
---
drivers/watchdog/Kconfig | 11 ++-
drivers/watchdog/Makefile | 2 +-
drivers/watchdog/mpc83xx_wdt.c | 294 ----------------------------------------
drivers/watchdog/mpc8xxx_wdt.c | 294 ++++++++++++++++++++++++++++++++++++++++
4 files changed, 304 insertions(+), 297 deletions(-)
delete mode 100644 drivers/watchdog/mpc83xx_wdt.c
create mode 100644 drivers/watchdog/mpc8xxx_wdt.c
@@ -0,0 +1,294 @@+/*+*mpc83xx_wdt.c-MPC83xx/MPC86xxwatchdoguserspaceinterface+*+*Authors:DaveUpdegraff<dave@cray.org>+*KumarGala<galak@kernel.crashing.org>+*Attribution:from83xx_wst:FlorianSchirmer<jolt@tuxbox.org>+*..andfromsc520_wdt+*Copyright(c)2008MontaVistaSoftware,Inc.+*AntonVorontsov<avorontsov@ru.mvista.com>+*+*Note:itappearsthatyoucanonlyactuallyENABLEorDISABLEthething+*onceafterPOR.Onceenabled,youcannotdisable,andviceversa.+*+*Thisprogramisfreesoftware;youcanredistributeitand/ormodifyit+*underthetermsoftheGNUGeneralPublicLicenseaspublishedbythe+*FreeSoftwareFoundation;eitherversion2oftheLicense,or(atyour+*option)anylaterversion.+*/++#include<linux/fs.h>+#include<linux/init.h>+#include<linux/kernel.h>+#include<linux/timer.h>+#include<linux/miscdevice.h>+#include<linux/of_platform.h>+#include<linux/module.h>+#include<linux/watchdog.h>+#include<linux/io.h>+#include<linux/uaccess.h>+#include<sysdev/fsl_soc.h>++structmpc83xx_wdt{+__be32res0;+__be32swcrr;/* System watchdog control register */+#define SWCRR_SWTC 0xFFFF0000 /* Software Watchdog Time Count. */+#define SWCRR_SWEN 0x00000004 /* Watchdog Enable bit. */+#define SWCRR_SWRI 0x00000002 /* Software Watchdog Reset/Interrupt Select bit.*/+#define SWCRR_SWPR 0x00000001 /* Software Watchdog Counter Prescale bit. */+__be32swcnr;/* System watchdog count register */+u8res1[2];+__be16swsrr;/* System watchdog service register */+u8res2[0xF0];+};++structmpc83xx_wdt_type{+intprescaler;+boolhw_enabled;+};++staticstructmpc83xx_wdt__iomem*wd_base;++staticu16timeout=0xffff;+module_param(timeout,ushort,0);+MODULE_PARM_DESC(timeout,"Watchdog timeout in ticks. "+"(0<timeout<65536, default=65535");++staticintreset=1;+module_param(reset,bool,0);+MODULE_PARM_DESC(reset,"Watchdog Interrupt/Reset Mode. "+"0 = interrupt, 1 = reset");++staticintnowayout=WATCHDOG_NOWAYOUT;+module_param(nowayout,int,0);+MODULE_PARM_DESC(nowayout,"Watchdog cannot be stopped once started "+"(default="__MODULE_STRING(WATCHDOG_NOWAYOUT)")");++/*+*Wealwaysprescale,butifsomeonereallydoesn'twanttotheycansetthis+*to0+*/+staticintprescale=1;+staticunsignedinttimeout_sec;++staticunsignedlongwdt_is_open;+staticDEFINE_SPINLOCK(wdt_spinlock);++staticvoidmpc83xx_wdt_keepalive(void)+{+/* Ping the WDT */+spin_lock(&wdt_spinlock);+out_be16(&wd_base->swsrr,0x556c);+out_be16(&wd_base->swsrr,0xaa39);+spin_unlock(&wdt_spinlock);+}++staticvoidmpc83xx_wdt_timer_ping(unsignedlongarg);+staticDEFINE_TIMER(wdt_timer,mpc83xx_wdt_timer_ping,0,0);++staticvoidmpc83xx_wdt_timer_ping(unsignedlongarg)+{+mpc83xx_wdt_keepalive();+/* We're pinging it twice faster than needed, just to be sure. */+mod_timer(&wdt_timer,jiffies+HZ*timeout_sec/2);+}++staticvoidmpc83xx_wdt_pr_warn(constchar*msg)+{+pr_crit("mpc83xx_wdt: %s, expect the %s soon!\n",msg,+reset?"reset":"machine check exception");+}++staticssize_tmpc83xx_wdt_write(structfile*file,constchar__user*buf,+size_tcount,loff_t*ppos)+{+if(count)+mpc83xx_wdt_keepalive();+returncount;+}++staticintmpc83xx_wdt_open(structinode*inode,structfile*file)+{+u32tmp=SWCRR_SWEN;+if(test_and_set_bit(0,&wdt_is_open))+return-EBUSY;++/* Once we start the watchdog we can't stop it */+if(nowayout)+__module_get(THIS_MODULE);++/* Good, fire up the show */+if(prescale)+tmp|=SWCRR_SWPR;+if(reset)+tmp|=SWCRR_SWRI;++tmp|=timeout<<16;++out_be32(&wd_base->swcrr,tmp);++del_timer_sync(&wdt_timer);++returnnonseekable_open(inode,file);+}++staticintmpc83xx_wdt_release(structinode*inode,structfile*file)+{+if(!nowayout)+mpc83xx_wdt_timer_ping(0);+else+mpc83xx_wdt_pr_warn("watchdog closed");+clear_bit(0,&wdt_is_open);+return0;+}++staticintmpc83xx_wdt_ioctl(structinode*inode,structfile*file,+unsignedintcmd,unsignedlongarg)+{+void__user*argp=(void__user*)arg;+int__user*p=argp;+staticstructwatchdog_infoident={+.options=WDIOF_KEEPALIVEPING,+.firmware_version=1,+.identity="MPC83xx",+};++switch(cmd){+caseWDIOC_GETSUPPORT:+returncopy_to_user(argp,&ident,sizeof(ident))?-EFAULT:0;+caseWDIOC_GETSTATUS:+caseWDIOC_GETBOOTSTATUS:+returnput_user(0,p);+caseWDIOC_KEEPALIVE:+mpc83xx_wdt_keepalive();+return0;+caseWDIOC_GETTIMEOUT:+returnput_user(timeout_sec,p);+default:+return-ENOTTY;+}+}++staticconststructfile_operationsmpc83xx_wdt_fops={+.owner=THIS_MODULE,+.llseek=no_llseek,+.write=mpc83xx_wdt_write,+.ioctl=mpc83xx_wdt_ioctl,+.open=mpc83xx_wdt_open,+.release=mpc83xx_wdt_release,+};++staticstructmiscdevicempc83xx_wdt_miscdev={+.minor=WATCHDOG_MINOR,+.name="watchdog",+.fops=&mpc83xx_wdt_fops,+};++staticint__devinitmpc83xx_wdt_probe(structof_device*ofdev,+conststructof_device_id*match)+{+intret;+structdevice_node*np=ofdev->node;+structmpc83xx_wdt_type*wdt_type=match->data;+u32freq=fsl_get_sys_freq();+boolenabled;++if(!freq||freq==-1)+return-EINVAL;++wd_base=of_iomap(np,0);+if(!wd_base)+return-ENOMEM;++enabled=in_be32(&wd_base->swcrr)&SWCRR_SWEN;+if(!enabled&&wdt_type->hw_enabled){+pr_info("mpc83xx_wdt: could not be enabled in software\n");+ret=-ENOSYS;+gotoerr_unmap;+}++ret=misc_register(&mpc83xx_wdt_miscdev);+if(ret){+pr_err("cannot register miscdev on minor=%d (err=%d)\n",+WATCHDOG_MINOR,ret);+gotoerr_unmap;+}++/* Calculate the timeout in seconds */+if(prescale)+timeout_sec=(timeout*wdt_type->prescaler)/freq;+else+timeout_sec=timeout/freq;++pr_info("WDT driver for MPC83xx initialized. mode:%s timeout=%d "+"(%d seconds)\n",reset?"reset":"interrupt",timeout,+timeout_sec);++/*+*Ifthewatchdogwaspreviouslyenabledorwe'rerunningon+*MPC86xx,weshouldpingthewdtfromthekerneluntilthe+*userspacehandlesit.+*/+if(enabled)+mpc83xx_wdt_timer_ping(0);+return0;+err_unmap:+iounmap(wd_base);+returnret;+}++staticint__devexitmpc83xx_wdt_remove(structof_device*ofdev)+{+mpc83xx_wdt_pr_warn("watchdog removed");+del_timer_sync(&wdt_timer);+misc_deregister(&mpc83xx_wdt_miscdev);+iounmap(wd_base);++return0;+}++staticconststructof_device_idmpc83xx_wdt_match[]={+{+.compatible="mpc83xx_wdt",+.data=&(structmpc83xx_wdt_type){+.prescaler=0x10000,+},+},+{+.compatible="fsl,mpc8610-wdt",+.data=&(structmpc83xx_wdt_type){+.prescaler=0x10000,+.hw_enabled=true,+},+},+{},+};+MODULE_DEVICE_TABLE(of,mpc83xx_wdt_match);++staticstructof_platform_drivermpc83xx_wdt_driver={+.match_table=mpc83xx_wdt_match,+.probe=mpc83xx_wdt_probe,+.remove=__devexit_p(mpc83xx_wdt_remove),+.driver={+.name="mpc83xx_wdt",+.owner=THIS_MODULE,+},+};++staticint__initmpc83xx_wdt_init(void)+{+returnof_register_platform_driver(&mpc83xx_wdt_driver);+}++staticvoid__exitmpc83xx_wdt_exit(void)+{+of_unregister_platform_driver(&mpc83xx_wdt_driver);+}++subsys_initcall(mpc83xx_wdt_init);+module_exit(mpc83xx_wdt_exit);++MODULE_AUTHOR("Dave Updegraff, Kumar Gala");+MODULE_DESCRIPTION("Driver for watchdog timer in MPC83xx/MPC86xx uProcessors");+MODULE_LICENSE("GPL");+MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
From: Anton Vorontsov <hidden> Date: 2008-06-02 17:40:14
mpc83xx_wdt.c renamed to mpc8xxx_wdt.c, now we can do various renames
in the file itself.
Signed-off-by: Anton Vorontsov <redacted>
---
drivers/watchdog/mpc8xxx_wdt.c | 104 ++++++++++++++++++++--------------------
1 files changed, 52 insertions(+), 52 deletions(-)
@@ -74,7 +74,7 @@ static unsigned int timeout_sec;staticunsignedlongwdt_is_open;staticDEFINE_SPINLOCK(wdt_spinlock);-staticvoidmpc83xx_wdt_keepalive(void)+staticvoidmpc8xxx_wdt_keepalive(void){/* Ping the WDT */spin_lock(&wdt_spinlock);
@@ -83,31 +83,31 @@ static void mpc83xx_wdt_keepalive(void)spin_unlock(&wdt_spinlock);}-staticvoidmpc83xx_wdt_timer_ping(unsignedlongarg);-staticDEFINE_TIMER(wdt_timer,mpc83xx_wdt_timer_ping,0,0);+staticvoidmpc8xxx_wdt_timer_ping(unsignedlongarg);+staticDEFINE_TIMER(wdt_timer,mpc8xxx_wdt_timer_ping,0,0);-staticvoidmpc83xx_wdt_timer_ping(unsignedlongarg)+staticvoidmpc8xxx_wdt_timer_ping(unsignedlongarg){-mpc83xx_wdt_keepalive();+mpc8xxx_wdt_keepalive();/* We're pinging it twice faster than needed, just to be sure. */mod_timer(&wdt_timer,jiffies+HZ*timeout_sec/2);}-staticvoidmpc83xx_wdt_pr_warn(constchar*msg)+staticvoidmpc8xxx_wdt_pr_warn(constchar*msg){-pr_crit("mpc83xx_wdt: %s, expect the %s soon!\n",msg,+pr_crit("mpc8xxx_wdt: %s, expect the %s soon!\n",msg,reset?"reset":"machine check exception");}-staticssize_tmpc83xx_wdt_write(structfile*file,constchar__user*buf,+staticssize_tmpc8xxx_wdt_write(structfile*file,constchar__user*buf,size_tcount,loff_t*ppos){if(count)-mpc83xx_wdt_keepalive();+mpc8xxx_wdt_keepalive();returncount;}-staticintmpc83xx_wdt_open(structinode*inode,structfile*file)+staticintmpc8xxx_wdt_open(structinode*inode,structfile*file){u32tmp=SWCRR_SWEN;if(test_and_set_bit(0,&wdt_is_open))
@@ -202,12 +202,12 @@ static int __devinit mpc83xx_wdt_probe(struct of_device *ofdev,enabled=in_be32(&wd_base->swcrr)&SWCRR_SWEN;if(!enabled&&wdt_type->hw_enabled){-pr_info("mpc83xx_wdt: could not be enabled in software\n");+pr_info("mpc8xxx_wdt: could not be enabled in software\n");ret=-ENOSYS;gotoerr_unmap;}-ret=misc_register(&mpc83xx_wdt_miscdev);+ret=misc_register(&mpc8xxx_wdt_miscdev);if(ret){pr_err("cannot register miscdev on minor=%d (err=%d)\n",WATCHDOG_MINOR,ret);
@@ -220,73 +220,73 @@ static int __devinit mpc83xx_wdt_probe(struct of_device *ofdev,elsetimeout_sec=timeout/freq;-pr_info("WDT driver for MPC83xx initialized. mode:%s timeout=%d "+pr_info("WDT driver for MPC8xxx initialized. mode:%s timeout=%d ""(%d seconds)\n",reset?"reset":"interrupt",timeout,timeout_sec);/**Ifthewatchdogwaspreviouslyenabledorwe'rerunningon-*MPC86xx,weshouldpingthewdtfromthekerneluntilthe+*MPC8xxx,weshouldpingthewdtfromthekerneluntilthe*userspacehandlesit.*/if(enabled)-mpc83xx_wdt_timer_ping(0);+mpc8xxx_wdt_timer_ping(0);return0;err_unmap:iounmap(wd_base);returnret;}-staticint__devexitmpc83xx_wdt_remove(structof_device*ofdev)+staticint__devexitmpc8xxx_wdt_remove(structof_device*ofdev){-mpc83xx_wdt_pr_warn("watchdog removed");+mpc8xxx_wdt_pr_warn("watchdog removed");del_timer_sync(&wdt_timer);-misc_deregister(&mpc83xx_wdt_miscdev);+misc_deregister(&mpc8xxx_wdt_miscdev);iounmap(wd_base);return0;}-staticconststructof_device_idmpc83xx_wdt_match[]={+staticconststructof_device_idmpc8xxx_wdt_match[]={{.compatible="mpc83xx_wdt",-.data=&(structmpc83xx_wdt_type){+.data=&(structmpc8xxx_wdt_type){.prescaler=0x10000,},},{.compatible="fsl,mpc8610-wdt",-.data=&(structmpc83xx_wdt_type){+.data=&(structmpc8xxx_wdt_type){.prescaler=0x10000,.hw_enabled=true,},},{},};-MODULE_DEVICE_TABLE(of,mpc83xx_wdt_match);+MODULE_DEVICE_TABLE(of,mpc8xxx_wdt_match);-staticstructof_platform_drivermpc83xx_wdt_driver={-.match_table=mpc83xx_wdt_match,-.probe=mpc83xx_wdt_probe,-.remove=__devexit_p(mpc83xx_wdt_remove),+staticstructof_platform_drivermpc8xxx_wdt_driver={+.match_table=mpc8xxx_wdt_match,+.probe=mpc8xxx_wdt_probe,+.remove=__devexit_p(mpc8xxx_wdt_remove),.driver={-.name="mpc83xx_wdt",+.name="mpc8xxx_wdt",.owner=THIS_MODULE,},};-staticint__initmpc83xx_wdt_init(void)+staticint__initmpc8xxx_wdt_init(void){-returnof_register_platform_driver(&mpc83xx_wdt_driver);+returnof_register_platform_driver(&mpc8xxx_wdt_driver);}-staticvoid__exitmpc83xx_wdt_exit(void)+staticvoid__exitmpc8xxx_wdt_exit(void){-of_unregister_platform_driver(&mpc83xx_wdt_driver);+of_unregister_platform_driver(&mpc8xxx_wdt_driver);}-subsys_initcall(mpc83xx_wdt_init);-module_exit(mpc83xx_wdt_exit);+subsys_initcall(mpc8xxx_wdt_init);+module_exit(mpc8xxx_wdt_exit);MODULE_AUTHOR("Dave Updegraff, Kumar Gala");MODULE_DESCRIPTION("Driver for watchdog timer in MPC83xx/MPC86xx uProcessors");
From: Anton Vorontsov <hidden> Date: 2008-06-02 17:40:39
The mpc8xxx_wdt driver is using two registers: SWSRR to push magic
numbers, and SWCRR to control the watchdog. Both registers are available
on the MPC8xx, and seem to have the same offsets and semantics as in
MPC83xx/MPC86xx watchdogs. The only difference is prescale value. So this
driver simply works on the MPC8xx CPUs.
One quirk is needed for the MPC8xx, though. It has small prescale value
and slow CPU, so the watchdog resets board prior to the driver has time
to load. To solve this we should split initialization in two steps: start
ping the watchdog early, and register the watchdog userspace interface
later.
MPC823 seem to be the first CPU in MPC8xx line, so we use fsl,mpc823-wdt
compatible matching.
Signed-off-by: Anton Vorontsov <redacted>
Tested-by: Jochen Friedrich <jochen@scram.de>
---
drivers/watchdog/Kconfig | 3 +-
drivers/watchdog/mpc8xxx_wdt.c | 44 ++++++++++++++++++++++++++++++----------
2 files changed, 35 insertions(+), 12 deletions(-)
From: Anton Vorontsov <hidden> Date: 2008-06-02 17:40:55
mpc83xx_wdt is the OF driver now, so we don't need fsl_soc constructor.
Signed-off-by: Anton Vorontsov <redacted>
---
arch/powerpc/sysdev/fsl_soc.c | 46 -----------------------------------------
1 files changed, 0 insertions(+), 46 deletions(-)
From: Anton Vorontsov <hidden> Date: 2008-06-02 20:50:02
On Mon, Jun 02, 2008 at 08:43:18PM +0100, Alan Cox wrote:
On Mon, 2 Jun 2008 21:38:36 +0400
Anton Vorontsov [off-list ref] wrote:
quoted
Quite tired of these warnings ;-), checkpatch spitting them when
seeing the rename patch.
I've already sent the maintainer a complete overhaul of watchdog via
checkpatch.
Oh, I see it now, thanks. I've just read Wim's comments there, and I
think I'll have to wait for git-watchdog update and then will rebase my
work on top.
Thanks,
--
Anton Vorontsov
email: cbouatmailru@gmail.com
irc://irc.freenode.net/bd2
From: Andrew Morton <akpm@linux-foundation.org> Date: 2008-06-03 23:51:17
On Mon, 2 Jun 2008 21:37:26 +0400
Anton Vorontsov [off-list ref] wrote:
No comments on the previous version for two weeks... resending once
again.
I did all the rework to make the patches apply on top of all the
pending watchdog work in Wim's tree and in -mm. I haven't build tested
it yet.
I'll assume that
[PATCH 7/8] [POWERPC] fsl_soc: remove mpc83xx_wdt code
and
[PATCH 8/8] [POWERPC] 86xx: mpc8610_hpcd: add watchdog node
are dependent upon the preceding six patches. This might be wrong.
Please put the subsystem identifier (eg, "watchdog" and "powerpc")
outside the [], for reasons which should be in
Documentation/SubmittingPatches, which used to be there but which got
lost. Bascially the text inside [] is for temporary not-for-committing
information such as "rfc", "2.6.24-rc4", "resend", etc and should be stripped
by the email recipient before merging.
From: Anton Vorontsov <hidden> Date: 2008-06-04 00:17:54
On Tue, Jun 03, 2008 at 04:48:30PM -0700, Andrew Morton wrote:
On Mon, 2 Jun 2008 21:37:26 +0400
Anton Vorontsov [off-list ref] wrote:
quoted
No comments on the previous version for two weeks... resending once
again.
I did all the rework to make the patches apply on top of all the
pending watchdog work in Wim's tree and in -mm. I haven't build tested
it yet.
Thanks, I'll test it in run-time also.
I'll assume that
[PATCH 7/8] [POWERPC] fsl_soc: remove mpc83xx_wdt code
and
[PATCH 8/8] [POWERPC] 86xx: mpc8610_hpcd: add watchdog node
are dependent upon the preceding six patches. This might be wrong.
This is correct.
Please put the subsystem identifier (eg, "watchdog" and "powerpc")
outside the [], for reasons which should be in
Documentation/SubmittingPatches, which used to be there but which got
lost. Bascially the text inside [] is for temporary not-for-committing
information such as "rfc", "2.6.24-rc4", "resend", etc and should be stripped
by the email recipient before merging.
Yeah, I know. It is just hard to remember all the preferences.
For example, PowerPC maintainers asking to do patches with "[POWERPC]"
identifier, this identifier purposely keeps intact for git-log.
--
Anton Vorontsov
email: cbouatmailru@gmail.com
irc://irc.freenode.net/bd2
From: Andrew Morton <akpm@linux-foundation.org> Date: 2008-06-04 00:32:47
On Wed, 4 Jun 2008 04:17:39 +0400
Anton Vorontsov [off-list ref] wrote:
quoted
Please put the subsystem identifier (eg, "watchdog" and "powerpc")
outside the [], for reasons which should be in
Documentation/SubmittingPatches, which used to be there but which got
lost. Bascially the text inside [] is for temporary not-for-committing
information such as "rfc", "2.6.24-rc4", "resend", etc and should be stripped
by the email recipient before merging.
Yeah, I know. It is just hard to remember all the preferences.
For example, PowerPC maintainers asking to do patches with "[POWERPC]"
identifier, this identifier purposely keeps intact for git-log.
Addition of "[powerpc]" if it was absent can be scripted.
However, the retaining of "[powerpc]" (etc) while not retaining "[rfc]"
(etc) is not practical.
Plus putting things into git with "[powerpc]" in the title is wrong.
The chances are good that anyone who is taking such a patch off the
git-commits list (say, for a backport) will lose that part of the
title. It should be "powerpc: "
(http://userweb.kernel.org/~akpm/dh.gif)
From: Paul Mackerras <hidden> Date: 2008-06-04 04:07:44
Andrew Morton writes:
On Wed, 4 Jun 2008 04:17:39 +0400
Anton Vorontsov [off-list ref] wrote:
quoted
quoted
Please put the subsystem identifier (eg, "watchdog" and "powerpc")
outside the [], for reasons which should be in
Documentation/SubmittingPatches, which used to be there but which got
lost. Bascially the text inside [] is for temporary not-for-committing
information such as "rfc", "2.6.24-rc4", "resend", etc and should be stripped
by the email recipient before merging.
Yeah, I know. It is just hard to remember all the preferences.
For example, PowerPC maintainers asking to do patches with "[POWERPC]"
identifier, this identifier purposely keeps intact for git-log.
Addition of "[powerpc]" if it was absent can be scripted.
However, the retaining of "[powerpc]" (etc) while not retaining "[rfc]"
(etc) is not practical.
Plus putting things into git with "[powerpc]" in the title is wrong.
The chances are good that anyone who is taking such a patch off the
git-commits list (say, for a backport) will lose that part of the
title. It should be "powerpc: "
I think Anton is confusing two things: (a) what should be in the
subject line of a patch posted to a mailing list, and (b) what should
be in the headline of a commit put into a git tree that I pull from.
As for (a), people can put whatever they like in [], and if people put
"powerpc:" in the subject, I edit it out since my scripts put
[POWERPC] in the git commit headline. For (b), I ask git tree
maintainers that I'm going to pull from to put [POWERPC] at the start
of the headline for consistency with what I do.
Looking at Linus' git tree, it's evident that some subsystems use the
the "[SUBSYSTEM]" notation and some use "subsystem:". If there is now
an edict from on high that only "subsystem:" is acceptable, then I
must have missed that memo.
Paul.
From: Andrew Morton <akpm@linux-foundation.org> Date: 2008-06-04 04:16:02
On Wed, 4 Jun 2008 14:07:20 +1000 Paul Mackerras [off-list ref] wrote:
Looking at Linus' git tree, it's evident that some subsystems use the
the "[SUBSYSTEM]" notation and some use "subsystem:". If there is now
an edict from on high that only "subsystem:" is acceptable, then I
must have missed that memo.
I'm all edicted out. Sometimes one just puts forth the reasoning and
lets others decide whether it's worth bothering about. I could understand
that decision being "no" :)
From: Anton Vorontsov <hidden> Date: 2008-06-04 12:27:39
On Wed, Jun 04, 2008 at 02:07:20PM +1000, Paul Mackerras wrote:
Andrew Morton writes:
quoted
On Wed, 4 Jun 2008 04:17:39 +0400
Anton Vorontsov [off-list ref] wrote:
quoted
quoted
Please put the subsystem identifier (eg, "watchdog" and "powerpc")
outside the [], for reasons which should be in
Documentation/SubmittingPatches, which used to be there but which got
lost. Bascially the text inside [] is for temporary not-for-committing
information such as "rfc", "2.6.24-rc4", "resend", etc and should be stripped
by the email recipient before merging.
Yeah, I know. It is just hard to remember all the preferences.
For example, PowerPC maintainers asking to do patches with "[POWERPC]"
identifier, this identifier purposely keeps intact for git-log.
Addition of "[powerpc]" if it was absent can be scripted.
However, the retaining of "[powerpc]" (etc) while not retaining "[rfc]"
(etc) is not practical.
Plus putting things into git with "[powerpc]" in the title is wrong.
The chances are good that anyone who is taking such a patch off the
git-commits list (say, for a backport) will lose that part of the
title. It should be "powerpc: "
I think Anton is confusing two things:
I found original email.. yes, you indeed ask for [POWERPC] in git
trees.
But. I believe anyone who send patches, tries to mimic existing practice,
and thus please the maintainer. Personally, I'm doing git log subsystem/
and looking for the preferred format for the commit message. And I'm not
alone: linuxppc-dev is full of [POWERPC] in the patch subjects, despite
the fact that you didn't explicitly ask for it.
Asking to send patches with "subsystem: " and then seeing them as
"[SUBSYSTEM] " in git-log is more confusing. Since new authors will
personalize this thinking: "Oh, maintainer fixed my negligence.
Next time I should send a patch with [SUBSYSTEM]".
--
Anton Vorontsov
email: cbouatmailru@gmail.com
irc://irc.freenode.net/bd2
From: Randy Dunlap <hidden> Date: 2008-06-04 17:32:17
On Tue, 3 Jun 2008 21:15:30 -0700 Andrew Morton wrote:
On Wed, 4 Jun 2008 14:07:20 +1000 Paul Mackerras [off-list ref] wrote:
quoted
Looking at Linus' git tree, it's evident that some subsystems use the
the "[SUBSYSTEM]" notation and some use "subsystem:". If there is now
an edict from on high that only "subsystem:" is acceptable, then I
must have missed that memo.
I'm all edicted out. Sometimes one just puts forth the reasoning and
lets others decide whether it's worth bothering about. I could understand
that decision being "no" :)
Well, it would be a Good Thing if all subsystem/arch maintainers would do it
in the same format, whatever that format is.
---
~Randy
<quote:>
"It's the Government of the United States." ... The largest, and yet
the least efficient, producer of computer software in the world.
From: Anton Vorontsov <hidden> Date: 2008-06-07 17:57:26
CC drivers/watchdog/mpc8xxx_wdt.o
drivers/watchdog/mpc8xxx_wdt.c: In function 'mpc8xxx_wdt_ioctl':
drivers/watchdog/mpc8xxx_wdt.c:156: error: 'cmd' undeclared (first use in this function)
drivers/watchdog/mpc8xxx_wdt.c:156: error: (Each undeclared identifier is reported only once
drivers/watchdog/mpc8xxx_wdt.c:156: error: for each function it appears in.)
drivers/watchdog/mpc8xxx_wdt.c: At top level:
drivers/watchdog/mpc8xxx_wdt.c:176: warning: initialization from incompatible pointer type
This patch ought to be folded into
mpc8xxx_wdt-various-renames-mostly-s-mpc83xx-mpc8xxx-g.patch
Signed-off-by: Anton Vorontsov <redacted>
---
On Tue, Jun 03, 2008 at 04:48:30PM -0700, Andrew Morton wrote:
On Mon, 2 Jun 2008 21:37:26 +0400
Anton Vorontsov [off-list ref] wrote:
quoted
No comments on the previous version for two weeks... resending once
again.
I did all the rework to make the patches apply on top of all the
pending watchdog work in Wim's tree and in -mm. I haven't build tested
it yet.
Well, only one hunk is mis-merged, in
mpc8xxx_wdt-various-renames-mostly-s-mpc83xx-mpc8xxx-g.patch.
Here is the patch to fix it.
I also run-time tested it, everything seem to work great.
p.s. Would be very handy if linux-trees.git would track mmotm snapshots.
drivers/watchdog/mpc8xxx_wdt.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)