Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp961809rwb; Thu, 15 Dec 2022 04:57:03 -0800 (PST) X-Google-Smtp-Source: AA0mqf79LKA78m35D+frnxveOFQOe8WvN2FY+tDP/JyDDr9m5ryKZu9nQymU7luyG290mIeBkF73 X-Received: by 2002:a05:6402:f29:b0:46f:a2c2:405b with SMTP id i41-20020a0564020f2900b0046fa2c2405bmr11435861eda.37.1671109023231; Thu, 15 Dec 2022 04:57:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671109023; cv=none; d=google.com; s=arc-20160816; b=sN5LHyXWb/fb/dPs9zOJ40BzGN+IjvAnmPRX0dii5+2TQ5wEKitsNZupUYmVOA8i7O nw5UQNDKVSxcMtOBudFqzwYj8exbAvgT8vuyV6QNsasKvDoG0BGtPMCGC46LUP2wDwm6 0Ck+B7cPtua3XxFHRjx7GgXEOpfmzHimCsBEKPJnidPIfl20eFPlC+fdOrc8r3C87zWT WRT+M97xvd3gkNfyLHAWbE8myizkbkdlgbw168fA5qskJu/7oOMC3g8b4Ak5BoG6k9+D I9gAQb3ZMGZ4Zow+XK7WKuFF0RmWEv4Kxi2RWBpsgILeVZN4uaKGPny5uCYXYC2wueAV 0UJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=ynjdJXjX/mrHt9B9UqdlZGPSYqtk36pCUFCNUVyWFFE=; b=Uc0aJ1S3dZGK29A1/o/1N6X8pyw1CvR5yxEIH2BG1Ug8o9cn1sX3du9O1zDsfVVOVF pvPKtql9NiDPoL7AdcwdGqlLtEm+JPrGm2djTizS9wHB7mGqz/zBj19+0bnfITnO4nzb 6qc+IX7ew+6kbO/+i+siY5ULCmwmKMnfRJP0txU+UHGyW60oN8UnuCd4u+yvXPunPF4E htLcJyFpII5fN+tODp90iEfDzxfSdC69+dzvRrpWzmPEIkiKGt9zmCVRLzFzl83NaRTr plOYZsm3bV1wcFMKfaR8FopCvm+PEGo5JJBmYNinxWcCMEbmxLUYmrmzJZ7JGLAEmvyR itbQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n12-20020a05640206cc00b0045d15503bb8si12854062edy.224.2022.12.15.04.56.46; Thu, 15 Dec 2022 04:57:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229629AbiLOMst (ORCPT + 69 others); Thu, 15 Dec 2022 07:48:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35940 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229627AbiLOMso (ORCPT ); Thu, 15 Dec 2022 07:48:44 -0500 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C57C463A8; Thu, 15 Dec 2022 04:48:41 -0800 (PST) Received: by verein.lst.de (Postfix, from userid 2407) id A1F0068AA6; Thu, 15 Dec 2022 13:48:37 +0100 (CET) Date: Thu, 15 Dec 2022 13:48:37 +0100 From: Christoph Hellwig To: Ricardo Ribalda Cc: Max Staudt , Jonathan Cameron , Sergey Senozhatsky , Ming Lei , Mauro Carvalho Chehab , Laurent Pinchart , Yunke Cao , Christoph Hellwig , linux-usb@vger.kernel.org, Alan Stern , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: Re: [PATCH v3 2/2] media: uvcvideo: Do not alloc dev->status Message-ID: <20221215124837.GA19113@lst.de> References: <20221214-uvc-status-alloc-v3-0-9a67616cc549@chromium.org> <20221214-uvc-status-alloc-v3-2-9a67616cc549@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221214-uvc-status-alloc-v3-2-9a67616cc549@chromium.org> User-Agent: Mutt/1.5.17 (2007-11-01) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 15, 2022 at 11:57:19AM +0100, Ricardo Ribalda wrote: > + /* > + * Ensure that status is aligned, making it safe to use with > + * non-coherent DMA. > + */ > + struct uvc_status status __aligned(ARCH_KMALLOC_MINALIGN); This should be ARCH_DMA_MINALIGN, not ARCH_KMALLOC_MINALIGN. Note that without an __aligned tag on the next member as well, those next members might get cache corrupted. > > struct input_dev *input; .. and without also aligning the next member you'll might still corrupt everything adter the DMAed member. That's the reason why I generall advocate against playing these __aligned games as they can easily go wrong if someone reorders the structure.