Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Geoff Levand and committed by
Michael Ellerman
48e91846 ef6cb5f1

+13 -4
+4 -2
drivers/usb/host/ehci-ps3.c
··· 86 86 int result; 87 87 struct usb_hcd *hcd; 88 88 unsigned int virq; 89 - static u64 dummy_mask = DMA_BIT_MASK(32); 89 + static u64 dummy_mask; 90 90 91 91 if (usb_disabled()) { 92 92 result = -ENODEV; ··· 131 131 goto fail_irq; 132 132 } 133 133 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); 135 137 136 138 hcd = usb_create_hcd(&ps3_ehci_hc_driver, &dev->core, dev_name(&dev->core)); 137 139
+4 -2
drivers/usb/host/ohci-ps3.c
··· 69 69 int result; 70 70 struct usb_hcd *hcd; 71 71 unsigned int virq; 72 - static u64 dummy_mask = DMA_BIT_MASK(32); 72 + static u64 dummy_mask; 73 73 74 74 if (usb_disabled()) { 75 75 result = -ENODEV; ··· 115 115 goto fail_irq; 116 116 } 117 117 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); 119 121 120 122 hcd = usb_create_hcd(&ps3_ohci_hc_driver, &dev->core, dev_name(&dev->core)); 121 123
+5
sound/ppc/snd_ps3.c
··· 930 930 { 931 931 int i, ret; 932 932 u64 lpar_addr, lpar_size; 933 + static u64 dummy_mask; 933 934 934 935 if (WARN_ON(!firmware_has_feature(FW_FEATURE_PS3_LV1))) 935 936 return -ENODEV; ··· 970 969 pr_info("%s: region_create\n", __func__); 971 970 goto clean_mmio; 972 971 } 972 + 973 + dummy_mask = DMA_BIT_MASK(32); 974 + dev->core.dma_mask = &dummy_mask; 975 + dma_set_coherent_mask(&dev->core, dummy_mask); 973 976 974 977 snd_ps3_audio_set_base_addr(dev->d_region->bus_addr); 975 978