Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp350274rdg; Thu, 12 Oct 2023 07:29:26 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF5EJnySysOYaX/mwozudhBaX5G1pZYBpb004W2fLY27Mhyz2TvDduMn4GF2DFQBlddKci9 X-Received: by 2002:a05:6a21:328b:b0:175:7085:ba18 with SMTP id yt11-20020a056a21328b00b001757085ba18mr1396628pzb.58.1697120966296; Thu, 12 Oct 2023 07:29:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697120966; cv=none; d=google.com; s=arc-20160816; b=pVGcMD+W38V5Y0cDGC9uo+c0FWlwmBWDbjKC0h2FrThM+om5EXZkmwO3/9fcXjDDmB zCb2mJovFeOHMIhe+hagTrhcoUErxEMExlSnt0aLIvqLSbJCF9iJZWcjiNLva3vkzHeU 5GUjZJVFjrnOFFn8nXFSIRA0gMCoHCUebcZJxjX4ewKUbPKUS2yEso0uuLMluztHeRu+ DFxNliq0TNHVRRwnWBmIOiFsWk80ukLeE2JGlqJ60tozcb4vP7K9o6SV4Bx8IciFqjxt 5pZ1k8zg1NxhT1YJfGaTYEe3IE3NWMY3rwvCHCP60CKhR+/CW8mdknOiqqhaneWRBRZx yskQ== 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=p7tlRuTQrKnD6QilSK3qdAIwE6J3Vo8tvFmbh1op99o=; fh=uG4veIUoVN/qys2RaoxtEEBnvzEmgX6shwcBI/9kSe0=; b=Qb4zVzcMNSzMo4od2Sm2GxX3E4tCj39H22g/+BtAIwSgYuhOHipyrGGgBFVZ4SkTX7 uA7zFIiXiIHGgFirweDv0rBghbA7f6/8HlyQQRTNmybrWNI7uj2f2bDInw93cr9csOT7 nfb04m8b+j5F5Rvqc7oLOYnfPVF9ii0iWe1NFf4JKbXPs6RIQTVYcia60ilbyLsC8uI4 u9eBX7RS8r2jpvR2wUWWvOrZG0XsMZOgQ1Kcii6Oy7NrWZLoDP7GBLy9xWB5vWdnGKrt j+RC3L9GUXDRpTJP/kb3+NQ/IFA8/hchAixHdSDF2tnZziZu90p0CfjWWSoBozvuClSc zRTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=eORk5bk9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id u17-20020a170903125100b001c755810f7esi2499884plh.499.2023.10.12.07.29.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Oct 2023 07:29:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=eORk5bk9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 0F8BF8245A4A; Thu, 12 Oct 2023 07:29:23 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378679AbjJLO3M (ORCPT + 99 others); Thu, 12 Oct 2023 10:29:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52078 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343998AbjJLO3M (ORCPT ); Thu, 12 Oct 2023 10:29:12 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6D0A1B8; Thu, 12 Oct 2023 07:29:10 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CA3F4C433C7; Thu, 12 Oct 2023 14:29:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697120950; bh=0zepIBMYqAlKUO2MDAqi4ujk5GjeQTtEjMF27O3SY1o=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=eORk5bk9QWyM1mxIY6B0dMMFC/ITZh0n3PfEJ/gBXGEkKmBTqRae24uq5Wh2XtbKv cpOkoNItYL/AiO+VVDoSBUaF169h+TK6uBj2VlfHvM3gkD9ivRX82z2/ulIOLV4Tu1 8nh0/N6MAlKSYiq0CqiTYvofAginQZ/4SibKu6OOqoN2imTjAgIoVBn6i9SvTrFf3r B/hfau1Dz33T8SaTWPJnNGcYLXxJzqXPXhss9CYR6Jg6rU+/BZaxt7nWPaVijcgb1k 9skIDbZP+VMr3OsHyReprmFmRU73KcPMC7iZwz/bMmwkV3w/KxI+V2k197Ecq1eyLI nX7mJocuZ48cg== Date: Thu, 12 Oct 2023 22:28:59 +0800 From: Peter Chen To: Thierry Reding Cc: =?utf-8?B?TWljaGHFgiBNaXJvc8WCYXc=?= , Peter Geis , Dmitry Osipenko , Greg Kroah-Hartman , 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: <20231012142859.GC1010588@nchen-desktop> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 howler.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 (howler.vger.email [0.0.0.0]); Thu, 12 Oct 2023 07:29:23 -0700 (PDT) On 23-10-11 23:53:28, 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? > > Regardless, this looks fine, so: > > Acked-by: Thierry Reding Acked-by: Peter Chen -- Thanks, Peter Chen