]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
usb: misc: qcom_eud: Access EUD_MODE_MANAGER2 through secure calls
authorKomal Bajaj <komal.bajaj@oss.qualcomm.com>
Thu, 31 Jul 2025 09:01:32 +0000 (14:31 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Aug 2025 15:13:45 +0000 (17:13 +0200)
commitc0485e864a2eaa1d5a84c71e573dd236d0e885ae
treef106041fade4dca76c65ef452ba152a80838da7a
parent738812440b3c9083188191caa62ef950cf1ed9ed
usb: misc: qcom_eud: Access EUD_MODE_MANAGER2 through secure calls

EUD_MODE_MANAGER2 register is mapped to a memory region that is marked
as read-only for operating system running at EL1, enforcing access
restrictions that prohibit direct memory-mapped writes via writel().

Attempts to write to this region from HLOS can result in silent failures
or memory access violations, particularly when toggling EUD (Embedded
USB Debugger) state. To ensure secure register access, modify the driver
to use qcom_scm_io_writel(), which routes the write operation to Qualcomm
Secure Channel Monitor (SCM). SCM has the necessary permissions to access
protected memory regions, enabling reliable control over EUD state.

SC7280, the only user of EUD is also affected, indicating that this could
never have worked on a properly fused device.

Fixes: 9a1bf58ccd44 ("usb: misc: eud: Add driver support for Embedded USB Debugger(EUD)")
Signed-off-by: Melody Olvera <quic_molvera@quicinc.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Reviewed-by: Souradeep Chowdhury <quic_schowdhu@quicinc.com>
Signed-off-by: Komal Bajaj <komal.bajaj@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20250731-eud_mode_manager_secure_access-v8-1-4a5dcbb79f41@oss.qualcomm.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/misc/Kconfig
drivers/usb/misc/qcom_eud.c