提交 a085963a 编写于 作者: L Linus Torvalds

Merge branch 'timers-fixes-for-linus' of...

Merge branch 'timers-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip

* 'timers-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  tick: Clear broadcast active bit when switching to oneshot
  rtc: mc13xxx: Don't call rtc_device_register while holding lock
  rtc: rp5c01: Initialize drvdata before registering device
  rtc: pcap: Initialize drvdata before registering device
  rtc: msm6242: Initialize drvdata before registering device
  rtc: max8998: Initialize drvdata before registering device
  rtc: max8925: Initialize drvdata before registering device
  rtc: m41t80: Initialize clientdata before registering device
  rtc: ds1286: Initialize drvdata before registering device
  rtc: ep93xx: Initialize drvdata before registering device
  rtc: davinci: Initialize drvdata before registering device
  rtc: mxc: Initialize drvdata before registering device
  clocksource: Install completely before selecting
...@@ -524,6 +524,8 @@ static int __init davinci_rtc_probe(struct platform_device *pdev) ...@@ -524,6 +524,8 @@ static int __init davinci_rtc_probe(struct platform_device *pdev)
goto fail2; goto fail2;
} }
platform_set_drvdata(pdev, davinci_rtc);
davinci_rtc->rtc = rtc_device_register(pdev->name, &pdev->dev, davinci_rtc->rtc = rtc_device_register(pdev->name, &pdev->dev,
&davinci_rtc_ops, THIS_MODULE); &davinci_rtc_ops, THIS_MODULE);
if (IS_ERR(davinci_rtc->rtc)) { if (IS_ERR(davinci_rtc->rtc)) {
...@@ -553,8 +555,6 @@ static int __init davinci_rtc_probe(struct platform_device *pdev) ...@@ -553,8 +555,6 @@ static int __init davinci_rtc_probe(struct platform_device *pdev)
rtcss_write(davinci_rtc, PRTCSS_RTC_CCTRL_CAEN, PRTCSS_RTC_CCTRL); rtcss_write(davinci_rtc, PRTCSS_RTC_CCTRL_CAEN, PRTCSS_RTC_CCTRL);
platform_set_drvdata(pdev, davinci_rtc);
device_init_wakeup(&pdev->dev, 0); device_init_wakeup(&pdev->dev, 0);
return 0; return 0;
...@@ -562,6 +562,7 @@ static int __init davinci_rtc_probe(struct platform_device *pdev) ...@@ -562,6 +562,7 @@ static int __init davinci_rtc_probe(struct platform_device *pdev)
fail4: fail4:
rtc_device_unregister(davinci_rtc->rtc); rtc_device_unregister(davinci_rtc->rtc);
fail3: fail3:
platform_set_drvdata(pdev, NULL);
iounmap(davinci_rtc->base); iounmap(davinci_rtc->base);
fail2: fail2:
release_mem_region(davinci_rtc->pbase, davinci_rtc->base_size); release_mem_region(davinci_rtc->pbase, davinci_rtc->base_size);
......
...@@ -355,6 +355,7 @@ static int __devinit ds1286_probe(struct platform_device *pdev) ...@@ -355,6 +355,7 @@ static int __devinit ds1286_probe(struct platform_device *pdev)
goto out; goto out;
} }
spin_lock_init(&priv->lock); spin_lock_init(&priv->lock);
platform_set_drvdata(pdev, priv);
rtc = rtc_device_register("ds1286", &pdev->dev, rtc = rtc_device_register("ds1286", &pdev->dev,
&ds1286_ops, THIS_MODULE); &ds1286_ops, THIS_MODULE);
if (IS_ERR(rtc)) { if (IS_ERR(rtc)) {
...@@ -362,7 +363,6 @@ static int __devinit ds1286_probe(struct platform_device *pdev) ...@@ -362,7 +363,6 @@ static int __devinit ds1286_probe(struct platform_device *pdev)
goto out; goto out;
} }
priv->rtc = rtc; priv->rtc = rtc;
platform_set_drvdata(pdev, priv);
return 0; return 0;
out: out:
......
...@@ -151,6 +151,7 @@ static int __init ep93xx_rtc_probe(struct platform_device *pdev) ...@@ -151,6 +151,7 @@ static int __init ep93xx_rtc_probe(struct platform_device *pdev)
return -ENXIO; return -ENXIO;
pdev->dev.platform_data = ep93xx_rtc; pdev->dev.platform_data = ep93xx_rtc;
platform_set_drvdata(pdev, rtc);
rtc = rtc_device_register(pdev->name, rtc = rtc_device_register(pdev->name,
&pdev->dev, &ep93xx_rtc_ops, THIS_MODULE); &pdev->dev, &ep93xx_rtc_ops, THIS_MODULE);
...@@ -159,8 +160,6 @@ static int __init ep93xx_rtc_probe(struct platform_device *pdev) ...@@ -159,8 +160,6 @@ static int __init ep93xx_rtc_probe(struct platform_device *pdev)
goto exit; goto exit;
} }
platform_set_drvdata(pdev, rtc);
err = sysfs_create_group(&pdev->dev.kobj, &ep93xx_rtc_sysfs_files); err = sysfs_create_group(&pdev->dev.kobj, &ep93xx_rtc_sysfs_files);
if (err) if (err)
goto fail; goto fail;
...@@ -168,9 +167,9 @@ static int __init ep93xx_rtc_probe(struct platform_device *pdev) ...@@ -168,9 +167,9 @@ static int __init ep93xx_rtc_probe(struct platform_device *pdev)
return 0; return 0;
fail: fail:
platform_set_drvdata(pdev, NULL);
rtc_device_unregister(rtc); rtc_device_unregister(rtc);
exit: exit:
platform_set_drvdata(pdev, NULL);
pdev->dev.platform_data = NULL; pdev->dev.platform_data = NULL;
return err; return err;
} }
......
...@@ -783,6 +783,9 @@ static int m41t80_probe(struct i2c_client *client, ...@@ -783,6 +783,9 @@ static int m41t80_probe(struct i2c_client *client,
goto exit; goto exit;
} }
clientdata->features = id->driver_data;
i2c_set_clientdata(client, clientdata);
rtc = rtc_device_register(client->name, &client->dev, rtc = rtc_device_register(client->name, &client->dev,
&m41t80_rtc_ops, THIS_MODULE); &m41t80_rtc_ops, THIS_MODULE);
if (IS_ERR(rtc)) { if (IS_ERR(rtc)) {
...@@ -792,8 +795,6 @@ static int m41t80_probe(struct i2c_client *client, ...@@ -792,8 +795,6 @@ static int m41t80_probe(struct i2c_client *client,
} }
clientdata->rtc = rtc; clientdata->rtc = rtc;
clientdata->features = id->driver_data;
i2c_set_clientdata(client, clientdata);
/* Make sure HT (Halt Update) bit is cleared */ /* Make sure HT (Halt Update) bit is cleared */
rc = i2c_smbus_read_byte_data(client, M41T80_REG_ALARM_HOUR); rc = i2c_smbus_read_byte_data(client, M41T80_REG_ALARM_HOUR);
......
...@@ -258,6 +258,8 @@ static int __devinit max8925_rtc_probe(struct platform_device *pdev) ...@@ -258,6 +258,8 @@ static int __devinit max8925_rtc_probe(struct platform_device *pdev)
} }
dev_set_drvdata(&pdev->dev, info); dev_set_drvdata(&pdev->dev, info);
/* XXX - isn't this redundant? */
platform_set_drvdata(pdev, info);
info->rtc_dev = rtc_device_register("max8925-rtc", &pdev->dev, info->rtc_dev = rtc_device_register("max8925-rtc", &pdev->dev,
&max8925_rtc_ops, THIS_MODULE); &max8925_rtc_ops, THIS_MODULE);
...@@ -267,10 +269,9 @@ static int __devinit max8925_rtc_probe(struct platform_device *pdev) ...@@ -267,10 +269,9 @@ static int __devinit max8925_rtc_probe(struct platform_device *pdev)
goto out_rtc; goto out_rtc;
} }
platform_set_drvdata(pdev, info);
return 0; return 0;
out_rtc: out_rtc:
platform_set_drvdata(pdev, NULL);
free_irq(chip->irq_base + MAX8925_IRQ_RTC_ALARM0, info); free_irq(chip->irq_base + MAX8925_IRQ_RTC_ALARM0, info);
out_irq: out_irq:
kfree(info); kfree(info);
......
...@@ -265,6 +265,8 @@ static int __devinit max8998_rtc_probe(struct platform_device *pdev) ...@@ -265,6 +265,8 @@ static int __devinit max8998_rtc_probe(struct platform_device *pdev)
info->rtc = max8998->rtc; info->rtc = max8998->rtc;
info->irq = max8998->irq_base + MAX8998_IRQ_ALARM0; info->irq = max8998->irq_base + MAX8998_IRQ_ALARM0;
platform_set_drvdata(pdev, info);
info->rtc_dev = rtc_device_register("max8998-rtc", &pdev->dev, info->rtc_dev = rtc_device_register("max8998-rtc", &pdev->dev,
&max8998_rtc_ops, THIS_MODULE); &max8998_rtc_ops, THIS_MODULE);
...@@ -274,8 +276,6 @@ static int __devinit max8998_rtc_probe(struct platform_device *pdev) ...@@ -274,8 +276,6 @@ static int __devinit max8998_rtc_probe(struct platform_device *pdev)
goto out_rtc; goto out_rtc;
} }
platform_set_drvdata(pdev, info);
ret = request_threaded_irq(info->irq, NULL, max8998_rtc_alarm_irq, 0, ret = request_threaded_irq(info->irq, NULL, max8998_rtc_alarm_irq, 0,
"rtc-alarm0", info); "rtc-alarm0", info);
...@@ -293,6 +293,7 @@ static int __devinit max8998_rtc_probe(struct platform_device *pdev) ...@@ -293,6 +293,7 @@ static int __devinit max8998_rtc_probe(struct platform_device *pdev)
return 0; return 0;
out_rtc: out_rtc:
platform_set_drvdata(pdev, NULL);
kfree(info); kfree(info);
return ret; return ret;
} }
......
...@@ -349,11 +349,15 @@ static int __devinit mc13xxx_rtc_probe(struct platform_device *pdev) ...@@ -349,11 +349,15 @@ static int __devinit mc13xxx_rtc_probe(struct platform_device *pdev)
if (ret) if (ret)
goto err_alarm_irq_request; goto err_alarm_irq_request;
mc13xxx_unlock(mc13xxx);
priv->rtc = rtc_device_register(pdev->name, priv->rtc = rtc_device_register(pdev->name,
&pdev->dev, &mc13xxx_rtc_ops, THIS_MODULE); &pdev->dev, &mc13xxx_rtc_ops, THIS_MODULE);
if (IS_ERR(priv->rtc)) { if (IS_ERR(priv->rtc)) {
ret = PTR_ERR(priv->rtc); ret = PTR_ERR(priv->rtc);
mc13xxx_lock(mc13xxx);
mc13xxx_irq_free(mc13xxx, MC13XXX_IRQ_TODA, priv); mc13xxx_irq_free(mc13xxx, MC13XXX_IRQ_TODA, priv);
err_alarm_irq_request: err_alarm_irq_request:
...@@ -365,12 +369,12 @@ static int __devinit mc13xxx_rtc_probe(struct platform_device *pdev) ...@@ -365,12 +369,12 @@ static int __devinit mc13xxx_rtc_probe(struct platform_device *pdev)
mc13xxx_irq_free(mc13xxx, MC13XXX_IRQ_RTCRST, priv); mc13xxx_irq_free(mc13xxx, MC13XXX_IRQ_RTCRST, priv);
err_reset_irq_request: err_reset_irq_request:
mc13xxx_unlock(mc13xxx);
platform_set_drvdata(pdev, NULL); platform_set_drvdata(pdev, NULL);
kfree(priv); kfree(priv);
} }
mc13xxx_unlock(mc13xxx);
return ret; return ret;
} }
......
...@@ -214,6 +214,7 @@ static int __init msm6242_rtc_probe(struct platform_device *dev) ...@@ -214,6 +214,7 @@ static int __init msm6242_rtc_probe(struct platform_device *dev)
error = -ENOMEM; error = -ENOMEM;
goto out_free_priv; goto out_free_priv;
} }
platform_set_drvdata(dev, priv);
rtc = rtc_device_register("rtc-msm6242", &dev->dev, &msm6242_rtc_ops, rtc = rtc_device_register("rtc-msm6242", &dev->dev, &msm6242_rtc_ops,
THIS_MODULE); THIS_MODULE);
...@@ -223,10 +224,10 @@ static int __init msm6242_rtc_probe(struct platform_device *dev) ...@@ -223,10 +224,10 @@ static int __init msm6242_rtc_probe(struct platform_device *dev)
} }
priv->rtc = rtc; priv->rtc = rtc;
platform_set_drvdata(dev, priv);
return 0; return 0;
out_unmap: out_unmap:
platform_set_drvdata(dev, NULL);
iounmap(priv->regs); iounmap(priv->regs);
out_free_priv: out_free_priv:
kfree(priv); kfree(priv);
......
...@@ -418,14 +418,6 @@ static int __init mxc_rtc_probe(struct platform_device *pdev) ...@@ -418,14 +418,6 @@ static int __init mxc_rtc_probe(struct platform_device *pdev)
goto exit_put_clk; goto exit_put_clk;
} }
rtc = rtc_device_register(pdev->name, &pdev->dev, &mxc_rtc_ops,
THIS_MODULE);
if (IS_ERR(rtc)) {
ret = PTR_ERR(rtc);
goto exit_put_clk;
}
pdata->rtc = rtc;
platform_set_drvdata(pdev, pdata); platform_set_drvdata(pdev, pdata);
/* Configure and enable the RTC */ /* Configure and enable the RTC */
...@@ -438,8 +430,19 @@ static int __init mxc_rtc_probe(struct platform_device *pdev) ...@@ -438,8 +430,19 @@ static int __init mxc_rtc_probe(struct platform_device *pdev)
pdata->irq = -1; pdata->irq = -1;
} }
rtc = rtc_device_register(pdev->name, &pdev->dev, &mxc_rtc_ops,
THIS_MODULE);
if (IS_ERR(rtc)) {
ret = PTR_ERR(rtc);
goto exit_clr_drvdata;
}
pdata->rtc = rtc;
return 0; return 0;
exit_clr_drvdata:
platform_set_drvdata(pdev, NULL);
exit_put_clk: exit_put_clk:
clk_disable(pdata->clk); clk_disable(pdata->clk);
clk_put(pdata->clk); clk_put(pdata->clk);
......
...@@ -151,6 +151,8 @@ static int __devinit pcap_rtc_probe(struct platform_device *pdev) ...@@ -151,6 +151,8 @@ static int __devinit pcap_rtc_probe(struct platform_device *pdev)
pcap_rtc->pcap = dev_get_drvdata(pdev->dev.parent); pcap_rtc->pcap = dev_get_drvdata(pdev->dev.parent);
platform_set_drvdata(pdev, pcap_rtc);
pcap_rtc->rtc = rtc_device_register("pcap", &pdev->dev, pcap_rtc->rtc = rtc_device_register("pcap", &pdev->dev,
&pcap_rtc_ops, THIS_MODULE); &pcap_rtc_ops, THIS_MODULE);
if (IS_ERR(pcap_rtc->rtc)) { if (IS_ERR(pcap_rtc->rtc)) {
...@@ -158,7 +160,6 @@ static int __devinit pcap_rtc_probe(struct platform_device *pdev) ...@@ -158,7 +160,6 @@ static int __devinit pcap_rtc_probe(struct platform_device *pdev)
goto fail_rtc; goto fail_rtc;
} }
platform_set_drvdata(pdev, pcap_rtc);
timer_irq = pcap_to_irq(pcap_rtc->pcap, PCAP_IRQ_1HZ); timer_irq = pcap_to_irq(pcap_rtc->pcap, PCAP_IRQ_1HZ);
alarm_irq = pcap_to_irq(pcap_rtc->pcap, PCAP_IRQ_TODA); alarm_irq = pcap_to_irq(pcap_rtc->pcap, PCAP_IRQ_TODA);
...@@ -177,6 +178,7 @@ static int __devinit pcap_rtc_probe(struct platform_device *pdev) ...@@ -177,6 +178,7 @@ static int __devinit pcap_rtc_probe(struct platform_device *pdev)
fail_timer: fail_timer:
rtc_device_unregister(pcap_rtc->rtc); rtc_device_unregister(pcap_rtc->rtc);
fail_rtc: fail_rtc:
platform_set_drvdata(pdev, NULL);
kfree(pcap_rtc); kfree(pcap_rtc);
return err; return err;
} }
......
...@@ -249,15 +249,15 @@ static int __init rp5c01_rtc_probe(struct platform_device *dev) ...@@ -249,15 +249,15 @@ static int __init rp5c01_rtc_probe(struct platform_device *dev)
spin_lock_init(&priv->lock); spin_lock_init(&priv->lock);
platform_set_drvdata(dev, priv);
rtc = rtc_device_register("rtc-rp5c01", &dev->dev, &rp5c01_rtc_ops, rtc = rtc_device_register("rtc-rp5c01", &dev->dev, &rp5c01_rtc_ops,
THIS_MODULE); THIS_MODULE);
if (IS_ERR(rtc)) { if (IS_ERR(rtc)) {
error = PTR_ERR(rtc); error = PTR_ERR(rtc);
goto out_unmap; goto out_unmap;
} }
priv->rtc = rtc; priv->rtc = rtc;
platform_set_drvdata(dev, priv);
error = sysfs_create_bin_file(&dev->dev.kobj, &priv->nvram_attr); error = sysfs_create_bin_file(&dev->dev.kobj, &priv->nvram_attr);
if (error) if (error)
...@@ -268,6 +268,7 @@ static int __init rp5c01_rtc_probe(struct platform_device *dev) ...@@ -268,6 +268,7 @@ static int __init rp5c01_rtc_probe(struct platform_device *dev)
out_unregister: out_unregister:
rtc_device_unregister(rtc); rtc_device_unregister(rtc);
out_unmap: out_unmap:
platform_set_drvdata(dev, NULL);
iounmap(priv->regs); iounmap(priv->regs);
out_free_priv: out_free_priv:
kfree(priv); kfree(priv);
......
...@@ -685,8 +685,8 @@ int __clocksource_register_scale(struct clocksource *cs, u32 scale, u32 freq) ...@@ -685,8 +685,8 @@ int __clocksource_register_scale(struct clocksource *cs, u32 scale, u32 freq)
/* Add clocksource to the clcoksource list */ /* Add clocksource to the clcoksource list */
mutex_lock(&clocksource_mutex); mutex_lock(&clocksource_mutex);
clocksource_enqueue(cs); clocksource_enqueue(cs);
clocksource_select();
clocksource_enqueue_watchdog(cs); clocksource_enqueue_watchdog(cs);
clocksource_select();
mutex_unlock(&clocksource_mutex); mutex_unlock(&clocksource_mutex);
return 0; return 0;
} }
...@@ -706,8 +706,8 @@ int clocksource_register(struct clocksource *cs) ...@@ -706,8 +706,8 @@ int clocksource_register(struct clocksource *cs)
mutex_lock(&clocksource_mutex); mutex_lock(&clocksource_mutex);
clocksource_enqueue(cs); clocksource_enqueue(cs);
clocksource_select();
clocksource_enqueue_watchdog(cs); clocksource_enqueue_watchdog(cs);
clocksource_select();
mutex_unlock(&clocksource_mutex); mutex_unlock(&clocksource_mutex);
return 0; return 0;
} }
......
...@@ -522,10 +522,11 @@ static void tick_broadcast_init_next_event(struct cpumask *mask, ...@@ -522,10 +522,11 @@ static void tick_broadcast_init_next_event(struct cpumask *mask,
*/ */
void tick_broadcast_setup_oneshot(struct clock_event_device *bc) void tick_broadcast_setup_oneshot(struct clock_event_device *bc)
{ {
int cpu = smp_processor_id();
/* Set it up only once ! */ /* Set it up only once ! */
if (bc->event_handler != tick_handle_oneshot_broadcast) { if (bc->event_handler != tick_handle_oneshot_broadcast) {
int was_periodic = bc->mode == CLOCK_EVT_MODE_PERIODIC; int was_periodic = bc->mode == CLOCK_EVT_MODE_PERIODIC;
int cpu = smp_processor_id();
bc->event_handler = tick_handle_oneshot_broadcast; bc->event_handler = tick_handle_oneshot_broadcast;
clockevents_set_mode(bc, CLOCK_EVT_MODE_ONESHOT); clockevents_set_mode(bc, CLOCK_EVT_MODE_ONESHOT);
...@@ -551,6 +552,15 @@ void tick_broadcast_setup_oneshot(struct clock_event_device *bc) ...@@ -551,6 +552,15 @@ void tick_broadcast_setup_oneshot(struct clock_event_device *bc)
tick_broadcast_set_event(tick_next_period, 1); tick_broadcast_set_event(tick_next_period, 1);
} else } else
bc->next_event.tv64 = KTIME_MAX; bc->next_event.tv64 = KTIME_MAX;
} else {
/*
* The first cpu which switches to oneshot mode sets
* the bit for all other cpus which are in the general
* (periodic) broadcast mask. So the bit is set and
* would prevent the first broadcast enter after this
* to program the bc device.
*/
tick_broadcast_clear_oneshot(cpu);
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册