mbox series

[0/2] arm64: tegra: Enable audio IOMMU support on Tegra194

Message ID 20210628181118.2295007-1-thierry.reding@gmail.com
Headers show
Series arm64: tegra: Enable audio IOMMU support on Tegra194 | expand

Message

Thierry Reding June 28, 2021, 6:11 p.m. UTC
From: Thierry Reding <treding@nvidia.com>

This small series addresses a minor issue with how IOMMU support is
wired up on various Tegra generations. Currently the virtual "card"
device is used to allocate DMA memory for, but since that device does
not actually exist, the path to memory cannot be correctly described.

To address this, this series moves to using the ADMAIF as the DMA device
for audio. This is a real device that can have a proper DMA mask set and
with which a stream ID can be associated with in the SMMU. The memory
accesses technically originate from the ADMA controller (that the ADMAIF
uses), but DMA channel are dynamically allocated at runtime while DMA
memory is allocated at driver load time, drivers won't have access to
the ADMA device yet.

Further patches will be required to correct this issue on Tegra186 and
Tegra210, but I wanted to get feedback on this approach first.

Thierry

Thierry Reding (2):
  ASoC: tegra: Use ADMAIF component for DMA allocations
  arm64: tegra: Enable audio IOMMU support on Tegra194

 arch/arm64/boot/dts/nvidia/tegra194.dtsi |  4 ++++
 sound/soc/tegra/tegra_pcm.c              | 21 +++++++++------------
 2 files changed, 13 insertions(+), 12 deletions(-)

Comments

Mark Brown June 30, 2021, 4:10 p.m. UTC | #1
On Mon, 28 Jun 2021 20:11:16 +0200, Thierry Reding wrote:
> This small series addresses a minor issue with how IOMMU support is

> wired up on various Tegra generations. Currently the virtual "card"

> device is used to allocate DMA memory for, but since that device does

> not actually exist, the path to memory cannot be correctly described.

> 

> To address this, this series moves to using the ADMAIF as the DMA device

> for audio. This is a real device that can have a proper DMA mask set and

> with which a stream ID can be associated with in the SMMU. The memory

> accesses technically originate from the ADMA controller (that the ADMAIF

> uses), but DMA channel are dynamically allocated at runtime while DMA

> memory is allocated at driver load time, drivers won't have access to

> the ADMA device yet.

> 

> [...]


Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/2] ASoC: tegra: Use ADMAIF component for DMA allocations
      commit: e6b66edfef64698d4d9ed3847c95cdfab9bde579

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark
Thierry Reding June 30, 2021, 5:08 p.m. UTC | #2
On Wed, Jun 30, 2021 at 05:10:33PM +0100, Mark Brown wrote:
> On Mon, 28 Jun 2021 20:11:16 +0200, Thierry Reding wrote:

> > This small series addresses a minor issue with how IOMMU support is

> > wired up on various Tegra generations. Currently the virtual "card"

> > device is used to allocate DMA memory for, but since that device does

> > not actually exist, the path to memory cannot be correctly described.

> > 

> > To address this, this series moves to using the ADMAIF as the DMA device

> > for audio. This is a real device that can have a proper DMA mask set and

> > with which a stream ID can be associated with in the SMMU. The memory

> > accesses technically originate from the ADMA controller (that the ADMAIF

> > uses), but DMA channel are dynamically allocated at runtime while DMA

> > memory is allocated at driver load time, drivers won't have access to

> > the ADMA device yet.

> > 

> > [...]

> 

> Applied to

> 

>    https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

> 

> Thanks!

> 

> [1/2] ASoC: tegra: Use ADMAIF component for DMA allocations

>       commit: e6b66edfef64698d4d9ed3847c95cdfab9bde579

> 

> All being well this means that it will be integrated into the linux-next

> tree (usually sometime in the next 24 hours) and sent to Linus during

> the next merge window (or sooner if it is a bug fix), however if

> problems are discovered then the patch may be dropped or reverted.

> 

> You may get further e-mails resulting from automated or manual testing

> and review of the tree, please engage with people reporting problems and

> send followup patches addressing any issues that are reported if needed.

> 

> If any updates are required or you are submitting further changes they

> should be sent as incremental updates against current git, existing

> patches will not be replaced.

> 

> Please add any relevant lists and maintainers to the CCs when replying

> to this mail.


Hi Mark,

Looks like I was a bit quick on the trigger with this one. Turns out
this breaks audio on Tegra186 because we had already merged the patch
that adds the iommus property to the wrong device tree node, so the
damage had already been done and we're going to have to provide a
backwards-compatibility fallback.

I've got a v2 of this series that incorporates the fallback (which is
just a two-line addition, luckily) but I wanted to give it another spin
in our test farm to make sure it's safe this time.

Could you drop this patch from your queue at this time? I can send out
the updated patch once I'm convinced it isn't going to regress further.

Thanks and sorry for the noise,
Thierry
Mark Brown July 1, 2021, 12:51 p.m. UTC | #3
On Wed, Jun 30, 2021 at 07:08:40PM +0200, Thierry Reding wrote:

> Could you drop this patch from your queue at this time? I can send out

> the updated patch once I'm convinced it isn't going to regress further.


OK since it's the top commit, in general it's better to send reverts for
things like this though - like some other people I rarely rebase or
otherwise modify existing commits.