Skip to content

RDKECOREMW-1166 : handle not supported hal implementation causing high cpu utilization#41

Open
Nairisnotavailable wants to merge 9 commits into
developfrom
feature/RDKECOREMW-1166-handle-not-supported-halimpl
Open

RDKECOREMW-1166 : handle not supported hal implementation causing high cpu utilization#41
Nairisnotavailable wants to merge 9 commits into
developfrom
feature/RDKECOREMW-1166-handle-not-supported-halimpl

Conversation

@Nairisnotavailable
Copy link
Copy Markdown
Contributor

@Nairisnotavailable Nairisnotavailable commented Nov 18, 2025

Reason for Change: on a CEC not supported HAL; middleware component is causing high CPU utilization (100%+) due to frequent poll process. This change addresses that by moving polling threads into an init section from contructor and reporting exception when hal call fails. In the upper layer these exceptions gets handled gracefully
Related: rdkcentral/entservices-inputoutput#308

@Nairisnotavailable Nairisnotavailable requested a review from a team as a code owner November 18, 2025 10:21
Comment thread ccec/src/LibCCEC.cpp
@arun-madhavan-013 arun-madhavan-013 changed the title Feature/rdkecoremw 1166 handle not supported halimpl RDKECOREMW-1166 : handle not supported hal implementation causing high cpu utilization Nov 18, 2025
@apatel859 apatel859 requested a review from Copilot November 25, 2025 14:12
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses high CPU utilization (100%+) on devices where the HAL (Hardware Abstraction Layer) does not support CEC. The fix moves polling thread initialization from the Bus constructor to the init section and adds comprehensive exception handling when HAL calls fail.

Key Changes:

  • Added try-catch blocks in LibCCEC::init() to handle exceptions from driver initialization, particularly OperationNotSupportedException
  • Enhanced error handling across all HAL API calls in DriverImpl.cpp to throw specific exceptions based on error codes rather than generic IOExceptions
  • Deferred Bus thread startup from constructor to Bus::start() method to prevent polling on unsupported hardware
  • Fixed typo and removed trailing whitespace

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
ccec/src/Util.cpp Fixed typo in error message ("filee" → "file") and cleaned up trailing whitespace
ccec/src/LibCCEC.cpp Added exception handling in init() to catch and propagate HAL errors, preventing thread startup on unsupported hardware
ccec/src/DriverImpl.cpp Enhanced all HAL API calls with comprehensive error handling that maps specific error codes to appropriate exceptions
ccec/src/Bus.cpp Removed thread startup from constructor; added comments explaining deferred initialization strategy

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread ccec/src/LibCCEC.cpp
Comment thread ccec/src/DriverImpl.cpp
Comment thread ccec/src/Bus.cpp Outdated
Comment thread ccec/src/LibCCEC.cpp Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 27 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread ccec/src/DriverImpl.cpp Outdated
Comment thread ccec/src/DriverImpl.cpp Outdated
Comment thread ccec/src/DriverImpl.cpp Outdated
Comment thread ccec/src/Bus.cpp Outdated
Comment thread ccec/src/DriverImpl.cpp
Comment thread ccec/src/DriverImpl.cpp Outdated
Comment thread ccec/src/DriverImpl.cpp
Comment thread ccec/src/DriverImpl.cpp
Comment thread ccec/src/DriverImpl.cpp
Comment thread ccec/src/DriverImpl.cpp Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread ccec/src/DriverImpl.cpp
Comment thread ccec/src/DriverImpl.cpp
Comment thread ccec/src/DriverImpl.cpp
Comment thread ccec/src/DriverImpl.cpp
Comment thread ccec/src/DriverImpl.cpp
Comment thread ccec/src/DriverImpl.cpp
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 10 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread ccec/src/DriverImpl.cpp
Comment thread ccec/src/DriverImpl.cpp
Comment thread ccec/src/DriverImpl.cpp
Comment thread ccec/src/DriverImpl.cpp
Comment thread ccec/src/DriverImpl.cpp
Comment thread ccec/src/DriverImpl.cpp
Comment thread ccec/src/DriverImpl.cpp
Comment thread ccec/src/DriverImpl.cpp
Comment thread ccec/src/DriverImpl.cpp
Comment thread ccec/src/DriverImpl.cpp
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread ccec/src/DriverImpl.cpp
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread ccec/src/DriverImpl.cpp
Comment thread ccec/src/DriverImpl.cpp
Comment thread ccec/src/DriverImpl.cpp
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 9 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread ccec/src/DriverImpl.cpp
Comment thread ccec/src/DriverImpl.cpp
Comment thread ccec/src/DriverImpl.cpp
Comment thread ccec/src/DriverImpl.cpp
Comment thread ccec/src/DriverImpl.cpp
Comment thread ccec/src/DriverImpl.cpp
Comment thread ccec/src/DriverImpl.cpp
Comment thread ccec/src/DriverImpl.cpp
Comment thread ccec/src/DriverImpl.cpp
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.

4 participants