Skip to content

Conversation

@majunkier
Copy link
Contributor

In legacy SSP driver, DMA request request is enabled during FIFO drain, causing DMA keeps filling FIFO and preventing empty, which leads to timeout. ERROR is logged by poll_for_register_delay() while ssp_empty_tx_fifo() returns WARN, so there is inconsistent error handling between this two functions.

Issue#4369 describe issue on older firmware version.

case-lib/lib.sh Outdated
# Filter out SSP timeout errors which not relevant on older firmware
grep -v 'poll timeout reg .* mask .* val .* us .*' | \
grep -v 'ssp_empty_tx_fifo() warning: timeout' | \
grep -i --word-regexp -e 'ERR' -e 'ERROR' -e '<err>' -e OSError
Copy link
Collaborator

@marc-hb marc-hb Nov 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks fragile and it's located in the main/critical spot. Also, it's losing the -B 2 and -A 1 context.

Do you really care about other errors on those old platforms? If not, you could just go all the way, extend 706a9d8 and ignore those legacy platforms completely.

If you still care about other errors on legacy systems, then it's simpler not to duplicate the first grep and not lose the context with only 2 greps like this:

  SSP_timeout_msgs=(
    -e 'poll timeout reg .* mask .* val .* us .*'
    -e 'ssp_empty_tx_fifo() warning: timeout' 
  )

  grep -v "${SSP_timeout_msgs[@]}" "$1" |
       grep -B 2 -A 1 -i --word-regexp -e 'ERR' -e 'ERROR' -e '<err>' -e OSError 

So the last grep gives you the exit status wanted.

Or:

  case "$platf" in
  abd|def)
     SSP_timeout_msgs=(
    -e 'poll timeout reg .* mask .* val .* us .*'
    -e 'ssp_empty_tx_fifo() warning: timeout' 
    );;
  *)
  # dummy string so it's never empty
   SSP_timeout_msgs=(
    -e dummy_ztring_Never_matches 
   ) ;;
  esac

  grep -v  "${SSP_timeout_msgs[@]}" "$1" |
       grep -B 2 -A 1 -i --word-regexp -e 'ERR' -e 'ERROR' -e '<err>' -e OSError

Copy link
Contributor Author

@majunkier majunkier Nov 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you for suggestion! you were absolutely correct, i have implemented and tested your example

In legacy SSP driver, DMA request request is enabled
during FIFO drain, causing DMA keeps filling FIFO
and preventing empty, which leads to timeout.
ERROR is logged by poll_for_register_delay()
while ssp_empty_tx_fifo() returns WARN,
so there is inconsistent error handling between
this two functions.

Issue#4369 describe issue on older firmware version.

Signed-off-by: Mateusz Junkier <mateusz.junkier@intel.com>
@redzynix redzynix merged commit 270d240 into thesofproject:main Nov 26, 2025
4 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants