Here is a summary of the changes in this patch series: 1. Fix for race condition in updating of the chan_in_use flag Ensures correct updating of the chan_in_use flag to avoid potential race conditions. 2. Interrupt handling fix Ensures platform acknowledgment interrupts are always cleared to avoid leaving the interrupt asserted forever. 3. Endian conversion cleanup Removes unnecessary endianness conversion in the PCC mailbox driver. 4. Memory mapping improvements Uses acpi_os_ioremap() instead of direct mapping methods for better ACPI compatibility. 5. Return early if the command complete register is absent Ensures that if no GAS (Generic Address Structure) register is available, the function exits early. 6. Refactor IRQ handler and move error handling to a separate function Improves readability of error handling in the PCC mailbox driver’s interrupt handler. 7. Shared memory mapping refactoring/enhancements Ensures the shared memory is always mapped and unmapped in the PCC mailbox driver when the PCC channel is requested and release. 8. Refactored check_and_ack() Function Simplifies and improves the logic for handling type4 platform notification acknowledgments. 09-13. Shared memory handling simplifications across multiple drivers Simplifies shared memory handling in: Kunpeng HCCS driver (soc: hisilicon) Apm X-Gene Slimpro I2C driver X-Gene hardware monitoring driver (hwmon) ACPI PCC driver ACPI CPPC driver The X-gene related changes now change the mapping attributes to align with ACPI specification. There are possibilities for more cleanups on top of these changes around how the shmem is accessed within these driver. Also, my main aim is to get 1-8 merged first and target 9-13 for following merge window through respective tree. Overall, the patch series focuses on improving correctness, efficiency, and maintainability of the PCC mailbox driver and related components by fixing race conditions, optimizing memory handling, simplifying shared memory interactions, and refactoring code for clarity. Signed-off-by: Sudeep Holla <sudeep.holla@xxxxxxx> --- Jassi, Please take patch [1-8]/13 through the mailbox tree if and when you are happy with the changes. I haven't got Ack from I2C still, but if you are happy to take [9-13]/13, I can check with I2C maintainer. Or else I am happy to take it individually later once the PCC changes are merged. I am still keeping it together if anyone is interested in testing. Changes in v3: - Updated the comment around updation of chan_in_use flag to keep it appropriate even after acknowledging the interrupt as first action in the irq handler - Added all the review/ack/tested-by tags from Huisong Li, Adam Young and Robbie King - Added a note that double mapping introduced temporarily will not impact any existing mbox client drivers as all the drivers move to using new and only mapping after all the changes - s/pcc_chan_check_and_ack/pcc_chan_acknowledge/ which was originally check_and_ack() - Link to v2: https://lore.kernel.org/r/20250305-pcc_fixes_updates-v2-0-1b1822bc8746@xxxxxxx Changes in v2: - Improved time vs flow graph for the platform ack interrupt acknowledgment issue in patch 2 - Replaced PCC_ACK_FLAG_MASK with PCC_CMD_COMPLETION_NOTIFY in patch 3 - Fixed return value check from pcc_mbox_error_check_and_clear() in patch 6 - Dropped the change moving the function pcc_mbox_ioremap() - Adjusted error message in kunpeng_hccs driver after the change - Added the received ack/review tags - Link to v1: https://lore.kernel.org/r/20250303-pcc_fixes_updates-v1-0-3b44f3d134b1@xxxxxxx --- Huisong Li (1): mailbox: pcc: Fix the possible race in updation of chan_in_use flag Sudeep Holla (12): mailbox: pcc: Always clear the platform ack interrupt first mailbox: pcc: Drop unnecessary endianness conversion of pcc_hdr.flags mailbox: pcc: Return early if no GAS register from pcc_mbox_cmd_complete_check mailbox: pcc: Use acpi_os_ioremap() instead of ioremap() mailbox: pcc: Refactor error handling in irq handler into separate function mailbox: pcc: Always map the shared memory communication address mailbox: pcc: Refactor and simplify check_and_ack() soc: hisilicon: kunpeng_hccs: Simplify PCC shared memory region handling i2c: xgene-slimpro: Simplify PCC shared memory region handling hwmon: (xgene-hwmon) Simplify PCC shared memory region handling ACPI: PCC: Simplify PCC shared memory region handling ACPI: CPPC: Simplify PCC shared memory region handling drivers/acpi/acpi_pcc.c | 13 +--- drivers/acpi/cppc_acpi.c | 16 +---- drivers/hwmon/xgene-hwmon.c | 40 ++---------- drivers/i2c/busses/i2c-xgene-slimpro.c | 39 ++---------- drivers/mailbox/pcc.c | 113 ++++++++++++++++----------------- drivers/soc/hisilicon/kunpeng_hccs.c | 42 +++++------- drivers/soc/hisilicon/kunpeng_hccs.h | 2 - include/acpi/pcc.h | 6 -- 8 files changed, 84 insertions(+), 187 deletions(-) --- base-commit: 4d872d51bc9d7b899c1f61534e3dbde72613f627 change-id: 20250303-pcc_fixes_updates-55a17fd28e76 -- Regards, Sudeep