Skip to content

Commit 02ec144

Browse files
Sergei Trofimovichmartinkpetersen
authored andcommitted
scsi: hpsa: Fix boot on ia64 (atomic_t alignment)
Boot failure was observed on an HP rx3600 ia64 machine with RAID bus controller: Hewlett-Packard Company Smart Array P600: kernel unaligned access to 0xe000000105dd8b95, ip=0xa000000100b87551 kernel unaligned access to 0xe000000105dd8e95, ip=0xa000000100b87551 hpsa 0000:14:01.0: Controller reports max supported commands of 0 Using 16 instead. Ensure that firmware is up to date. swapper/0[1]: error during unaligned kernel access The unaligned access comes from 'struct CommandList' that happens to be packed. Commit f749d8b ("scsi: hpsa: Correct dev cmds outstanding for retried cmds") introduced unexpected padding and unaligned atomic_t from natural alignment to something else. This change removes packing annotation from a struct not intended to be sent to controller as is. This restores natural `atomic_t` alignment. The change was tested on the same rx3600 machine. Link: https://lore.kernel.org/r/20210330071958.3788214-2-slyfox@gentoo.org Fixes: f749d8b ("scsi: hpsa: Correct dev cmds outstanding for retried cmds") CC: linux-ia64@vger.kernel.org CC: linux-kernel@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>
1 parent 5482a9a commit 02ec144

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/scsi/hpsa_cmd.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ struct CommandList {
452452
bool retry_pending;
453453
struct hpsa_scsi_dev_t *device;
454454
atomic_t refcount; /* Must be last to avoid memset in hpsa_cmd_init() */
455-
} __packed __aligned(COMMANDLIST_ALIGNMENT);
455+
} __aligned(COMMANDLIST_ALIGNMENT);
456456

457457
/* Max S/G elements in I/O accelerator command */
458458
#define IOACCEL1_MAXSGENTRIES 24

0 commit comments

Comments
 (0)