diff mbox series

powerpc/ps3: Set driver coherent_dma_mask

Message ID 068ebcfa-7cd0-bd06-42e7-577a4624f0b0@infradead.org (mailing list archive)
State Accepted
Commit 48e91846865cd61bfdb701eb737de222d7f08c74
Headers show
Series powerpc/ps3: Set driver coherent_dma_mask | expand

Checks

Context Check Description
snowpatch_ozlabs/apply_patch success next/apply_patch Successfully applied
snowpatch_ozlabs/checkpatch success Test checkpatch on branch next
snowpatch_ozlabs/build-ppc64le success Test build-ppc64le on branch next
snowpatch_ozlabs/build-ppc64be success Test build-ppc64be on branch next
snowpatch_ozlabs/build-ppc64e success Test build-ppc64e on branch next
snowpatch_ozlabs/build-ppc32 success Test build-ppc32 on branch next

Commit Message

Geoff Levand July 18, 2018, 10:08 p.m. UTC
Set the coherent_dma_mask for the PS3 ehci, ohci, and snd devices.

Silences WARN_ON_ONCE messages emitted by the dma_alloc_attrs() routine.

Reported-by: Fredrik Noring <noring@nocrew.org>
Signed-off-by: Geoff Levand <geoff@infradead.org>
---
Hi Michael,

This just silences some warnings.  Can you take it through the powerpc
tree?

-Geoff


 drivers/usb/host/ehci-ps3.c | 6 ++++--
 drivers/usb/host/ohci-ps3.c | 6 ++++--
 sound/ppc/snd_ps3.c         | 5 +++++
 3 files changed, 13 insertions(+), 4 deletions(-)

Comments

Takashi Iwai July 19, 2018, 6:46 a.m. UTC | #1
On Thu, 19 Jul 2018 00:08:33 +0200,
Geoff Levand wrote:
> 
> Set the coherent_dma_mask for the PS3 ehci, ohci, and snd devices.
> 
> Silences WARN_ON_ONCE messages emitted by the dma_alloc_attrs() routine.
> 
> Reported-by: Fredrik Noring <noring@nocrew.org>
> Signed-off-by: Geoff Levand <geoff@infradead.org>

For sound bits,
  Reviewed-by: Takashi Iwai <tiwai@suse.de>


thanks,

Takashi

