Commit dd09232e authored by Kiwoong Kim's avatar Kiwoong Kim Committed by Greg Kroah-Hartman
Browse files

FROMGIT: ufs: introduce a quirk to allow only page-aligned sg entries

Some SoCs could require one scatterlist entry for smaller than
page size, i.e. 4KB. For the cases of dispatching commands
with more than one scatterlist entry and under 4KB size,
They could behave as follows:

Given that a command to read something
from device is dispatched with two scatterlist entries that
are named AAA and BBB. After dispatching, host builds two PRDT
entries and during transmission, device sends just one DATA IN
because device doesn't care on host dma. The host then tranfers
the whole data from start address of the area named AAA.
In consequence, the area that follows AAA would be corrupted.

    |<------------->|
    +-------+------------         +-------+
    +  AAA  + (corrupted)   ...   +  BBB  +
    +-------+------------         +-------+

In this case, you need to force an alignment with page size for
sg entries.

Bug: 177399609
Change-Id: I4a930e35efeed233d09ff935431c3db120c13e4d
(cherry picked from commit 2b2bfc8a
 https://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git

 5.12/scsi-staging)
Signed-off-by: default avatarKiwoong Kim <kwmad.kim@samsung.com>
parent 6c5175ca
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment