Re: [PATCH 21/29] mm: remove the pgprot argument to __vmalloc

2020-05-01 Thread Andrew Morton
On Thu, 30 Apr 2020 22:38:10 -0400 John Dorminy  wrote:

> the change
> description refers to PROT_KERNEL, which is a symbol which does not
> appear to exist; perhaps PAGE_KERNEL was meant?

Yes, thanks, fixed.
___
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu


Re: [PATCH 03/14] docs: fix references for DMA*.txt files

2020-05-01 Thread Paul E. McKenney
On Fri, May 01, 2020 at 05:37:47PM +0200, Mauro Carvalho Chehab wrote:
> As we moved those files to core-api, fix references to point
> to their newer locations.
> 
> Signed-off-by: Mauro Carvalho Chehab 
> ---
>  Documentation/PCI/pci.rst  |  6 +++---
>  Documentation/block/biodoc.rst |  2 +-
>  Documentation/core-api/bus-virt-phys-mapping.rst   |  2 +-
>  Documentation/core-api/dma-api.rst |  6 +++---
>  Documentation/core-api/dma-isa-lpc.rst |  2 +-
>  Documentation/driver-api/usb/dma.rst   |  6 +++---
>  Documentation/memory-barriers.txt  |  6 +++---

For memory-barriers.txt:

Acked-by: Paul E. McKenney 

>  .../translations/ko_KR/memory-barriers.txt |  6 +++---
>  arch/ia64/hp/common/sba_iommu.c| 12 ++--
>  arch/parisc/kernel/pci-dma.c   |  2 +-
>  arch/x86/include/asm/dma-mapping.h |  4 ++--
>  arch/x86/kernel/amd_gart_64.c  |  2 +-
>  drivers/parisc/sba_iommu.c | 14 +++---
>  include/linux/dma-mapping.h|  2 +-
>  include/media/videobuf-dma-sg.h|  2 +-
>  kernel/dma/debug.c |  2 +-
>  16 files changed, 38 insertions(+), 38 deletions(-)
> 
> diff --git a/Documentation/PCI/pci.rst b/Documentation/PCI/pci.rst
> index 8c016d8c9862..d10d3fe604c5 100644
> --- a/Documentation/PCI/pci.rst
> +++ b/Documentation/PCI/pci.rst
> @@ -265,7 +265,7 @@ Set the DMA mask size
>  -
>  .. note::
> If anything below doesn't make sense, please refer to
> -   Documentation/DMA-API.txt. This section is just a reminder that
> +   :doc:`/core-api/dma-api`. This section is just a reminder that
> drivers need to indicate DMA capabilities of the device and is not
> an authoritative source for DMA interfaces.
>  
> @@ -291,7 +291,7 @@ Many 64-bit "PCI" devices (before PCI-X) and some PCI-X 
> devices are
>  Setup shared control data
>  -
>  Once the DMA masks are set, the driver can allocate "consistent" (a.k.a. 
> shared)
> -memory.  See Documentation/DMA-API.txt for a full description of
> +memory.  See :doc:`/core-api/dma-api` for a full description of
>  the DMA APIs. This section is just a reminder that it needs to be done
>  before enabling DMA on the device.
>  
> @@ -421,7 +421,7 @@ owners if there is one.
>  
>  Then clean up "consistent" buffers which contain the control data.
>  
> -See Documentation/DMA-API.txt for details on unmapping interfaces.
> +See :doc:`/core-api/dma-api` for details on unmapping interfaces.
>  
>  
>  Unregister from other subsystems
> diff --git a/Documentation/block/biodoc.rst b/Documentation/block/biodoc.rst
> index b964796ec9c7..ba7f45d0271c 100644
> --- a/Documentation/block/biodoc.rst
> +++ b/Documentation/block/biodoc.rst
> @@ -196,7 +196,7 @@ a virtual address mapping (unlike the earlier scheme of 
> virtual address
>  do not have a corresponding kernel virtual address space mapping) and
>  low-memory pages.
>  
> -Note: Please refer to Documentation/DMA-API-HOWTO.txt for a discussion
> +Note: Please refer to :doc:`/core-api/dma-api-howto` for a discussion
>  on PCI high mem DMA aspects and mapping of scatter gather lists, and support
>  for 64 bit PCI.
>  
> diff --git a/Documentation/core-api/bus-virt-phys-mapping.rst 
> b/Documentation/core-api/bus-virt-phys-mapping.rst
> index 4bb07c2f3e7d..c7bc99cd2e21 100644
> --- a/Documentation/core-api/bus-virt-phys-mapping.rst
> +++ b/Documentation/core-api/bus-virt-phys-mapping.rst
> @@ -8,7 +8,7 @@ How to access I/O mapped memory from within device drivers
>  
>   The virt_to_bus() and bus_to_virt() functions have been
>   superseded by the functionality provided by the PCI DMA interface
> - (see Documentation/DMA-API-HOWTO.txt).  They continue
> + (see :doc:`/core-api/dma-api-howto`).  They continue
>   to be documented below for historical purposes, but new code
>   must not use them. --davidm 00/12/12
>  
> diff --git a/Documentation/core-api/dma-api.rst 
> b/Documentation/core-api/dma-api.rst
> index 2d8d2fed7317..63b4a2f20867 100644
> --- a/Documentation/core-api/dma-api.rst
> +++ b/Documentation/core-api/dma-api.rst
> @@ -5,7 +5,7 @@ Dynamic DMA mapping using the generic device
>  :Author: James E.J. Bottomley 
>  
>  This document describes the DMA API.  For a more gentle introduction
> -of the API (and actual examples), see Documentation/DMA-API-HOWTO.txt.
> +of the API (and actual examples), see :doc:`/core-api/dma-api-howto`.
>  
>  This API is split into two pieces.  Part I describes the basic API.
>  Part II describes extensions for supporting non-consistent memory
> @@ -471,7 +471,7 @@ without the _attrs suffixes, except that they pass an 
> optional
>  dma_attrs.
>  
>  The interpretation of DMA attributes is architecture-specific, and
> -each attribute 

