Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp4163508pxf; Tue, 30 Mar 2021 00:22:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwnzmhfQyT6OsS63IBOTZwXzKeMwsAU4zWf71Hbu6m482iqw6b5QHk5gqtvTrPWQkhnV4Y0 X-Received: by 2002:a50:ec96:: with SMTP id e22mr32270758edr.385.1617088952352; Tue, 30 Mar 2021 00:22:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617088952; cv=none; d=google.com; s=arc-20160816; b=ncX5/HDl2QdcKSWotDiyF6kaRKrZywXmUMbVp3oleaVsjDaSzsSt1Jn9/QNLfFIWII O9RJQOrqjTyM1Afk4MkDGUV1JqnhEXAOEWVyIJs2y81rQgn4o5A2C51Zh9kZJDfSYacF K9c6OaquU2uhAWThla1PTb3aFhl8fNYQ0ihaSjdDtRMOPrO1Cgb/Q8femNw6ShWpkapb xnQz9okGi0L08c81D4DQgG3pfgCbgJ91XdrYLeMrGGmSFK0jOtPvpUUkHD6VUEVXbhZN QhYPlcZfG6CZKRLehIqkUwnc5PbnCBpITEbwZts+71ee6UD2tVZv6dlMPqWofu4tZaQL V/tg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=NNITDmDQrGVNRYWeJTwpDvxHZmRXkRUQqmh+ctsNpNg=; b=YUfn0YbQVU6PggP1jrV8/0tttFsKrfgdd4EpKPANy4fUG+dLkBJSgKzQUwfmydROgl LprY4I4zOhkXAnJ0SqLaPDtNeswRwR5zc7w70M25Zp6Ybn0zTr74yQ738xBlaeupS/4P GolFFX972y3dIyLJFFtbtc+09XoAGPbZ9M/OE0Qmp2OvqaO1I9EK3EQ2aTiOCRbYJEZg aG0V3SybT4C3ZePgE929ew6QQKpiLTa6abMOxEaP5xhK/EKWYVBFNf+TxkRqm3BihLpL L4ern9DLsLHBFhmsweLF2NzUk81i/GP0kgUKEJ8+YTJDKhOJHgY9xkzthtHsDeFeCI9v hreA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gentoo.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x24si14569237ejs.293.2021.03.30.00.22.08; Tue, 30 Mar 2021 00:22:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=gentoo.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231206AbhC3HVJ (ORCPT + 99 others); Tue, 30 Mar 2021 03:21:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37046 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229483AbhC3HUj (ORCPT ); Tue, 30 Mar 2021 03:20:39 -0400 Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C310DC061762; Tue, 30 Mar 2021 00:20:36 -0700 (PDT) Received: by sf.home (Postfix, from userid 1000) id 7C4D25A22062; Tue, 30 Mar 2021 08:20:31 +0100 (BST) From: Sergei Trofimovich To: "Martin K. Petersen" , Arnd Bergmann , John Paul Adrian Glaubitz , Don Brace , linux-ia64@vger.kernel.org, storagedev@microchip.com, linux-scsi , jszczype@redhat.com, Scott Benesh , Scott Teel , thenzl@redhat.com Cc: linux-kernel@vger.kernel.org, Sergei Trofimovich Subject: [PATCH v2 2/3] hpsa: fix boot on ia64 (atomic_t alignment) Date: Tue, 30 Mar 2021 08:19:57 +0100 Message-Id: <20210330071958.3788214-2-slyfox@gentoo.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210330071958.3788214-1-slyfox@gentoo.org> References: <20210330071958.3788214-1-slyfox@gentoo.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The failure initially observed as boot failure on 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 Here unaligned access comes from 'struct CommandList' that happens to be packed. The change f749d8b7a ("scsi: hpsa: Correct dev cmds outstanding for retried cmds") introduced unexpected padding and un-aligned atomic_t from natural alignment to something else. This change removes packing annotation from struct not intended to be sent to controller as is. This restores natural `atomic_t` alignment. The change is tested on the same rx3600 machine. 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 CC: Scott Benesh CC: Scott Teel CC: Tomas Henzl CC: "Martin K. Petersen" CC: Don Brace Reported-by: John Paul Adrian Glaubitz Suggested-by: Don Brace Fixes: f749d8b7a "scsi: hpsa: Correct dev cmds outstanding for retried cmds" Signed-off-by: Sergei Trofimovich --- drivers/scsi/hpsa_cmd.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/hpsa_cmd.h b/drivers/scsi/hpsa_cmd.h index 280e933d27e7..885b1f1fb20a 100644 --- a/drivers/scsi/hpsa_cmd.h +++ b/drivers/scsi/hpsa_cmd.h @@ -452,7 +452,7 @@ struct CommandList { bool retry_pending; struct hpsa_scsi_dev_t *device; atomic_t refcount; /* Must be last to avoid memset in hpsa_cmd_init() */ -} __packed __aligned(COMMANDLIST_ALIGNMENT); +} __aligned(COMMANDLIST_ALIGNMENT); /* Max S/G elements in I/O accelerator command */ #define IOACCEL1_MAXSGENTRIES 24 -- 2.31.1