1. 11 Dec, 2020 1 commit
  2. 29 Oct, 2020 2 commits
  3. 22 Oct, 2020 2 commits
  4. 20 Oct, 2020 8 commits
  5. 03 Nov, 2017 1 commit
    • Julius Werner's avatar
      vboot: Update block devices from VbExKeyboardRead() to fix SD detection · 0c084919
      Julius Werner authored
      
      
      The problem with SD cards is that you need to keep track of removals and
      reinsertions so that you know when you have to fully reinitialize it. In
      depthcharge, we do that by maintaining a 'present' member in the MMC
      controller object. On every update() call to the controller, we check if
      the previously known 'present' state still matches the current
      card_detect pin value, and if it doesn't we handle the respective
      insertion or removal.
      
      This works fine in recovery mode: vboot keeps checking for new media
      automatically every second, so we regularly call update() on all our
      removable block device controllers. But in dev mode, vboot only asks us
      to do that when it reads an explicit Ctrl+U from the user. This creates
      a problem when the user inserts an SD card with an invalid image,
      presses Ctrl+U (vboot sees that the image is invalid and beeps),
      replaces the SD card with a different one and presses Ctrl+U again. We
      only call update() twice on the block device controller in this case,
      and in both cases there is a card present. The driver has no chance to
      notice that it is no longer the same card and has to be reinitialized.
      
      It's hard to solve this in a good way: we could make it the
      responsibility of the individual MMC controller driver to track this
      (through some sort of controller-internal hardware latch), but it's
      unclear whether all controllers could support that, and it would have to
      be fixed in every single controller driver individually. We could also
      change the vboot API to add an explicit polling function that tells
      depthcharge to update this state, but that seems overkill at a time
      where we're thinking about moving away from depthcharge at some point
      anyway (towards a solution that probably wouldn't have this problem).
      
      This patch implements the quick and dirty fix of updating removable
      block device controllers in the only continuously polled vboot callback
      we have in dev mode, which is VbExKeyboardRead(). It's not exactly a
      clean solution from a design standpoint, but it'll work. USB storage
      devices essentially get the same treatment already because libpayload
      unconditionally calls usb_poll() as part of havechar()... so it's not
      really any worse than what we already have, just in a different place.
      
      BRANCH=oak,gru,nyan,veyron,reef?
      BUG=b:35854317
      TEST=Boot an Elm, plug in a uSD card without a good image, press Ctrl+U,
      replace SD card with one that has a good image, press Ctrl+U again,
      watch it boot.
      
      Change-Id: I729a37028140f354478422078804e750079a4c23
      Signed-off-by: default avatarJulius Werner <jwerner@chromium.org>
      Reviewed-on: https://chromium-review.googlesource.com/750321
      
      Reviewed-by: default avatarAaron Durbin <adurbin@chromium.org>
      Reviewed-by: default avatarFurquan Shaikh <furquan@chromium.org>
      (cherry picked from commit 6b4baa85)
      Reviewed-on: https://chromium-review.googlesource.com/753861
      
      
      Commit-Queue: Aaron Durbin <adurbin@chromium.org>
      Tested-by: default avatarAaron Durbin <adurbin@chromium.org>
      0c084919
  6. 20 Oct, 2017 2 commits
  7. 16 Oct, 2017 1 commit
  8. 13 Oct, 2017 1 commit
  9. 10 Oct, 2017 1 commit
  10. 29 Sep, 2017 1 commit
  11. 26 Sep, 2017 1 commit
  12. 25 Sep, 2017 1 commit
  13. 22 Sep, 2017 1 commit
  14. 21 Sep, 2017 2 commits
  15. 13 Sep, 2017 1 commit
  16. 09 Sep, 2017 4 commits
  17. 08 Sep, 2017 1 commit
  18. 07 Sep, 2017 4 commits
  19. 29 Aug, 2017 1 commit
  20. 25 Aug, 2017 1 commit
  21. 22 Aug, 2017 2 commits
  22. 19 Aug, 2017 1 commit