remarkable-linux/drivers
Luis R. Rodriguez 7d89a3cb15 drivers/video/fbdev/atyfb: Use arch_phys_wc_add() and ioremap_wc()
This driver uses strong UC for the MMIO region, and ioremap_wc()
for the framebuffer to whitelist for the WC MTRR that can be
changed to WC. On PAT systems we don't need the MTRR call so
just use arch_phys_wc_add() there, this lets us remove all those
ifdefs. Let's also be consistent and use ioremap_wc() for ATARI
as well.

There are a few motivations for this:

  a) Take advantage of PAT when available.

  b) Help bury MTRR code away, MTRR is architecture specific and
     on x86 it is being replaced by PAT.

  c) Help with the goal of eventually using _PAGE_CACHE_UC over
     _PAGE_CACHE_UC_MINUS on x86 on ioremap_nocache() (see commit
     de33c442e titled "x86 PAT: fix performance drop for glx,
     use UC minus for ioremap(), ioremap_nocache() and
     pci_mmap_page_range()").

The conversion done is expressed by the following Coccinelle
SmPL patch, it additionally required manual intervention to
address all the ifdeffery and removal of redundant things which
arch_phys_wc_add() already addresses such as verbose message
about when MTRR fails and doing nothing when we didn't get an
MTRR:

	@ mtrr_found @
	expression index, base, size;
	@@

	-index = mtrr_add(base, size, MTRR_TYPE_WRCOMB, 1);
	+index = arch_phys_wc_add(base, size);

	@ mtrr_rm depends on mtrr_found @
	expression mtrr_found.index, mtrr_found.base, mtrr_found.size;
	@@

	-mtrr_del(index, base, size);
	+arch_phys_wc_del(index);

	@ mtrr_rm_zero_arg depends on mtrr_found @
	expression mtrr_found.index;
	@@

	-mtrr_del(index, 0, 0);
	+arch_phys_wc_del(index);

	@ mtrr_rm_fb_info depends on mtrr_found @
	struct fb_info *info;
	expression mtrr_found.index;
	@@

	-mtrr_del(index, info->fix.smem_start, info->fix.smem_len);
	+arch_phys_wc_del(index);

	@ ioremap_replace_nocache depends on mtrr_found @
	struct fb_info *info;
	expression base, size;
	@@

	-info->screen_base = ioremap_nocache(base, size);
	+info->screen_base = ioremap_wc(base, size);

	@ ioremap_replace_default depends on mtrr_found @
	struct fb_info *info;
	expression base, size;
	@@

	-info->screen_base = ioremap(base, size);
	+info->screen_base = ioremap_wc(base, size);

Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Andrzej Hajda <a.hajda@samsung.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Antonino Daplas <adaplas@gmail.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Dave Airlie <airlied@redhat.com>
Cc: Davidlohr Bueso <dbueso@suse.de>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
Cc: Juergen Gross <jgross@suse.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mathias Krause <minipli@googlemail.com>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Rob Clark <robdclark@gmail.com>
Cc: Suresh Siddha <sbsiddha@gmail.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: Toshi Kani <toshi.kani@hp.com>
Cc: Ville Syrjälä <syrjala@sci.fi>
Cc: Vlastimil Babka <vbabka@suse.cz>
Cc: arnd@arndb.de
Cc: benh@kernel.crashing.org
Cc: dan.j.williams@intel.com
Cc: geert@linux-m68k.org
Cc: hch@lst.de
Cc: hmh@hmh.eng.br
Cc: linux-fbdev@vger.kernel.org
Cc: linux-mm@kvack.org
Cc: linux-pci@vger.kernel.org
Cc: mpe@ellerman.id.au
Cc: mst@redhat.com
Cc: ralf@linux-mips.org
Cc: ross.zwisler@linux.intel.com
Cc: stefan.bader@canonical.com
Cc: tj@kernel.org
Cc: ville.syrjala@linux.intel.com
Link: http://lkml.kernel.org/r/1436491499-3289-5-git-send-email-mcgrof@do-not-panic.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2015-07-21 10:47:05 +02:00
..
accessibility
acpi x86/mm: Decouple <linux/vmalloc.h> from <asm/io.h> 2015-06-03 12:02:00 +02:00
amba
android
ata Merge branch 'for-4.1-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata 2015-05-11 10:54:20 -07:00
atm
auxdisplay
base Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2015-04-26 17:22:07 -07:00
bcma Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus 2015-04-17 15:50:54 -04:00
block drivers/block/pmem: Map NVDIMM in Write-Through mode 2015-06-07 15:29:01 +02:00
bluetooth Bluetooth: ath3k: add support of 04ca:300f AR3012 device 2015-05-13 23:04:20 +02:00
bus drivers: CCI: fix used_mask init in validate_group() 2015-05-07 18:29:18 +02:00
cdrom
char ipmi: Fix multi-part message handling 2015-05-05 19:37:22 -05:00
clk clk: si5351: Do not pass struct clk in platform_data 2015-05-08 11:22:30 -07:00
clocksource Initial ACPI support for arm64: 2015-04-24 08:23:45 -07:00
connector
cpufreq x86/mm: Decouple <linux/vmalloc.h> from <asm/io.h> 2015-06-03 12:02:00 +02:00
cpuidle cpuidle: Run tick_broadcast_exit() with disabled interrupts 2015-04-29 15:19:21 +02:00
crypto Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2015-04-26 13:51:05 -07:00
dca
devfreq
dio
dma x86/mm: Decouple <linux/vmalloc.h> from <asm/io.h> 2015-06-03 12:02:00 +02:00
dma-buf dma-buf: cleanup dma_buf_export() to make it easily extensible 2015-04-21 14:47:16 +05:30
edac
eisa
extcon extcon: usb-gpio: register extcon device before IRQ registration 2015-04-27 11:06:05 +09:00
firewire
firmware Merge branch 'dmi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging 2015-05-14 18:02:15 -07:00
fmc
gpio gpio: omap: Fix regression for MPUIO interrupts 2015-05-06 15:19:38 +02:00
gpu x86/mm/mtrr: Avoid #ifdeffery with phys_wc_to_mtrr_index() 2015-05-27 14:41:00 +02:00
hid Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid 2015-05-21 17:23:11 -07:00
hsi HSI: cmt_speech: fix error return code 2015-04-05 14:45:27 +02:00
hv Drivers: hv: hv_balloon: correctly handle num_pages>INT_MAX case 2015-04-03 16:20:12 +02:00
hwmon hwmon: (w83795) use find_closest_descending() in pwm_freq_to_reg() 2015-04-17 09:03:55 -04:00
hwspinlock
hwtracing/coresight Char/Misc driver patches for 4.1-rc1 2015-04-21 09:42:58 -07:00
i2c Merge branch 'i2c/for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux 2015-04-26 17:44:09 -07:00
ide Merge branch 'for-4.1-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata 2015-05-11 10:54:20 -07:00
idle Power management and ACPI updates for v4.1-rc1 2015-04-14 20:21:54 -07:00
iio The usual mixed bag of fixes for IIO in the 4.1 cycle. 2015-05-13 11:51:14 -07:00
infiniband x86/mm/pat, drivers/infiniband/ipath: Use arch_phys_wc_add() and require PAT disabled 2015-06-18 11:23:42 +02:00
input Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input 2015-05-22 14:49:55 -07:00
iommu iommu/arm-smmu: Fix sign-extension of upstream bus addresses at stage 1 2015-05-11 18:36:20 +02:00
ipack
irqchip irqchip/gicv3-its: ITS table size should not be smaller than PSZ 2015-05-20 22:13:37 +02:00
isdn Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2015-04-15 09:00:47 -07:00
leds This is the bulk of GPIO changes for the v4.1 development 2015-04-18 08:22:10 -04:00
lguest Some virtio internal cleanups, a new virtio device "virtio input", and 2015-04-22 10:55:06 -07:00
macintosh Merge branch 'next-remove-ldst' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc into next 2015-04-07 13:25:14 +10:00
mailbox
mcb mcb: request_mem_region() returns NULL on error 2015-04-03 16:15:30 +02:00
md md fixes for 4.1-rc4 2015-05-22 15:10:07 -07:00
media x86/mm/pat, drivers/media/ivtv: Use arch_phys_wc_add() and require PAT disabled 2015-06-18 11:23:41 +02:00
memory ARM: SoC driver updates for v4.1 2015-04-22 09:18:17 -07:00
memstick memstick: mspro_block: add missing curly braces 2015-04-17 09:04:09 -04:00
message
mfd platform/chrome: Updates for v4.1 2015-04-26 13:36:02 -07:00
misc Char/Misc driver patches for 4.1-rc1 2015-04-21 09:42:58 -07:00
mmc mmc: atmel-mci: fix bad variable type for clkdiv 2015-05-18 09:04:42 +02:00
mtd Two MTD fixes for 4.1: 2015-05-18 10:01:54 -07:00
net x86/mm: Decouple <linux/vmalloc.h> from <asm/io.h> 2015-06-03 12:02:00 +02:00
nfc NFC: logging neatening 2015-04-07 12:05:12 +02:00
ntb
nubus
of Devicetree updates for 4.1: 2015-04-24 08:46:18 -07:00
oprofile Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2015-04-26 17:22:07 -07:00
parisc parisc: %pf is only for function pointers 2015-04-24 13:45:54 +02:00
parport
pci xen: features and fixes for 4.1-rc0 2015-04-16 14:01:03 -05:00
pcmcia ARM: SoC cleanups for v4.1 2015-04-22 09:04:39 -07:00
phy USB patches for 4.1-rc1 2015-04-13 17:07:21 -07:00
pinctrl These are some GPIO fixes for the v4.1 series: 2015-05-08 19:42:59 -07:00
platform thinkpad_acpi: Fix warning for static not at beginning 2015-05-05 13:56:46 -07:00
pnp Power management and ACPI updates for v4.1-rc1 2015-04-14 20:21:54 -07:00
power power: bq27x00_battery: Add missing MODULE_ALIAS 2015-05-01 23:01:48 +02:00
powercap powercap / RAPL: Add support for Intel Skylake processors 2015-04-15 23:06:16 +02:00
pps
ps3
ptp
pwm pwm: img: Impose upper and lower timebase steps value 2015-05-19 16:07:40 +02:00
rapidio
ras
regulator == Changes to existing drivers == 2015-04-14 17:29:55 -07:00
remoteproc
reset
rpmsg
rtc drivers/rtc/rtc-armada38x.c: remove unused local `flags' 2015-05-14 17:55:51 -07:00
s390 s390/zcrypt: Fix invalid domain handling during ap module unload 2015-05-13 09:57:29 +02:00
sbus drivers/sbus/char/envctrl.c: ignore orderly_poweroff return value 2015-04-15 16:35:23 -07:00
scsi x86/mm: Decouple <linux/vmalloc.h> from <asm/io.h> 2015-06-03 12:02:00 +02:00
sfi
sh drivers: sh: Remove test for now unsupported sh7372 2015-04-27 13:08:14 +09:00
sn
soc - fix unused variable warning for pmic-wrapper 2015-04-14 00:43:28 +02:00
spi Merge remote-tracking branches 'spi/fix/fsl-cpm', 'spi/fix/fsl-dspi' and 'spi/fix/fsl-espi' into spi-linus 2015-05-11 17:29:49 +01:00
spmi spmi: pmic_arb: remove ARM build time dependency 2015-04-03 16:15:30 +02:00
ssb Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus 2015-04-17 15:50:54 -04:00
staging Staging / IIO driver fixes for 4.1-rc4 2015-05-16 21:04:56 -07:00
target Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending 2015-04-24 10:22:09 -07:00
tc
thermal Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/evalenti/linux-soc-thermal into for-rc 2015-05-19 08:12:27 +08:00
thunderbolt
tty xen: bug fixes for 4.1-rc4 2015-05-21 20:19:38 -07:00
uio Revert "uio: constify of_device_id array" 2015-04-03 16:04:21 +02:00
usb USB-serial fixes for v4.1-rc4 2015-05-14 12:43:36 -07:00
uwb
vfio vfio: Fix runaway interruptible timeout 2015-05-01 16:31:41 -06:00
vhost Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending 2015-04-24 10:22:09 -07:00
video drivers/video/fbdev/atyfb: Use arch_phys_wc_add() and ioremap_wc() 2015-07-21 10:47:05 +02:00
virt
virtio virtio: drop virtio_device_is_legacy_only 2015-04-15 12:41:14 +09:30
vlynq
vme
w1
watchdog Merge git://www.linux-watchdog.org/linux-watchdog 2015-04-22 11:22:55 -07:00
xen xen/events: don't bind non-percpu VIRQs with percpu chip 2015-05-19 19:55:36 +01:00
zorro
Kconfig
Makefile coresight: moving to new "hwtracing" directory 2015-04-03 16:17:04 +02:00