> ---
> Hi Michael,
> 
> This just silences some warnings.  Can you take it through the powerpc
> tree?
> 
> -Geoff
> 
> 
>  drivers/usb/host/ehci-ps3.c | 6 ++++--
>  drivers/usb/host/ohci-ps3.c | 6 ++++--
>  sound/ppc/snd_ps3.c         | 5 +++++
>  3 files changed, 13 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/usb/host/ehci-ps3.c b/drivers/usb/host/ehci-ps3.c
> index 8c733492d8fe..454d8c624a3f 100644
> --- a/drivers/usb/host/ehci-ps3.c
> +++ b/drivers/usb/host/ehci-ps3.c
> @@ -86,7 +86,7 @@ static int ps3_ehci_probe(struct ps3_system_bus_device *dev)
>  	int result;
>  	struct usb_hcd *hcd;
>  	unsigned int virq;
> -	static u64 dummy_mask = DMA_BIT_MASK(32);
> +	static u64 dummy_mask;
>  
>  	if (usb_disabled()) {
>  		result = -ENODEV;
> @@ -131,7 +131,9 @@ static int ps3_ehci_probe(struct ps3_system_bus_device *dev)
>  		goto fail_irq;
>  	}
>  
> -	dev->core.dma_mask = &dummy_mask; /* FIXME: for improper usb code */
> +	dummy_mask = DMA_BIT_MASK(32);
> +	dev->core.dma_mask = &dummy_mask;
> +	dma_set_coherent_mask(&dev->core, dummy_mask);
>  
>  	hcd = usb_create_hcd(&ps3_ehci_hc_driver, &dev->core, dev_name(&dev->core));
>  
> diff --git a/drivers/usb/host/ohci-ps3.c b/drivers/usb/host/ohci-ps3.c
> index 20a23d795adf..395f9d3bc849 100644
> --- a/drivers/usb/host/ohci-ps3.c
> +++ b/drivers/usb/host/ohci-ps3.c
> @@ -69,7 +69,7 @@ static int ps3_ohci_probe(struct ps3_system_bus_device *dev)
>  	int result;
>  	struct usb_hcd *hcd;
>  	unsigned int virq;
> -	static u64 dummy_mask = DMA_BIT_MASK(32);
> +	static u64 dummy_mask;
>  
>  	if (usb_disabled()) {
>  		result = -ENODEV;
> @@ -115,7 +115,9 @@ static int ps3_ohci_probe(struct ps3_system_bus_device *dev)
>  		goto fail_irq;
>  	}
>  
> -	dev->core.dma_mask = &dummy_mask; /* FIXME: for improper usb code */
> +	dummy_mask = DMA_BIT_MASK(32);
> +	dev->core.dma_mask = &dummy_mask;
> +	dma_set_coherent_mask(&dev->core, dummy_mask);
>  
>  	hcd = usb_create_hcd(&ps3_ohci_hc_driver, &dev->core, dev_name(&dev->core));
>  
> diff --git a/sound/ppc/snd_ps3.c b/sound/ppc/snd_ps3.c
> index 36f34f434ecb..abe031c9d592 100644
> --- a/sound/ppc/snd_ps3.c
> +++ b/sound/ppc/snd_ps3.c
> @@ -930,6 +930,7 @@ static int snd_ps3_driver_probe(struct ps3_system_bus_device *dev)
>  {
>  	int i, ret;
>  	u64 lpar_addr, lpar_size;
> +	static u64 dummy_mask;
>  
>  	if (WARN_ON(!firmware_has_feature(FW_FEATURE_PS3_LV1)))
>  		return -ENODEV;
> @@ -970,6 +971,10 @@ static int snd_ps3_driver_probe(struct ps3_system_bus_device *dev)
>  		goto clean_mmio;
>  	}
>  
> +	dummy_mask = DMA_BIT_MASK(32);
> +	dev->core.dma_mask = &dummy_mask;
> +	dma_set_coherent_mask(&dev->core, dummy_mask);
> +
>  	snd_ps3_audio_set_base_addr(dev->d_region->bus_addr);
>  
>  	/* CONFIG_SND_PS3_DEFAULT_START_DELAY */
> -- 
> 2.14.1
> 
>
gregkh@linuxfoundation.org July 19, 2018, 6:54 a.m. UTC | #2
On Thu, Jul 19, 2018 at 08:46:45AM +0200, Takashi Iwai wrote:
> On Thu, 19 Jul 2018 00:08:33 +0200,
> Geoff Levand wrote:
> > 
> > Set the coherent_dma_mask for the PS3 ehci, ohci, and snd devices.
> > 
> > Silences WARN_ON_ONCE messages emitted by the dma_alloc_attrs() routine.
> > 
> > Reported-by: Fredrik Noring <noring@nocrew.org>
> > Signed-off-by: Geoff Levand <geoff@infradead.org>
> 
> For sound bits,
>   Reviewed-by: Takashi Iwai <tiwai@suse.de>

Thanks, I'll take this through the USB tree then.

greg k-h
gregkh@linuxfoundation.org July 19, 2018, 6:55 a.m. UTC | #3
On Wed, Jul 18, 2018 at 03:08:33PM -0700, Geoff Levand wrote:
> Set the coherent_dma_mask for the PS3 ehci, ohci, and snd devices.
> 
> Silences WARN_ON_ONCE messages emitted by the dma_alloc_attrs() routine.
> 
> Reported-by: Fredrik Noring <noring@nocrew.org>
> Signed-off-by: Geoff Levand <geoff@infradead.org>
> ---
> Hi Michael,
> 
> This just silences some warnings.  Can you take it through the powerpc
> tree?

Oops, nevermind, it should go through the ppc tree.  Here's my ack:

Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Michael Ellerman July 19, 2018, 11:28 a.m. UTC | #4
Greg KH <gregkh@linuxfoundation.org> writes:

> On Wed, Jul 18, 2018 at 03:08:33PM -0700, Geoff Levand wrote:
>> Set the coherent_dma_mask for the PS3 ehci, ohci, and snd devices.
>> 
>> Silences WARN_ON_ONCE messages emitted by the dma_alloc_attrs() routine.
>> 
>> Reported-by: Fredrik Noring <noring@nocrew.org>
>> Signed-off-by: Geoff Levand <geoff@infradead.org>
>> ---
>> Hi Michael,
>> 
>> This just silences some warnings.  Can you take it through the powerpc
>> tree?
>
> Oops, nevermind, it should go through the ppc tree.  Here's my ack:
>
> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

OK thanks, I'll take it.

cheers
Alan Stern July 19, 2018, 2:33 p.m. UTC | #5
On Wed, 18 Jul 2018, Geoff Levand wrote:

> Set the coherent_dma_mask for the PS3 ehci, ohci, and snd devices.
> 
> Silences WARN_ON_ONCE messages emitted by the dma_alloc_attrs() routine.
> 
> Reported-by: Fredrik Noring <noring@nocrew.org>
> Signed-off-by: Geoff Levand <geoff@infradead.org>
> ---
> Hi Michael,
> 
> This just silences some warnings.  Can you take it through the powerpc
> tree?
> 
> -Geoff
> 
> 
>  drivers/usb/host/ehci-ps3.c | 6 ++++--
>  drivers/usb/host/ohci-ps3.c | 6 ++++--
>  sound/ppc/snd_ps3.c         | 5 +++++
>  3 files changed, 13 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/usb/host/ehci-ps3.c b/drivers/usb/host/ehci-ps3.c
> index 8c733492d8fe..454d8c624a3f 100644
> --- a/drivers/usb/host/ehci-ps3.c
> +++ b/drivers/usb/host/ehci-ps3.c
> @@ -86,7 +86,7 @@ static int ps3_ehci_probe(struct ps3_system_bus_device *dev)
>  	int result;
>  	struct usb_hcd *hcd;
>  	unsigned int virq;
> -	static u64 dummy_mask = DMA_BIT_MASK(32);
> +	static u64 dummy_mask;
>  
>  	if (usb_disabled()) {
>  		result = -ENODEV;
> @@ -131,7 +131,9 @@ static int ps3_ehci_probe(struct ps3_system_bus_device *dev)
>  		goto fail_irq;
>  	}
>  
> -	dev->core.dma_mask = &dummy_mask; /* FIXME: for improper usb code */
> +	dummy_mask = DMA_BIT_MASK(32);
> +	dev->core.dma_mask = &dummy_mask;
> +	dma_set_coherent_mask(&dev->core, dummy_mask);

What is the reason for changing a static initialization to a dynamic
one?  As far as I can see, the patch touches four lines of code but the
only real difference is addition of a single line (and removal of a 
comment).

> diff --git a/drivers/usb/host/ohci-ps3.c b/drivers/usb/host/ohci-ps3.c
> index 20a23d795adf..395f9d3bc849 100644
> --- a/drivers/usb/host/ohci-ps3.c
> +++ b/drivers/usb/host/ohci-ps3.c
> @@ -69,7 +69,7 @@ static int ps3_ohci_probe(struct ps3_system_bus_device *dev)
>  	int result;
>  	struct usb_hcd *hcd;
>  	unsigned int virq;
> -	static u64 dummy_mask = DMA_BIT_MASK(32);
> +	static u64 dummy_mask;
>  
>  	if (usb_disabled()) {
>  		result = -ENODEV;
> @@ -115,7 +115,9 @@ static int ps3_ohci_probe(struct ps3_system_bus_device *dev)
>  		goto fail_irq;
>  	}
>  
> -	dev->core.dma_mask = &dummy_mask; /* FIXME: for improper usb code */
> +	dummy_mask = DMA_BIT_MASK(32);
> +	dev->core.dma_mask = &dummy_mask;
> +	dma_set_coherent_mask(&dev->core, dummy_mask);

