dmaengine: xilinx_dma: Fix uninitialized addr_width when "xlnx,addrwidth" property is missing

When device tree lacks optional "xlnx,addrwidth" property, the addr_width
variable remained uninitialized with garbage values, causing incorrect
DMA mask configuration and subsequent probe failure. The fix ensures a
fallback to the default 32-bit address width when this property is missing.

Signed-off-by: Suraj Gupta <suraj.gupta2@amd.com>
Fixes: b72db4005fe4 ("dmaengine: vdma: Add 64 bit addressing support to the driver")
Reviewed-by: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
Reviewed-by: Folker Schwesinger <dev@folker-schwesinger.de>
Link: https://patch.msgid.link/20251021183006.3434495-1-suraj.gupta2@amd.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by Suraj Gupta and committed by Vinod Koul c0732fe7 2efd07a7

+5 -2
+5 -2
drivers/dma/xilinx/xilinx_dma.c
··· 131 131 #define XILINX_MCDMA_MAX_CHANS_PER_DEVICE 0x20 132 132 #define XILINX_DMA_MAX_CHANS_PER_DEVICE 0x2 133 133 #define XILINX_CDMA_MAX_CHANS_PER_DEVICE 0x1 134 + #define XILINX_DMA_DFAULT_ADDRWIDTH 0x20 134 135 135 136 #define XILINX_DMA_DMAXR_ALL_IRQ_MASK \ 136 137 (XILINX_DMA_DMASR_FRM_CNT_IRQ | \ ··· 3160 3159 struct device_node *node = pdev->dev.of_node; 3161 3160 struct xilinx_dma_device *xdev; 3162 3161 struct device_node *child, *np = pdev->dev.of_node; 3163 - u32 num_frames, addr_width, len_width; 3162 + u32 num_frames, addr_width = XILINX_DMA_DFAULT_ADDRWIDTH, len_width; 3164 3163 int i, err; 3165 3164 3166 3165 /* Allocate and initialize the DMA engine structure */ ··· 3236 3235 3237 3236 err = of_property_read_u32(node, "xlnx,addrwidth", &addr_width); 3238 3237 if (err < 0) 3239 - dev_warn(xdev->dev, "missing xlnx,addrwidth property\n"); 3238 + dev_warn(xdev->dev, 3239 + "missing xlnx,addrwidth property, using default value %d\n", 3240 + XILINX_DMA_DFAULT_ADDRWIDTH); 3240 3241 3241 3242 if (addr_width > 32) 3242 3243 xdev->ext_addr = true;