Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • linux-rt linux-rt
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
    • 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
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Arch LinuxArch Linux
  • Packaging
  • Upstream
  • linux-rtlinux-rt
  • Repository
  • linux-rt
  • sound
  • core
  • pcm_lib.c
Find file BlameHistoryPermalink
  • Kelly Anderson's avatar
    ALSA: pcm: fix infinite loop in snd_pcm_update_hw_ptr0() · 12ff414e
    Kelly Anderson authored Apr 01, 2011
    
    
    When period interrupts are disabled, snd_pcm_update_hw_ptr0() compares
    the current time against the time estimated for the current hardware
    pointer to detect xruns.  The somewhat fuzzy threshold in the while loop
    makes it possible that hdelta becomes negative; the comparison being
    done with unsigned types then makes the loop go through the entire 263
    negative range, and, depending on the value, never reach an unsigned
    value that is small enough to stop the loop.  Doing this with interrupts
    disabled results in the machine locking up.
    
    To prevent this, ensure that the loop condition uses signed types for
    both operands so that the comparison is correctly done.
    
    Many thanks to Kelly Anderson for debugging this.
    
    Reported-by: default avatarNix <nix@esperi.org.uk>
    Reported-by: default avatar"Christopher K." <c.krooss@googlemail.com>
    Reported-and-tested-by: default avatarKelly Anderson <kelly@silka.with-linux.com>
    Signed-off-by: default avatarKelly Anderson <kelly@silka.with-linux.com>
    [cl: remove unneeded casts; use a temp variable]
    Signed-off-by: default avatarClemens Ladisch <clemens@ladisch.de>
    Cc: 2.6.38 <stable@kernel.org>
    
    Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
    12ff414e