[PATCH] iommu: Add missing dependencies

2017-09-10 Thread Guenter Roeck
&& (ARM || ARM64 || COMPILE_TEST && !GENERIC_ATOMIC64)) IOMMU_IO_PGTABLE_LPAE depends on (COMPILE_TEST && !GENERIC_ATOMIC64), so any configuration option selecting it needs to have the same dependencies. Signed-off-by: Guenter Roeck <li...@roeck-us.net> --- drivers/iommu/

Re: [RFC PATCH] m68k: set dma and coherent masks for Macintosh SONIC based ethernet

2018-05-26 Thread Guenter Roeck
Hi, On Sun, May 27, 2018 at 01:01:11PM +1000, Finn Thain wrote: > On Sat, 26 May 2018, Guenter Roeck wrote: > > > As of commit 205e1b7f51e4 ("dma-mapping: warn when there is no > > coherent_dma_mask") the NatSemi SONIC Ethernet driver is issuing the > > followin

Re: [PATCH v3] sparc: set a default 32-bit dma mask for OF devices

2018-09-01 Thread Guenter Roeck
On 09/01/2018 06:49 AM, Christoph Hellwig wrote: This keeps the historic default behavior for devices without a DMA mask, but removes the warning about a lacking DMA mask for doing DMA without a mask. Reported-by: Meelis Roos Signed-off-by: Christoph Hellwig Tested-by: Guenter Roeck

Re: various dma_mask fixups

2018-08-29 Thread Guenter Roeck
On Wed, Aug 29, 2018 at 08:23:58AM +0200, Christoph Hellwig wrote: > Fix warnings and regressions from requiring a dma mask. With this series applied, I see the following in my sh4 boot tests. sb 1-1: new full-speed USB device number 2 using sm501-usb sm501-usb sm501-usb: OHCI Unrecoverable

Re: various dma_mask fixups

2018-08-30 Thread Guenter Roeck
On Wed, Aug 29, 2018 at 03:38:21PM -0700, Guenter Roeck wrote: > On Wed, Aug 29, 2018 at 08:23:58AM +0200, Christoph Hellwig wrote: > > Fix warnings and regressions from requiring a dma mask. > > With this series applied, I see the following in my sh4 boot tests. > > sb 1-

Re: [PATCH] dma-direct: always allow dma mask <= physiscal memory size

2018-10-03 Thread Guenter Roeck
On Fri, Sep 07, 2018 at 09:31:58AM +0200, Christoph Hellwig wrote: > This way an architecture with less than 4G of RAM can support dma_mask > smaller than 32-bit without a ZONE_DMA. Apparently that is a common > case on powerpc. > > Signed-off-by: Christoph Hellwig > Reviewed-by: Robin Murphy

Re: [PATCH 4/4] dma-mapping: clear dev->dma_ops in arch_teardown_dma_ops

2018-09-22 Thread Guenter Roeck
Hi, On Mon, Aug 27, 2018 at 10:47:11AM +0200, Christoph Hellwig wrote: > There is no reason to leave the per-device dma_ops around when > deconfiguring a device, so move this code from arm64 into the > common code. > Signed-off-by: Christoph Hellwig > Reviewed-by: Robin Murphy This patch

Re: [PATCH 3/6] sparc: remove the sparc32_dma_ops indirection

2018-12-14 Thread Guenter Roeck
On Sat, Dec 08, 2018 at 09:41:12AM -0800, Christoph Hellwig wrote: > There is no good reason to have a double indirection for the sparc32 > dma ops, so remove the sparc32_dma_ops and define separate dma_map_ops > instance for the different IOMMU types. > Except maybe this: scsi host0: esp scsi

Re: [PATCH 3/6] sparc: remove the sparc32_dma_ops indirection

2018-12-15 Thread Guenter Roeck
On 12/15/18 2:47 AM, Christoph Hellwig wrote: On Fri, Dec 14, 2018 at 10:30:18PM -0800, Guenter Roeck wrote: and so on, until qemu is terminated. This is seen with all sparc32 qemu emulations. Reverting the patch fixes the problem. Hi Guenter, can you check which of the three new ops is used

Re: [15/15] dma-mapping: bypass indirect calls for dma-direct