[PATCH 03/14] docs: fix references for DMA*.txt files

2020-05-01 Thread Mauro Carvalho Chehab
As we moved those files to core-api, fix references to point
to their newer locations.

Signed-off-by: Mauro Carvalho Chehab 
---
 Documentation/PCI/pci.rst  |  6 +++---
 Documentation/block/biodoc.rst |  2 +-
 Documentation/core-api/bus-virt-phys-mapping.rst   |  2 +-
 Documentation/core-api/dma-api.rst |  6 +++---
 Documentation/core-api/dma-isa-lpc.rst |  2 +-
 Documentation/driver-api/usb/dma.rst   |  6 +++---
 Documentation/memory-barriers.txt  |  6 +++---
 .../translations/ko_KR/memory-barriers.txt |  6 +++---
 arch/ia64/hp/common/sba_iommu.c| 12 ++--
 arch/parisc/kernel/pci-dma.c   |  2 +-
 arch/x86/include/asm/dma-mapping.h |  4 ++--
 arch/x86/kernel/amd_gart_64.c  |  2 +-
 drivers/parisc/sba_iommu.c | 14 +++---
 include/linux/dma-mapping.h|  2 +-
 include/media/videobuf-dma-sg.h|  2 +-
 kernel/dma/debug.c |  2 +-
 16 files changed, 38 insertions(+), 38 deletions(-)

diff --git a/Documentation/PCI/pci.rst b/Documentation/PCI/pci.rst
index 8c016d8c9862..d10d3fe604c5 100644
--- a/Documentation/PCI/pci.rst
+++ b/Documentation/PCI/pci.rst
@@ -265,7 +265,7 @@ Set the DMA mask size
 -
 .. note::
If anything below doesn't make sense, please refer to
-   Documentation/DMA-API.txt. This section is just a reminder that
+   :doc:`/core-api/dma-api`. This section is just a reminder that
drivers need to indicate DMA capabilities of the device and is not
an authoritative source for DMA interfaces.
 
@@ -291,7 +291,7 @@ Many 64-bit "PCI" devices (before PCI-X) and some PCI-X 
devices are
 Setup shared control data
 -
 Once the DMA masks are set, the driver can allocate "consistent" (a.k.a. 
shared)
-memory.  See Documentation/DMA-API.txt for a full description of
+memory.  See :doc:`/core-api/dma-api` for a full description of
 the DMA APIs. This section is just a reminder that it needs to be done
 before enabling DMA on the device.
 
