scsi: hpsa: Use __packed on individual structs, not header-wide
authorSergei Trofimovich <slyfox@gentoo.org>
Tue, 30 Mar 2021 07:19:56 +0000 (08:19 +0100)
committerMartin K. Petersen <martin.petersen@oracle.com>
Fri, 2 Apr 2021 02:50:53 +0000 (22:50 -0400)
commit5482a9a1a8fd23fbb57afc6d409e12713aa93fa5
tree8176888057e061bac7d8ac81fc99921f049dd960
parent9e67600ed6b8565da4b85698ec659b5879a6c1c6
scsi: hpsa: Use __packed on individual structs, not header-wide

The hpsa driver uses data structures which contain a combination of driver
internals and commands sent directly to the hardware. To manage alignment
for the hardware portions the driver used #pragma pack(1).

Commit f749d8b7a989 ("scsi: hpsa: Correct dev cmds outstanding for retried
cmds") switched an existing variable from int to bool. Due to the pragma an
atomic_t in the same data structure ended up being misaligned and broke
boot on ia64.

Add __packed to every struct and union in the header file. Subsequent
commits will address the actual atomic_t misalignment regression.

The commit is a no-op at least on ia64:
    $ diff -u <(objdump -d -r old.o) <(objdump -d -r new.o)

Link: https://lore.kernel.org/r/20210330071958.3788214-1-slyfox@gentoo.org
Fixes: f749d8b7a989 ("scsi: hpsa: Correct dev cmds outstanding for retried cmds")
CC: linux-ia64@vger.kernel.org
CC: storagedev@microchip.com
CC: linux-scsi@vger.kernel.org
CC: Joe Szczypek <jszczype@redhat.com>
CC: Scott Benesh <scott.benesh@microchip.com>
CC: Scott Teel <scott.teel@microchip.com>
CC: Tomas Henzl <thenzl@redhat.com>
CC: "Martin K. Petersen" <martin.petersen@oracle.com>
CC: Don Brace <don.brace@microchip.com>
Reported-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Suggested-by: Don Brace <don.brace@microchip.com>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/hpsa_cmd.h