- 04 May, 2024 3 commits
-
-
Frank Li authored
Introduce the use of C11 standard _Generic in the fsl-edma driver for handling different TCD field types. Improve code clarity and help compiler optimization. Signed-off-by: Frank Li <Frank.Li@nxp.com> Link: https://lore.kernel.org/r/20240425205947.3436501-2-Frank.Li@nxp.comSigned-off-by: Vinod Koul <vkoul@kernel.org>
-
Frank Li authored
Implement trace event support to enhance logging functionality for register access and the transfer control descriptor (TCD) context. This will enable more comprehensive monitoring and analysis of system activities Signed-off-by: Frank Li <Frank.Li@nxp.com> Link: https://lore.kernel.org/r/20240425205947.3436501-1-Frank.Li@nxp.comSigned-off-by: Vinod Koul <vkoul@kernel.org>
-
Fenghua Yu authored
file_ida is allocated during cdev open and is freed accordingly during cdev release. This sequence is guaranteed by driver file operations. Therefore, there is no need to destroy an already empty file_ida when the WQ cdev is removed. Worse, ida_free() in cdev release may happen after destruction of file_ida per WQ cdev. This can lead to accessing an id in file_ida after it has been destroyed, resulting in a kernel panic. Remove ida_destroy(&file_ida) to address these issues. Fixes: e6fd6d7e ("dmaengine: idxd: add a device to represent the file opened") Signed-off-by: Lijun Pan <lijun.pan@intel.com> Signed-off-by: Fenghua Yu <fenghua.yu@intel.com> Reviewed-by: Dave Jiang <dave.jiang@intel.com> Link: https://lore.kernel.org/r/20240130013954.2024231-1-fenghua.yu@intel.comSigned-off-by: Vinod Koul <vkoul@kernel.org>
-
- 25 Apr, 2024 11 commits
-
-
Krzysztof Kozlowski authored
Add MODULE_DEVICE_TABLE(), so the module could be properly autoloaded based on the alias from of_device_id table. Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Link: https://lore.kernel.org/r/20240410170317.248715-2-krzk@kernel.orgSigned-off-by: Vinod Koul <vkoul@kernel.org>
-
Frank Li authored
Allow 'power-domains' property because i.MX8DXL i.MX8QM and i.MX8QXP need it. EDMA supports each power-domain for each dma channel. So minItems and maxItems align 'dma-channels'. Change fsl,imx93-edma3 example to fsl,imx8qm-edma to reflect this variants. Fixed below DTB_CHECK warning: dma-controller@599f0000: Unevaluated properties are not allowed ('power-domains' was unexpected) Signed-off-by: Frank Li <Frank.Li@nxp.com> Reviewed-by: Rob Herring (Arm) <robh@kernel.org> Link: https://lore.kernel.org/r/20240417152457.361340-2-Frank.Li@nxp.comSigned-off-by: Vinod Koul <vkoul@kernel.org>
-
Frank Li authored
fsl,imx8qm-adma and fsl,imx8qm-edma don't require 'clocks'. Remove it from required and add 'if' block for other compatible string to keep the same restrictions. Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Signed-off-by: Frank Li <Frank.Li@nxp.com> Link: https://lore.kernel.org/r/20240417152457.361340-1-Frank.Li@nxp.comSigned-off-by: Vinod Koul <vkoul@kernel.org>
-
Frank Li authored
Fix all kernel-doc warnings under drivers/dma/fsl-dpaa2-qdma. ./scripts/kernel-doc -v -none drivers/dma/fsl-dpaa2-qdma/* drivers/dma/fsl-dpaa2-qdma/dpdmai.c:262: warning: Function parameter or struct member 'queue_idx' not described in 'dpdmai_set_rx_queue' drivers/dma/fsl-dpaa2-qdma/dpdmai.c:339: warning: Excess function parameter 'fqid' description in 'dpdmai_get_tx_queue' ... Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202404190019.t4IhmbHh-lkp@intel.com/Signed-off-by: Frank Li <Frank.Li@nxp.com> Link: https://lore.kernel.org/r/20240418185851.3221726-1-Frank.Li@nxp.comSigned-off-by: Vinod Koul <vkoul@kernel.org>
-
Robin Gong authored
New sdma script (sdma-6q: v3.6, sdma-7d: v4.6) support i2c at imx8mp and imx6ull. So add I2C dma support. Signed-off-by: Robin Gong <yibin.gong@nxp.com> Acked-by: Clark Wang <xiaoning.wang@nxp.com> Reviewed-by: Joy Zou <joy.zou@nxp.com> Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com> Signed-off-by: Frank Li <Frank.Li@nxp.com> Link: https://lore.kernel.org/r/20240419150729.1071904-3-Frank.Li@nxp.comSigned-off-by: Vinod Koul <vkoul@kernel.org>
-
Frank Li authored
The macros SDMA_SCRIPT_ADDRS_ARRAY_SIZE_V<n> actually related with the struct sdma_script_start_addrs. struct sdma_script_start_addrs { ... /* End of v1 array */ ... /* End of v2 array */ ... /* End of v3 array */ ... /* End of v4 array */ }; When add new field of sdma_script_start_addrs, it is easy to miss update SDMA_SCRIPT_ADDRS_ARRAY_SIZE_V<n>. Employ offsetof for SDMA_SCRIPT_ADDRS_ARRAY_SIZE_V<n> macros instead of hardcoding numbers. the preprocessing stage will calculate the size for each version automatically. Signed-off-by: Frank Li <Frank.Li@nxp.com> Link: https://lore.kernel.org/r/20240419150729.1071904-2-Frank.Li@nxp.comSigned-off-by: Vinod Koul <vkoul@kernel.org>
-
Frank Li authored
Add peripheral types ID 27 for I2C because sdma firmware (sdma-6q: v3.6, sdma-7d: v4.6) support I2C DMA transfer. Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Signed-off-by: Frank Li <Frank.Li@nxp.com> Link: https://lore.kernel.org/r/20240419150729.1071904-1-Frank.Li@nxp.comSigned-off-by: Vinod Koul <vkoul@kernel.org>
-
Joy Zou authored
The eDMA hardware issue only exist imx8QM A0. A0 never mass production. The compatible string "fsl,imx8qm-adma" is unused. So remove it safely. Signed-off-by: Joy Zou <joy.zou@nxp.com> Reviewed-by: Frank Li <Frank.Li@nxp.com> Reviewed-by: Rob Herring (Arm) <robh@kernel.org> Link: https://lore.kernel.org/r/20240424064508.1886764-3-joy.zou@nxp.comSigned-off-by: Vinod Koul <vkoul@kernel.org>
-
Joy Zou authored
The eDMA hardware issue only exist imx8QM A0. A0 never mass production. So remove the workaround safely. Signed-off-by: Joy Zou <joy.zou@nxp.com> Reviewed-by: Frank Li <Frank.Li@nxp.com> Link: https://lore.kernel.org/r/20240424064508.1886764-2-joy.zou@nxp.comSigned-off-by: Vinod Koul <vkoul@kernel.org>
-
Rob Herring (Arm) authored
The QCom hidma binding was used on a defunct QCom server platform which mainly used ACPI. DT support in the Linux driver has been broken since 2018, so it seems this binding is unused and can be dropped. Signed-off-by: Rob Herring (Arm) <robh@kernel.org> Acked-by: Konrad Dybcio <konrad.dybcio@linaro.org> Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com> Link: https://lore.kernel.org/r/20240423161413.481670-2-robh@kernel.orgSigned-off-by: Vinod Koul <vkoul@kernel.org>
-
Rob Herring (Arm) authored
The DT support in hidma has been broken since commit 37fa4905 ("dmaengine: qcom_hidma: simplify DT resource parsing") in 2018. The issue is the of_address_to_resource() calls bail out on success rather than failure. This driver is for a defunct QCom server platform where DT use was limited to start with. As it seems no one has noticed the breakage, just remove the DT support altogether. Reported-by: Dan Carpenter <dan.carpenter@linaro.org> Signed-off-by: Rob Herring (Arm) <robh@kernel.org> Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org> Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com> Link: https://lore.kernel.org/r/20240423161413.481670-1-robh@kernel.orgSigned-off-by: Vinod Koul <vkoul@kernel.org>
-
- 17 Apr, 2024 3 commits
-
-
Erick Archer authored
This is an effort to get rid of all multiplications from allocation functions in order to prevent integer overflows [1]. Here the multiplication is obviously safe because the "channels" member can only be 8 or 2. This value is set when the "vendor_data" structs are initialized. static struct vendor_data vendor_pl080 = { [...] .channels = 8, [...] }; static struct vendor_data vendor_nomadik = { [...] .channels = 8, [...] }; static struct vendor_data vendor_pl080s = { [...] .channels = 8, [...] }; static struct vendor_data vendor_pl081 = { [...] .channels = 2, [...] }; However, using kcalloc() is more appropriate [1] and improves readability. This patch has no effect on runtime behavior. Link: https://github.com/KSPP/linux/issues/162 [1] Link: https://www.kernel.org/doc/html/next/process/deprecated.html#open-coded-arithmetic-in-allocator-arguments [1] Reviewed-by: Gustavo A. R. Silva <gustavoars@kernel.org> Signed-off-by: Erick Archer <erick.archer@outlook.com> Link: https://lore.kernel.org/r/AS8PR02MB72373D9261B3B166048A8E218B392@AS8PR02MB7237.eurprd02.prod.outlook.comSigned-off-by: Vinod Koul <vkoul@kernel.org>
-
Frank Li authored
Update the DPDMAI interfaces to support MC firmware up to 10.1x.x, which major change is to add dpaa domain id support. User space MC controller tool can create difference dpaa domain for difference virtual environment. DMA queues can map to difference service priorities. The MC command was basic compatible original one. The new command use previous reserved field. - Add queue number for dpdmai_get_tx(rx)_queue(). - Unified rx(tx)_queue_attr. - Update pad/reserved field of struct dpdmai_rsp_get_attributes and struct dpdmai_cmd_queue for new API. - Update command DPDMAI_SET(GET)_RX_QUEUE and DPDMAI_CMDID_GET_TX_QUEUE Signed-off-by: Frank Li <Frank.Li@nxp.com> Link: https://lore.kernel.org/r/20240409163630.1996052-1-Frank.Li@nxp.comSigned-off-by: Vinod Koul <vkoul@kernel.org>
-
Frank Li authored
Use cleanup to manage mutex. Let compiler to do scope guard automatically. Fixes: 6aa60f79 ("dmaengine: fsl-edma: add safety check for 'srcid'") Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/r/202404110915.riwV3ZAC-lkp@intel.com/Signed-off-by: Frank Li <Frank.Li@nxp.com> Link: https://lore.kernel.org/r/20240411203935.3137158-1-Frank.Li@nxp.comSigned-off-by: Vinod Koul <vkoul@kernel.org>
-
- 07 Apr, 2024 23 commits
-
-
Colin Ian King authored
The helper function chan2parent is not used and has never been used since the first commit to the code back in 2010. The function is redundant and can be removed. Cleans up clang scan build warning: drivers/dma/pch_dma.c:158:30: warning: unused function 'chan2parent' [-Wunused-function] Signed-off-by: Colin Ian King <colin.i.king@gmail.com> Link: https://lore.kernel.org/r/20240308134750.2058556-1-colin.i.king@gmail.comSigned-off-by: Vinod Koul <vkoul@kernel.org>
-
Frank Li authored
Introduce the structures dpdmai_cmd_open to maintain consistency within the API calls of the driver. Signed-off-by: Frank Li <Frank.Li@nxp.com> Link: https://lore.kernel.org/r/20240320-dpaa2-v1-3-eb56e47c94ec@nxp.comSigned-off-by: Vinod Koul <vkoul@kernel.org>
-
Frank Li authored
Remove unused function dpdmai_create(); Signed-off-by: Frank Li <Frank.Li@nxp.com> Link: https://lore.kernel.org/r/20240320-dpaa2-v1-2-eb56e47c94ec@nxp.comSigned-off-by: Vinod Koul <vkoul@kernel.org>
-
Frank Li authored
Remove unused macro definition. Signed-off-by: Frank Li <Frank.Li@nxp.com> Link: https://lore.kernel.org/r/20240320-dpaa2-v1-1-eb56e47c94ec@nxp.comSigned-off-by: Vinod Koul <vkoul@kernel.org>
-
Joy Zou authored
Add support for the i.MX8ULP platform to the eDMA driver. Introduce the use of the correct FSL_EDMA_DRV_HAS_CHCLK flag to handle per-channel clock configurations. Signed-off-by: Joy Zou <joy.zou@nxp.com> Reviewed-by: Frank Li <Frank.Li@nxp.com> Link: https://lore.kernel.org/r/20240323-8ulp_edma-v3-5-c0e981027c05@nxp.comSigned-off-by: Vinod Koul <vkoul@kernel.org>
-
Joy Zou authored
Introduce the compatible string 'fsl,imx8ulp-edma' to enable support for the i.MX8ULP's eDMA, alongside adjusting the clock numbering. The i.MX8ULP eDMA architecture features one clock for each DMA channel and an additional clock for the core controller. Given a maximum of 32 DMA channels, the maximum clock number consequently increases to 33. Signed-off-by: Joy Zou <joy.zou@nxp.com> Signed-off-by: Frank Li <Frank.Li@nxp.com> Reviewed-by: Rob Herring <robh@kernel.org> Link: https://lore.kernel.org/r/20240323-8ulp_edma-v3-4-c0e981027c05@nxp.comSigned-off-by: Vinod Koul <vkoul@kernel.org>
-
Frank Li authored
No device currently utilizes chclk and FSL_EDMA_DRV_HAS_CHCLK features. Removes these unused features. Signed-off-by: Frank Li <Frank.Li@nxp.com> Link: https://lore.kernel.org/r/20240323-8ulp_edma-v3-3-c0e981027c05@nxp.comSigned-off-by: Vinod Koul <vkoul@kernel.org>
-
Frank Li authored
Ensure that 'srcid' is a non-zero value to avoid dtb passing invalid 'srcid' to the driver. Signed-off-by: Frank Li <Frank.Li@nxp.com> Link: https://lore.kernel.org/r/20240323-8ulp_edma-v3-2-c0e981027c05@nxp.comSigned-off-by: Vinod Koul <vkoul@kernel.org>
-
Frank Li authored
The 'slave_id' field is redundant as it duplicates the functionality of 'srcid'. Remove 'slave_id' from fsl_edma_chan to eliminate redundancy. Signed-off-by: Frank Li <Frank.Li@nxp.com> Link: https://lore.kernel.org/r/20240323-8ulp_edma-v3-1-c0e981027c05@nxp.comSigned-off-by: Vinod Koul <vkoul@kernel.org>
-
Baruch Siach authored
Hardware might not support a single combined interrupt that covers all channels. In that case we have to deal with interrupt per channel. Add support for that configuration. Signed-off-by: Baruch Siach <baruch@tkos.co.il> Link: https://lore.kernel.org/r/ebab52e886ef1adc3c40e636aeb1ba3adfe2e578.1711453387.git.baruchs-c@neureality.aiSigned-off-by: Vinod Koul <vkoul@kernel.org>
-
Joao Pinto authored
I have a use case where nr_buffers = 3 and in which each descriptor is composed by 3 segments, resulting in the DMA channel descs_allocated to be 9. Since axi_desc_put() handles the hw_desc considering the descs_allocated, this scenario would result in a kernel panic (hw_desc array will be overrun). To fix this, the proposal is to add a new member to the axi_dma_desc structure, where we keep the number of allocated hw_descs (axi_desc_alloc()) and use it in axi_desc_put() to handle the hw_desc array correctly. Additionally I propose to remove the axi_chan_start_first_queued() call after completing the transfer, since it was identified that unbalance can occur (started descriptors can be interrupted and transfer ignored due to DMA channel not being enabled). Signed-off-by: Joao Pinto <jpinto@synopsys.com> Link: https://lore.kernel.org/r/1711536564-12919-1-git-send-email-jpinto@synopsys.comSigned-off-by: Vinod Koul <vkoul@kernel.org>
-
Tan Chun Hau authored
JH8100 requires reset operation only in device probe. Signed-off-by: Tan Chun Hau <chunhau.tan@starfivetech.com> Link: https://lore.kernel.org/r/20240327025126.229475-3-chunhau.tan@starfivetech.comSigned-off-by: Vinod Koul <vkoul@kernel.org>
-
Tan Chun Hau authored
Add support for StarFive JH8100 SoC in Sysnopsys Designware AXI DMA controller. Both JH8100 and JH7110 require reset operation in device probe. However, JH8100 doesn't need to apply different configuration on CH_CFG registers. Signed-off-by: Tan Chun Hau <chunhau.tan@starfivetech.com> Acked-by: Conor Dooley <conor.dooley@microchip.com> Link: https://lore.kernel.org/r/20240327025126.229475-2-chunhau.tan@starfivetech.comSigned-off-by: Vinod Koul <vkoul@kernel.org>
-
Nuno Sa authored
In axi_dmac_probe(), there's a mix in using device managed APIs and explicitly cleaning things in the driver .remove() hook. Move to use device managed APIs and thus drop the .remove() hook. Signed-off-by: Nuno Sa <nuno.sa@analog.com> Link: https://lore.kernel.org/r/20240328-axi-dmac-devm-probe-v3-2-523c0176df70@analog.comSigned-off-by: Vinod Koul <vkoul@kernel.org>
-
Nuno Sa authored
We need to first free the IRQ before calling of_dma_controller_free(). Otherwise we could get an interrupt and schedule a tasklet while removing the DMA controller. Fixes: 0e3b67b3 ("dmaengine: Add support for the Analog Devices AXI-DMAC DMA controller") Cc: stable@kernel.org Signed-off-by: Nuno Sa <nuno.sa@analog.com> Link: https://lore.kernel.org/r/20240328-axi-dmac-devm-probe-v3-1-523c0176df70@analog.comSigned-off-by: Vinod Koul <vkoul@kernel.org>
-
Sean Anderson authored
Add lockdep asserts to all functions with "vc.lock must be held by caller" in their documentation. This will help catch cases where these assumptions do not hold. Signed-off-by: Sean Anderson <sean.anderson@linux.dev> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Link: https://lore.kernel.org/r/20240308210034.3634938-4-sean.anderson@linux.devSigned-off-by: Vinod Koul <vkoul@kernel.org>
-
Sean Anderson authored
xilinx_dpdma_chan_done_irq and xilinx_dpdma_chan_vsync_irq are always called with IRQs disabled from xilinx_dpdma_irq_handler. Therefore we don't need to save/restore the IRQ flags. Signed-off-by: Sean Anderson <sean.anderson@linux.dev> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Link: https://lore.kernel.org/r/20240308210034.3634938-3-sean.anderson@linux.devSigned-off-by: Vinod Koul <vkoul@kernel.org>
-
Shengjiu Wang authored
SSI and SPDIF are dual fifo interface, when support ASRC P2P with SSI and SPDIF, the src fifo or dst fifo number can be two. The p2p watermark level bit 13 and 14 are designed for these use case. This patch is to complete this function in driver. Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Signed-off-by: Joy Zou <joy.zou@nxp.com> Acked-by: Iuliana Prodan <iuliana.prodan@nxp.com> Signed-off-by: Frank Li <Frank.Li@nxp.com> Link: https://lore.kernel.org/r/20240329-sdma_upstream-v4-3-daeb3067dea7@nxp.comSigned-off-by: Vinod Koul <vkoul@kernel.org>
-
Shengjiu Wang authored
Update 3bytes buswidth that is supported by sdma. Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com> Signed-off-by: Srikanth Krishnakar <Srikanth_Krishnakar@mentor.com> Acked-by: Robin Gong <yibin.gong@nxp.com> Reviewed-by: Joy Zou <joy.zou@nxp.com> Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com> Signed-off-by: Frank Li <Frank.Li@nxp.com> Link: https://lore.kernel.org/r/20240329-sdma_upstream-v4-2-daeb3067dea7@nxp.comSigned-off-by: Vinod Koul <vkoul@kernel.org>
-
Nicolin Chen authored
Allocate memory from SoC internal SRAM to reduce DDR access and keep DDR in lower power state (such as self-referesh) longer. Check iram_pool before sdma_init() so that ccb/context could be allocated from iram because DDR maybe in self-referesh in lower power audio case while sdma still running. Reviewed-by: Shengjiu Wang <shengjiu.wang@nxp.com> Signed-off-by: Nicolin Chen <b42378@freescale.com> Signed-off-by: Joy Zou <joy.zou@nxp.com> Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com> Signed-off-by: Frank Li <Frank.Li@nxp.com> Link: https://lore.kernel.org/r/20240329-sdma_upstream-v4-1-daeb3067dea7@nxp.comSigned-off-by: Vinod Koul <vkoul@kernel.org>
-
Rob Herring authored
'data-width' and 'data_width' properties are defined as arrays, but the schema is defined as a matrix. That works currently since everything gets decoded in to matrices, but that is internal to dtschema and could change. Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Serge Semin <fancer.lancer@gmail.com> Signed-off-by: Rob Herring <robh@kernel.org> Acked-by: Conor Dooley <conor.dooley@microchip.com> Link: https://lore.kernel.org/r/20240401204354.1691845-1-robh@kernel.orgSigned-off-by: Vinod Koul <vkoul@kernel.org>
-
Chen Ni authored
As the possible failure of the dma_set_max_seg_size(), it should be better to check the return value of the dma_set_max_seg_size(). Fixes: e3fdb189 ("dmaengine: idma64: set maximum allowed segment size for DMA") Signed-off-by: Chen Ni <nichen@iscas.ac.cn> Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20240403024932.3342606-1-nichen@iscas.ac.cnSigned-off-by: Vinod Koul <vkoul@kernel.org>
-
Jerry Snitselaar authored
Currently if the user driver is probed on a workqueue configured for another driver with SVA not enabled on the system, it will print out a number of probe failing messages like the following: [ 264.831140] user: probe of wq13.0 failed with error -95 On some systems, such as GNR, the number of messages can reach over 100. Move the SVA feature check to be after the driver name match check. Cc: Vinod Koul <vkoul@kernel.org> Cc: dmaengine@vger.kernel.org Cc: linux-kernel@vger.kernel.org Reviewed-by: Fenghua Yu <fenghua.yu@intel.com> Reviewed-by: Dave Jiang <dave.jiang@intel.com> Signed-off-by: Jerry Snitselaar <jsnitsel@redhat.com> Link: https://lore.kernel.org/r/20240405213941.3629709-1-jsnitsel@redhat.comSigned-off-by: Vinod Koul <vkoul@kernel.org>
-