Pull ARM SoC fixes from Arnd Bergmann: "There are a lot of minor DT fixes for Mediatek, Rockchip, Qualcomm and Microchip and NXP, addressing both build-time warnings and bugs found during runtime testing. Most of these changes are machine specific fixups, but there are a few notable regressions that affect an entire SoC: - The Qualcomm MSI support that was improved for 6.9 ended up being wrong on some chips and now gets fixed. - The i.MX8MP camera interface broke due to a typo and gets updated again. The main driver fix is also for Qualcomm platforms, rewriting an interface in the QSEECOM firmware support that could lead to crashing the kernel from a trusted application. The only other code changes are minor fixes for Mediatek SoC drivers" * tag 'soc-fixes-6.9-2' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc: (50 commits) ARM: dts: imx6ull-tarragon: fix USB over-current polarity soc: mediatek: mtk-socinfo: depends on CONFIG_SOC_BUS soc: mediatek: mtk-svs: Append "-thermal" to thermal zone names arm64: dts: imx8mp: Fix assigned-clocks for second CSI2 ARM: dts: microchip: at91-sama7g54_curiosity: Replace regulator-suspend-voltage with the valid property ARM: dts: microchip: at91-sama7g5ek: Replace regulator-suspend-voltage with the valid property arm64: dts: rockchip: Fix USB interface compatible string on kobol-helios64 arm64: dts: qcom: sc8180x: Fix ss_phy_irq for secondary USB controller arm64: dts: qcom: sm8650: Fix the msi-map entries arm64: dts: qcom: sm8550: Fix the msi-map entries arm64: dts: qcom: sm8450: Fix the msi-map entries arm64: dts: qcom: sc8280xp: add missing PCIe minimum OPP arm64: dts: qcom: x1e80100: Fix the compatible for cluster idle states arm64: dts: qcom: Fix type of "wdog" IRQs for remoteprocs arm64: dts: rockchip: regulator for sd needs to be always on for BPI-R2Pro dt-bindings: rockchip: grf: Add missing type to 'pcie-phy' node arm64: dts: rockchip: drop redundant disable-gpios in Lubancat 2 arm64: dts: rockchip: drop redundant disable-gpios in Lubancat 1 arm64: dts: rockchip: drop redundant pcie-reset-suspend in Scarlet Dumo arm64: dts: rockchip: mark system power controller and fix typo on orangepi-5-plus ...
Showing the changes to include/linux (2 of 44 files). Show all
Unified · Split
| @@ -10,6 +10,7 @@ · 9 unmodified lines | ||
| 10 | 10 | #define __QCOM_QSEECOM_H |
| 11 | 11 | |
| 12 | 12 | #include <linux/auxiliary_bus.h> |
| 13 | +#include <linux/dma-mapping.h> | |
| 13 | 14 | #include <linux/types.h> |
| 14 | 15 | |
| 15 | 16 | #include <linux/firmware/qcom/qcom_scm.h> |
| @@ -24,12 +25,57 @@ struct qseecom_client { · 8 unmodified lines | ||
| 24 | 25 | u32 app_id; |
| 25 | 26 | }; |
| 26 | 27 | |
| 28 | +/** | |
| 29 | + * qseecom_scm_dev() - Get the SCM device associated with the QSEECOM client. | |
| 30 | + * @client: The QSEECOM client device. | |
| 31 | + * | |
| 32 | + * Returns the SCM device under which the provided QSEECOM client device | |
| 33 | + * operates. This function is intended to be used for DMA allocations. | |
| 34 | + */ | |
| 35 | +static inline struct device *qseecom_scm_dev(struct qseecom_client *client) | |
| 36 | +{ | |
| 37 | + return client->aux_dev.dev.parent->parent; | |
| 38 | +} | |
| 39 | + | |
| 40 | +/** | |
| 41 | + * qseecom_dma_alloc() - Allocate DMA memory for a QSEECOM client. | |
| 42 | + * @client: The QSEECOM client to allocate the memory for. | |
| 43 | + * @size: The number of bytes to allocate. | |
| 44 | + * @dma_handle: Pointer to where the DMA address should be stored. | |
| 45 | + * @gfp: Allocation flags. | |
| 46 | + * | |
| 47 | + * Wrapper function for dma_alloc_coherent(), allocating DMA memory usable for | |
| 48 | + * TZ/QSEECOM communication. Refer to dma_alloc_coherent() for details. | |
| 49 | + */ | |
| 50 | +static inline void *qseecom_dma_alloc(struct qseecom_client *client, size_t size, | |
| 51 | + dma_addr_t *dma_handle, gfp_t gfp) | |
| 52 | +{ | |
| 53 | + return dma_alloc_coherent(qseecom_scm_dev(client), size, dma_handle, gfp); | |
| 54 | +} | |
| 55 | + | |
| 56 | +/** | |
| 57 | + * dma_free_coherent() - Free QSEECOM DMA memory. | |
| 58 | + * @client: The QSEECOM client for which the memory has been allocated. | |
| 59 | + * @size: The number of bytes allocated. | |
| 60 | + * @cpu_addr: Virtual memory address to free. | |
| 61 | + * @dma_handle: DMA memory address to free. | |
| 62 | + * | |
| 63 | + * Wrapper function for dma_free_coherent(), freeing memory previously | |
| 64 | + * allocated with qseecom_dma_alloc(). Refer to dma_free_coherent() for | |
| 65 | + * details. | |
| 66 | + */ | |
| 67 | +static inline void qseecom_dma_free(struct qseecom_client *client, size_t size, | |
| 68 | + void *cpu_addr, dma_addr_t dma_handle) | |
| 69 | +{ | |
| 70 | + return dma_free_coherent(qseecom_scm_dev(client), size, cpu_addr, dma_handle); | |
| 71 | +} | |
| 72 | + | |
| 27 | 73 | /** |
| 28 | 74 | * qcom_qseecom_app_send() - Send to and receive data from a given QSEE app. |
| 29 | 75 | * @client: The QSEECOM client associated with the target app. |
| 30 | − * @req: Request buffer sent to the app (must be DMA-mappable). | |
| 76 | + * @req: DMA address of the request buffer sent to the app. | |
| 31 | 77 | * @req_size: Size of the request buffer. |
| 32 | − * @rsp: Response buffer, written to by the app (must be DMA-mappable). | |
| 78 | + * @rsp: DMA address of the response buffer, written to by the app. | |
| 33 | 79 | * @rsp_size: Size of the response buffer. |
| 34 | 80 | * |
| 35 | 81 | * Sends a request to the QSEE app associated with the given client and read |
| @@ -43,8 +89,9 @@ struct qseecom_client { · 7 unmodified lines | ||
| 43 | 89 | * |
| 44 | 90 | * Return: Zero on success, nonzero on failure. |
| 45 | 91 | */ |
| 46 | −static inline int qcom_qseecom_app_send(struct qseecom_client *client, void *req, size_t req_size, | |
| 47 | − void *rsp, size_t rsp_size) | |
| 92 | +static inline int qcom_qseecom_app_send(struct qseecom_client *client, | |
| 93 | + dma_addr_t req, size_t req_size, | |
| 94 | + dma_addr_t rsp, size_t rsp_size) | |
| 48 | 95 | { |
| 49 | 96 | return qcom_scm_qseecom_app_send(client->app_id, req, req_size, rsp, rsp_size); |
| 50 | 97 | } |
| @@ -118,8 +118,8 @@ bool qcom_scm_lmh_dcvsh_available(void); · 117 unmodified lines | ||
| 118 | 118 | #ifdef CONFIG_QCOM_QSEECOM |
| 119 | 119 | |
| 120 | 120 | int qcom_scm_qseecom_app_get_id(const char *app_name, u32 *app_id); |
| 121 | −int qcom_scm_qseecom_app_send(u32 app_id, void *req, size_t req_size, void *rsp, | |
| 122 | − size_t rsp_size); | |
| 121 | +int qcom_scm_qseecom_app_send(u32 app_id, dma_addr_t req, size_t req_size, | |
| 122 | + dma_addr_t rsp, size_t rsp_size); | |
| 123 | 123 | |
| 124 | 124 | #else /* CONFIG_QCOM_QSEECOM */ |
| 125 | 125 | |
| @@ -128,9 +128,9 @@ static inline int qcom_scm_qseecom_app_get_id(const char *app_name, u32 *app_id) · 2 unmodified lines | ||
| 128 | 128 | return -EINVAL; |
| 129 | 129 | } |
| 130 | 130 | |
| 131 | −static inline int qcom_scm_qseecom_app_send(u32 app_id, void *req, | |
| 132 | − size_t req_size, void *rsp, | |
| 133 | − size_t rsp_size) | |
| 131 | +static inline int qcom_scm_qseecom_app_send(u32 app_id, | |
| 132 | + dma_addr_t req, size_t req_size, | |
| 133 | + dma_addr_t rsp, size_t rsp_size) | |
| 134 | 134 | { |
| 135 | 135 | return -EINVAL; |
| 136 | 136 | } |