All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christian Zigotzky <chzigotzky@xenosoft.de>
To: Mike Rapoport <rppt@linux.ibm.com>, Christoph Hellwig <hch@lst.de>
Cc: Robin Murphy <robin.murphy@arm.com>,
	linux-arch@vger.kernel.org, darren@stevens-zone.net,
	mad skateman <madskateman@gmail.com>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	iommu@lists.linux-foundation.org,
	Rob Herring <robh+dt@kernel.org>,
	paulus@samba.org, rtd2@xtra.co.nz,
	"contact@a-eon.com" <contact@a-eon.com>,
	linuxppc-dev <linuxppc-dev@lists.ozlabs.org>,
	nsaenzjulienne@suse.de
Subject: Re: Bug 205201 - Booting halts if Dawicontrol DC-2976 UW SCSI board installed, unless RAM size limited to 3500M
Date: Tue, 26 Nov 2019 12:57:02 +0100	[thread overview]
Message-ID: <b668bc25-9268-d25e-f9a0-176bb4ce1d07@xenosoft.de> (raw)
In-Reply-To: <20191125093159.GA23118@linux.ibm.com>

On 25 November 2019 at 10:32 am, Mike Rapoport wrote:
> On Mon, Nov 25, 2019 at 08:39:23AM +0100, Christoph Hellwig wrote:
>> On Sat, Nov 23, 2019 at 12:42:27PM +0100, Christian Zigotzky wrote:
>>> Hello Christoph,
>>>
>>> Please find attached the dmesg of your Git kernel.
>> Thanks.  It looks like on your platform the swiotlb buffer isn't
>> actually addressable based on the bus dma mask limit, which is rather
>> interesting.  swiotlb_init uses memblock_alloc_low to allocate the
>> buffer, and I'll need some help from Mike and the powerpc maintainers
>> to figure out how that select where to allocate the buffer from, and
>> how we can move it to a lower address.  My gut feeling would be to try
>> to do what arm64 does and define a new ARCH_LOW_ADDRESS_LIMIT, preferably
>> without needing too much arch specific magic.
> Presuming the problem is relevant for all CoreNet boards something like
> this could work:
>   
> diff --git a/arch/powerpc/include/asm/dma.h b/arch/powerpc/include/asm/dma.h
> index 1b4f0254868f..7c6cfeeaff52 100644
> --- a/arch/powerpc/include/asm/dma.h
> +++ b/arch/powerpc/include/asm/dma.h
> @@ -347,5 +347,11 @@ extern int isa_dma_bridge_buggy;
>   #define isa_dma_bridge_buggy	(0)
>   #endif
>   
> +#ifdef CONFIG_CORENET_GENERIC
> +extern phys_addr_t ppc_dma_phys_limit;
> +#define ARCH_LOW_ADDRESS_LIMIT	(ppc_dma_phys_limit - 1)
> +#endif
> +
> +
>   #endif /* __KERNEL__ */
>   #endif	/* _ASM_POWERPC_DMA_H */
> diff --git a/arch/powerpc/platforms/85xx/common.c b/arch/powerpc/platforms/85xx/common.c
> index fe0606439b5a..346b436b6d3f 100644
> --- a/arch/powerpc/platforms/85xx/common.c
> +++ b/arch/powerpc/platforms/85xx/common.c
> @@ -126,3 +126,7 @@ void __init mpc85xx_qe_par_io_init(void)
>   	}
>   }
>   #endif
> +
> +#ifdef CONFIG_CORENET_GENERIC
> +phys_addr_t ppc_dma_phys_limit = 0xffffffffUL;
> +#endif
> diff --git a/arch/powerpc/platforms/85xx/corenet_generic.c b/arch/powerpc/platforms/85xx/corenet_generic.c
> index 7ee2c6628f64..673bcbdc7c75 100644
> --- a/arch/powerpc/platforms/85xx/corenet_generic.c
> +++ b/arch/powerpc/platforms/85xx/corenet_generic.c
> @@ -64,7 +64,7 @@ void __init corenet_gen_setup_arch(void)
>   	mpc85xx_smp_init();
>   
>   	swiotlb_detect_4g();
> -
> +	ppc_dma_phys_limit = 0x0fffffffUL;
>   	pr_info("%s board\n", ppc_md.name);
>   
>   	mpc85xx_qe_init();
Hello Mike,