Same here.

Alan Stern
Geoff Levand July 19, 2018, 2:53 p.m. UTC | #6
Hi Alan,

On 07/19/2018 07:33 AM, Alan Stern wrote:
> On Wed, 18 Jul 2018, Geoff Levand wrote:
> 
>> diff --git a/drivers/usb/host/ehci-ps3.c b/drivers/usb/host/ehci-ps3.c
>> index 8c733492d8fe..454d8c624a3f 100644
>> --- a/drivers/usb/host/ehci-ps3.c
>> +++ b/drivers/usb/host/ehci-ps3.c
>> @@ -86,7 +86,7 @@ static int ps3_ehci_probe(struct ps3_system_bus_device *dev)
>>  	int result;
>>  	struct usb_hcd *hcd;
>>  	unsigned int virq;
>> -	static u64 dummy_mask = DMA_BIT_MASK(32);
>> +	static u64 dummy_mask;
>>  
>>  	if (usb_disabled()) {
>>  		result = -ENODEV;
>> @@ -131,7 +131,9 @@ static int ps3_ehci_probe(struct ps3_system_bus_device *dev)
>>  		goto fail_irq;
>>  	}
>>  
>> -	dev->core.dma_mask = &dummy_mask; /* FIXME: for improper usb code */
>> +	dummy_mask = DMA_BIT_MASK(32);
>> +	dev->core.dma_mask = &dummy_mask;
>> +	dma_set_coherent_mask(&dev->core, dummy_mask);
> 
> What is the reason for changing a static initialization to a dynamic
> one?  As far as I can see, the patch touches four lines of code but the
> only real difference is addition of a single line (and removal of a 
> comment).

I thought it would be better if all the setting was done in
one place, that's the only reason.

-Geoff
Alan Stern July 19, 2018, 3 p.m. UTC | #7
On Thu, 19 Jul 2018, Geoff Levand wrote:

> Hi Alan,
> 
> On 07/19/2018 07:33 AM, Alan Stern wrote:
> > On Wed, 18 Jul 2018, Geoff Levand wrote:
> > 
> >> diff --git a/drivers/usb/host/ehci-ps3.c b/drivers/usb/host/ehci-ps3.c
> >> index 8c733492d8fe..454d8c624a3f 100644
> >> --- a/drivers/usb/host/ehci-ps3.c
> >> +++ b/drivers/usb/host/ehci-ps3.c
> >> @@ -86,7 +86,7 @@ static int ps3_ehci_probe(struct ps3_system_bus_device *dev)
> >>  	int result;
> >>  	struct usb_hcd *hcd;
> >>  	unsigned int virq;
> >> -	static u64 dummy_mask = DMA_BIT_MASK(32);
> >> +	static u64 dummy_mask;
> >>  
> >>  	if (usb_disabled()) {
> >>  		result = -ENODEV;
> >> @@ -131,7 +131,9 @@ static int ps3_ehci_probe(struct ps3_system_bus_device *dev)
> >>  		goto fail_irq;
> >>  	}
> >>  
> >> -	dev->core.dma_mask = &dummy_mask; /* FIXME: for improper usb code */
> >> +	dummy_mask = DMA_BIT_MASK(32);
> >> +	dev->core.dma_mask = &dummy_mask;
> >> +	dma_set_coherent_mask(&dev->core, dummy_mask);
> > 
> > What is the reason for changing a static initialization to a dynamic
> > one?  As far as I can see, the patch touches four lines of code but the
> > only real difference is addition of a single line (and removal of a 
> > comment).
> 
> I thought it would be better if all the setting was done in
> one place, that's the only reason.

All right; in that case (for the EHCI and OHCI pieces):

Acked-by: Alan Stern <stern@rowland.harvard.edu>