@@ -421,7 +421,7 @@ owners if there is one.
 
 Then clean up "consistent" buffers which contain the control data.
 
-See Documentation/DMA-API.txt for details on unmapping interfaces.
+See :doc:`/core-api/dma-api` for details on unmapping interfaces.
 
 
 Unregister from other subsystems
diff --git a/Documentation/block/biodoc.rst b/Documentation/block/biodoc.rst
index b964796ec9c7..ba7f45d0271c 100644
--- a/Documentation/block/biodoc.rst
+++ b/Documentation/block/biodoc.rst
@@ -196,7 +196,7 @@ a virtual address mapping (unlike the earlier scheme of 
virtual address
 do not have a corresponding kernel virtual address space mapping) and
 low-memory pages.
 
-Note: Please refer to Documentation/DMA-API-HOWTO.txt for a discussion
+Note: Please refer to :doc:`/core-api/dma-api-howto` for a discussion
 on PCI high mem DMA aspects and mapping of scatter gather lists, and support
 for 64 bit PCI.
 
diff --git a/Documentation/core-api/bus-virt-phys-mapping.rst 
b/Documentation/core-api/bus-virt-phys-mapping.rst
index 4bb07c2f3e7d..c7bc99cd2e21 100644
--- a/Documentation/core-api/bus-virt-phys-mapping.rst
+++ b/Documentation/core-api/bus-virt-phys-mapping.rst
@@ -8,7 +8,7 @@ How to access I/O mapped memory from within device drivers
 
The virt_to_bus() and bus_to_virt() functions have been
superseded by the functionality provided by the PCI DMA interface
-   (see Documentation/DMA-API-HOWTO.txt).  They continue
+   (see :doc:`/core-api/dma-api-howto`).  They continue
to be documented below for historical purposes, but new code
must not use them. --davidm 00/12/12
 
diff --git a/Documentation/core-api/dma-api.rst 
b/Documentation/core-api/dma-api.rst
index 2d8d2fed7317..63b4a2f20867 100644
--- a/Documentation/core-api/dma-api.rst
+++ b/Documentation/core-api/dma-api.rst
@@ -5,7 +5,7 @@ Dynamic DMA mapping using the generic device
 :Author: James E.J. Bottomley 
 
 This document describes the DMA API.  For a more gentle introduction
-of the API (and actual examples), see Documentation/DMA-API-HOWTO.txt.
+of the API (and actual examples), see :doc:`/core-api/dma-api-howto`.
 
 This API is split into two pieces.  Part I describes the basic API.
 Part II describes extensions for supporting non-consistent memory
@@ -471,7 +471,7 @@ without the _attrs suffixes, except that they pass an 
optional
 dma_attrs.
 
 The interpretation of DMA attributes is architecture-specific, and
-each attribute should be documented in Documentation/DMA-attributes.txt.
+each attribute should be documented in :doc:`/core-api/dma-attributes`.
 
 If dma_attrs are 0, the semantics of each of these functions
 is identical to those of the corresponding function
@@ -484,7 +484,7 @@ for DMA::
 