My PCI TV card works also with your patch! Before I had to add "#include 
<asm/dma.h>" to the file "arch/powerpc/platforms/85xx/corenet_generic.c" 
because of the following error:

------

   CC      arch/powerpc/platforms/85xx/corenet_generic.o
   CC      ipc/util.o
   CC      ipc/msgutil.o
arch/powerpc/platforms/85xx/corenet_generic.c: In function 
‘corenet_gen_setup_arch’:
arch/powerpc/platforms/85xx/corenet_generic.c:77:2: error: 
‘ppc_dma_phys_limit’ undeclared (first use in this function); did you 
mean ‘cpu_to_phys_id’?
   ppc_dma_phys_limit = 0x0fffffffUL;
   ^~~~~~~~~~~~~~~~~~
   cpu_to_phys_id
arch/powerpc/platforms/85xx/corenet_generic.c:77:2: note: each 
undeclared identifier is reported only once for each function it appears in
scripts/Makefile.build:265: recipe for target 
'arch/powerpc/platforms/85xx/corenet_generic.o' failed
make[3]: *** [arch/powerpc/platforms/85xx/corenet_generic.o] Error 1
scripts/Makefile.build:509: recipe for target 
'arch/powerpc/platforms/85xx' failed
make[2]: *** [arch/powerpc/platforms/85xx] Error 2
scripts/Makefile.build:509: recipe for target 'arch/powerpc/platforms' 
failed
make[1]: *** [arch/powerpc/platforms] Error 2
Makefile:1652: recipe for target 'arch/powerpc' failed
make: *** [arch/powerpc] Error 2

------

After that I was able to compile the latest Git kernel with your patch.

Thanks,
Christian

WARNING: multiple messages have this Message-ID (diff)
From: Christian Zigotzky <chzigotzky@xenosoft.de>
To: Mike Rapoport <rppt@linux.ibm.com>, Christoph Hellwig <hch@lst.de>
Cc: linux-arch@vger.kernel.org, darren@stevens-zone.net,
	rtd2@xtra.co.nz, linuxppc-dev <linuxppc-dev@lists.ozlabs.org>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	iommu@lists.linux-foundation.org,
	Rob Herring <robh+dt@kernel.org>,
	paulus@samba.org, mad skateman <madskateman@gmail.com>,
	"contact@a-eon.com" <contact@a-eon.com>,
	Robin Murphy <robin.murphy@arm.com>,
	nsaenzjulienne@suse.de
Subject: Re: Bug 205201 - Booting halts if Dawicontrol DC-2976 UW SCSI board installed, unless RAM size limited to 3500M
Date: Tue, 26 Nov 2019 12:57:02 +0100	[thread overview]
Message-ID: <b668bc25-9268-d25e-f9a0-176bb4ce1d07@xenosoft.de> (raw)
In-Reply-To: <20191125093159.GA23118@linux.ibm.com>

