staging: Android: vsoc: Create wc kernel mapping for region shm.
authorAlistair Strachan <astrachan@google.com>
Thu, 3 May 2018 04:45:21 +0000 (21:45 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 3 May 2018 20:53:03 +0000 (13:53 -0700)
Map the region shm as write-combining instead of uncachable.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Arve Hjønnevåg <arve@android.com>
Cc: Todd Kjos <tkjos@android.com>
Cc: Martijn Coenen <maco@android.com>
Cc: Greg Hartman <ghartman@google.com>
Cc: devel@driverdev.osuosl.org
Cc: kernel-team@android.com
Signed-off-by: Alistair Strachan <astrachan@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/android/TODO
drivers/staging/android/vsoc.c

index 6aab759..fbf015c 100644 (file)
@@ -17,7 +17,6 @@ vsoc.c, uapi/vsoc_shm.h
    waiting threads. We should eventually use multiple queues and select the
    queue based on the region.
  - Add debugfs support for examining the permissions of regions.
- - Use ioremap_wc instead of ioremap_nocache.
  - Remove VSOC_WAIT_FOR_INCOMING_INTERRUPT ioctl. This functionality has been
    superseded by the futex and is there for legacy reasons.
 
index 587c66d..794137b 100644 (file)
@@ -802,9 +802,7 @@ static int vsoc_probe_device(struct pci_dev *pdev,
 
        dev_info(&pdev->dev, "shared memory @ DMA %p size=0x%zx\n",
                 (void *)vsoc_dev.shm_phys_start, vsoc_dev.shm_size);
-       /* TODO(ghartman): ioremap_wc should work here */
-       vsoc_dev.kernel_mapped_shm = ioremap_nocache(
-                       vsoc_dev.shm_phys_start, vsoc_dev.shm_size);
+       vsoc_dev.kernel_mapped_shm = pci_iomap_wc(pdev, SHARED_MEMORY_BAR, 0);
        if (!vsoc_dev.kernel_mapped_shm) {
                dev_err(&vsoc_dev.dev->dev, "cannot iomap region\n");
                vsoc_remove_device(pdev);