Skip to content

Commit

Permalink
powerpc/ps3: Set driver coherent_dma_mask
Browse files Browse the repository at this point in the history
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>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
  • Loading branch information
Geoff Levand authored and Michael Ellerman committed Jul 20, 2018
1 parent ef6cb5f commit 48e9184
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
6 changes: 4 additions & 2 deletions drivers/usb/host/ehci-ps3.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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));

Expand Down
6 changes: 4 additions & 2 deletions drivers/usb/host/ohci-ps3.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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));

Expand Down
5 changes: 5 additions & 0 deletions sound/ppc/snd_ps3.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 */
Expand Down

0 comments on commit 48e9184

Please sign in to comment.