On 25 November 2019 at 10:32 am, Mike Rapoport wrote:
> On Mon, Nov 25, 2019 at 08:39:23AM +0100, Christoph Hellwig wrote:
>> On Sat, Nov 23, 2019 at 12:42:27PM +0100, Christian Zigotzky wrote:
>>> Hello Christoph,
>>>
>>> Please find attached the dmesg of your Git kernel.
>> Thanks.  It looks like on your platform the swiotlb buffer isn't
>> actually addressable based on the bus dma mask limit, which is rather
>> interesting.  swiotlb_init uses memblock_alloc_low to allocate the
>> buffer, and I'll need some help from Mike and the powerpc maintainers
>> to figure out how that select where to allocate the buffer from, and
>> how we can move it to a lower address.  My gut feeling would be to try
>> to do what arm64 does and define a new ARCH_LOW_ADDRESS_LIMIT, preferably
>> without needing too much arch specific magic.
> Presuming the problem is relevant for all CoreNet boards something like
> this could work:
>   
> diff --git a/arch/powerpc/include/asm/dma.h b/arch/powerpc/include/asm/dma.h
> index 1b4f0254868f..7c6cfeeaff52 100644
> --- a/arch/powerpc/include/asm/dma.h
> +++ b/arch/powerpc/include/asm/dma.h
> @@ -347,5 +347,11 @@ extern int isa_dma_bridge_buggy;
>   #define isa_dma_bridge_buggy	(0)
>   #endif
>   
> +#ifdef CONFIG_CORENET_GENERIC
> +extern phys_addr_t ppc_dma_phys_limit;
> +#define ARCH_LOW_ADDRESS_LIMIT	(ppc_dma_phys_limit - 1)
> +#endif
> +
> +
>   #endif /* __KERNEL__ */
>   #endif	/* _ASM_POWERPC_DMA_H */
> diff --git a/arch/powerpc/platforms/85xx/common.c b/arch/powerpc/platforms/85xx/common.c
> index fe0606439b5a..346b436b6d3f 100644
> --- a/arch/powerpc/platforms/85xx/common.c
> +++ b/arch/powerpc/platforms/85xx/common.c
> @@ -126,3 +126,7 @@ void __init mpc85xx_qe_par_io_init(void)
>   	}
>   }
>   #endif
> +
> +#ifdef CONFIG_CORENET_GENERIC
> +phys_addr_t ppc_dma_phys_limit = 0xffffffffUL;
> +#endif
> diff --git a/arch/powerpc/platforms/85xx/corenet_generic.c b/arch/powerpc/platforms/85xx/corenet_generic.c
> index 7ee2c6628f64..673bcbdc7c75 100644
> --- a/arch/powerpc/platforms/85xx/corenet_generic.c
> +++ b/arch/powerpc/platforms/85xx/corenet_generic.c
> @@ -64,7 +64,7 @@ void __init corenet_gen_setup_arch(void)
>   	mpc85xx_smp_init();
>   
>   	swiotlb_detect_4g();
> -
> +	ppc_dma_phys_limit = 0x0fffffffUL;
>   	pr_info("%s board\n", ppc_md.name);
>   
>   	mpc85xx_qe_init();
Hello Mike,

My PCI TV card works also with your patch! Before I had to add "#include 
<asm/dma.h>" to the file "arch/powerpc/platforms/85xx/corenet_generic.c" 
because of the following error:

------

   CC      arch/powerpc/platforms/85xx/corenet_generic.o
   CC      ipc/util.o
   CC      ipc/msgutil.o
arch/powerpc/platforms/85xx/corenet_generic.c: In function 
‘corenet_gen_setup_arch’:
arch/powerpc/platforms/85xx/corenet_generic.c:77:2: error: 
‘ppc_dma_phys_limit’ undeclared (first use in this function); did you 
mean ‘cpu_to_phys_id’?
   ppc_dma_phys_limit = 0x0fffffffUL;
   ^~~~~~~~~~~~~~~~~~
   cpu_to_phys_id
arch/powerpc/platforms/85xx/corenet_generic.c:77:2: note: each 
undeclared identifier is reported only once for each function it appears in
scripts/Makefile.build:265: recipe for target 
'arch/powerpc/platforms/85xx/corenet_generic.o' failed
make[3]: *** [arch/powerpc/platforms/85xx/corenet_generic.o] Error 1
scripts/Makefile.build:509: recipe for target 
'arch/powerpc/platforms/85xx' failed
make[2]: *** [arch/powerpc/platforms/85xx] Error 2
scripts/Makefile.build:509: recipe for target 'arch/powerpc/platforms' 
failed
make[1]: *** [arch/powerpc/platforms] Error 2
Makefile:1652: recipe for target 'arch/powerpc' failed
make: *** [arch/powerpc] Error 2