2018-12-15 Thread Guenter Roeck
Hi, On Fri, Dec 07, 2018 at 11:07:20AM -0800, Christoph Hellwig wrote: > Avoid expensive indirect calls in the fast path DMA mapping > operations by directly calling the dma_direct_* ops if we are using > the directly mapped DMA operations. > This patch results in arm64 boot failures. Reverting

Re: [PATCH 6/7] dma-direct: handle DMA_ATTR_NO_KERNEL_MAPPING in common code

2019-06-29 Thread Guenter Roeck
On Fri, Jun 14, 2019 at 04:44:30PM +0200, Christoph Hellwig wrote: > DMA_ATTR_NO_KERNEL_MAPPING is generally implemented by allocating > normal cacheable pages or CMA memory, and then returning the page > pointer as the opaque handle. Lift that code from the xtensa and > generic dma remapping

Re: [PATCH] MIPS: only select ARCH_HAS_UNCACHED_SEGMENT for non-coherent platforms

2019-06-30 Thread Guenter Roeck
as the arch_dma_prep_coherent symbol is also only provided for non-coherent platforms. Fixes: 2e96e04d25 ("MIPS: use the generic uncached segment support in dma-direct") Reported-by: Guenter Roeck Signed-off-by: Christoph Hellwig --- This patch fixes kernel/dma/direct.c:144: undefined

Re: [PATCH 1/9] dma-mapping: split

2020-10-11 Thread Guenter Roeck
On Wed, Sep 30, 2020 at 10:55:40AM +0200, Christoph Hellwig wrote: > Split out all the bits that are purely for dma_map_ops implementations > and related code into a new header so that they > don't get pulled into all the drivers. That also means the architecture > specific is not pulled in by

Re: [PATCH v12 09/13] drm/msm: Add support to create a local pagetable

2020-08-23 Thread Guenter Roeck
On Mon, Aug 10, 2020 at 04:26:53PM -0600, Jordan Crouse wrote: > Add support to create a io-pgtable for use by targets that support > per-instance pagetables. In order to support per-instance pagetables the > GPU SMMU device needs to have the qcom,adreno-smmu compatible string and > split

Re: [PATCH v2] dma-pool: Fix too large DMA pools on medium systems

2020-06-21 Thread Guenter Roeck
On 6/21/20 1:35 AM, Geert Uytterhoeven wrote: > Hi Günter, > > On Sat, Jun 20, 2020 at 10:09 PM Guenter Roeck wrote: >> On Mon, Jun 08, 2020 at 03:22:17PM +0200, Geert Uytterhoeven wrote: >>> On systems with at least 32 MiB, but less than 32 GiB of RAM, the DMA >>

Re: [PATCH v2] dma-pool: Fix too large DMA pools on medium systems

2020-06-24 Thread Guenter Roeck
On Wed, Jun 24, 2020 at 09:38:15AM +0200, Christoph Hellwig wrote: > Hi Guenter, > > can you try the patch below? This just converts the huge allocations > in mptbase to use GFP_KERNEL. Christophe (added to Cc) actually has > a scripted conversion for the rest that he hasn't posted yet, so I'll

Re: [patch] dma-pool: warn when coherent pool is depleted

2020-06-21 Thread Guenter Roeck
kernel command line. > > Provide some guidance on the failure and a recommended minimum size for > the pools (double the size). > > Signed-off-by: David Rientjes Tested-by: Guenter Roeck Also confirmed that coherent_pool=256k works around the crash I had observed. Guenter

Re: [PATCH v2] dma-pool: Fix too large DMA pools on medium systems

2020-06-20 Thread Guenter Roeck
On Mon, Jun 08, 2020 at 03:22:17PM +0200, Geert Uytterhoeven wrote: > On systems with at least 32 MiB, but less than 32 GiB of RAM, the DMA > memory pools are much larger than intended (e.g. 2 MiB instead of 128 > KiB on a 256 MiB system). > > Fix this by correcting the calculation of the number

Re: [PATCH 3/5] dma-mapping: make support for dma ops optional

2020-07-18 Thread Guenter Roeck
On Wed, Jul 08, 2020 at 05:24:47PM +0200, Christoph Hellwig wrote: > Avoid the overhead of the dma ops support for tiny builds that only > use the direct mapping. > > Signed-off-by: Christoph Hellwig For ppc:pmac32_defconfig and other configurations, this patch results in: Error log:

Re: [PATCH v15 12/12] of: Add plumbing for restricted DMA pool

