linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH kernel] powerpc/powernv/ioda: Handle failures correctly in pnv_pci_ioda_iommu_bypass_supported
@ 2019-04-10  6:48 Alexey Kardashevskiy
  2019-05-03  6:59 ` Michael Ellerman
  0 siblings, 1 reply; 2+ messages in thread
From: Alexey Kardashevskiy @ 2019-04-10  6:48 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Alexey Kardashevskiy, Christoph Hellwig

When the return value type was changed from int to bool, few places were
left unchanged, this fixes them. We did not hit these failures as
the first one is not happening at all and the second one is little more
likely to happen if the user switches a 33..58bit DMA capable device
between the VFIO and vendor drivers and there are not so many of these.

Fixes: 2d6ad41b2c21 ("powerpc/powernv: use the generic iommu bypass code", 2019-02-13)
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
---
 arch/powerpc/platforms/powernv/pci-ioda.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c
index 0565d8b8b33d..dcfb5469678e 100644
--- a/arch/powerpc/platforms/powernv/pci-ioda.c
+++ b/arch/powerpc/platforms/powernv/pci-ioda.c
@@ -1836,7 +1836,7 @@ static bool pnv_pci_ioda_iommu_bypass_supported(struct pci_dev *pdev,
 	struct pnv_ioda_pe *pe;
 
 	if (WARN_ON(!pdn || pdn->pe_number == IODA_INVALID_PE))
-		return -ENODEV;
+		return false;
 
 	pe = &phb->ioda.pe_array[pdn->pe_number];
 	if (pe->tce_bypass_enabled) {
@@ -1859,7 +1859,7 @@ static bool pnv_pci_ioda_iommu_bypass_supported(struct pci_dev *pdev,
 		/* Configure the bypass mode */
 		s64 rc = pnv_pci_ioda_dma_64bit_bypass(pe);
 		if (rc)
-			return rc;
+			return false;
 		/* 4GB offset bypasses 32-bit space */
 		pdev->dev.archdata.dma_offset = (1ULL << 32);
 		return true;
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH kernel] powerpc/powernv/ioda: Handle failures correctly in pnv_pci_ioda_iommu_bypass_supported
  2019-04-10  6:48 [PATCH kernel] powerpc/powernv/ioda: Handle failures correctly in pnv_pci_ioda_iommu_bypass_supported Alexey Kardashevskiy
@ 2019-05-03  6:59 ` Michael Ellerman
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Ellerman @ 2019-05-03  6:59 UTC (permalink / raw)
  To: Alexey Kardashevskiy, linuxppc-dev
  Cc: Alexey Kardashevskiy, Christoph Hellwig

On Wed, 2019-04-10 at 06:48:00 UTC, Alexey Kardashevskiy wrote:
> When the return value type was changed from int to bool, few places were
> left unchanged, this fixes them. We did not hit these failures as
> the first one is not happening at all and the second one is little more
> likely to happen if the user switches a 33..58bit DMA capable device
> between the VFIO and vendor drivers and there are not so many of these.
> 
> Fixes: 2d6ad41b2c21 ("powerpc/powernv: use the generic iommu bypass code", 2019-02-13)
> Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/b511cdd1c12d1e450baeba5373dd3a88

cheers

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-05-03  7:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-10  6:48 [PATCH kernel] powerpc/powernv/ioda: Handle failures correctly in pnv_pci_ioda_iommu_bypass_supported Alexey Kardashevskiy
2019-05-03  6:59 ` Michael Ellerman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).