[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Fri, 2 Feb 2024 09:28:43 +0100
From: Joerg Roedel <jroedel@...e.de>
To: Shivaprasad G Bhat <sbhat@...ux.ibm.com>
Cc: iommu@...ts.linux.dev, linuxppc-dev@...ts.ozlabs.org,
linux-kernel@...r.kernel.org, mpe@...erman.id.au, npiggin@...il.com,
christophe.leroy@...roup.eu, aneesh.kumar@...nel.org,
naveen.n.rao@...ux.ibm.com, jgg@...pe.ca,
tpearson@...torengineering.com, aik@....com, bgray@...ux.ibm.com,
gregkh@...uxfoundation.org, gbatra@...ux.vnet.ibm.com,
vaibhav@...ux.ibm.com
Subject: Re: [PATCH v2] powerpc: iommu: Bring back table group
release_ownership() call
On Fri, Jan 26, 2024 at 09:09:18AM -0600, Shivaprasad G Bhat wrote:
> The commit 2ad56efa80db ("powerpc/iommu: Setup a default domain and
> remove set_platform_dma_ops") refactored the code removing the
> set_platform_dma_ops(). It missed out the table group
> release_ownership() call which would have got called otherwise
> during the guest shutdown via vfio_group_detach_container(). On
> PPC64, this particular call actually sets up the 32-bit TCE table,
> and enables the 64-bit DMA bypass etc. Now after guest shutdown,
> the subsequent host driver (e.g megaraid-sas) probe post unbind
> from vfio-pci fails like,
>
> megaraid_sas 0031:01:00.0: Warning: IOMMU dma not supported: mask 0x7fffffffffffffff, table unavailable
> megaraid_sas 0031:01:00.0: Warning: IOMMU dma not supported: mask 0xffffffff, table unavailable
> megaraid_sas 0031:01:00.0: Failed to set DMA mask
> megaraid_sas 0031:01:00.0: Failed from megasas_init_fw 6539
>
> The patch brings back the call to table_group release_ownership()
> call when switching back to PLATFORM domain from BLOCKED, while
> also separates the domain_ops for both.
>
> Fixes: 2ad56efa80db ("powerpc/iommu: Setup a default domain and remove set_platform_dma_ops")
> Signed-off-by: Shivaprasad G Bhat <sbhat@...ux.ibm.com>
> ---
> Changelog:
> v1: https://lore.kernel.org/linux-iommu/170618451433.3805.9015493852395837391.stgit@ltcd48-lp2.aus.stglab.ibm.com/
> - Split the common attach_dev call to platform and blocked attach_dev
> calls as suggested.
>
> arch/powerpc/kernel/iommu.c | 37 ++++++++++++++++++++++++++++---------
> 1 file changed, 28 insertions(+), 9 deletions(-)
Applied, thanks.
--
Jörg Rödel
jroedel@...e.de
SUSE Software Solutions Germany GmbH
Frankenstraße 146
90461 Nürnberg
Germany
https://www.suse.com/
Geschäftsführer: Ivo Totev, Andrew McDonald, Werner Knoblich
(HRB 36809, AG Nürnberg)
Powered by blists - more mailing lists