Files
android_kernel_xiaomi_sm8450/arch/arm/include/asm
Roger Quadros d248220f04 ARM: 8617/1: dma: fix dma_max_pfn()
Since commit 6ce0d20016 ("ARM: dma: Use dma_pfn_offset for dma address translation"),
dma_to_pfn() already returns the PFN with the physical memory start offset
so we don't need to add it again.

This fixes USB mass storage lock-up problem on systems that can't do DMA
over the entire physical memory range (e.g.) Keystone 2 systems with 4GB RAM
can only do DMA over the first 2GB. [K2E-EVM].

What happens there is that without this patch SCSI layer sets a wrong
bounce buffer limit in scsi_calculate_bounce_limit() for the USB mass
storage device. dma_max_pfn() evaluates to 0x8fffff and bounce_limit
is set to 0x8fffff000 whereas maximum DMA'ble physical memory on Keystone 2
is 0x87fffffff. This results in non DMA'ble pages being given to the
USB controller and hence the lock-up.

NOTE: in the above case, USB-SCSI-device's dma_pfn_offset was showing as 0.
This should have really been 0x780000 as on K2e, LOWMEM_START is 0x80000000
and HIGHMEM_START is 0x800000000. DMA zone is 2GB so dma_max_pfn should be
0x87ffff. The incorrect dma_pfn_offset for the USB storage device is because
USB devices are not correctly inheriting the dma_pfn_offset from the
USB host controller. This will be fixed by a separate patch.

Fixes: 6ce0d20016 ("ARM: dma: Use dma_pfn_offset for dma address translation")
Cc: stable@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Santosh Shilimkar <santosh.shilimkar@oracle.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Olof Johansson <olof@lixom.net>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Reported-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2016-09-29 16:57:44 +01:00
..
2016-06-21 10:54:29 -05:00
2014-06-02 09:20:18 +01:00
2014-12-04 12:41:50 +00:00
2015-05-05 13:35:39 -06:00
2015-05-28 15:31:53 +02:00
2015-09-16 16:53:39 +02:00
2012-09-14 13:53:39 +00:00
2016-08-02 19:35:29 -04:00
2016-07-03 23:41:27 +02:00
2016-07-03 23:41:27 +02:00
2016-07-03 23:41:27 +02:00
2014-06-01 01:17:12 +01:00
2013-07-08 22:08:51 +01:00
2015-06-01 23:48:19 +01:00
2014-02-25 11:33:37 +00:00
2014-03-18 16:39:40 -04:00