···2745274527462746ARM/QUALCOMM SUPPORT27472747M: Bjorn Andersson <andersson@kernel.org>27482748-M: Konrad Dybcio <konrad.dybcio@linaro.org>27482748+M: Konrad Dybcio <konradybcio@kernel.org>27492749L: linux-arm-msm@vger.kernel.org27502750S: Maintained27512751T: git git://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux.git···71067106DRM DRIVER for Qualcomm Adreno GPUs71077107M: Rob Clark <robdclark@gmail.com>71087108R: Sean Paul <sean@poorly.run>71097109-R: Konrad Dybcio <konrad.dybcio@linaro.org>71097109+R: Konrad Dybcio <konradybcio@kernel.org>71107110L: linux-arm-msm@vger.kernel.org71117111L: dri-devel@lists.freedesktop.org71127112L: freedreno@lists.freedesktop.org···18771187711877218772QUALCOMM CORE POWER REDUCTION (CPR) AVS DRIVER1877318773M: Bjorn Andersson <andersson@kernel.org>1877418774-M: Konrad Dybcio <konrad.dybcio@linaro.org>1877418774+M: Konrad Dybcio <konradybcio@kernel.org>1877518775L: linux-pm@vger.kernel.org1877618776L: linux-arm-msm@vger.kernel.org1877718777S: Maintained
···4040};41414242struct qcom_tzmem_chunk {4343- phys_addr_t paddr;4443 size_t size;4544 struct qcom_tzmem_pool *owner;4645};···384385 return NULL;385386 }386387387387- chunk->paddr = gen_pool_virt_to_phys(pool->genpool, vaddr);388388 chunk->size = size;389389 chunk->owner = pool;390390···429431EXPORT_SYMBOL_GPL(qcom_tzmem_free);430432431433/**432432- * qcom_tzmem_to_phys() - Map the virtual address of a TZ buffer to physical.433433- * @vaddr: Virtual address of the buffer allocated from a TZ memory pool.434434+ * qcom_tzmem_to_phys() - Map the virtual address of TZ memory to physical.435435+ * @vaddr: Virtual address of memory allocated from a TZ memory pool.434436 *435435- * Can be used in any context. The address must have been returned by a call436436- * to qcom_tzmem_alloc().437437+ * Can be used in any context. The address must point to memory allocated438438+ * using qcom_tzmem_alloc().437439 *438438- * Returns: Physical address of the buffer.440440+ * Returns:441441+ * Physical address mapped from the virtual or 0 if the mapping failed.439442 */440443phys_addr_t qcom_tzmem_to_phys(void *vaddr)441444{442445 struct qcom_tzmem_chunk *chunk;446446+ struct radix_tree_iter iter;447447+ void __rcu **slot;448448+ phys_addr_t ret;443449444450 guard(spinlock_irqsave)(&qcom_tzmem_chunks_lock);445451446446- chunk = radix_tree_lookup(&qcom_tzmem_chunks, (unsigned long)vaddr);447447- if (!chunk)448448- return 0;452452+ radix_tree_for_each_slot(slot, &qcom_tzmem_chunks, &iter, 0) {453453+ chunk = radix_tree_deref_slot_protected(slot,454454+ &qcom_tzmem_chunks_lock);449455450450- return chunk->paddr;456456+ ret = gen_pool_virt_to_phys(chunk->owner->genpool,457457+ (unsigned long)vaddr);458458+ if (ret == -1)459459+ continue;460460+461461+ return ret;462462+ }463463+464464+ return 0;451465}452466EXPORT_SYMBOL_GPL(qcom_tzmem_to_phys);453467
+1-1
drivers/soc/qcom/Kconfig
···7777 select QCOM_QMI_HELPERS7878 select QCOM_PDR_MSG7979 select AUXILIARY_BUS8080- depends on NET && QRTR8080+ depends on NET && QRTR && (ARCH_QCOM || COMPILE_TEST)8181 default QCOM_RPROC_COMMON8282 help8383 The Protection Domain Mapper maps registered services to the domains
···2626};27272828/**2929- * qseecom_scm_dev() - Get the SCM device associated with the QSEECOM client.3030- * @client: The QSEECOM client device.3131- *3232- * Returns the SCM device under which the provided QSEECOM client device3333- * operates. This function is intended to be used for DMA allocations.3434- */3535-static inline struct device *qseecom_scm_dev(struct qseecom_client *client)3636-{3737- return client->aux_dev.dev.parent->parent;3838-}3939-4040-/**4141- * qseecom_dma_alloc() - Allocate DMA memory for a QSEECOM client.4242- * @client: The QSEECOM client to allocate the memory for.4343- * @size: The number of bytes to allocate.4444- * @dma_handle: Pointer to where the DMA address should be stored.4545- * @gfp: Allocation flags.4646- *4747- * Wrapper function for dma_alloc_coherent(), allocating DMA memory usable for4848- * TZ/QSEECOM communication. Refer to dma_alloc_coherent() for details.4949- */5050-static inline void *qseecom_dma_alloc(struct qseecom_client *client, size_t size,5151- dma_addr_t *dma_handle, gfp_t gfp)5252-{5353- return dma_alloc_coherent(qseecom_scm_dev(client), size, dma_handle, gfp);5454-}5555-5656-/**5757- * dma_free_coherent() - Free QSEECOM DMA memory.5858- * @client: The QSEECOM client for which the memory has been allocated.5959- * @size: The number of bytes allocated.6060- * @cpu_addr: Virtual memory address to free.6161- * @dma_handle: DMA memory address to free.6262- *6363- * Wrapper function for dma_free_coherent(), freeing memory previously6464- * allocated with qseecom_dma_alloc(). Refer to dma_free_coherent() for6565- * details.6666- */6767-static inline void qseecom_dma_free(struct qseecom_client *client, size_t size,6868- void *cpu_addr, dma_addr_t dma_handle)6969-{7070- return dma_free_coherent(qseecom_scm_dev(client), size, cpu_addr, dma_handle);7171-}7272-7373-/**7429 * qcom_qseecom_app_send() - Send to and receive data from a given QSEE app.7530 * @client: The QSEECOM client associated with the target app.7631 * @req: Request buffer sent to the app (must be TZ memory).