------

After that I was able to compile the latest Git kernel with your patch.

Thanks,
Christian

WARNING: multiple messages have this Message-ID (diff)
From: Christian Zigotzky <chzigotzky@xenosoft.de>
To: Mike Rapoport <rppt@linux.ibm.com>, Christoph Hellwig <hch@lst.de>
Cc: linux-arch@vger.kernel.org, darren@stevens-zone.net,
	rtd2@xtra.co.nz,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	linuxppc-dev <linuxppc-dev@lists.ozlabs.org>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	iommu@lists.linux-foundation.org,
	Rob Herring <robh+dt@kernel.org>,
	paulus@samba.org, mad skateman <madskateman@gmail.com>,
	"contact@a-eon.com" <contact@a-eon.com>,
	Robin Murphy <robin.murphy@arm.com>,
	nsaenzjulienne@suse.de
Subject: Re: Bug 205201 - Booting halts if Dawicontrol DC-2976 UW SCSI board installed, unless RAM size limited to 3500M
Date: Tue, 26 Nov 2019 12:57:02 +0100	[thread overview]
Message-ID: <b668bc25-9268-d25e-f9a0-176bb4ce1d07@xenosoft.de> (raw)
In-Reply-To: <20191125093159.GA23118@linux.ibm.com>

On 25 November 2019 at 10:32 am, Mike Rapoport wrote:
> On Mon, Nov 25, 2019 at 08:39:23AM +0100, Christoph Hellwig wrote:
>> On Sat, Nov 23, 2019 at 12:42:27PM +0100, Christian Zigotzky wrote:
>>> Hello Christoph,
>>>
>>> Please find attached the dmesg of your Git kernel.
>> Thanks.  It looks like on your platform the swiotlb buffer isn't
>> actually addressable based on the bus dma mask limit, which is rather
>> interesting.  swiotlb_init uses memblock_alloc_low to allocate the
>> buffer, and I'll need some help from Mike and the powerpc maintainers
>> to figure out how that select where to allocate the buffer from, and
>> how we can move it to a lower address.  My gut feeling would be to try
>> to do what arm64 does and define a new ARCH_LOW_ADDRESS_LIMIT, preferably
>> without needing too much arch specific magic.
> Presuming the problem is relevant for all CoreNet boards something like
> this could work:
>   
> diff --git a/arch/powerpc/include/asm/dma.h b/arch/powerpc/include/asm/dma.h
> index 1b4f0254868f..7c6cfeeaff52 100644
> --- a/arch/powerpc/include/asm/dma.h
> +++ b/arch/powerpc/include/asm/dma.h
> @@ -347,5 +347,11 @@ extern int isa_dma_bridge_buggy;
>   #define isa_dma_bridge_buggy	(0)
>   #endif
>   
> +#ifdef CONFIG_CORENET_GENERIC
> +extern phys_addr_t ppc_dma_phys_limit;
> +#define ARCH_LOW_ADDRESS_LIMIT	(ppc_dma_phys_limit - 1)
> +#endif
> +
> +
>   #endif /* __KERNEL__ */
>   #endif	/* _ASM_POWERPC_DMA_H */
> diff --git a/arch/powerpc/platforms/85xx/common.c b/arch/powerpc/platforms/85xx/common.c
> index fe0606439b5a..346b436b6d3f 100644
> --- a/arch/powerpc/platforms/85xx/common.c
> +++ b/arch/powerpc/platforms/85xx/common.c
> @@ -126,3 +126,7 @@ void __init mpc85xx_qe_par_io_init(void)
>   	}
>   }
>   #endif
> +
> +#ifdef CONFIG_CORENET_GENERIC
> +phys_addr_t ppc_dma_phys_limit = 0xffffffffUL;
> +#endif
> diff --git a/arch/powerpc/platforms/85xx/corenet_generic.c b/arch/powerpc/platforms/85xx/corenet_generic.c
> index 7ee2c6628f64..673bcbdc7c75 100644
> --- a/arch/powerpc/platforms/85xx/corenet_generic.c
> +++ b/arch/powerpc/platforms/85xx/corenet_generic.c
> @@ -64,7 +64,7 @@ void __init corenet_gen_setup_arch(void)
>   	mpc85xx_smp_init();
>   
>   	swiotlb_detect_4g();
> -
> +	ppc_dma_phys_limit = 0x0fffffffUL;
>   	pr_info("%s board\n", ppc_md.name);
>   
>   	mpc85xx_qe_init();
Hello Mike,

