Skip to content

Commit 48e9184

Browse files
glevandmpe
authored andcommitted
powerpc/ps3: Set driver coherent_dma_mask
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>
1 parent ef6cb5f commit 48e9184

3 files changed

Lines changed: 13 additions & 4 deletions

File tree

‎drivers/usb/host/ehci-ps3.c‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ static int ps3_ehci_probe(struct ps3_system_bus_device *dev)
8686
int result;
8787
struct usb_hcd *hcd;
8888
unsigned int virq;
89-
static u64 dummy_mask = DMA_BIT_MASK(32);
89+
static u64 dummy_mask;
9090

9191
if (usb_disabled()) {
9292
result = -ENODEV;
@@ -131,7 +131,9 @@ static int ps3_ehci_probe(struct ps3_system_bus_device *dev)
131131
goto fail_irq;
132132
}
133133

134-
dev->core.dma_mask = &dummy_mask; /* FIXME: for improper usb code */
134+
dummy_mask = DMA_BIT_MASK(32);
135+
dev->core.dma_mask = &dummy_mask;
136+
dma_set_coherent_mask(&dev->core, dummy_mask);
135137

136138
hcd = usb_create_hcd(&ps3_ehci_hc_driver, &dev->core, dev_name(&dev->core));
137139

‎drivers/usb/host/ohci-ps3.c‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ static int ps3_ohci_probe(struct ps3_system_bus_device *dev)
6969
int result;
7070
struct usb_hcd *hcd;
7171
unsigned int virq;
72-
static u64 dummy_mask = DMA_BIT_MASK(32);
72+
static u64 dummy_mask;
7373

7474
if (usb_disabled()) {
7575
result = -ENODEV;
@@ -115,7 +115,9 @@ static int ps3_ohci_probe(struct ps3_system_bus_device *dev)
115115
goto fail_irq;
116116
}
117117

118-
dev->core.dma_mask = &dummy_mask; /* FIXME: for improper usb code */
118+
dummy_mask = DMA_BIT_MASK(32);
119+
dev->core.dma_mask = &dummy_mask;
120+
dma_set_coherent_mask(&dev->core, dummy_mask);
119121

120122
hcd = usb_create_hcd(&ps3_ohci_hc_driver, &dev->core, dev_name(&dev->core));
121123

‎sound/ppc/snd_ps3.c‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -930,6 +930,7 @@ static int snd_ps3_driver_probe(struct ps3_system_bus_device *dev)
930930
{
931931
int i, ret;
932932
u64 lpar_addr, lpar_size;
933+
static u64 dummy_mask;
933934

934935
if (WARN_ON(!firmware_has_feature(FW_FEATURE_PS3_LV1)))
935936
return -ENODEV;
@@ -970,6 +971,10 @@ static int snd_ps3_driver_probe(struct ps3_system_bus_device *dev)
970971
goto clean_mmio;
971972
}
972973

974+
dummy_mask = DMA_BIT_MASK(32);
975+
dev->core.dma_mask = &dummy_mask;
976+
dma_set_coherent_mask(&dev->core, dummy_mask);
977+
973978
snd_ps3_audio_set_base_addr(dev->d_region->bus_addr);
974979

975980
/* CONFIG_SND_PS3_DEFAULT_START_DELAY */

0 commit comments

Comments
 (0)