From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5882AC07E96 for ; Thu, 8 Jul 2021 15:36:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3993661921 for ; Thu, 8 Jul 2021 15:36:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232072AbhGHPjg (ORCPT ); Thu, 8 Jul 2021 11:39:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:52824 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231956AbhGHPjf (ORCPT ); Thu, 8 Jul 2021 11:39:35 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id CEC226186A; Thu, 8 Jul 2021 15:36:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1625758612; bh=wseLBnjAibGIxhA/WADEubcjORxxlZR37p2FTF3iJMM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=gffoeIavl/L2txYo39Vda0QFrciLTKORom3INbuNt2qO+/D6CiH6m4hMmMF0gcRcz gMYiU/ekfr3BdBy7aNdgfjkFojOVs5WdNNU9H9BX31R4N6BZKGHKaqbgj97se3CRD/ u+m0MUJchAiCaMJh3g1YhY/aBg4ngbsnKO+l8M0Q= Date: Thu, 8 Jul 2021 17:36:49 +0200 From: Greg KH To: Matthew Weber Cc: sashal@kernel.org, Sean Young , Mauro Carvalho Chehab , Stefani Seibold , Mauro Carvalho Chehab , linux-kernel@vger.kernel.org Subject: Re: [PATCH] kfifo: DECLARE_KIFO_PTR(fifo, u64) does not work on arm 32 bit Message-ID: References: <20210708152342.59635-1-matthew.weber@collins.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210708152342.59635-1-matthew.weber@collins.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 08, 2021 at 10:23:41AM -0500, Matthew Weber wrote: > From: Sean Young > > If you try to store u64 in a kfifo (or a struct with u64 members), > then the buf member of __STRUCT_KFIFO_PTR will cause 4 bytes > padding due to alignment (note that struct __kfifo is 20 bytes > on 32 bit). > > That in turn causes the __is_kfifo_ptr() to fail, which is caught > by kfifo_alloc(), which now returns EINVAL. > > So, ensure that __is_kfifo_ptr() compares to the right structure. > > Signed-off-by: Sean Young > Acked-by: Stefani Seibold > Signed-off-by: Mauro Carvalho Chehab > Signed-off-by: Matthew Weber > --- > > This patch originally made it into 4.16 as > 8a866fee3909c49738e1c4429a8d2b9bf27e015d but is a bug on at least 4.14 > for any 32bit system(PPC/ARM/...) using kfifo with u64 datatypes. > > Please add to linux-4.14.y for the next LTS tag. > (Below patch is a cherry-pick of the commit onto linux-4.14.y and was > verified on 32bit hardware.) Now queued up, thanks. greg k-h