#include 
/* DMA_ATTR_FOO 

[PATCH 00/14] Move the ReST files from Documentation/*.txt

2020-05-01 Thread Mauro Carvalho Chehab
The main goal of this series is to cleanup the Documentation/
directory.

Most of the files under Documentation/*.txt are already in ReST format.
They just need to be moved to some place. So, most of the work here is
to just move files for them to generate an output using the docs building
system.

After this change, the  Documentation/ dir will contain:

- the main ReST file:
- index.rst

- TUX and its copyright:
- logo.gif and COPYING-logo

- Files required to do ReST builds:
- .gitignore, Makefile,  conf.py,  docutils.conf,  Kconfig

- A pre-git file used to generate patches:
- dontdiff
  (I guess we should get rid of it, as I doubt this is useful those days).

-

Besides the above rightful files, the Documentation/ dir will also
contain some left-overs:

- two somewhat new ReST files that should be moved to somewhere:
- asm-annotations.rst and watch_queue.rst

- Two files that helps people looking for some well known documents
  that are referenced at the web, pointing to their new location inside
  the process/ dir:
- SubmittingPatches and CodingStyle

- Three .txt files that weren't converted to ReST:
- atomic_bitops.txt, memory-barriers.txt, atomic_t.txt

It should be noticed that I'm in doubt about the location of some files,
and some stuff may well belong to a trash can. So, this series create
a temporary place for orphaned documents in the form of a
Documentation/staging directory.

This series is also on my development git tree, at:

https://git.linuxtv.org/mchehab/experimental.git/log/?h=rename-main-docs

The built output documentation on html format is at:

https://www.infradead.org/~mchehab/kernel_docs/

(it contains also other documents I converted to ReST)


Mauro Carvalho Chehab (14):
  docs: move DMA kAPI to Documentation/core-api
  docs: add bus-virt-phys-mapping.txt to core-api
  docs: fix references for DMA*.txt files
  docs: move IPMI.txt to the driver API book
  docs: fix references for ipmi.rst file
  docs: debugging-via-ohci1394.txt: add it to the core-api book
  docs: add IRQ documentation at the core-api book
  docs: move kobject and kref docs into the core-api book
  docs: move digsig docs to the security book
  docs: move locking-specific documenta to locking/ directory
  docs: move other kAPI documents to core-api
  docs: move remaining stuff under Documentation/*.txt to
Documentation/staging
  docs: staging: don't use literalinclude
  docs: staging: use small font for literal includes

 Documentation/PCI/pci.rst |  6 +-
 Documentation/admin-guide/hw-vuln/l1tf.rst|  2 +-
 .../admin-guide/kernel-parameters.txt |  2 +-
 .../admin-guide/kernel-per-CPU-kthreads.rst   |  2 +-
 Documentation/admin-guide/sysctl/vm.rst   |  2 +-
 Documentation/block/biodoc.rst|  2 +-
 .../bus-virt-phys-mapping.rst}|  2 +-
 .../debugging-via-ohci1394.rst}   |  0
 .../dma-api-howto.rst}|  0
 .../{DMA-API.txt => core-api/dma-api.rst} |  6 +-
 .../dma-attributes.rst}   |  0
 .../dma-isa-lpc.rst}  |  2 +-
 Documentation/core-api/index.rst  | 14 +
 .../{IRQ.txt => core-api/irq/concepts.rst}|  0
 Documentation/core-api/irq/index.rst  | 11 
 .../irq/irq-affinity.rst} |  0
 .../irq/irq-domain.rst}   |  3 +-
 .../irq/irqflags-tracing.rst} |  0
 Documentation/core-api/kobject.rst|  2 +-
 Documentation/{kref.txt => core-api/kref.rst} |  0
 .../{mailbox.txt => core-api/mailbox.rst} |  0
 .../nommu-mmap.rst}   |  0
 .../this_cpu_ops.rst} |  0
 .../unaligned-memory-access.rst}  |  0
 Documentation/driver-api/index.rst|  1 +
 .../{IPMI.txt => driver-api/ipmi.rst} |  0
 Documentation/driver-api/usb/dma.rst  |  6 +-
 Documentation/gpu/drm-mm.rst  |  2 +-
 Documentation/ia64/irq-redir.rst  |  2 +-
 Documentation/index.rst   | 13 
 .../futex-requeue-pi.rst} |  0
 .../hwspinlock.rst}   |  0
 Documentation/locking/index.rst   |  7 +++
 .../percpu-rw-semaphore.rst}  |  0
 .../{pi-futex.txt => locking/pi-futex.rst}|  0
 .../preempt-locking.rst}  |  0
 .../robust-futex-ABI.rst} |  0
 .../robust-futexes.rst}   |  0
 Documentation/locking/rt-mutex.rst|  2 +-
 Documentation/memory-barriers.txt |  6 +-
 Documentation/networking/scaling.rst  |  4 +-
 .../{digsig.txt => security/digsig.rst}   |  0
 Documentation/security/index.rst  |  1 +
 .../{crc32.txt => staging/crc32.rst}  |  0
 Documentation/staging/index.rst   | 59 +++
 .../{kprobes.txt => 

Re: [PATCH 1/2] arm64: dts: qcom: sc7180: Add A618 gpu dt blob

2020-05-01 Thread Doug Anderson
Hi,

On Fri, May 1, 2020 at 3:30 AM Sharat Masetty  wrote:
>
> This patch adds the required dt nodes and properties
> to enabled A618 GPU.
>
> Signed-off-by: Sharat Masetty 
> ---
> * Remove GCC_DDRSS_GPU_AXI_CLK clock reference from gpu smmu node.
>
>  arch/arm64/boot/dts/qcom/sc7180.dtsi | 102 
> +++
>  1 file changed, 102 insertions(+)

This is the newer version of the patch:

https://lore.kernel.org/r/1581320465-15854-2-git-send-email-smase...@codeaurora.org

The change to remove the extra IOMMU clock matches our discussions and
there's no longer anything blocking this from landing.

Reviewed-by: Douglas Anderson 
Tested-by: Douglas Anderson 
___
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu


Re: [PATCH 2/2] dt-bindings: arm-smmu: Add sc7180 compatible string

2020-05-01 Thread Doug Anderson
Hi,

On Fri, May 1, 2020 at 3:30 AM Sharat Masetty  wrote:
>
> This patch simply adds a new compatible string for SC7180 platform.
>
> Signed-off-by: Sharat Masetty 
> ---
>  Documentation/devicetree/bindings/iommu/arm,smmu.yaml | 1 +
>  1 file changed, 1 insertion(+)

Reviewed-by: Douglas Anderson 
___
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu


Re: [PATCH v2]iommu/qcom:fix local_base status check

2020-05-01 Thread Tang Bin



On 2020/5/1 19:37, Joerg Roedel wrote:

On Sat, Apr 18, 2020 at 09:47:03PM +0800, Tang Bin wrote:

The function qcom_iommu_device_probe() does not perform sufficient
error checking after executing devm_ioremap_resource(), which can
result in crashes if a critical error path is encountered.

Fixes: 0ae349a0f33f ("iommu/qcom: Add qcom_iommu")

Signed-off-by: Tang Bin 
---
v2:
  - fix commit message and add fixed tag
---
  drivers/iommu/qcom_iommu.c | 5 -
  1 file changed, 4 insertions(+), 1 deletion(-)

Applied for v5.7, thanks.


Thank you very much.

Tang Bin






___
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu


Re: [PATCH v6 17/25] iommu/arm-smmu-v3: Implement iommu_sva_bind/unbind()

2020-05-01 Thread Jason Gunthorpe
On Fri, May 01, 2020 at 05:15:52AM -0700, Christoph Hellwig wrote:
> > @@ -432,6 +432,7 @@ config ARM_SMMU_V3
> > tristate "ARM Ltd. System MMU Version 3 (SMMUv3) Support"
> > depends on ARM64
> > select IOMMU_API
> > +   select IOMMU_SVA
> > select IOMMU_IO_PGTABLE_LPAE
> > select GENERIC_MSI_IRQ_DOMAIN
> 
> Doesn't this need to select MMU_NOTIFIER now?
> 
> > +   struct mmu_notifier_ops mn_ops;
> 
> Note: not a pointer.
> 
> > +   /* If bind() was already called for this (dev, mm) pair, reuse it. */
> > +   list_for_each_entry(bond, >bonds, list) {
> > +   if (bond->mm == mm) {
> > +   refcount_inc(>refs);
> > +   return >sva;
> > +   }
> > +   }