My PCI TV card works also with your patch! Before I had to add "#include 
<asm/dma.h>" to the file "arch/powerpc/platforms/85xx/corenet_generic.c" 
because of the following error:

------

   CC      arch/powerpc/platforms/85xx/corenet_generic.o
   CC      ipc/util.o
   CC      ipc/msgutil.o
arch/powerpc/platforms/85xx/corenet_generic.c: In function 
‘corenet_gen_setup_arch’:
arch/powerpc/platforms/85xx/corenet_generic.c:77:2: error: 
‘ppc_dma_phys_limit’ undeclared (first use in this function); did you 
mean ‘cpu_to_phys_id’?
   ppc_dma_phys_limit = 0x0fffffffUL;
   ^~~~~~~~~~~~~~~~~~
   cpu_to_phys_id
arch/powerpc/platforms/85xx/corenet_generic.c:77:2: note: each 
undeclared identifier is reported only once for each function it appears in
scripts/Makefile.build:265: recipe for target 
'arch/powerpc/platforms/85xx/corenet_generic.o' failed
make[3]: *** [arch/powerpc/platforms/85xx/corenet_generic.o] Error 1
scripts/Makefile.build:509: recipe for target 
'arch/powerpc/platforms/85xx' failed
make[2]: *** [arch/powerpc/platforms/85xx] Error 2
scripts/Makefile.build:509: recipe for target 'arch/powerpc/platforms' 
failed
make[1]: *** [arch/powerpc/platforms] Error 2
Makefile:1652: recipe for target 'arch/powerpc' failed
make: *** [arch/powerpc] Error 2

------

After that I was able to compile the latest Git kernel with your patch.

Thanks,
Christian
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

  parent reply	other threads:[~2019-11-26 11:57 UTC|newest]

