Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

+53 -29
+3 -2
drivers/rtc/rtc-davinci.c
··· 524 524 goto fail2; 525 525 } 526 526 527 + platform_set_drvdata(pdev, davinci_rtc); 528 + 527 529 davinci_rtc->rtc = rtc_device_register(pdev->name, &pdev->dev, 528 530 &davinci_rtc_ops, THIS_MODULE); 529 531 if (IS_ERR(davinci_rtc->rtc)) { ··· 555 553 556 554 rtcss_write(davinci_rtc, PRTCSS_RTC_CCTRL_CAEN, PRTCSS_RTC_CCTRL); 557 555 558 - platform_set_drvdata(pdev, davinci_rtc); 559 - 560 556 device_init_wakeup(&pdev->dev, 0); 561 557 562 558 return 0; ··· 562 562 fail4: 563 563 rtc_device_unregister(davinci_rtc->rtc); 564 564 fail3: 565 + platform_set_drvdata(pdev, NULL); 565 566 iounmap(davinci_rtc->base); 566 567 fail2: 567 568 release_mem_region(davinci_rtc->pbase, davinci_rtc->base_size);
+1 -1
drivers/rtc/rtc-ds1286.c
··· 355 355 goto out; 356 356 } 357 357 spin_lock_init(&priv->lock); 358 + platform_set_drvdata(pdev, priv); 358 359 rtc = rtc_device_register("ds1286", &pdev->dev, 359 360 &ds1286_ops, THIS_MODULE); 360 361 if (IS_ERR(rtc)) { ··· 363 362 goto out; 364 363 } 365 364 priv->rtc = rtc; 366 - platform_set_drvdata(pdev, priv); 367 365 return 0; 368 366 369 367 out:
+2 -3
drivers/rtc/rtc-ep93xx.c
··· 151 151 return -ENXIO; 152 152 153 153 pdev->dev.platform_data = ep93xx_rtc; 154 + platform_set_drvdata(pdev, rtc); 154 155 155 156 rtc = rtc_device_register(pdev->name, 156 157 &pdev->dev, &ep93xx_rtc_ops, THIS_MODULE); ··· 160 159 goto exit; 161 160 } 162 161 163 - platform_set_drvdata(pdev, rtc); 164 - 165 162 err = sysfs_create_group(&pdev->dev.kobj, &ep93xx_rtc_sysfs_files); 166 163 if (err) 167 164 goto fail; ··· 167 168 return 0; 168 169 169 170 fail: 170 - platform_set_drvdata(pdev, NULL); 171 171 rtc_device_unregister(rtc); 172 172 exit: 173 + platform_set_drvdata(pdev, NULL); 173 174 pdev->dev.platform_data = NULL; 174 175 return err; 175 176 }
+3 -2
drivers/rtc/rtc-m41t80.c
··· 783 783 goto exit; 784 784 } 785 785 786 + clientdata->features = id->driver_data; 787 + i2c_set_clientdata(client, clientdata); 788 + 786 789 rtc = rtc_device_register(client->name, &client->dev, 787 790 &m41t80_rtc_ops, THIS_MODULE); 788 791 if (IS_ERR(rtc)) { ··· 795 792 } 796 793 797 794 clientdata->rtc = rtc; 798 - clientdata->features = id->driver_data; 799 - i2c_set_clientdata(client, clientdata); 800 795 801 796 /* Make sure HT (Halt Update) bit is cleared */ 802 797 rc = i2c_smbus_read_byte_data(client, M41T80_REG_ALARM_HOUR);
+3 -2
drivers/rtc/rtc-max8925.c
··· 258 258 } 259 259 260 260 dev_set_drvdata(&pdev->dev, info); 261 + /* XXX - isn't this redundant? */ 262 + platform_set_drvdata(pdev, info); 261 263 262 264 info->rtc_dev = rtc_device_register("max8925-rtc", &pdev->dev, 263 265 &max8925_rtc_ops, THIS_MODULE); ··· 269 267 goto out_rtc; 270 268 } 271 269 272 - platform_set_drvdata(pdev, info); 273 - 274 270 return 0; 275 271 out_rtc: 272 + platform_set_drvdata(pdev, NULL); 276 273 free_irq(chip->irq_base + MAX8925_IRQ_RTC_ALARM0, info); 277 274 out_irq: 278 275 kfree(info);
+3 -2
drivers/rtc/rtc-max8998.c
··· 265 265 info->rtc = max8998->rtc; 266 266 info->irq = max8998->irq_base + MAX8998_IRQ_ALARM0; 267 267 268 + platform_set_drvdata(pdev, info); 269 + 268 270 info->rtc_dev = rtc_device_register("max8998-rtc", &pdev->dev, 269 271 &max8998_rtc_ops, THIS_MODULE); 270 272 ··· 275 273 dev_err(&pdev->dev, "Failed to register RTC device: %d\n", ret); 276 274 goto out_rtc; 277 275 } 278 - 279 - platform_set_drvdata(pdev, info); 280 276 281 277 ret = request_threaded_irq(info->irq, NULL, max8998_rtc_alarm_irq, 0, 282 278 "rtc-alarm0", info); ··· 293 293 return 0; 294 294 295 295 out_rtc: 296 + platform_set_drvdata(pdev, NULL); 296 297 kfree(info); 297 298 return ret; 298 299 }
+6 -2
drivers/rtc/rtc-mc13xxx.c
··· 349 349 if (ret) 350 350 goto err_alarm_irq_request; 351 351 352 + mc13xxx_unlock(mc13xxx); 353 + 352 354 priv->rtc = rtc_device_register(pdev->name, 353 355 &pdev->dev, &mc13xxx_rtc_ops, THIS_MODULE); 354 356 if (IS_ERR(priv->rtc)) { 355 357 ret = PTR_ERR(priv->rtc); 358 + 359 + mc13xxx_lock(mc13xxx); 356 360 357 361 mc13xxx_irq_free(mc13xxx, MC13XXX_IRQ_TODA, priv); 358 362 err_alarm_irq_request: ··· 369 365 mc13xxx_irq_free(mc13xxx, MC13XXX_IRQ_RTCRST, priv); 370 366 err_reset_irq_request: 371 367 368 + mc13xxx_unlock(mc13xxx); 369 + 372 370 platform_set_drvdata(pdev, NULL); 373 371 kfree(priv); 374 372 } 375 - 376 - mc13xxx_unlock(mc13xxx); 377 373 378 374 return ret; 379 375 }
+2 -1
drivers/rtc/rtc-msm6242.c
··· 214 214 error = -ENOMEM; 215 215 goto out_free_priv; 216 216 } 217 + platform_set_drvdata(dev, priv); 217 218 218 219 rtc = rtc_device_register("rtc-msm6242", &dev->dev, &msm6242_rtc_ops, 219 220 THIS_MODULE); ··· 224 223 } 225 224 226 225 priv->rtc = rtc; 227 - platform_set_drvdata(dev, priv); 228 226 return 0; 229 227 230 228 out_unmap: 229 + platform_set_drvdata(dev, NULL); 231 230 iounmap(priv->regs); 232 231 out_free_priv: 233 232 kfree(priv);
+11 -8
drivers/rtc/rtc-mxc.c
··· 418 418 goto exit_put_clk; 419 419 } 420 420 421 - rtc = rtc_device_register(pdev->name, &pdev->dev, &mxc_rtc_ops, 422 - THIS_MODULE); 423 - if (IS_ERR(rtc)) { 424 - ret = PTR_ERR(rtc); 425 - goto exit_put_clk; 426 - } 427 - 428 - pdata->rtc = rtc; 429 421 platform_set_drvdata(pdev, pdata); 430 422 431 423 /* Configure and enable the RTC */ ··· 430 438 pdata->irq = -1; 431 439 } 432 440 441 + rtc = rtc_device_register(pdev->name, &pdev->dev, &mxc_rtc_ops, 442 + THIS_MODULE); 443 + if (IS_ERR(rtc)) { 444 + ret = PTR_ERR(rtc); 445 + goto exit_clr_drvdata; 446 + } 447 + 448 + pdata->rtc = rtc; 449 + 433 450 return 0; 434 451 452 + exit_clr_drvdata: 453 + platform_set_drvdata(pdev, NULL); 435 454 exit_put_clk: 436 455 clk_disable(pdata->clk); 437 456 clk_put(pdata->clk);
+3 -1
drivers/rtc/rtc-pcap.c
··· 151 151 152 152 pcap_rtc->pcap = dev_get_drvdata(pdev->dev.parent); 153 153 154 + platform_set_drvdata(pdev, pcap_rtc); 155 + 154 156 pcap_rtc->rtc = rtc_device_register("pcap", &pdev->dev, 155 157 &pcap_rtc_ops, THIS_MODULE); 156 158 if (IS_ERR(pcap_rtc->rtc)) { ··· 160 158 goto fail_rtc; 161 159 } 162 160 163 - platform_set_drvdata(pdev, pcap_rtc); 164 161 165 162 timer_irq = pcap_to_irq(pcap_rtc->pcap, PCAP_IRQ_1HZ); 166 163 alarm_irq = pcap_to_irq(pcap_rtc->pcap, PCAP_IRQ_TODA); ··· 178 177 fail_timer: 179 178 rtc_device_unregister(pcap_rtc->rtc); 180 179 fail_rtc: 180 + platform_set_drvdata(pdev, NULL); 181 181 kfree(pcap_rtc); 182 182 return err; 183 183 }
+3 -2
drivers/rtc/rtc-rp5c01.c
··· 249 249 250 250 spin_lock_init(&priv->lock); 251 251 252 + platform_set_drvdata(dev, priv); 253 + 252 254 rtc = rtc_device_register("rtc-rp5c01", &dev->dev, &rp5c01_rtc_ops, 253 255 THIS_MODULE); 254 256 if (IS_ERR(rtc)) { 255 257 error = PTR_ERR(rtc); 256 258 goto out_unmap; 257 259 } 258 - 259 260 priv->rtc = rtc; 260 - platform_set_drvdata(dev, priv); 261 261 262 262 error = sysfs_create_bin_file(&dev->dev.kobj, &priv->nvram_attr); 263 263 if (error) ··· 268 268 out_unregister: 269 269 rtc_device_unregister(rtc); 270 270 out_unmap: 271 + platform_set_drvdata(dev, NULL); 271 272 iounmap(priv->regs); 272 273 out_free_priv: 273 274 kfree(priv);
+2 -2
kernel/time/clocksource.c
··· 685 685 /* Add clocksource to the clcoksource list */ 686 686 mutex_lock(&clocksource_mutex); 687 687 clocksource_enqueue(cs); 688 - clocksource_select(); 689 688 clocksource_enqueue_watchdog(cs); 689 + clocksource_select(); 690 690 mutex_unlock(&clocksource_mutex); 691 691 return 0; 692 692 } ··· 706 706 707 707 mutex_lock(&clocksource_mutex); 708 708 clocksource_enqueue(cs); 709 - clocksource_select(); 710 709 clocksource_enqueue_watchdog(cs); 710 + clocksource_select(); 711 711 mutex_unlock(&clocksource_mutex); 712 712 return 0; 713 713 }
+11 -1
kernel/time/tick-broadcast.c
··· 522 522 */ 523 523 void tick_broadcast_setup_oneshot(struct clock_event_device *bc) 524 524 { 525 + int cpu = smp_processor_id(); 526 + 525 527 /* Set it up only once ! */ 526 528 if (bc->event_handler != tick_handle_oneshot_broadcast) { 527 529 int was_periodic = bc->mode == CLOCK_EVT_MODE_PERIODIC; 528 - int cpu = smp_processor_id(); 529 530 530 531 bc->event_handler = tick_handle_oneshot_broadcast; 531 532 clockevents_set_mode(bc, CLOCK_EVT_MODE_ONESHOT); ··· 552 551 tick_broadcast_set_event(tick_next_period, 1); 553 552 } else 554 553 bc->next_event.tv64 = KTIME_MAX; 554 + } else { 555 + /* 556 + * The first cpu which switches to oneshot mode sets 557 + * the bit for all other cpus which are in the general 558 + * (periodic) broadcast mask. So the bit is set and 559 + * would prevent the first broadcast enter after this 560 + * to program the bc device. 561 + */ 562 + tick_broadcast_clear_oneshot(cpu); 555 563 } 556 564 } 557 565