Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • L linux
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Kirill Smelkov
  • linux
  • Repository
  • linux
  • kernel
  • resource.c
Find file BlameHistoryPermalink
  • Simon Guinot's avatar
    kernel/resource.c: fix muxed resource handling in __request_region() · cda49c04
    Simon Guinot authored Sep 10, 2015
    commit 59ceeaaf
    
     upstream.
    
    In __request_region, if a conflict with a BUSY and MUXED resource is
    detected, then the caller goes to sleep and waits for the resource to be
    released.  A pointer on the conflicting resource is kept.  At wake-up
    this pointer is used as a parent to retry to request the region.
    
    A first problem is that this pointer might well be invalid (if for
    example the conflicting resource have already been freed).  Another
    problem is that the next call to __request_region() fails to detect a
    remaining conflict.  The previously conflicting resource is passed as a
    parameter and __request_region() will look for a conflict among the
    children of this resource and not at the resource itself.  It is likely
    to succeed anyway, even if there is still a conflict.
    
    Instead, the parent of the conflicting resource should be passed to
    __request_region().
    
    As a fix, this patch doesn't update the parent resource pointer in the
    case we have to wait for a muxed region right after.
    
    Reported-and-tested-by: default avatarVincent Pelletier <plr.vincent@gmail.com>
    Signed-off-by: default avatarSimon Guinot <simon.guinot@sequanux.org>
    Tested-by: default avatarVincent Donnefort <vdonnefort@gmail.com>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    cda49c04
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7