Thread overview: 74+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-16  7:06 Bug 205201 - Booting halts if Dawicontrol DC-2976 UW SCSI board installed, unless RAM size limited to 3500M Christian Zigotzky
2019-11-16  7:06 ` Christian Zigotzky
2019-11-21  7:29 ` Christoph Hellwig
2019-11-21  7:29   ` Christoph Hellwig
2019-11-21  7:29   ` Christoph Hellwig
2019-11-21 12:16   ` Christian Zigotzky
2019-11-21 12:16     ` Christian Zigotzky
2019-11-21 12:16     ` Christian Zigotzky
2019-11-21 12:21     ` Christian Zigotzky
2019-11-21 12:21       ` Christian Zigotzky
2019-11-21 12:21       ` Christian Zigotzky
2019-11-21 13:33       ` Robin Murphy
2019-11-21 13:33         ` Robin Murphy
2019-11-21 13:33         ` Robin Murphy
2019-11-21 16:34         ` Christian Zigotzky
2019-11-21 16:34           ` Christian Zigotzky
2019-11-21 16:34           ` Christian Zigotzky
2019-11-21 18:02           ` Christoph Hellwig
2019-11-21 18:02             ` Christoph Hellwig
2019-11-21 18:02             ` Christoph Hellwig
2019-11-21 18:21             ` Christian Zigotzky
2019-11-21 18:21               ` Christian Zigotzky
2019-11-21 18:21               ` Christian Zigotzky
2019-11-23 11:42             ` Christian Zigotzky
2019-11-23 11:42               ` Christian Zigotzky
2019-11-23 11:42               ` Christian Zigotzky
2019-11-25  7:39               ` Christoph Hellwig
2019-11-25  7:39                 ` Christoph Hellwig
2019-11-25  7:39                 ` Christoph Hellwig
2019-11-25  9:32                 ` Mike Rapoport
2019-11-25  9:32                   ` Mike Rapoport
2019-11-25  9:32                   ` Mike Rapoport
2019-11-25  9:32                   ` Mike Rapoport
2019-11-25  9:32                   ` Mike Rapoport
2019-11-25 16:38                   ` Christian Zigotzky
2019-11-25 16:38                     ` Christian Zigotzky
2019-11-25 16:38                     ` Christian Zigotzky
2019-11-26 11:57                   ` Christian Zigotzky [this message]
2019-11-26 11:57                     ` Christian Zigotzky
2019-11-26 11:57                     ` Christian Zigotzky
2019-11-25 16:36                 ` Christian Zigotzky
2019-11-25 16:36                   ` Christian Zigotzky
2019-11-25 16:36                   ` Christian Zigotzky
2019-11-26 11:26                 ` Christian Zigotzky
2019-11-26 11:26                   ` Christian Zigotzky
2019-11-26 11:26                   ` Christian Zigotzky
2019-11-26 16:40                   ` Christoph Hellwig
2019-11-26 16:40                     ` Christoph Hellwig
2019-11-26 16:40                     ` Christoph Hellwig
2019-11-27  6:56                     ` Mike Rapoport
2019-11-27  6:56                       ` Mike Rapoport
2019-11-27  6:56                       ` Mike Rapoport
2019-11-27  6:56                       ` Mike Rapoport
2019-11-27  8:53                       ` Christoph Hellwig
2019-11-27  8:53                         ` Christoph Hellwig
2019-11-27  8:53                         ` Christoph Hellwig
2019-11-27 15:14                       ` Christian Zigotzky
2019-11-27 15:14                         ` Christian Zigotzky
2019-11-27 15:14                         ` Christian Zigotzky
2019-12-04  8:56                       ` Christoph Hellwig
2019-12-04  8:56                         ` Christoph Hellwig
2019-12-04  8:56                         ` Christoph Hellwig
2019-12-04 12:22                         ` Christian Zigotzky
2019-12-04 12:22                           ` Christian Zigotzky
2019-12-04 12:22                           ` Christian Zigotzky
2019-12-04 12:22                           ` Christian Zigotzky
2020-01-10  7:10                         ` Christian Zigotzky
2020-01-10  7:10                           ` Christian Zigotzky
2020-01-10  7:10                           ` Christian Zigotzky
2020-01-15 15:18                           ` Christoph Hellwig
2020-01-15 15:18                             ` Christoph Hellwig
2020-01-15 15:18                             ` Christoph Hellwig
  -- strict thread matches above, loose matches on Subject: below --
2019-10-29  4:49 Christian Zigotzky
2019-10-30  0:10 ` Christian Zigotzky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b668bc25-9268-d25e-f9a0-176bb4ce1d07@xenosoft.de \
    --to=chzigotzky@xenosoft.de \
    --cc=benh@kernel.crashing.org \
    --cc=contact@a-eon.com \
    --cc=darren@stevens-zone.net \
    --cc=hch@lst.de \
    --cc=iommu@lists.linux-foundation.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=madskateman@gmail.com \
    --cc=nsaenzjulienne@suse.de \
    --cc=paulus@samba.org \
    --cc=robh+dt@kernel.org \
    --cc=robin.murphy@arm.com \
    --cc=rppt@linux.ibm.com \
    --cc=rtd2@xtra.co.nz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.