]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
fsi: Fix one and two byte bus reads/writes
authorEddie James <eajames@us.ibm.com>
Mon, 12 Feb 2018 05:15:43 +0000 (15:45 +1030)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Mar 2018 18:11:00 +0000 (19:11 +0100)
Address checker fixed to allow one and two byte reads/writes.
Address alignments for each size verified.

Signed-off-by: Edward James <eajames@us.ibm.com>
Signed-off-by: Christopher Bostic <cbostic@linux.vnet.ibm.com>
Acked-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/fsi/fsi-core.c

index 6e5aa9b2666593aa7445ffc3bbb66fba22841891..e5dfece248a5bb1ee6c4036b5ad8026d2661d67d 100644 (file)
@@ -656,10 +656,13 @@ static int fsi_slave_init(struct fsi_master *master, int link, uint8_t id)
 /* FSI master support */
 static int fsi_check_access(uint32_t addr, size_t size)
 {
-       if (size != 1 && size != 2 && size != 4)
-               return -EINVAL;
-
-       if ((addr & 0x3) != (size & 0x3))
+       if (size == 4) {
+               if (addr & 0x3)
+                       return -EINVAL;
+       } else if (size == 2) {
+               if (addr & 0x1)
+                       return -EINVAL;
+       } else if (size != 1)
                return -EINVAL;
 
        return 0;