Alan Stern
Michael Ellerman July 23, 2018, 3:11 p.m. UTC | #8
On Wed, 2018-07-18 at 22:08:33 UTC, Geoff Levand wrote:
> Set the coherent_dma_mask for the PS3 ehci, ohci, and snd devices.
> 
> Silences WARN_ON_ONCE messages emitted by the dma_alloc_attrs() routine.
> 
> Reported-by: Fredrik Noring <noring@nocrew.org>
> Signed-off-by: Geoff Levand <geoff@infradead.org>
> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/48e91846865cd61bfdb701eb737de2

cheers
diff mbox series

Patch

diff --git a/drivers/usb/host/ehci-ps3.c b/drivers/usb/host/ehci-ps3.c
index 8c733492d8fe..454d8c624a3f 100644
--- a/drivers/usb/host/ehci-ps3.c
+++ b/drivers/usb/host/ehci-ps3.c
@@ -86,7 +86,7 @@  static int ps3_ehci_probe(struct ps3_system_bus_device *dev)
 	int result;
 	struct usb_hcd *hcd;
 	unsigned int virq;
-	static u64 dummy_mask = DMA_BIT_MASK(32);
+	static u64 dummy_mask;
 
 	if (usb_disabled()) {
 		result = -ENODEV;
@@ -131,7 +131,9 @@  static int ps3_ehci_probe(struct ps3_system_bus_device *dev)
 		goto fail_irq;
 	}
 
-	dev->core.dma_mask = &dummy_mask; /* FIXME: for improper usb code */
+	dummy_mask = DMA_BIT_MASK(32);
+	dev->core.dma_mask = &dummy_mask;
+	dma_set_coherent_mask(&dev->core, dummy_mask);
 
 	hcd = usb_create_hcd(&ps3_ehci_hc_driver, &dev->core, dev_name(&dev->core));
 
diff --git a/drivers/usb/host/ohci-ps3.c b/drivers/usb/host/ohci-ps3.c
index 20a23d795adf..395f9d3bc849 100644
--- a/drivers/usb/host/ohci-ps3.c
+++ b/drivers/usb/host/ohci-ps3.c
@@ -69,7 +69,7 @@  static int ps3_ohci_probe(struct ps3_system_bus_device *dev)
 	int result;
 	struct usb_hcd *hcd;
 	unsigned int virq;
-	static u64 dummy_mask = DMA_BIT_MASK(32);
+	static u64 dummy_mask;
 
 	if (usb_disabled()) {
 		result = -ENODEV;
@@ -115,7 +115,9 @@  static int ps3_ohci_probe(struct ps3_system_bus_device *dev)
 		goto fail_irq;
 	}
 
-	dev->core.dma_mask = &dummy_mask; /* FIXME: for improper usb code */
+	dummy_mask = DMA_BIT_MASK(32);
+	dev->core.dma_mask = &dummy_mask;
+	dma_set_coherent_mask(&dev->core, dummy_mask);
 
 	hcd = usb_create_hcd(&ps3_ohci_hc_driver, &dev->core, dev_name(&dev->core));
 
diff --git a/sound/ppc/snd_ps3.c b/sound/ppc/snd_ps3.c
index 36f34f434ecb..abe031c9d592 100644
--- a/sound/ppc/snd_ps3.c
+++ b/sound/ppc/snd_ps3.c
@@ -930,6 +930,7 @@  static int snd_ps3_driver_probe(struct ps3_system_bus_device *dev)
 {
 	int i, ret;
 	u64 lpar_addr, lpar_size;
+	static u64 dummy_mask;
 
 	if (WARN_ON(!firmware_has_feature(FW_FEATURE_PS3_LV1)))
 		return -ENODEV;
@@ -970,6 +971,10 @@  static int snd_ps3_driver_probe(struct ps3_system_bus_device *dev)
 		goto clean_mmio;
 	}
 
+	dummy_mask = DMA_BIT_MASK(32);
+	dev->core.dma_mask = &dummy_mask;
+	dma_set_coherent_mask(&dev->core, dummy_mask);
+
 	snd_ps3_audio_set_base_addr(dev->d_region->bus_addr);
 
 	/* CONFIG_SND_PS3_DEFAULT_START_DELAY */