Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1875976ybz; Thu, 23 Apr 2020 07:33:24 -0700 (PDT) X-Google-Smtp-Source: APiQypJZzOz3ZXqwR318OjRFn0MtHKhgDyrzpFywNsFP2Ip9bICFlG7pvg8FC40ly5AsLfsoRrTj X-Received: by 2002:a05:6402:1d15:: with SMTP id dg21mr3045645edb.13.1587652404573; Thu, 23 Apr 2020 07:33:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587652404; cv=none; d=google.com; s=arc-20160816; b=Vq55Vyv0Aj9/sDdJApETNhTHjPJGd+Ct+lONXw9VdgU/W6HZ0cSbNjUafDgdJyC9Gk cWLbfUZrLq9zamA3ShN75LFz3Pnp36jDGfKxTha15IEbJJ4zJ5uBk9V3O8wXsMkDO6WL Vm8voH3YSRMcfg1iHczC12USxGE0oXRRlhHkPW/HqhMGGYNVauNaUGTMz7sAVvbjlt/L Id3hRFda233nIiUblLzp38xBsSAOi+f9jqr/+et8BogP1ddTd/UUyghJgf0J7rRNxFH2 BVESJoY2zGK2R0v2G+R3K2wep+XrcoalCl8vgvx23TlkRumcgJNsBq4frp2sy/QY6Q5M koDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=G9dhazjywX2xN/5Ah0+630rD5ukq7nrmQdRrKdxkLhU=; b=0WcH5BJp88QB5ZK2CvDRvHqCserMpwTgqhwibAKpJMM/dT0btufEMA6fhw/Wb/IsWF DcSyKBWQa5x1CdLv2I6KWosmr2LAawHxkV9u6h83AwoGN/0N+JvZkyJoEysGu+cinckC BHyPfKhxcC1RaoiFsgy/l6uPkAa3PVBrd1b3P+nUPhrGXNTBZK3wSjibKAB+oRIIPUex Mup6bbK56w3pOb+V8b0+xZ6VZy5sNFWwE0B+vTBtZZO4G58gINiHe1NaFSc0fTnG+uuP jBu6Q8WR9hrvPXtmZK5tdDLz8OsxqnJqimUdaj1XrASd0xfh1urpiYMxEHKXYRLNN+2k kaXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=fRY+2kfD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a63si1217593ede.399.2020.04.23.07.33.01; Thu, 23 Apr 2020 07:33:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=fRY+2kfD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726918AbgDWObc (ORCPT + 99 others); Thu, 23 Apr 2020 10:31:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:39034 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726060AbgDWObc (ORCPT ); Thu, 23 Apr 2020 10:31:32 -0400 Received: from localhost (unknown [117.99.83.91]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 33AF020728; Thu, 23 Apr 2020 14:31:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1587652292; bh=lI3x3Wgxq/DlxqjieCrseB2CoKABPYFIihFQcs7uAuo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=fRY+2kfDUSjwGHmBG3P90xdDtebN6Az+VfjTLoi322j7th4zLubnSAoTZtg00p35q bX1IFR1EU3Kup5TwP2TnQNn+JjmeYQY6J9F2Vm41UYl5DoiS2en+iR8Bj6iZcy+8+e 1Nlm3C+PJAgLj1MAYEpM7AIV9qZycz6NUMIAdw9o= Date: Thu, 23 Apr 2020 20:01:27 +0530 From: Vinod Koul To: Mathias Nyman Cc: Mathias Nyman , Greg Kroah-Hartman , linux-arm-msm@vger.kernel.org, Bjorn Andersson , Yoshihiro Shimoda , Christian Lamparter , John Stultz , Alan Stern , Andreas =?iso-8859-1?Q?B=F6hler?= , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v9 3/5] usb: xhci: Add support for Renesas controller with memory Message-ID: <20200423143127.GK72691@vkoul-mobl> References: <20200414164152.2786474-1-vkoul@kernel.org> <20200414164152.2786474-4-vkoul@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 23-04-20, 17:07, Mathias Nyman wrote: > On 14.4.2020 19.41, Vinod Koul wrote: > > Some rensas controller like uPD720201 and uPD720202 need firmware to be > > loaded. Add these devices in table and invoke renesas firmware loader > > functions to check and load the firmware into device memory when > > required. > > > > Signed-off-by: Vinod Koul > > --- > > drivers/usb/host/xhci-pci.c | 33 +++++++++++++++++++++++++++++++++ > > drivers/usb/host/xhci.h | 1 + > > 2 files changed, 34 insertions(+) > > > > diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c > > index b6c2f5c530e3..11521e2e1720 100644 > > --- a/drivers/usb/host/xhci-pci.c > > +++ b/drivers/usb/host/xhci-pci.c > > @@ -15,6 +15,7 @@ > > > > #include "xhci.h" > > #include "xhci-trace.h" > > +#include "xhci-pci.h" > > > > #define SSIC_PORT_NUM 2 > > #define SSIC_PORT_CFG2 0x880c > > @@ -328,6 +329,21 @@ static int xhci_pci_probe(struct pci_dev *dev, const struct pci_device_id *id) > > int retval; > > struct xhci_hcd *xhci; > > struct usb_hcd *hcd; > > + struct xhci_driver_data *driver_data; > > + > > + driver_data = (struct xhci_driver_data *)id->driver_data; > > + > > + if (driver_data && driver_data->quirks & XHCI_RENESAS_FW_QUIRK) { > > + retval = renesas_xhci_pci_probe(dev, id); > > + switch (retval) { > > + case 0: /* fw check success, continue */ > > + break; > > + case 1: /* fw will be loaded by async load */ > > + return 0; > > This is no longer true, right? Correct. > To me it looks like renesas_xhci_pci_probe() returns 0 on success, both if > firmware was already running or if successfully loaded, and negative on error Yes now it does that and I will update this part.. > > While changing this the function name "renesas_xhci_pci_probe()" should be > changed as well. This isn't anymore a separate firmware loading driver, just a > a lot of renesas firmware loading code. > > You could call renesas_xhci_check_request_fw() directly instead: > > if (driver_data && driver_data->quirks & XHCI_RENESAS_FW_QUIRK) { > retval = renesas_xhci_check_request_fw(dev, id); > if (retval) > return retval; > } Yes I can remove this layer and directly invoke the internal function.. Thanks for the comments -- ~Vinod