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=-15.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 5D0F4C2B9F4 for ; Thu, 17 Jun 2021 11:12:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1DF0961209 for ; Thu, 17 Jun 2021 11:12:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232427AbhFQLOq (ORCPT ); Thu, 17 Jun 2021 07:14:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:53260 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231501AbhFQLOj (ORCPT ); Thu, 17 Jun 2021 07:14:39 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 35B9561369; Thu, 17 Jun 2021 11:12:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1623928351; bh=Ocgp30BnZ8XoWmAPjRUOn8bkwl1ycXvMtwzaDtMaEJ8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=uCWxl1+Ory823yoEna0SAz0awtcGyw8neh4ehe/wf0i8uU0bF80EgjVsykwxScWer 28mx3Yal6+rzR5dcj/9AbQUMnD/wXdicCME9S5uXyhczbM0gUgPslv3kH6B0Iop0Rh yYwanpzA7XUupkvbXrvYkC/yJ1V5GDqLMWZXB7lc= Date: Thu, 17 Jun 2021 13:12:28 +0200 From: Greg KH To: Wesley Cheng Cc: balbi@kernel.org, robh+dt@kernel.org, agross@kernel.org, bjorn.andersson@linaro.org, frowand.list@gmail.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org, jackp@codeaurora.org, fntoth@gmail.com, heikki.krogerus@linux.intel.com, andy.shevchenko@gmail.com Subject: Re: [PATCH v10 5/6] usb: dwc3: dwc3-qcom: Enable tx-fifo-resize property by default Message-ID: References: <1623923899-16759-1-git-send-email-wcheng@codeaurora.org> <1623923899-16759-6-git-send-email-wcheng@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1623923899-16759-6-git-send-email-wcheng@codeaurora.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 17, 2021 at 02:58:18AM -0700, Wesley Cheng wrote: > In order to take advantage of the TX fifo resizing logic, manually add > these properties to the DWC3 child node by default. This will allow > the DWC3 gadget to resize the TX fifos for the IN endpoints, which > help with performance. > > Signed-off-by: Wesley Cheng > --- > drivers/usb/dwc3/dwc3-qcom.c | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/drivers/usb/dwc3/dwc3-qcom.c b/drivers/usb/dwc3/dwc3-qcom.c > index 49e6ca9..44e0eaa1 100644 > --- a/drivers/usb/dwc3/dwc3-qcom.c > +++ b/drivers/usb/dwc3/dwc3-qcom.c > @@ -645,6 +645,7 @@ static int dwc3_qcom_of_register_core(struct platform_device *pdev) > struct dwc3_qcom *qcom = platform_get_drvdata(pdev); > struct device_node *np = pdev->dev.of_node, *dwc3_np; > struct device *dev = &pdev->dev; > + struct property *prop; > int ret; > > dwc3_np = of_get_compatible_child(np, "snps,dwc3"); > @@ -653,6 +654,14 @@ static int dwc3_qcom_of_register_core(struct platform_device *pdev) > return -ENODEV; > } > > + prop = devm_kzalloc(dev, sizeof(*prop), GFP_KERNEL); > + if (prop) { > + prop->name = "tx-fifo-resize"; > + ret = of_add_property(dwc3_np, prop); > + if (ret < 0) > + dev_info(dev, "unable to add tx-fifo-resize prop\n"); dev_err()? And you do not error out properly? > + } No failure if prop is NULL? This check looks backwards to me, error paths are in the if () statement, not "all is good". This feels backwards. greg k-h