Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp575130rdg; Thu, 12 Oct 2023 14:21:38 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEzQHuMh1x2RyRlp6GAq2cwHrMBG51SEs66a6diOfEkJqcmz2JB6BegyamI6Q0jbt6aKb00 X-Received: by 2002:a05:6a21:3e0b:b0:171:8e16:ea83 with SMTP id bk11-20020a056a213e0b00b001718e16ea83mr8395699pzc.29.1697145698331; Thu, 12 Oct 2023 14:21:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697145698; cv=none; d=google.com; s=arc-20160816; b=o2k/Y0Z3IbTvZIdb/c7X1e59fBHG8GoxYT3CkFp0aFuGlvoZ57gdH8bBA+qEDkKGgl 2nG8Febg0+B80lW8cFxdC613xGCa88t7gOZnE2H3SB7IHFF7h4K+xO4w14b5iLz33iDJ 1+WbOw2pmWsDWqGB4BaeoH5yUJzGydNbtBwu60hEAa18Rqo2pjTctnsc33/o3gYDXKN0 auD1eSLDRv3MAlqZ/1MVhCZHGp62govqeUEmxIYuXQu2JP424xU9wGGoTaYcv3jhKF7T sDx0TYhCf9rnDtfGZ5q9wk630IbqKe9oF9ZSs0v0zWUC2FSI3twdMTmi5m9QWgQPPwMM DOxQ== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=JIi1Ru62sSEaVJOcjuQi8MOniXH6w2nBP2/Rq1OA4ng=; fh=YnCvfFMWa6e2VxKeGK1hqXsR0VUlzIg+dO/MoMwc1wY=; b=EMuZg7lJYVRseAgdbHcUshUXWqPNVqXTviwyPYoU/EMjmUy+zBm6x/1YAgrsZTsqxx KBMnSghuD8o6vfk/poNdrwX/brmn9mj1oEUe3BnQNhRdexEESBZoeEFClaMSc0EPSuyu XeOv+kMvWKsNpazdUFle+fdyxBviG77/l7GXQ/SgDXiOBO/xzhbTh+6L83HEQosE+4N1 gJfCqUdjUQIJy12byON9+I60NahYIgrs0wj13WwaEWpn5Um3cj4r0B9bVNgjEuiVBo3s v4JxUBhzCNLSnr3izq5l2Q3N2MpVy86cN+BNE4QoInKGTKPFFK/p5In087hdELuxZO1o WauQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rere.qmqm.pl header.s=1 header.b="i3vS/REg"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=rere.qmqm.pl Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id m16-20020a63fd50000000b005aa56e17658si281823pgj.168.2023.10.12.14.21.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Oct 2023 14:21:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@rere.qmqm.pl header.s=1 header.b="i3vS/REg"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=rere.qmqm.pl Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 7ED52803C465; Thu, 12 Oct 2023 14:21:15 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1442894AbjJLVVE (ORCPT + 99 others); Thu, 12 Oct 2023 17:21:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47254 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1443010AbjJLVVC (ORCPT ); Thu, 12 Oct 2023 17:21:02 -0400 Received: from rere.qmqm.pl (rere.qmqm.pl [91.227.64.183]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 32E37BE; Thu, 12 Oct 2023 14:21:00 -0700 (PDT) Received: from remote.user (localhost [127.0.0.1]) by rere.qmqm.pl (Postfix) with ESMTPSA id 4S62cT30VwzCT; Thu, 12 Oct 2023 23:20:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rere.qmqm.pl; s=1; t=1697145658; bh=TaFBxjLod3uos3quRT45Zb/J+JK5WWkvgFBpk4JPSEU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=i3vS/REggArqteGlr9HGCH5hE+NNntBKcU1JhqPMggIKfY4K8p2o6auKIptfIP4jA jIp39nMRAP9qPeg57o3mqc0Dc+UBL1wCDWoLrCXx0IxWklAUSiyYeyI7bYDWA9Jmp/ ukto59bZzrjHBwqFyrdHJSViqfz6VHB72G9ZNYJr2TbBUSrgnnRNsRp4ESwtJl2RXe u8JPM7mHdD3JMVJ7EdePsRVmJMSjjPO5UJ+mcSsCK2hWN0rYIu8GRFl2gzcOgFBXec 0/f10TvlpDLx50aTTqY8ZMfbEq45i1OjlX/FDOAstT7cVvWCpawvwnP7tC6OfmFpgV IdcuNZ1R1ezxg== X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at mail Date: Thu, 12 Oct 2023 23:20:55 +0200 From: =?iso-8859-2?Q?Micha=B3_Miros=B3aw?= To: Thierry Reding Cc: Peter Geis , Dmitry Osipenko , Greg Kroah-Hartman , Peter Chen , Thierry Reding , linux-kernel@vger.kernel.org, linux-tegra@vger.kernel.org, linux-usb@vger.kernel.org Subject: Re: [PATCH v2 2/3] usb: chipidea: Simplify Tegra DMA alignment code Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Thu, 12 Oct 2023 14:21:15 -0700 (PDT) On Wed, Oct 11, 2023 at 11:53:28PM +0200, Thierry Reding wrote: > On Thu, Sep 28, 2023 at 11:06:03PM +0200, Micha? Miros?aw wrote: > > The USB host on Tegra3 works with 32-bit alignment. Previous code tried > > to align the buffer, but it did align the wrapper struct instead, so > > the buffer was at a constant offset of 8 bytes (two pointers) from > > expected alignment. Since kmalloc() guarantees at least 8-byte > > alignment already, the alignment-extending is removed. > > > > Fixes: fc53d5279094 ("usb: chipidea: tegra: Support host mode") > > Signed-off-by: Micha? Miros?aw > > --- > > drivers/usb/chipidea/host.c | 45 +++++++++++++++---------------------- > > 1 file changed, 18 insertions(+), 27 deletions(-) > > > > diff --git a/drivers/usb/chipidea/host.c b/drivers/usb/chipidea/host.c > > index abddd39d1ff1..0cce19208370 100644 > > --- a/drivers/usb/chipidea/host.c > > +++ b/drivers/usb/chipidea/host.c > > @@ -30,8 +30,7 @@ struct ehci_ci_priv { > > }; > > > > struct ci_hdrc_dma_aligned_buffer { > > - void *kmalloc_ptr; > > - void *old_xfer_buffer; > > + void *original_buffer; > > u8 data[]; > > }; > > > > @@ -380,60 +379,52 @@ static int ci_ehci_bus_suspend(struct usb_hcd *hcd) > > return 0; > > } > > > > -static void ci_hdrc_free_dma_aligned_buffer(struct urb *urb) > > +static void ci_hdrc_free_dma_aligned_buffer(struct urb *urb, bool copy_back) > > { > > struct ci_hdrc_dma_aligned_buffer *temp; > > - size_t length; > > > > if (!(urb->transfer_flags & URB_ALIGNED_TEMP_BUFFER)) > > return; > > + urb->transfer_flags &= ~URB_ALIGNED_TEMP_BUFFER; > > This threw me off a bit until I realized it was already there > previously, just in a different place. Is there a particular reason why > this is moved? I figured that it is easier to understand if the test and clear of the URB_ALIGNED_TEMP_BUFFER bit is in a single place. Seeing it again, I think it could be replaced with __test_and_clear_bit() in a future commit. Best Regards Micha? Miros?aw