2021-07-01 Thread Guenter Roeck
Hi, On Thu, Jun 24, 2021 at 11:55:26PM +0800, Claire Chang wrote: > If a device is not behind an IOMMU, we look up the device node and set > up the restricted DMA when the restricted-dma-pool is presented. > > Signed-off-by: Claire Chang > Tested-by: Stefano Stabellini > Tested-by: Will Deacon

Re: [PATCH v15 12/12] of: Add plumbing for restricted DMA pool

2021-07-02 Thread Guenter Roeck
On 7/2/21 6:18 AM, Will Deacon wrote: On Fri, Jul 02, 2021 at 12:39:41PM +0100, Robin Murphy wrote: On 2021-07-02 04:08, Guenter Roeck wrote: On Thu, Jun 24, 2021 at 11:55:26PM +0800, Claire Chang wrote: If a device is not behind an IOMMU, we look up the device node and set up the restricted

Re: [PATCH 1/3] dt-bindings: Fix undocumented compatible strings in examples

2021-02-02 Thread Guenter Roeck
s Walleij > Cc: Herbert Xu > Cc: "David S. Miller" > Cc: Daniel Palmer > Cc: Bartosz Golaszewski > Cc: Avi Fishman > Cc: Tomer Maimon > Cc: Tali Perry > Cc: Joerg Roedel > Cc: Will Deacon > Cc: Andrew Jeffery > Cc: Joel Stanley > Cc: Wim Van

Re: [PATCH v2 1/4] iommu/vt-d: Enable write protect for supervisor SVM

2021-03-30 Thread Guenter Roeck
On 3/30/21 10:52 AM, Jacob Pan wrote: > Hi Guenter, > > On Mon, 22 Mar 2021 10:53:38 -0700, Guenter Roeck > wrote: > >> On Tue, Mar 02, 2021 at 02:13:57AM -0800, Jacob Pan wrote: >>> Write protect bit, when set, inhibits supervisor writes to the read-only >>&

Re: [PATCH v2 1/4] iommu/vt-d: Enable write protect for supervisor SVM

2021-03-22 Thread Guenter Roeck
On Tue, Mar 02, 2021 at 02:13:57AM -0800, Jacob Pan wrote: > Write protect bit, when set, inhibits supervisor writes to the read-only > pages. In supervisor shared virtual addressing (SVA), where page tables > are shared between CPU and DMA, IOMMU PASID entry WPE bit should match > CR0.WP bit in

Re: [RFC v1 PATCH 3/3] driver: update all the code that use soc_device_match

2021-04-19 Thread Guenter Roeck
On 4/18/21 9:27 PM, Alice Guo (OSS) wrote: > From: Alice Guo > > Update all the code that use soc_device_match because add support for > soc_device_match returning -EPROBE_DEFER. > > Signed-off-by: Alice Guo > --- [ ... ] > drivers/watchdog/renesas_wdt.c| 2 +- > 48 files

Re: [PATCH v15 10/12] swiotlb: Add restricted DMA pool initialization

2021-08-24 Thread Guenter Roeck
Hi Claire, On Thu, Jun 24, 2021 at 11:55:24PM +0800, Claire Chang wrote: > Add the initialization function to create restricted DMA pools from > matching reserved-memory nodes. > > Regardless of swiotlb setting, the restricted DMA pool is preferred if > available. > > The restricted DMA pools

Re: [PATCH v2 4/4] swiotlb: Free tbl memory in swiotlb_exit()

2021-07-31 Thread Guenter Roeck
Hi, On Tue, Jul 20, 2021 at 02:38:26PM +0100, Will Deacon wrote: > Although swiotlb_exit() frees the 'slots' metadata array referenced by > 'io_tlb_default_mem', it leaves the underlying buffer pages allocated > despite no longer being usable. > > Extend swiotlb_exit() to free the buffer pages

Re: [PATCH v2 4/4] swiotlb: Free tbl memory in swiotlb_exit()

2021-07-31 Thread Guenter Roeck
On 7/31/21 7:29 PM, Konrad Rzeszutek Wilk wrote: On Sat, Jul 31, 2021 at 11:26:11AM -0700, Guenter Roeck wrote: Hi, On Tue, Jul 20, 2021 at 02:38:26PM +0100, Will Deacon wrote: Although swiotlb_exit() frees the 'slots' metadata array referenced by 'io_tlb_default_mem', it leaves

