Skip to content
Snippets Groups Projects
Select Git revision
  • ce2fcbd99cef580623116bb33531dbc3e6f690b0
  • master default protected
  • android-msm-bullhead-3.10-nougat_kgdb_less_changes
  • android-msm-bullhead-3.10-nougat_kgdb
  • android-msm-bullhead-3.10-nougat_klist
  • android-4.4
  • android-msm-vega-4.4-oreo-daydream
  • android-msm-wahoo-4.4-p-preview-5
  • android-msm-wahoo-4.4-pie
  • android-msm-marlin-3.18-p-preview-5
  • android-msm-marlin-3.18-pie
  • android-msm-wahoo-2018.07-oreo-m2
  • android-msm-wahoo-2018.07-oreo-m4
  • android-msm-wahoo-4.4-p-preview-4
  • android-msm-bullhead-3.10-oreo-m6
  • android-msm-angler-3.10-oreo-m6
  • android-msm-marlin-3.18-p-preview-4
  • android-msm-stargazer-3.18-oreo-wear-dr
  • android-msm-catshark-3.18-oreo-wear-dr
  • android-msm-wahoo-4.4-oreo-m2
  • android-msm-wahoo-4.4-oreo-m4
  • android-daydreamos-8.0.0_r0.5
  • android-8.1.0_r0.92
  • android-8.1.0_r0.91
  • android-daydreamos-8.0.0_r0.4
  • android-p-preview-5_r0.2
  • android-p-preview-5_r0.1
  • android-9.0.0_r0.5
  • android-9.0.0_r0.4
  • android-9.0.0_r0.2
  • android-9.0.0_r0.1
  • android-8.1.0_r0.81
  • android-8.1.0_r0.80
  • android-8.1.0_r0.78
  • android-8.1.0_r0.76
  • android-8.1.0_r0.75
  • android-8.1.0_r0.72
  • android-8.1.0_r0.70
  • android-p-preview-4_r0.2
  • android-p-preview-4_r0.1
  • android-wear-8.0.0_r0.30
41 results

firmware_class.c

Blame
  • user avatar
    Chuansheng Liu authored and Greg Kroah-Hartman committed
    There is a race as below when calling request_firmware():
    CPU1                                   CPU2
    write 0 > loading
    mutex_lock(&fw_lock)
    ...
    set_bit FW_STATUS_DONE                 class_timeout is coming
                                           set_bit FW_STATUS_ABORT
    complete_all &completion
    ...
    mutex_unlock(&fw_lock)
    
    In this time, the bit FW_STATUS_DONE and FW_STATUS_ABORT are set,
    and request_firmware() will return failure due to condition in
    _request_firmware_load():
    	if (!buf->size || test_bit(FW_STATUS_ABORT, &buf->status))
    		retval = -ENOENT;
    
    But from the above scenerio, it should be a successful requesting.
    So we need judge if the bit FW_STATUS_DONE is already set before
    calling fw_load_abort() in timeout function.
    
    As Ming's proposal, we need change the timer into sched_work to
    benefit from using &fw_lock mutex also.
    
    Signed-off-by: default avatarliu chuansheng <chuansheng.liu@intel.com>
    Acked-by: default avatarMing Lei <ming.lei@canonical.com>
    Cc: stable <stable@vger.kernel.org>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    ce2fcbd9
    History
    firmware_class.c 34.08 KiB