shoujixiaodao
    @linuxer:在手机的做法一般如下 1,pm_power_off()这个函数最终machine 都会实现的。 2,machine的实现方式大都一样。即控制PMIC。让PMIC给soc断电 3,下完如上第二点的命令后。虽然控制pmic掉电。但是一般pmic的输出电源都有滤波电容。所以电源是慢慢掉下去的。即下电后cpu还能挣扎执行一些命令 4,如上第3点。所以一般加一些delay 5.有的做法还会做一些判断。比如我插入充电器。执行了关机命令。一般充电器插入pmic的时候,即使cpu发命令让pmic下电。pmic也不会掉电。所以如果延时过后会check是否插入充电器。如果插入则重启手机,以便进入关机充电模式。
    Linux电源管理(3)_Generic PM之Reboot过程  发表时间:2015-05-01 22:38
    buyit
    @heziq:你找的这段代码来自于CSR,(reviewer是出书的某位大牛)。 事实上如果你搜索kernel代码的话,会发现很少有人调用IRQF_NOAUTOEN这个flag,所有调用它的都是1级或者2级interrupt controller,唯一的例外就是CSR的这份uart代码,所以我觉得它没有参考价值。 从这个函数来看,申请中断和开启中断中间只隔了一个uart controller的初始化函数。那么如果把startup_uart_controller(port)函数放到最前面,等这个函数把uart硬件初始化好了之后,再调用request_irq函数来注册中断,这样子就不需要IRQF_NOAUTOEN了。 request_irq的注释里面已经说明了,这个函数返回之后,handler就有可能马上被调用。如果硬件还没有准备好,说明你注册中断时间点很有可能不合理。
    buyit
    @linuxer:一个SPI的终端送往多个CPU在绝大多数的时候是没有意义的,因为有可能会造成多个CPU去响应这个中断,虽然最后只有一个CPU会真正ack这个irq,而其它CPU会读到1023这个fake irq number,这样子意味着其它CPU浪费了资源做无用功,所以MIPS和ARM斗士在set_affinity函数里面做了点文法,无视上层传递下来的mask里面的多个bit,只会把该中断分发给mask里面的第一个有效位(这个位代表的cpu必须是online的)代表的CPU。 但是这里面也有例外,假设有一个secure watchdog,它是全局的一个watchdog,并不是per-cpu类型的,这个中断一般会分发给每一个CPU,如果系统有8核,那么这个secure watchdog会分配给8个CPU,当然这个代码可以自己写,不能呼叫ARM的API。这样做的理由是:全局的secure watchdog保障的是全系统的稳定,单个CPU的watch dog事件由per-cpu的watchdog irq去处理就行了。 还有例外的情况是类似于bus error这种中断,也是广播到所有CPU去处理。
    linux kernel的中断子系统之(七):GIC代码分析  发表时间:2015-04-30 22:38
    shoujixiaodao
    站在代码外边分析问题。高屋建瓴。
    Linux电源管理(2)_Generic PM之基本概念和软件架构  发表时间:2015-04-30 22:20
    buyit
    @linuxer:期待broadcast的文章赶快面世。 对这个问题我仍然有疑惑:在只有一个A5 core的SOC里面假设有5个timer。假设我把其中一个timer配置成了A5 的local timer,假设HW团队也不反对,我在定义clock event device的时候不设置CLOCK_EVT_FEAT_C3STOP这个flag,同时也不开启那两个broadcast的config,在cpu idle的时候和A5绑定的那个local timer仍然运行,系统中另外的4个timer都没有用来做广播,请问这样子的设计是不是对软硬件都最好的设计?
    buyit
    对level 类型中断的irqs_pending的解读如下: Level irq的IRQS_PENDING状态来自于下面这个patch: commit d4dc0f90d243fb54cfbca6601c9a7c5a758e437f Author: Thomas Gleixner <tglx@linutronix.de> Date: Wed Apr 25 12:54:54 2012 +0200 genirq: Allow check_wakeup_irqs to notice level-triggered interrupts Level triggered interrupts do not cause IRQS_PENDING to be set when they fire while "disabled" as the 'pending' state is always present in the level - they automatically refire where re-enabled. However the IRQS_PENDING flag is also used to abort a suspend cycle - if any 'is_wakeup_set' interrupt is PENDING, check_wakeup_irqs() will cause suspend to abort. Without IRQS_PENDING, suspend won't abort. Consequently, level-triggered interrupts that fire during the 'noirq' phase of suspend do not currently abort suspend. So set IRQS_PENDING even for level triggered interrupts, and make sure to clear the flag in check_irq_resend. 从注释里面可以看出来: • 这个patch是为了解决一个level irq suspend状态错误的问题。 • 如果这是一个edge irq,假设在中断上半部disable_irq(),然后启动workqueue处理下半部,假设这个时候来了第二个同样的edge irq,系统设置IRQS_PENDING状态之后退出来,假设workqueue运行到一半还没有结束的时候系统进入suspend流程,那么在函数check_wakeup_irqs()会判断这个irq,如果这个irq是一个可以唤醒系统的中断,系统就不会suspend,而是直接退出suspend流程。 • 如果这是一个level irq,kernel之前的处理办法是先mask当前正在处理的这个irq,如果有相同的irq第二次进来,假设当前irq已经被disable了,那么就什么也不做直接退出。这样的结果是如果系统接下来进入suspend流程,假设这个irq是可以唤醒系统的,它的状态不是pending,所以系统真正进入suspend。这样子从逻辑上面来讲就是错误的,因为一个可以唤醒系统的中断源已经有效了,系统不应该进入suspend。 • 为了解决这个bug,在level irq重入的时候,如果状态已经是disable了,就设置IRQS_PENDING,然后在check_wakeup_irqs函数里面一旦检测到这种状态之后就会退出suspend流程。当最后enable_irq()函数被呼叫的时候,通过呼叫check_irq_resend()来去掉level irq的pending位。
    RobinHsiang
    @zlf:注释写的很清楚啊,不能移除这个mmc slot。 估计在mmc驱动里面用of API来读取后做了判断------有或者没有“ti,removable”,代码加载的分支是不一样的。
    Device Tree(一):背景介绍  发表时间:2015-04-30 17:21
    zlf
    @zlf:加上之后kernel可以正常挂载/dev/mmcblk0p2 不加ti,removable就无法挂载/dev/mmcblk0p2,报panic VFS:can not mount /dev/mmcbkl0p2
    Device Tree(一):背景介绍  发表时间:2015-04-30 14:27
    zlf
    我也刚接触dt, 我现在知道什么是dt了,dt是什么作用也大体清楚了。 但是我不知道dts应该怎么写,哪些参数应该要,每个参数是什么意思。 我手头上有个板子关于mmc的,加上ti,removable就可以启动,不加就启动不了,我很迷惑。 楼主要是能帮我指点一下我会感激不尽。 &mmc1 { status = "okay"; pinctrl-names = "default"; pinctrl-0 = <&mmc1_pins>; vmmc-supply = <&evm_3v3_sd>; bus-width = <4>; //ti,non-removable; /* sd card for mmcblk0 eMMC for mmcblk1 */ /* * SDCD signal is not being used here - using the fact that GPIO mode * is always hardwired. */ cd-gpios = <&gpio6 27 0>; };
    Device Tree(一):背景介绍  发表时间:2015-04-30 14:25
    tigger
    @linuxer:哈哈 ok
    Linux内核同步机制之(四):spin lock  发表时间:2015-04-30 08:37

共7862条645/787上一页 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 下一页
Copyright @ 2013-2015 蜗窝科技 All rights reserved. Powered by emlog