Re: [SPAM][PATCH] iommu/mediatek: Validate number of phandles associated with "mediatek,larbs"

2021-12-14 Thread Guenter Roeck
On 12/13/21 11:31 PM, Yong Wu wrote: On Fri, 2021-12-10 at 12:57 -0800, Guenter Roeck wrote: Since commit baf94e6ebff9 ("iommu/mediatek: Add device link for smi- common and m4u"), the driver assumes that at least one phandle associated with "mediatek,larbs" exists. If

Re: [SPAM][PATCH] iommu/mediatek: Validate number of phandles associated with "mediatek,larbs"

2021-12-15 Thread Guenter Roeck
On Wed, Dec 15, 2021 at 01:30:45PM +0800, Yong Wu wrote: > On Tue, 2021-12-14 at 07:02 -0800, Guenter Roeck wrote: > > On 12/13/21 11:31 PM, Yong Wu wrote: > > > On Fri, 2021-12-10 at 12:57 -0800, Guenter Roeck wrote: > > > > Since commit baf94e6ebff9 (&q

[PATCH] iommu/mediatek: Validate number of phandles associated with "mediatek, larbs"

2021-12-10 Thread Guenter Roeck
device link for smi-common and m4u") Reported-by: kernel test robot Reported-by: Dan Carpenter Signed-off-by: Guenter Roeck --- drivers/iommu/mtk_iommu.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c index 25b834104790..0bbe32d

Re: [patch V3 28/35] PCI/MSI: Simplify pci_irq_get_affinity()

2022-01-31 Thread Guenter Roeck
On 1/31/22 03:27, Thomas Gleixner wrote: On Sun, Jan 30 2022 at 09:12, Guenter Roeck wrote: On Fri, Dec 10, 2021 at 11:19:26PM +0100, Thomas Gleixner wrote: This patch results in the following runtime warning when booting x86 (32 bit) nosmp images from NVME in qemu. [ 14.825482] nvme nvme0

Re: [patch V3 28/35] PCI/MSI: Simplify pci_irq_get_affinity()

2022-01-30 Thread Guenter Roeck
On Fri, Dec 10, 2021 at 11:19:26PM +0100, Thomas Gleixner wrote: > From: Thomas Gleixner > > Replace open coded MSI descriptor chasing and use the proper accessor > functions instead. > > Signed-off-by: Thomas Gleixner > Reviewed-by: Greg Kroah-Hartman > Reviewed-by: Jason Gunthorpe This

Re: [patch V3 28/35] PCI/MSI: Simplify pci_irq_get_affinity()

2022-01-31 Thread Guenter Roeck
On Mon, Jan 31, 2022 at 10:16:41PM +0100, Thomas Gleixner wrote: > Guenter, > > On Mon, Jan 31 2022 at 07:21, Guenter Roeck wrote: > > Sure. Please see http://server.roeck-us.net/qemu/x86/. > > The logs are generated with with v5.16.4. > > thanks for providing the da

Re: [PATCH 7/7] dt-bindings: watchdog: renesas,wdt: R-Car V3U is R-Car Gen4

2022-05-14 Thread Guenter Roeck
ski > Reviewed-by: Wolfram Sang Reviewed-by: Guenter Roeck > --- > Documentation/devicetree/bindings/watchdog/renesas,wdt.yaml | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/Documentation/devicetree/bindings/watchdog/renesas,wdt.yaml > b/Documentation/

Re: [linux-next:master] BUILD REGRESSION 088b9c375534d905a4d337c78db3b3bfbb52c4a0

2022-07-07 Thread Guenter Roeck
On Thu, Jul 07, 2022 at 10:08:33AM +0200, Greg KH wrote: [ ... ] > > > > Unverified Error/Warning (likely false positive, please contact us if > > interested): > > > > arch/x86/events/core.c:2114 init_hw_perf_events() warn: missing error code > > 'err' > > drivers/android/binder.c:1481:19-23:

Re: [PATCH 1/4] iommu/mediatek: Use dev_err_probe to mute probe_defer err log

2022-05-11 Thread Guenter Roeck via iommu
OMMU flow with the MM TYPE") > Signed-off-by: Yong Wu Reviewed-by: Guenter Roeck > --- > The Fixes tag commit-id is from linux-next. > --- > drivers/iommu/mtk_iommu.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/iommu/mtk_i