Linux Sound subsystem development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Wesley Cheng" <wesley.cheng@oss.qualcomm.com>
Cc: linux-usb@vger.kernel.org, linux-sound@vger.kernel.org
Subject: Re: [PATCH v6 4/4] ALSA: usb-audio: qcom: fix xfer ring IOMMU unmap on 16K+ page kernels
Date: Tue, 10 Nov 2026 03:02:26 +0000	[thread overview]
Message-ID: <sashiko-outbox-206090@kernel.org> (raw)
In-Reply-To: <20261109-16k_offload_v1_b4-v6-4-858c6e0e007d@oss.qualcomm.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] ALSA: usb-audio: qcom: missing Fixes trailer for 16K+ page ring
  fix
--

commit 7088c3c3566e5837438b6b83c5b7547812406f63
Author: Wesley Cheng <wesley.cheng@oss.qualcomm.com>

> ALSA: usb-audio: qcom: fix xfer ring IOMMU unmap on 16K+ page kernels
>
> TRB_SEGMENT_SIZE is hardcoded to 4096 bytes, but on kernels built with
> a larger PAGE_SIZE (e.g. 16K or 64K page arches) the IOMMU still maps
> and unmaps in units of PAGE_SIZE. The driver maps the page containing
> the ring segment, but reports the start of that page as the ring
> address and PAGE_SIZE as its size. This is only correct if the segment
> starts at offset 0 in its page.
>
> For both the transfer rings and the event ring, add that offset to the
> mapped iova before sending it to the ADSP over QMI, so the reported
> address points at the start of the segment rather than the start of
> its page. Also report the sg entry length (TRB_SEGMENT_SIZE) instead of
> PAGE_SIZE as the ring size. The offset is taken from the sg entry
> rather than from the ring's DMA address, because when xHCI is behind an
> IOMMU that address is an IOVA, and its low bits need not match the
> offset within the page.
>
> With the offset added, IOVA_MASK() on the reported iova no longer gives
> the page-aligned iova that was mapped. Have uaudio_endpoint_setup() pass
> back the mapped iova, and use it for the cached data/sync_xfer_ring_va
> and the drop_sync_ep/drop_data_ep unmaps.
>
> Assisted-by: Claude:claude-opus-5-5
> Signed-off-by: Wesley Cheng <wesley.cheng@oss.qualcomm.com>

[Severity: Low]
Since this fixes a bug in the transfer and event ring IOVA setup and
unmapping, should it include a Fixes tag?

  Fixes: 326bbc348298 ("ALSA: usb-audio: qcom: Introduce QC USB SND offloading support")

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261109-16k_offload_v1_b4-v6-0-858c6e0e007d@oss.qualcomm.com?part=4

      reply	other threads:[~2026-11-10  3:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-10  2:38 [PATCH v6 0/4] Add larger page size support for USB audio offload path Wesley Cheng
2026-11-10  2:38 ` [PATCH v6 1/4] usb: xhci: sideband: fix ring sg table for sub-page TRB segments Wesley Cheng
2026-11-10  2:47   ` sashiko-bot
2026-11-10  2:38 ` [PATCH v6 2/4] usb: xhci: Allocate sideband ring segments with dma_alloc_coherent() Wesley Cheng
2026-11-10  2:38 ` [PATCH v6 3/4] ALSA: usb-audio: qcom: tag sideband endpoints before ring allocation Wesley Cheng
2026-11-10  2:38 ` [PATCH v6 4/4] ALSA: usb-audio: qcom: fix xfer ring IOMMU unmap on 16K+ page kernels Wesley Cheng
2026-11-10  3:02   ` sashiko-bot [this message]

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=sashiko-outbox-206090@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=wesley.cheng@oss.qualcomm.com \
    /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