Skip to content

build/tools/amebasmart: Refine wifi wake-up logic to fix rare crash issue#7112

Merged
hk-gwak merged 1 commit intoSamsung:masterfrom
jwei5:km4_issue
Feb 12, 2026
Merged

build/tools/amebasmart: Refine wifi wake-up logic to fix rare crash issue#7112
hk-gwak merged 1 commit intoSamsung:masterfrom
jwei5:km4_issue

Conversation

@jwei5
Copy link
Copy Markdown
Contributor

@jwei5 jwei5 commented Jan 8, 2026

  • Modify wififw logic to resolve rare KM4 crash after wakeup

@jwei5 jwei5 force-pushed the km4_issue branch 2 times, most recently from c0ad142 to 01a1482 Compare January 9, 2026 06:32
@sunghan-chang
Copy link
Copy Markdown
Contributor

@jwei5 You just changed the day in the release note. Does it mean you made a change for the same issue again?

@sunghan-chang
Copy link
Copy Markdown
Contributor

@hk-gwak Please check this PR.

@sunghan-chang
Copy link
Copy Markdown
Contributor

@jwei5 Please leave the issue and how to fix in detail. Current description does not help us in history.

Copy link
Copy Markdown
Contributor

@sunghan-chang sunghan-chang left a comment

Choose a reason for hiding this comment

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

Not allowed to merge. No meaningful description.

@jwei5 jwei5 changed the title build/tools/amebasmart: Fix KM4 crash after wakeup [Under Verification] build/tools/amebasmart: Fix KM4 crash after wakeup Jan 12, 2026
@jwei5
Copy link
Copy Markdown
Contributor Author

jwei5 commented Jan 12, 2026

Hi @sunghan-chang , as this PR currently includes some debug information used for verification, the detailed changes have not been included in the release note yet.
Once the verification is complete, we will update this PR to remove the debug information and include the detailed description. Apologies for any confusion this might have caused.

@sunghan-chang
Copy link
Copy Markdown
Contributor

Hi @sunghan-chang , as this PR currently includes some debug information used for verification, the detailed changes have not been included in the release note yet. Once the verification is complete, we will update this PR to remove the debug information and include the detailed description. Apologies for any confusion this might have caused.

@jwei5 Could you let me know status of this?
@hk-gwak Any plan for this?

@hk-gwak
Copy link
Copy Markdown
Collaborator

hk-gwak commented Feb 9, 2026

Hi @sunghan-chang,
Plan is : This PR needs to be merged by this week. This change needs to be included for a project on March.
We got technical report from realtek last Friday, and reviewing this document. Will merge this PR as soon as reviewing this document is finished.

@hk-gwak
Copy link
Copy Markdown
Collaborator

hk-gwak commented Feb 9, 2026

Hi @jwei5 , Reviewing the ER, I have some questions.

  1. "Detected buffer corruption; packet length and other information were invalid" -> What kind of buffer is this?
  2. "Instead of writing to a buffer, WiFiFWnow simply checks the thepacket’s destination address" -> What kind of address is this? mac address?
  3. "Instead of writing to a buffer, WiFiFWnow simply checks the thepacket’s destination address" -> So from now on, WiFI FW does not distinguish packet type, but only check dest addr for wakeup?
  4. According to my understanding, wakeup processing was not done normally by buffer corruption. Then, Do you guess any cause of buffer corruption?

@jwei5
Copy link
Copy Markdown
Contributor Author

jwei5 commented Feb 9, 2026

Hi @hk-gwak , please refer to the replies below:

  1. "Detected buffer corruption; packet length and other information were invalid" -> What kind of buffer is this?

This buffer is used for storing some details of the received packet, such as the packet length, data rate of the received packet etc.

  1. "Instead of writing to a buffer, WiFiFWnow simply checks the thepacket’s destination address" -> What kind of address is this? mac address?

Yes, this refers to the MAC address.

  1. "Instead of writing to a buffer, WiFiFWnow simply checks the thepacket’s destination address" -> So from now on, WiFI FW does not distinguish packet type, but only check dest addr for wakeup?

The general condition for wakeup is to check the destination address, but WiFiFW will also still distinguish packet type to filter it further. There are a few checks for the wake up flow:

  1. First, check if the destination address matches.
  2. Second, WiFiFW will filter further based on the packet type.
    For example, if the received packet type is Null Data, it will not wake the system even if the destination address matches.
  1. According to my understanding, wakeup processing was not done normally by buffer corruption. Then, Do you guess any cause of buffer corruption?

In our tests, the buffer corruption is caused by a very specific timing mismatch during the WiFi wake-up process, which explains its low occurrence rate.
With the refined WiFiFW wake-up logic, we've eliminated the mechanism of checking the shared buffer for evaluating the wake-up condition. Instead, we directly check the destination address of the packet to ensure the correct packet content is processed, thereby preventing the issue.

@jwei5
Copy link
Copy Markdown
Contributor Author

jwei5 commented Feb 9, 2026

Rebased PR to resolve merge conflict for KM4

@hk-gwak
Copy link
Copy Markdown
Collaborator

hk-gwak commented Feb 10, 2026

Hi @jwei5 , thank you for your response. I want to ask more questions.

2. For example, if the received packet type is Null Data, it will not wake the system even if the destination address matches.

If Null Data will not wake the system, which layer is sending the ACK response for the null data packet? And is this behavior changed before/after this PR?

  • First, check if the destination address matches.
  • Second, WiFiFW will filter further based on the packet type.

Sounds like 1. dest addr 2. packet type. Then how about broadcast packet like ARP? There is no dest addr, then it will be filtered as no-wakeup at 1.

@jwei5
Copy link
Copy Markdown
Contributor Author

jwei5 commented Feb 10, 2026

Hi @hk-gwak,

If Null Data will not wake the system, which layer is sending the ACK response for the null data packet? And is this behavior changed before/after this PR?

Regardless whether the system is awake or sleeping, the hardware layer handles the sending of ACK response for unicast packets. This behavior remains unchanged after this PR.

Sounds like 1. dest addr 2. packet type. Then how about broadcast packet like ARP? There is no dest addr, then it will be filtered as no-wakeup at 1.

In the context of 'wake-up,' it refers to the waking up of the driver/application layer. Packets that are marked as no-wakeup (eg. Broadcast), will still be processed by WiFiFW but do not wake the driver/application.

@hk-gwak
Copy link
Copy Markdown
Collaborator

hk-gwak commented Feb 10, 2026

Regardless whether the system is awake or sleeping, the hardware layer handles the sending of ACK response for unicast packets. This behavior remains unchanged after this PR.

hardware layer -> Is this WiFiFW also?

@jwei5
Copy link
Copy Markdown
Contributor Author

jwei5 commented Feb 10, 2026

hardware layer -> Is this WiFiFW also?

No, the hardware layer refers to the physical components of the system, such as the receiver. When a packet is received, the hardware layer will reply with an ACK packet as it can handle this operation efficiently.

hk-gwak
hk-gwak previously approved these changes Feb 11, 2026
@sunghan-chang
Copy link
Copy Markdown
Contributor

Hi @sunghan-chang , as this PR currently includes some debug information used for verification, the detailed changes have not been included in the release note yet. Once the verification is complete, we will update this PR to remove the debug information and include the detailed description. Apologies for any confusion this might have caused.

Hello @jwei5 . Please include the detailed description. This does not help maintenance in history.

…ssue

- Refine wififw wake-up logic to use packet's destination address for evaluating wake-up condition
- Previous logic checks a shared buffer, but there is a rare case of timing mismatch that can cause buffer corruption, affecting the wake-up process and causing KM4 crash
@jwei5 jwei5 changed the title [Under Verification] build/tools/amebasmart: Fix KM4 crash after wakeup build/tools/amebasmart: Refine wifi wake-up logic to fix rare crash issue Feb 11, 2026
@jwei5
Copy link
Copy Markdown
Contributor Author

jwei5 commented Feb 11, 2026

Hi @sunghan-chang , I have just updated the commit with more details. Could you help to check if it is ok?
Thank you.

@hk-gwak hk-gwak merged commit 075ac85 into Samsung:master Feb 12, 2026
17 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