The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Karthikeyan K S <karthiproffesional@gmail.com>
To: hminas@synopsys.com, gregkh@linuxfoundation.org
Cc: gregory.herrero@intel.com, linux-usb@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Karthikeyan K S <karthiproffesional@gmail.com>
Subject: [PATCH v2] usb: dwc2: add missing SLAB_CACHE_DMA flag for desc_hsisoc_cache
Date: Sun, 11 Jan 2026 12:32:18 +0000	[thread overview]
Message-ID: <20260111123218.15972-1-karthiproffesional@gmail.com> (raw)

The desc_hsisoc_cache kmem_cache is used to allocate DMA descriptors
for High-Speed isochronous transfers. These descriptors are passed to
the hardware via dma_map_single() in dwc2_desc_list_alloc().

The desc_gen_cache, which serves the same purpose for other transfer
types, correctly specifies SLAB_CACHE_DMA. However, desc_hsisoc_cache
was created without this flag, despite both caches being used
identically for DMA descriptor allocation.

Add the missing SLAB_CACHE_DMA flag to desc_hsisoc_cache for
consistency and correctness on platforms with DMA zone restrictions.
This also protects against future allocations from this cache that
might omit GFP_DMA.

Fixes: 3b5fcc9ac2f4 ("usb: dwc2: host: use kmem cache to allocate descriptors")

Signed-off-by: Karthikeyan K S <karthiproffesional@gmail.com>
---
v2: Resend with proper formatting (previous was corrupted by email client)
---
 drivers/usb/dwc2/hcd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/dwc2/hcd.c b/drivers/usb/dwc2/hcd.c
index 30eb85066..556d6ab36 100644
--- a/drivers/usb/dwc2/hcd.c
+++ b/drivers/usb/dwc2/hcd.c
@@ -5273,7 +5273,7 @@ int dwc2_hcd_init(struct dwc2_hsotg *hsotg)
 
 		hsotg->desc_hsisoc_cache = kmem_cache_create("dwc2-hsisoc-desc",
 				sizeof(struct dwc2_dma_desc) *
-				MAX_DMA_DESC_NUM_HS_ISOC, 512, 0, NULL);
+				MAX_DMA_DESC_NUM_HS_ISOC, 512, SLAB_CACHE_DMA, NULL);
 		if (!hsotg->desc_hsisoc_cache) {
 			dev_err(hsotg->dev,
 				"unable to create dwc2 hs isoc desc cache\n");
-- 
2.43.0


             reply	other threads:[~2026-01-11 12:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-11 12:32 Karthikeyan K S [this message]
2026-01-11 13:06 ` [PATCH v2] usb: dwc2: add missing SLAB_CACHE_DMA flag for desc_hsisoc_cache Greg KH
2026-01-13  9:46   ` karthikeyan K S

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260111123218.15972-1-karthiproffesional@gmail.com \
    --to=karthiproffesional@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=gregory.herrero@intel.com \
    --cc=hminas@synopsys.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox