From nobody Fri Oct 3 21:00:02 2025 Received: from fout-b3-smtp.messagingengine.com (fout-b3-smtp.messagingengine.com [202.12.124.146]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 43EF022576C; Mon, 25 Aug 2025 02:05:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.146 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756087534; cv=none; b=NbjEUqZ+r9rl8YRpggRCDF+4gNJAL9lNt99ziXqwEeQaD+qv9c6+g5NLuew6lU7ko3VXcdN8wdd4rqQ3kt73Iv2OVSLwur2mipm4cQDjEY1drtk/gc9GLDoIh/FdtK/miDeMqxive+8qftQ6BM+enwry7/oSSnq3X+yFiVkHm10= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756087534; c=relaxed/simple; bh=jRE0j/a3Blw5jBzPmdqmicKxGpOIJhBd9aEt46ekE8w=; h=To:Cc:Message-ID:From:Subject:Date; b=blOYsH5NGKSYsytK/t0SWmCeBoeLtgTfZjUFA7TeGAJa5Ei8od1zQ9sgPgZIRN1Xi8v3o55Sp4i4DJt824NhhCelzIvSbylVG2W6/NkbVu6ja/ernC008pZVDoNE6ge4RkfQou+A8F+YcwTh9oXUc1+j1ERAN1aKb+7WGcdg9eg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=linux-m68k.org; spf=none smtp.mailfrom=linux-m68k.org; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=jkCBQaeW; arc=none smtp.client-ip=202.12.124.146 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=linux-m68k.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux-m68k.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="jkCBQaeW" Received: from phl-compute-12.internal (phl-compute-12.internal [10.202.2.52]) by mailfout.stl.internal (Postfix) with ESMTP id E3AC51D00067; Sun, 24 Aug 2025 22:05:29 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-12.internal (MEProxy); Sun, 24 Aug 2025 22:05:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:message-id:reply-to:subject :subject:to:to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; t=1756087529; x=1756173929; bh=voARBgy3yx2HVaACbb8e7bteXCgR 0SdI2PllfVi1VYk=; b=jkCBQaeWkjCpG1BqyqE9iUJVlv5bsJJ2HDilUQ0ACr4m 1dVvtykKrU9iNo5k2yEoqkxhwMgxzSQR/3trTEvGaJ3ha3NSNNxQBJ6ZRlQPU1zL EVItXdRyNAgneww5s1t1W8cygfvw6vsnURSRNQEoJ8bnW47TNCuaEpyYHaQUBMCv f15EKPIsXkyRS6eFWnGJSroHMntk7hyF2Khy4MoD5SIrG0ifxt5G8u4ReI0A9EG+ ADxXfjtHBZGoF41tP67ZBO09ssku/l8tgZO0rDGUbmsjjYzjEB6pYE0mgcszsSmV dRvqhX5IW3JTYJF8ByjojIw2/w42Woqqm5TTQR4n+A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdefgddujeduudegucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepvfevkffhufffsedttdertddttddtnecuhfhrohhmpefhihhnnhcuvfhhrghinhcu oehfthhhrghinheslhhinhhugidqmheikehkrdhorhhgqeenucggtffrrghtthgvrhhnpe ekffejgfehheehkeekffffveekteevvddvveelhffgffetteefgfeutdehleetheenucff ohhmrghinhepkhgvrhhnvghlrdhorhhgnecuvehluhhsthgvrhfuihiivgeptdenucfrrg hrrghmpehmrghilhhfrhhomhepfhhthhgrihhnsehlihhnuhigqdhmieekkhdrohhrghdp nhgspghrtghpthhtohepledpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtoheprghkph hmsehlihhnuhigqdhfohhunhgurghtihhonhdrohhrghdprhgtphhtthhopehlrghntggv rdihrghngheslhhinhhugidruggvvhdprhgtphhtthhopehgvggvrhhtsehlihhnuhigqd hmieekkhdrohhrghdprhgtphhtthhopehmhhhirhgrmhgrtheskhgvrhhnvghlrdhorhhg pdhrtghpthhtohepohgrkheshhgvlhhsihhnkhhinhgvthdrfhhipdhrtghpthhtohepph gvthgvrhiisehinhhfrhgruggvrggurdhorhhgpdhrtghpthhtohepfihilhhlsehkvghr nhgvlhdrohhrghdprhgtphhtthhopehsthgrsghlvgesvhhgvghrrdhkvghrnhgvlhdroh hrghdprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgvlhdr ohhrgh X-ME-Proxy: Feedback-ID: i58a146ae:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 24 Aug 2025 22:05:25 -0400 (EDT) To: "Andrew Morton" , "Lance Yang" Cc: "Geert Uytterhoeven" , "Masami Hiramatsu" , "Eero Tamminen" , "Peter Zijlstra" , "Will Deacon" , stable@vger.kernel.org, linux-kernel@vger.kernel.org Message-ID: <7d9554bfe2412ed9427bf71ce38a376e06eb9ec4.1756087385.git.fthain@linux-m68k.org> From: Finn Thain Subject: [PATCH] atomic: Specify natural alignment for atomic_t Date: Mon, 25 Aug 2025 12:03:05 +1000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Some recent commits incorrectly assumed the natural alignment of locks. That assumption fails on Linux/m68k (and, interestingly, would have failed on Linux/cris also). This leads to spurious warnings from the hang check code. Fix this bug by adding the necessary 'aligned' attribute. Cc: Andrew Morton Cc: Geert Uytterhoeven Cc: Lance Yang Cc: Masami Hiramatsu Cc: Eero Tamminen Cc: Peter Zijlstra Cc: Will Deacon Cc: stable@vger.kernel.org Reported-by: Eero Tamminen Closes: https://lore.kernel.org/lkml/CAMuHMdW7Ab13DdGs2acMQcix5ObJK0O2dG_Fx= zr8_g58Rc1_0g@mail.gmail.com/ Fixes: e711faaafbe5 ("hung_task: replace blocker_mutex with encoded blocker= ") Signed-off-by: Finn Thain Reviewed-by: Masami Hiramatsu (Google) --- I tested this on m68k using GCC and it fixed the problem for me. AFAIK, the other architectures naturally align ints already so I'm expecting to see no effect there. --- include/linux/types.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/types.h b/include/linux/types.h index 6dfdb8e8e4c3..cd5b2b0f4b02 100644 --- a/include/linux/types.h +++ b/include/linux/types.h @@ -179,7 +179,7 @@ typedef phys_addr_t resource_size_t; typedef unsigned long irq_hw_number_t; =20 typedef struct { - int counter; + int counter __aligned(sizeof(int)); } atomic_t; =20 #define ATOMIC_INIT(i) { (i) } --=20 2.49.1