Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • C Ch Linux Perf
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • linux-arm
  • Ch Linux Perf
  • Repository
Switch branch/tag
  • ch-linux-perf
  • include
  • linux
  • device.h
Find file BlameHistoryPermalink
  • Rafael J. Wysocki's avatar
    drivers: base: Fix device link removal · 80dd33cf
    Rafael J. Wysocki authored May 14, 2021
    When device_link_free() drops references to the supplier and
    consumer devices of the device link going away and the reference
    being dropped turns out to be the last one for any of those
    device objects, its ->release callback will be invoked and it
    may sleep which goes against the SRCU callback execution
    requirements.
    
    To address this issue, make the device link removal code carry out
    the device_link_free() actions preceded by SRCU synchronization from
    a separate work item (the "long" workqueue is used for that, because
    it does not matter when the device link memory is released and it may
    take time to get to that point) instead of using SRCU callbacks.
    
    While at it, make the code work analogously when SRCU is not enabled
    to reduce the differences between the SRCU and non-SRCU cases.
    
    Fixes: 843e600b
    
     ("driver core: Fix sleeping in invalid context during device link deletion")
    Cc: stable <stable@vger.kernel.org>
    Reported-by: default avatarchenxiang (M) <chenxiang66@hisilicon.com>
    Tested-by: default avatarchenxiang (M) <chenxiang66@hisilicon.com>
    Reviewed-by: default avatarSaravana Kannan <saravanak@google.com>
    Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
    Link: https://lore.kernel.org/r/5722787.lOV4Wx5bFT@kreacher
    
    
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    80dd33cf