I also would like it if searching for mms in linked lists was not
necessary, this is kind of the point of 'get'

Is this a side effect of the earlier remark to get rid of the linked
list inside the notifier?

> Or we could enhance the mmu_notifier_get to pass a private
> oaque instance ID pointer, which is checked in addition to the ops,
> and you could probably kill off the bonds list and lookup.

This might be the best option if it can absorb the above search..

Jason
___
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu


Re: [PATCH v6 17/25] iommu/arm-smmu-v3: Implement iommu_sva_bind/unbind()

2020-05-01 Thread Christoph Hellwig
> @@ -432,6 +432,7 @@ config ARM_SMMU_V3
>   tristate "ARM Ltd. System MMU Version 3 (SMMUv3) Support"
>   depends on ARM64
>   select IOMMU_API
> + select IOMMU_SVA
>   select IOMMU_IO_PGTABLE_LPAE
>   select GENERIC_MSI_IRQ_DOMAIN

Doesn't this need to select MMU_NOTIFIER now?

> + struct mmu_notifier_ops mn_ops;

Note: not a pointer.

> + /* If bind() was already called for this (dev, mm) pair, reuse it. */
> + list_for_each_entry(bond, >bonds, list) {
> + if (bond->mm == mm) {
> + refcount_inc(>refs);
> + return >sva;
> + }
> + }
> +
> + mn = mmu_notifier_get(_domain->mn_ops, mm);
> + if (IS_ERR(mn))
> + return ERR_CAST(mn);

