1. 11 Jun, 2019 1 commit
    • Dan Carpenter's avatar
      test_firmware: Use correct snprintf() limit · 2418da02
      Dan Carpenter authored
      commit bd17cc5a20ae9aaa3ed775f360b75ff93cd66a1d upstream.
      
      The limit here is supposed to be how much of the page is left, but it's
      just using PAGE_SIZE as the limit.
      
      The other thing to remember is that snprintf() returns the number of
      bytes which would have been copied if we had had enough room.  So that
      means that if we run out of space then this code would end up passing a
      negative value as the limit and the kernel would print an error message.
      I have change the code to use scnprintf() which returns the number of
      bytes that were successfully printed (not counting the NUL terminator).
      
      Fixes: c92316bf ("test_firmware: add batched firmware tests")
      Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      2418da02
  2. 13 Dec, 2018 1 commit
  3. 03 Feb, 2018 1 commit
  4. 10 Aug, 2017 1 commit
    • Luis R. Rodriguez's avatar
      test_firmware: add batched firmware tests · c92316bf
      Luis R. Rodriguez authored
      The firmware API has a feature to enable batching requests for the same fil
      e under one worker, so only one lookup is done. This only triggers if we so
      happen to schedule two lookups for same file around the same time, or if
      release_firmware() has not been called for a successful firmware call. This
      can happen for instance if you happen to have multiple devices and one
      device driver for certain drivers where the stars line up scheduling
      wise.
      
      This adds a new sync and async test trigger. Instead of adding a new
      trigger for each new test type we make the tests a bit configurable so that
      we could configure the tests in userspace and just kick a test through a
      few basic triggers. With this, for instance the two types of sync requests:
      
        o request_firmware() and
        o request_firmware_direct()
      
      can be modified with a knob. Likewise the two type of async requests:
      
         o request_firmware_nowait(uevent=true) and
         o request_firmware_nowait(uevent=false)
      
      can be configured with another knob. The call request_firmware_into_buf()
      has no users... yet.
      
      The old tests are left in place as-is given they serve a few other purposes
      which we are currently not interested in also testing yet. This will change
      later as we will be able to just consolidate all tests under a few basic
      triggers with just one general configuration setup.
      
      We perform two types of tests, one for where the file is present and one
      for where the file is not present. All test tests go tested and they now
      pass for the following 3 kernel builds possible for the firmware API:
      
      0. Most distro setup:
         CONFIG_FW_LOADER_USER_HELPER_FALLBACK=n
         CONFIG_FW_LOADER_USER_HELPER=y
      1. Android:
         CONFIG_FW_LOADER_USER_HELPER_FALLBACK=y
         CONFIG_FW_LOADER_USER_HELPER=y
      2. Rare build:
         CONFIG_FW_LOADER_USER_HELPER_FALLBACK=n
         CONFIG_FW_LOADER_USER_HELPER=n
      Signed-off-by: default avatarLuis R. Rodriguez <mcgrof@kernel.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c92316bf
  5. 25 Jan, 2017 3 commits
  6. 07 Jan, 2016 3 commits
  7. 18 Jul, 2014 1 commit