Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp788876rwb; Thu, 15 Dec 2022 02:24:55 -0800 (PST) X-Google-Smtp-Source: AA0mqf5Ekewn/b/ddQJi6+kI1EYXrd4ya4tG6IZMG7TnK1o2ylT4pQYuX4h7fMtkU38llhMhgkhX X-Received: by 2002:a17:902:b708:b0:189:9dca:65e1 with SMTP id d8-20020a170902b70800b001899dca65e1mr25337520pls.21.1671099894983; Thu, 15 Dec 2022 02:24:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671099894; cv=none; d=google.com; s=arc-20160816; b=NOgoipLlk0eHzzwehqOZ3I3e0dMdduvjWSvTmAuzAsyy4Fs8yqo+o8QBLDvsG/gWg7 Am3nrPhS+cUn89/QDfwEMxUxFD81Jnu5EthIXNgPhV3+rWm87WgFr1FHHfj0YZxBHC2y rYamrdxC0eGOxnJE69a72W+COJFZIjR5vD19lIpRXA4CLjmViEaZdizKIjBgCs2KL99b 2ytWSq9oV5mDN5j+KiQFAW7Ea+yOfwn1NN/APZ3jo3mvqTCnXldhrhRMs7SdTGC79WaP n2041BKUuEC18W2p8UTkvUuzIpGznhZXqSgkK4ze5ZvCsiN7Kl887Q2sYy7/CWGqwCaC m5mw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=CGq55W4ZeBIAJrX2z6pbMUXDvVcZaDlEYg2tV/gASvs=; b=nxXxREsL6SSS4IlkACGLorJ4Gn6bJG/aihTPaHQdc+Y0R9ADHxzv337tPROyw4K+vf fJCXkQQOGUJ+UbI7ouJBhq4K0jnVBrYlqBP1kUEGtX24crxTzinow0EPv14rzc066/g2 Ouy9b5jRN08Vf2hLAT8zqCOTxmizm70QO9OTNXMWDMN1g27XnPHWYhvk7AbkBf0/UGqM uv0nynAjLBSEkPaQ7ZTry0jFPdRTtnqGki8BdPdiqx966B29DQY+9R8yw/GT0n19G+qM wOW7769SgHy1Zws1lud2jUb7/TW3fg/IIUHjk1+YuHpbyf7qS9Wj/UzZtNZIcdzktxbq DmAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=g++Av88W; 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 l131-20020a633e89000000b0047704a39c4asi2426280pga.504.2022.12.15.02.24.27; Thu, 15 Dec 2022 02:24:54 -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; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=g++Av88W; 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 S229864AbiLOJMM (ORCPT + 69 others); Thu, 15 Dec 2022 04:12:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53440 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229910AbiLOJMA (ORCPT ); Thu, 15 Dec 2022 04:12:00 -0500 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EEEB64AF3D; Thu, 15 Dec 2022 01:11:45 -0800 (PST) Received: from pendragon.ideasonboard.com (213-243-189-158.bb.dnainternet.fi [213.243.189.158]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id E14C0327; Thu, 15 Dec 2022 10:11:43 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1671095504; bh=B/rAE2EtDJgW0316vF1iS61fsZXVN3PrYw9k9T3QMFI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=g++Av88WSNYfP3Gon2rpgfKy1Hhfa/KgyJ1fElf3c1/+xUOKhfH8Qleb6swT5+I/5 p4Dhl4H50I33+x9j55QK1eGDDQtMNaW1s3o1ZE5/+VswPCVySw7Mdq4UNizV1yOdu4 LbAQkWq0KWhis1Lcv+Br9aQYflYjZXTRutn7h2tg= Date: Thu, 15 Dec 2022 11:11:40 +0200 From: Laurent Pinchart To: Ricardo Ribalda Cc: Sergey Senozhatsky , Yunke Cao , Ming Lei , Jonathan Cameron , Mauro Carvalho Chehab , Max Staudt , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: Re: [PATCH v2] media: uvcvideo: Do not alloc dev->status Message-ID: References: <20221214-uvc-status-alloc-v2-0-3f1cba6fc734@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS 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 Hi Ricardo, On Thu, Dec 15, 2022 at 11:08:05AM +0200, Laurent Pinchart wrote: > On Thu, Dec 15, 2022 at 08:59:14AM +0100, Ricardo Ribalda wrote: > > On Thu, 15 Dec 2022 at 02:15, Sergey Senozhatsky wrote: > > > > > > On (22/12/14 14:37), Ricardo Ribalda wrote: > > > [..] > > > > +struct uvc_status_streaming { > > > > + u8 button; > > > > +} __packed; > > > > + > > > > +struct uvc_status_control { > > > > + u8 bSelector; > > > > + u8 bAttribute; > > > > + u8 bValue[11]; > > > > +} __packed; > > > > + > > > > +struct uvc_status { > > > > + u8 bStatusType; > > > > + u8 bOriginator; > > > > + u8 bEvent; > > > > + union { > > > > + struct uvc_status_control control; > > > > + struct uvc_status_streaming streaming; > > > > + }; > > > > +} __packed; > > > > + > > > > struct uvc_device { > > > > struct usb_device *udev; > > > > struct usb_interface *intf; > > > > @@ -559,7 +579,7 @@ struct uvc_device { > > > > /* Status Interrupt Endpoint */ > > > > struct usb_host_endpoint *int_ep; > > > > struct urb *int_urb; > > > > - u8 *status; > > > > + > > > > struct input_dev *input; > > > > char input_phys[64]; > > > > > > > > @@ -572,6 +592,12 @@ struct uvc_device { > > > > } async_ctrl; > > > > > > > > struct uvc_entity *gpio_unit; > > > > + > > > > + /* > > > > + * Ensure that status is aligned, making it safe to use with > > > > + * non-coherent DMA. > > > > + */ > > > > + struct uvc_status status __aligned(ARCH_KMALLOC_MINALIGN); > > > > > > ____cacheline_aligned ? > > > > > > I don't see anyone using ARCH_KMALLOC_MINALIGN except for slab.h > > > > Seems like cacheline is not good enough: > > > > https://github.com/torvalds/linux/commit/12c4efe3509b8018e76ea3ebda8227cb53bf5887 > > https://lore.kernel.org/all/20220405135758.774016-1-catalin.marinas@arm.com/ > > > > and ARCH_KMALLOC_MINALIGN is what we have today and is working... > > > > But yeah, the name for that define is not the nicest :) > > > > I added Jonathan Cameron, on cc, as he had to deal with something > > similar for iio in case we are missing something > > I'd like to get feedback on this from DMA and USB experts. Expanding the > CC list of the original patch would help (especially including the > linux-usb mailing list). Also, do we need the allocation change ? It doesn't seem to simplify the code that much, neither in terms of lines of code > 2 files changed, 48 insertions(+), 49 deletions(-) nor in terms of complexity. Maybe we could keep the union and offsetof changes, and drop the allocation change ? In any case, those are two different changes, so I'd split them in two patches at least. > > ps: and I thought this was an easy change :P -- Regards, Laurent Pinchart