Which seems to be to avoid mmu_notifier_get reusing notifiers registered
by other arm_smmu_master instance right?

Either you could just use plain old mmu_notifier_register to avoid
the reuse.  Or we could enhance the mmu_notifier_get to pass a private
oaque instance ID pointer, which is checked in addition to the ops,
and you could probably kill off the bonds list and lookup.

___
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu


Re: [PATCH v2]iommu/qcom:fix local_base status check

2020-05-01 Thread Joerg Roedel
On Sat, Apr 18, 2020 at 09:47:03PM +0800, Tang Bin wrote:
> The function qcom_iommu_device_probe() does not perform sufficient
> error checking after executing devm_ioremap_resource(), which can
> result in crashes if a critical error path is encountered.
> 
> Fixes: 0ae349a0f33f ("iommu/qcom: Add qcom_iommu")
> 
> Signed-off-by: Tang Bin 
> ---
> v2:
>  - fix commit message and add fixed tag
> ---
>  drivers/iommu/qcom_iommu.c | 5 -
>  1 file changed, 4 insertions(+), 1 deletion(-)

Applied for v5.7, thanks.

___
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu


Re: [PATCH] drivers/iommu: properly export iommu_group_get_for_dev

2020-05-01 Thread Joerg Roedel
On Thu, Apr 30, 2020 at 02:01:20PM +0200, Greg Kroah-Hartman wrote:
> In commit a7ba5c3d008d ("drivers/iommu: Export core IOMMU API symbols to
> permit modular drivers") a bunch of iommu symbols were exported, all
> with _GPL markings except iommu_group_get_for_dev().  That export should
> also be _GPL like the others.
> 
> Cc: Will Deacon 
> Cc: Joerg Roedel 
> Cc: John Garry 
> Fixes: a7ba5c3d008d ("drivers/iommu: Export core IOMMU API symbols to permit 
> modular drivers")
> Signed-off-by: Greg Kroah-Hartman 
> ---
>  drivers/iommu/iommu.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied for v5.7, thanks.

___
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu


Re: [PATCH 1/1] iommu/vt-d: Use right Kconfig option name

2020-05-01 Thread Joerg Roedel
On Fri, May 01, 2020 at 03:24:27PM +0800, Lu Baolu wrote:
> The CONFIG_ prefix should be added in the code.
> 
> Fixes: 046182525db61 ("iommu/vt-d: Add Kconfig option to enable/disable 
> scalable mode")
> Reported-and-tested-by: Kumar, Sanjay K 
> Cc: Ashok Raj 
> Signed-off-by: Lu Baolu 
> ---
>  drivers/iommu/intel-iommu.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Applied for v5.7, thanks.

___
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu


Re: [PATCH] iommu: Free fwspec with the dev_iommu object

2020-05-01 Thread Joerg Roedel
Hi Jean-Philippe,

On Wed, Apr 22, 2020 at 03:55:14PM +0200, Jean-Philippe Brucker wrote:
> Fix this leak by freeing the fwspec in dev_iommu_free().
> 
> Fixes: 72acd9df18f1 ("iommu: Move iommu_fwspec to struct dev_iommu")
> Signed-off-by: Jean-Philippe Brucker 
> ---
>  drivers/iommu/iommu.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
> index 2b471419e26c3..54757c404866c 100644
> --- a/drivers/iommu/iommu.c
> +++ b/drivers/iommu/iommu.c
> @@ -170,6 +170,7 @@ static struct dev_iommu *dev_iommu_get(struct device *dev)
>  
>  static void dev_iommu_free(struct device *dev)
>  {
> + iommu_fwspec_free(dev);
>   kfree(dev->iommu);
>   dev->iommu = NULL;
>  }

Sorry, but [1] is already queued.

Thanks,

Joerg

[1] https://lore.kernel.org/r/20200402143749.40500-1-haoke...@gmail.com

___
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu


Re: [PATCH] iommu/amd: Fix legacy interrupt remapping for x2APIC-enabled system

2020-05-01 Thread Joerg Roedel
On Wed, Apr 22, 2020 at 08:30:02AM -0500, Suravee Suthikulpanit wrote:
> Currently, system fails to boot because the legacy interrupt remapping
> mode does not enable 128-bit IRTE (GA), which is required for x2APIC
> support.
> 
> Fix by using AMD_IOMMU_GUEST_IR_LEGACY_GA mode when booting with
> kernel option amd_iommu_intr=legacy instead. The initialization
> logic will check GASup and automatically fallback to using
> AMD_IOMMU_GUEST_IR_LEGACY if GA mode is not supported.
> 
> Fixes: 3928aa3f5775 ("iommu/amd: Detect and enable guest vAPIC support")
> Signed-off-by: Suravee Suthikulpanit 
> ---
>  drivers/iommu/amd_iommu_init.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied for v5.7, thanks Suravee.
___
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu


[PATCH 1/2] arm64: dts: qcom: sc7180: Add A618 gpu dt blob

2020-05-01 Thread Sharat Masetty
This patch adds the required dt nodes and properties
to enabled A618 GPU.

Signed-off-by: Sharat Masetty 
---
* Remove GCC_DDRSS_GPU_AXI_CLK clock reference from gpu smmu node.

 arch/arm64/boot/dts/qcom/sc7180.dtsi | 102 +++
 1 file changed, 102 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sc7180.dtsi 
b/arch/arm64/boot/dts/qcom/sc7180.dtsi
index 4216b57..de9a054 100644
--- a/arch/arm64/boot/dts/qcom/sc7180.dtsi
+++ b/arch/arm64/boot/dts/qcom/sc7180.dtsi
@@ -1373,6 +1373,108 @@
};
};

+   gpu: gpu@500 {
+   compatible = "qcom,adreno-618.0", "qcom,adreno";
+   #stream-id-cells = <16>;
+   reg = <0 0x0500 0 0x4>, <0 0x0509e000 0 0x1000>,
+   <0 0x05061000 0 0x800>;
+   reg-names = "kgsl_3d0_reg_memory", "cx_mem", "cx_dbgc";
+   interrupts = ;
+   iommus = <_smmu 0>;
+   operating-points-v2 = <_opp_table>;
+   qcom,gmu = <>;
+
+   gpu_opp_table: opp-table {
+   compatible = "operating-points-v2";
+
+   opp-8 {
+   opp-hz = /bits/ 64 <8>;
+   opp-level = 
;
+   };
+
+   opp-65000 {
+   opp-hz = /bits/ 64 <65000>;
+   opp-level = 
;
+   };
+
+   opp-56500 {
+   opp-hz = /bits/ 64 <56500>;
+   opp-level = ;
+   };
+
+   opp-43000 {
+   opp-hz = /bits/ 64 <43000>;
+   opp-level = 
;
+   };
+
+   opp-35500 {
+   opp-hz = /bits/ 64 <35500>;
+   opp-level = ;
+   };
+
+   opp-26700 {
+   opp-hz = /bits/ 64 <26700>;
+   opp-level = 
;
+   };
+
+   opp-18000 {
+   opp-hz = /bits/ 64 <18000>;
+   opp-level = 
;
+   };
+   };
+   };
+
+   adreno_smmu: iommu@504 {
+   compatible = "qcom,sc7180-smmu-v2", "qcom,smmu-v2";
+   reg = <0 0x0504 0 0x1>;
+   #iommu-cells = <1>;
+   #global-interrupts = <2>;
+   interrupts = ,
+   ,
+   ,
+   ,
+   ,
+   ,
+   ,
+   ,
+   ,
+   ;
+
+   clocks = < GCC_GPU_MEMNOC_GFX_CLK>,
+   < GCC_GPU_CFG_AHB_CLK>;
+   clock-names = "bus", "iface";
+
+   power-domains = < CX_GDSC>;
+   };
+
+   gmu: gmu@506a000 {
+   compatible="qcom,adreno-gmu-618.0", "qcom,adreno-gmu";
+   reg = <0 0x0506a000 0 0x31000>, <0 0x0b29 0 
0x1>,
+   <0 0x0b49 0 0x1>;
+   reg-names = "gmu", "gmu_pdc", "gmu_pdc_seq";
+   interrupts = ,
+  ;
+   interrupt-names = "hfi", "gmu";
+   clocks = < GPU_CC_CX_GMU_CLK>,
+  < GPU_CC_CXO_CLK>,
+  < GCC_DDRSS_GPU_AXI_CLK>,
+  < GCC_GPU_MEMNOC_GFX_CLK>;
+   clock-names = "gmu", "cxo", "axi", "memnoc";
+   power-domains = < CX_GDSC>, < GX_GDSC>;
+   power-domain-names = "cx", "gx";
+   iommus = <_smmu 5>;
+   operating-points-v2 = <_opp_table>;
+
+   gmu_opp_table: opp-table {
+   compatible = "operating-points-v2";
+
+   opp-2 {
+   opp-hz = /bits/ 64 <2>;
+   opp-level = 
;
+ 

[PATCH 2/2] dt-bindings: arm-smmu: Add sc7180 compatible string

2020-05-01 Thread Sharat Masetty
This patch simply adds a new compatible string for SC7180 platform.

Signed-off-by: Sharat Masetty 
---
 Documentation/devicetree/bindings/iommu/arm,smmu.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/iommu/arm,smmu.yaml 
b/Documentation/devicetree/bindings/iommu/arm,smmu.yaml
index 6515dbe..986098b 100644
--- a/Documentation/devicetree/bindings/iommu/arm,smmu.yaml
+++ b/Documentation/devicetree/bindings/iommu/arm,smmu.yaml
@@ -28,6 +28,7 @@ properties:
   - enum:
   - qcom,msm8996-smmu-v2
   - qcom,msm8998-smmu-v2
+  - qcom,sc7180-smmu-v2
   - qcom,sdm845-smmu-v2
   - const: qcom,smmu-v2
 
-- 
1.9.1
___
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu


[PATCH 1/1] iommu/vt-d: Use right Kconfig option name

2020-05-01 Thread Lu Baolu
The CONFIG_ prefix should be added in the code.

Fixes: 046182525db61 ("iommu/vt-d: Add Kconfig option to enable/disable 
scalable mode")
Reported-and-tested-by: Kumar, Sanjay K 
Cc: Ashok Raj 
Signed-off-by: Lu Baolu 
---
 drivers/iommu/intel-iommu.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c
index ef0a5246700e..0182cff2c7ac 100644
--- a/drivers/iommu/intel-iommu.c
+++ b/drivers/iommu/intel-iommu.c
@@ -371,11 +371,11 @@ int dmar_disabled = 0;
 int dmar_disabled = 1;
 #endif /* CONFIG_INTEL_IOMMU_DEFAULT_ON */
 
-#ifdef INTEL_IOMMU_SCALABLE_MODE_DEFAULT_ON
+#ifdef CONFIG_INTEL_IOMMU_SCALABLE_MODE_DEFAULT_ON
 int intel_iommu_sm = 1;
 #else
 int intel_iommu_sm;
-#endif /* INTEL_IOMMU_SCALABLE_MODE_DEFAULT_ON */
+#endif /* CONFIG_INTEL_IOMMU_SCALABLE_MODE_DEFAULT_ON */
 
 int intel_iommu_enabled = 0;
 EXPORT_SYMBOL_GPL(intel_iommu_enabled);
-- 
2.17.1

___
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu


Re: [PATCH] drivers/iommu: properly export iommu_group_get_for_dev

2020-05-01 Thread Will Deacon
On Thu, Apr 30, 2020 at 02:23:32PM +0200, Joerg Roedel wrote:
> On Thu, Apr 30, 2020 at 01:17:53PM +0100, Will Deacon wrote:
> > Thanks, not sure how I managed to screw this up in the original patch!
> > 
> > Acked-by: Will Deacon 
> > 
> > Joerg -- can you pick this one up please?
> 
> Yes, will send it as a fix for 5.7, but note that this function will be
> unexported in 5.8.

Thanks, Joerg.

Will
___
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu