Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp1831200ybh; Fri, 13 Mar 2020 08:10:18 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvsvkxdiPcWr1WPxZF/UElg/3Nucq0krK1igoUj35v0b3hsLAUAbPg7k7eTNNpD6lP4Zv2M X-Received: by 2002:a9d:2c44:: with SMTP id f62mr11829630otb.7.1584112218557; Fri, 13 Mar 2020 08:10:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584112218; cv=none; d=google.com; s=arc-20160816; b=cwk+jfh95NRVzOfwRDrJkYEoyHjwe4UbwpoVSwFHNwXRJvw2Uo6XDQhN3D4vRQur+5 ZSapPmhCrRGVdR3a4VD/cppW2YA8RNGn+YlHGOUZUhY8rWuIRPKKK+ahtafiehT/U2pE +ptwV/SjP769kvI7vPjdedAPrFY0XD5Lwpkjd4aiGz/39IkWh4bOyHbFovW9ehpgSfVi /rcS1M0Zd9dDspD6oWIM26LoZ2gmfLHA2em7DYvxzi+PUyhjtdjIGJv1zqSzcIKMHmb4 3evuabeck6v3d8xMUi/a8ougD6NWHDGlDXMWyF/t5oJJdrCCyKrlvAR/eN/9C3itTR99 nj3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:organization:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=iQfgMNBS2K0ht4LTVzVzbfJbp/I1GhFwCATEh8a3uVc=; b=JZuVuxHOo/vDfqWxsIxVmSRkRqEAPbZNtoChuwWrP1oRzLmOhD/OqlhWKVv/nu2hLf QhozRvP69Qp5Z6IGUrg7z45+w9SU9DZ//K7Ugb6rnX16UXK5mv5eBzPvg5KosEXo/HP6 mV6/OsKkcVAg2L0/0VB8iQXyKfWaq9VFpGYy0WJEu9crvsW+4uPaehoYBnN31dJliDGz bw0nc0cvg1tjsDZwZTczyGF1KbWmJK3OPpaRtHOlpeOOtpGvusJhtNnKn4KLgFY4FgHL 1vIa/E8GkdoEkzr/EFfVzBl3y6yVzs6B7HK3cG9xe4F/cWaHNYxRARyJK4AtxuuHcpfP eJHA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s11si2897571oih.95.2020.03.13.08.10.03; Fri, 13 Mar 2020 08:10:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726902AbgCMPI4 (ORCPT + 99 others); Fri, 13 Mar 2020 11:08:56 -0400 Received: from mga09.intel.com ([134.134.136.24]:11038 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726477AbgCMPIz (ORCPT ); Fri, 13 Mar 2020 11:08:55 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Mar 2020 08:08:54 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,549,1574150400"; d="scan'208";a="322815286" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by orsmga001.jf.intel.com with ESMTP; 13 Mar 2020 08:08:48 -0700 Received: from andy by smile with local (Exim 4.93) (envelope-from ) id 1jClve-009I1a-FG; Fri, 13 Mar 2020 17:08:50 +0200 Date: Fri, 13 Mar 2020 17:08:50 +0200 From: Andy Shevchenko To: Al Cooper Cc: linux-kernel@vger.kernel.org, Alan Stern , Arnd Bergmann , Bartlomiej Zolnierkiewicz , bcm-kernel-feedback-list@broadcom.com, "David S. Miller" , devicetree@vger.kernel.org, Greg Kroah-Hartman , Johan Hovold , Jonathan Cameron , Krzysztof Kozlowski , linux-usb@vger.kernel.org, Mark Rutland , Mathias Nyman , Mauro Carvalho Chehab , Rob Herring , Rob Herring Subject: Re: [PATCH 3/4] usb: ehci: Add new EHCI driver for Broadcom STB SoC's Message-ID: <20200313150850.GV1922688@smile.fi.intel.com> References: <20200313141545.31943-1-alcooperx@gmail.com> <20200313141545.31943-4-alcooperx@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200313141545.31943-4-alcooperx@gmail.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 13, 2020 at 10:15:44AM -0400, Al Cooper wrote: > Add a new EHCI driver for Broadcom STB SoC's. A new EHCI driver > was created instead of adding support to the existing ehci platform > driver because of the code required to workaround bugs in the EHCI > controller. I'm not sure this is the best approach, but I leave it to maintainers. By the way, can you list what exactly the difference to the (generic) ehci driver? ... > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include > +#include ... > +/* ehci_brcm_wait_for_sof > + * Wait for start of next microframe, then wait extra delay microseconds > + */ Style is inconsistent even inside this file. > +static inline void ehci_brcm_wait_for_sof(struct ehci_hcd *ehci, u32 delay) > +{ > + int frame_idx = ehci_readl(ehci, &ehci->regs->frame_index); This is not needed if you use do {} while approach. > + > + while (frame_idx == ehci_readl(ehci, &ehci->regs->frame_index)) > + ; Busy loop without even power management taking into consideration? Infinite loop? > + udelay(delay); > +} ... > +static const struct ehci_driver_overrides brcm_overrides __initconst = { > + > + .reset = ehci_brcm_reset, Indentation issue. > + .extra_priv_size = sizeof(struct brcm_priv), > +}; ... > +static int ehci_brcm_probe(struct platform_device *pdev) > +{ > + irq = platform_get_irq(pdev, 0); > + if (irq < 0) { > + dev_err(&pdev->dev, "no irq provided"); Duplicate with core message. > + return irq; > + } > + /* initialize hcd */ > + hcd = usb_create_hcd(&ehci_brcm_hc_driver, > + &pdev->dev, dev_name(&pdev->dev)); At least this one will look much better (and fit one line) when you introduce struct device *dev = &pdev->dev; in the definition block above. > + if (!hcd) > + return -ENOMEM; > + return err; > +} ... > +static struct platform_driver ehci_brcm_driver = { > + .probe = ehci_brcm_probe, > + .remove = ehci_brcm_remove, > + .shutdown = usb_hcd_platform_shutdown, > + .driver = { > + .owner = THIS_MODULE, Do we need this? > + .name = "ehci-brcm", > + .pm = &ehci_brcm_pm_ops, > + .of_match_table = brcm_ehci_of_match, > + } > +}; -- With Best Regards, Andy Shevchenko