From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0E5732451C8; Tue, 20 May 2025 13:54:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747749248; cv=none; b=ZROz9iXsK+gs+borLngFFz9Dc9CDEBj1H3/DPpqO7P5vH9JIB7vE4Dnh7UsqWPPC1zj3xfmUxhSi3AUstKw31KMDY2ux48TtcteHn9NhTKRZkUWIsr0jo1Mxt/aPFdT/g4ElX8kzybK+EOcs529DVoOaYvMsRZypgnzNTFHZjqA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747749248; c=relaxed/simple; bh=Iide5p1oDHgAugmedqz0aW5pzxD/pTjuW6/1quf3Gpk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DUCYZ/YxVuDrdDKQiZoI6Tx3bzdmmu19UHZ2LPfd8SKs43Dw2MI+MX4QoTq2GoLmDCG1ly04KtnHfnCdj17puFiBsa5K7RyyUidLaQZqa7VLr3xI4k0LkumqMfk8vlrcZ0z1jd7zcDLA5gjvH5lFIY2JNJEmOKq5AKPkAg8EtK4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=w6kfEUVV; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="w6kfEUVV" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 74842C4CEE9; Tue, 20 May 2025 13:54:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1747749247; bh=Iide5p1oDHgAugmedqz0aW5pzxD/pTjuW6/1quf3Gpk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=w6kfEUVVqWz9aowbCqhAF0dWgY5eWwB+o17/8bX8PWGBATw8gN6DkmmH1uPutLLo0 Ix/RCk64FxoDBpSPqwTNHiHKw288xTCIPkSOm6RGpVvxXuHKR6ddksGJ+Z0WpU9DPS AA0A/SC/ysF1FI6Ew+Eyx9UjRt421VRrcmiWHNLk= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Vaishnav Achath , Peter Ujfalusi , Udit Kumar , Yemike Abhilash Chandra , Vinod Koul Subject: [PATCH 5.15 43/59] dmaengine: ti: k3-udma: Use cap_mask directly from dma_device structure instead of a local copy Date: Tue, 20 May 2025 15:50:34 +0200 Message-ID: <20250520125755.556460244@linuxfoundation.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250520125753.836407405@linuxfoundation.org> References: <20250520125753.836407405@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Yemike Abhilash Chandra commit 8ca9590c39b69b55a8de63d2b21b0d44f523b43a upstream. Currently, a local dma_cap_mask_t variable is used to store device cap_mask within udma_of_xlate(). However, the DMA_PRIVATE flag in the device cap_mask can get cleared when the last channel is released. This can happen right after storing the cap_mask locally in udma_of_xlate(), and subsequent dma_request_channel() can fail due to mismatch in the cap_mask. Fix this by removing the local dma_cap_mask_t variable and directly using the one from the dma_device structure. Fixes: 25dcb5dd7b7c ("dmaengine: ti: New driver for K3 UDMA") Cc: stable@vger.kernel.org Signed-off-by: Vaishnav Achath Acked-by: Peter Ujfalusi Reviewed-by: Udit Kumar Signed-off-by: Yemike Abhilash Chandra Link: https://lore.kernel.org/r/20250417075521.623651-1-y-abhilashchandra@ti.com Signed-off-by: Vinod Koul Signed-off-by: Greg Kroah-Hartman --- drivers/dma/ti/k3-udma.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- a/drivers/dma/ti/k3-udma.c +++ b/drivers/dma/ti/k3-udma.c @@ -4210,7 +4210,6 @@ static struct dma_chan *udma_of_xlate(st struct of_dma *ofdma) { struct udma_dev *ud = ofdma->of_dma_data; - dma_cap_mask_t mask = ud->ddev.cap_mask; struct udma_filter_param filter_param; struct dma_chan *chan; @@ -4242,7 +4241,7 @@ static struct dma_chan *udma_of_xlate(st } } - chan = __dma_request_channel(&mask, udma_dma_filter_fn, &filter_param, + chan = __dma_request_channel(&ud->ddev.cap_mask, udma_dma_filter_fn, &filter_param, ofdma->of_node); if (!chan) { dev_err(ud->dev, "get channel fail in %s.\n", __func__);