Re: [PATCH next] iommu: intel: don't dereference iommu_device if IOMMU_API is not built

2020-10-14 Thread Bartosz Golaszewski
On Wed, Oct 14, 2020 at 2:49 AM Lu Baolu  wrote:
>
> On 10/13/20 3:30 PM, Bartosz Golaszewski wrote:
> > From: Bartosz Golaszewski 
> >
> > Since commit c40c1018 ("iommu/vt-d: Gracefully handle DMAR units
> > with no supported address widths") dmar.c needs struct iommu_device to
> > be selected. We can drop this dependency by not dereferencing struct
> > iommu_device if IOMMU_API is not selected and by reusing the information
> > stored in iommu->drhd->ignored instead.
> >
> > This fixes the following build error when IOMMU_API is not selected:
> >
> > drivers/iommu/intel/dmar.c: In function ‘free_iommu’:
> > drivers/iommu/intel/dmar.c:1139:41: error: ‘struct iommu_device’ has no 
> > member named ‘ops’
> >   1139 |  if (intel_iommu_enabled && iommu->iommu.ops) {
> >  ^
> >
> > Fixes: c40c1018 ("iommu/vt-d: Gracefully handle DMAR units with no 
> > supported address widths")
> > Signed-off-by: Bartosz Golaszewski 
>
> With commit title adjusted to "iommu/vt-d: Don't dereference
> iommu_device if IOMMU_API is not built",
>
> Acked-by: Lu Baolu 
>

Do you want me to resend it again with a changed title or can you fix
it up when applying? Or should someone else pick it up?

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

[PATCH next] iommu: intel: make DMAR_TABLE select IOMMU_API

2020-10-12 Thread Bartosz Golaszewski
From: Bartosz Golaszewski 

Since commit c40c1018 ("iommu/vt-d: Gracefully handle DMAR units
with no supported address widths") dmar.c needs struct iommu_device to
be defined. We need to unconditionally select IOMMU_API when DMAR_TABLE
is selected. This fixes the following build error when IOMMU_API is not
selected:

drivers/iommu/intel/dmar.c: In function ‘free_iommu’:
drivers/iommu/intel/dmar.c:1139:41: error: ‘struct iommu_device’ has no member 
named ‘ops’
 1139 |  if (intel_iommu_enabled && iommu->iommu.ops) {
^

Fixes: c40c1018 ("iommu/vt-d: Gracefully handle DMAR units with no 
supported address widths")
Signed-off-by: Bartosz Golaszewski 
---
 drivers/iommu/intel/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iommu/intel/Kconfig b/drivers/iommu/intel/Kconfig
index 5337ee1584b0..f814b7585ba8 100644
--- a/drivers/iommu/intel/Kconfig
+++ b/drivers/iommu/intel/Kconfig
@@ -1,13 +1,13 @@
 # SPDX-License-Identifier: GPL-2.0-only
 # Intel IOMMU support
 config DMAR_TABLE
+   select IOMMU_API
bool
 
 config INTEL_IOMMU
bool "Support for Intel IOMMU using DMA Remapping Devices"
depends on PCI_MSI && ACPI && (X86 || IA64)
select DMA_OPS
-   select IOMMU_API
select IOMMU_IOVA
select NEED_DMA_MAP_STATE
select DMAR_TABLE
-- 
2.28.0

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

Re: [PATCH next] iommu: intel: make DMAR_TABLE select IOMMU_API

2020-10-13 Thread Bartosz Golaszewski
On Tue, Oct 13, 2020 at 3:33 AM Lu Baolu  wrote:
>
> Hi,
>
> On 10/12/20 8:31 PM, Bartosz Golaszewski wrote:
> > From: Bartosz Golaszewski 
> >
> > Since commit c40c1018 ("iommu/vt-d: Gracefully handle DMAR units
> > with no supported address widths") dmar.c needs struct iommu_device to
> > be defined. We need to unconditionally select IOMMU_API when DMAR_TABLE
> > is selected. This fixes the following build error when IOMMU_API is not
> > selected:
> >
> > drivers/iommu/intel/dmar.c: In function ‘free_iommu’:
> > drivers/iommu/intel/dmar.c:1139:41: error: ‘struct iommu_device’ has no 
> > member named ‘ops’
> >   1139 |  if (intel_iommu_enabled && iommu->iommu.ops) {
>
> Thanks!
>
> How about making it symmetric with the registration code?
>
> if (intel_iommu_enabled && !iommu->drhd->ignored)
>
> Best regards,
> baolu
>

Sounds good, just sent out a patch.

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

[PATCH next] iommu: intel: don't dereference iommu_device if IOMMU_API is not built

2020-10-13 Thread Bartosz Golaszewski
From: Bartosz Golaszewski 

Since commit c40c1018 ("iommu/vt-d: Gracefully handle DMAR units
with no supported address widths") dmar.c needs struct iommu_device to
be selected. We can drop this dependency by not dereferencing struct
iommu_device if IOMMU_API is not selected and by reusing the information
stored in iommu->drhd->ignored instead.

This fixes the following build error when IOMMU_API is not selected:

drivers/iommu/intel/dmar.c: In function ‘free_iommu’:
drivers/iommu/intel/dmar.c:1139:41: error: ‘struct iommu_device’ has no member 
named ‘ops’
 1139 |  if (intel_iommu_enabled && iommu->iommu.ops) {
^

Fixes: c40c1018 ("iommu/vt-d: Gracefully handle DMAR units with no 
supported address widths")
Signed-off-by: Bartosz Golaszewski 
---
 drivers/iommu/intel/dmar.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iommu/intel/dmar.c b/drivers/iommu/intel/dmar.c
index 2d70d56d8e0d..404b40af31cb 100644
--- a/drivers/iommu/intel/dmar.c
+++ b/drivers/iommu/intel/dmar.c
@@ -1136,7 +1136,7 @@ static int alloc_iommu(struct dmar_drhd_unit *drhd)
 
 static void free_iommu(struct intel_iommu *iommu)
 {
-   if (intel_iommu_enabled && iommu->iommu.ops) {
+   if (intel_iommu_enabled && !iommu->drhd->ignored) {
iommu_device_unregister(>iommu);
iommu_device_sysfs_remove(>iommu);
}
-- 
2.28.0

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

Re: [PATCH 6/9] dt-bindings: gpio: renesas, rcar-gpio: Add r8a774e1 support

2020-08-27 Thread Bartosz Golaszewski
On Thu, Aug 27, 2020 at 6:40 PM Lad, Prabhakar
 wrote:
>
> Hi Linus and Bartosz,
>
> On Mon, Jul 13, 2020 at 10:35 PM Lad Prabhakar
>  wrote:
> >
> > Document Renesas RZ/G2H (R8A774E1) GPIO blocks compatibility within the
> > relevant dt-bindings.
> >
> > Signed-off-by: Lad Prabhakar 
> > ---
> >  Documentation/devicetree/bindings/gpio/renesas,rcar-gpio.yaml | 1 +
> >  1 file changed, 1 insertion(+)
> >
> Gentle ping.
>
> Cheers,
> Prabhakar

This doesn't apply on top of v5.9-rc1.

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


Re: [PATCH 1/7] dt-bindings: gpio: renesas,rcar-gpio: R-Car V3U is R-Car Gen4

2022-05-05 Thread Bartosz Golaszewski
On Mon, May 2, 2022 at 3:35 PM Geert Uytterhoeven
 wrote:
>
> Despite the name, R-Car V3U is the first member of the R-Car Gen4
> family.  Hence move its compatible value to the R-Car Gen4 section.
>
> Signed-off-by: Geert Uytterhoeven 
> ---
>  Documentation/devicetree/bindings/gpio/renesas,rcar-gpio.yaml | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/gpio/renesas,rcar-gpio.yaml 
> b/Documentation/devicetree/bindings/gpio/renesas,rcar-gpio.yaml
> index 0681a4790cd62e23..75e5da6a7cc04bbd 100644
> --- a/Documentation/devicetree/bindings/gpio/renesas,rcar-gpio.yaml
> +++ b/Documentation/devicetree/bindings/gpio/renesas,rcar-gpio.yaml
> @@ -48,11 +48,9 @@ properties:
>- renesas,gpio-r8a77995 # R-Car D3
>- const: renesas,rcar-gen3-gpio # R-Car Gen3 or RZ/G2
>
> -  - items:
> -  - const: renesas,gpio-r8a779a0  # R-Car V3U
> -
>- items:
>- enum:
> +  - renesas,gpio-r8a779a0 # R-Car V3U
>- renesas,gpio-r8a779f0 # R-Car S4-8
>- const: renesas,rcar-gen4-gpio # R-Car Gen4
>
> --
> 2.25.1
>

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