Commit 99f039e9 authored by Eddie James's avatar Eddie James Committed by Greg Kroah-Hartman

fsi: Fix one and two byte bus reads/writes

Address checker fixed to allow one and two byte reads/writes.
Address alignments for each size verified.
Signed-off-by: default avatarEdward James <eajames@us.ibm.com>
Signed-off-by: default avatarChristopher Bostic <cbostic@linux.vnet.ibm.com>
Acked-by: default avatarJeremy Kerr <jk@ozlabs.org>
Signed-off-by: default avatarJoel Stanley <joel@jms.id.au>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b8bd146d
...@@ -656,10 +656,13 @@ static int fsi_slave_init(struct fsi_master *master, int link, uint8_t id) ...@@ -656,10 +656,13 @@ static int fsi_slave_init(struct fsi_master *master, int link, uint8_t id)
/* FSI master support */ /* FSI master support */
static int fsi_check_access(uint32_t addr, size_t size) static int fsi_check_access(uint32_t addr, size_t size)
{ {
if (size != 1 && size != 2 && size != 4) if (size == 4) {
return -EINVAL; if (addr & 0x3)
return -EINVAL;
if ((addr & 0x3) != (size & 0x3)) } else if (size == 2) {
if (addr & 0x1)
return -EINVAL;
} else if (size != 1)
return -EINVAL; return -EINVAL;
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment