Received: by 2002:a17:90a:1609:0:0:0:0 with SMTP id n9csp2490865pja; Thu, 26 Mar 2020 16:27:30 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuoowGlv2kZDVaWt09z2D/2PsJHWiZmy9x6Op7IC4h3UYesoXo3yo7yQ+aRg7t7daYG+D7R X-Received: by 2002:a9d:7f19:: with SMTP id j25mr8565832otq.129.1585265250105; Thu, 26 Mar 2020 16:27:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585265250; cv=none; d=google.com; s=arc-20160816; b=SxOAsR2X+9y3teGwCK0rVb1NPAZY2wsJNLdDjFWY63cWpVFeJM3EmDat+77KmOIymI Jb6dg9WGLpY1+GzheHnto9OR+okMW7W6LX3MWVOn8rqE6zFrciwXS8z9kvQvaxue/a7J eR/fTcvYN4YGYup6cL4f4FEu3b9zKvtGQo/0joXg4ePzkRvgxk5U4f3nlLYYZe6jYjPr u8sz905zsYtVzwq/kQaqijLzB1HxPxi1sKwurpi9XVglmz4fyXxiUEMDkajN7Aznlap1 Gb9nqVDhgL1QOMkLrlIphgx16nfElxSWOHlwSonX+5Yv4ZJvxcIT1o/ADq7dyfth2dgk 2f1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=WqZyECE7b3l+/W5cG6aN6aQ7OERbPPJKLPh37gMr4P8=; b=pHp8xCH/MqBW8gy5KQKOWwp0/MB9ktweSaPKyNiMpfXr7O3z/jf8bIYL0nOALzT47N cbogLB09usLSh19VMvkpOF0WOhyI31CVGhKbtDPRscNhJp+NRvTgfeTvLSUFG1jxJ1A9 Su3OvBH+eSUbXak7Mk4QTsTEPaJzSKiuxpb/vzouZZle/LnkCIxxSKBUIJaBzmZxzlmV P46Kphde0Bclq9lOgZPi++OHJmonAIkcgqhwVBQTNR8V6VsbEzKdJli9rdzzhyjhK6uh pwOYqCIMt4m/jLZ3CFcxZpBRIJOQtzrgmooaaocK3t/bgWo0rVBvmNXbSKtjthTQDnoR 4qtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@googlemail.com header.s=20161025 header.b=ue1h1Ngs; 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=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s63si1645733oig.69.2020.03.26.16.27.17; Thu, 26 Mar 2020 16:27:30 -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; dkim=pass header.i=@googlemail.com header.s=20161025 header.b=ue1h1Ngs; 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=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=googlemail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728490AbgCZX0T (ORCPT + 99 others); Thu, 26 Mar 2020 19:26:19 -0400 Received: from mail-ed1-f67.google.com ([209.85.208.67]:45954 "EHLO mail-ed1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728475AbgCZX0S (ORCPT ); Thu, 26 Mar 2020 19:26:18 -0400 Received: by mail-ed1-f67.google.com with SMTP id u59so8971852edc.12; Thu, 26 Mar 2020 16:26:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=WqZyECE7b3l+/W5cG6aN6aQ7OERbPPJKLPh37gMr4P8=; b=ue1h1NgsTbotQg6qMgEzUEGsjz11gWWWp2SUopj+TH8eOOBmYryxsfc281mZqrloEv P76dythInNUEfdLKgr7SgCfjmFg6sE925yUai/7kD6iygiYW41tOLyueWqE41PZp/QQL FrX5esvWQpq4u2MT/46hJXxhdRYrB5LZG3OXoJRY8UAsN3fhBfF+Mmj+NBCYmBlhXkiB ee9g1chV624ys8iJxZOeJyLMD2lsOpr6uT72VNd2zFkDdFIzEQU1YJ3iJvKiaWZUvhxd 8ctYZYkWyFiCfSr/Sev5oQ62jff2k4N93aiamR/xOeC6EwLqNDKHb5/vZDTffrPQMHeA j5uQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=WqZyECE7b3l+/W5cG6aN6aQ7OERbPPJKLPh37gMr4P8=; b=U3mjb2viczXn5UNIInSpTrD1qs9k91EIacNeAUJkp7WtX4zntiHRY6l3t52ujvc8OV orhdResRTti+Qqyf45272qh2ch7IVbvN+DMIwPKn9CDGSLXhUDdLKlbayUCFChHZgbct 4FC0Mr9PjGKiVIBRo1UG4eJdUBRbk5yP5pCmV69T/cnW3WhNEjGDgVSi1RQBdYUEnXpt txwEXPs63Tu9wzIzTfbn9Vw37av0HQK233xppehjKikuPaCsQGZvhUN6D+6w6gTswAB2 SqBuvdy2WMriX0glb0YCQVOOODOSfxDsj98DT4oMXIWwzMzxPPVFfWvNm5teWMhAJtvY BM5A== X-Gm-Message-State: ANhLgQ35dGKMmUkpazLY+aEyggg9KqzaaaJtrySX00jDM/Nuc6MpTQpv PsDIjdzDbPDHJXKtNWgVTO3JjSypHR2I8RfhKsc= X-Received: by 2002:a17:906:491:: with SMTP id f17mr162602eja.30.1585265176806; Thu, 26 Mar 2020 16:26:16 -0700 (PDT) MIME-Version: 1.0 References: <20200326134507.4808-1-narmstrong@baylibre.com> <20200326134507.4808-8-narmstrong@baylibre.com> In-Reply-To: <20200326134507.4808-8-narmstrong@baylibre.com> From: Martin Blumenstingl Date: Fri, 27 Mar 2020 00:26:06 +0100 Message-ID: Subject: Re: [PATCH v2 07/14] usb: dwc3: meson-g12a: refactor usb init To: Neil Armstrong Cc: kishon@ti.com, balbi@kernel.org, khilman@baylibre.com, linux-amlogic@lists.infradead.org, linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Neil, On Thu, Mar 26, 2020 at 2:45 PM Neil Armstrong wrote: [...] > -static int dwc3_meson_g12a_usb2_init(struct dwc3_meson_g12a *priv) > +static int dwc3_meson_g12a_usb2_init(struct dwc3_meson_g12a *priv, > + enum phy_mode mode) > { > int i, ret; > > - if (priv->otg_mode == USB_DR_MODE_PERIPHERAL) > - priv->otg_phy_mode = PHY_MODE_USB_DEVICE; > - else > - priv->otg_phy_mode = PHY_MODE_USB_HOST; > - > for (i = 0; i < priv->drvdata->num_phys; ++i) { > if (!priv->phys[i]) > continue; > @@ -284,9 +286,10 @@ static void dwc3_meson_g12a_usb3_init(struct dwc3_meson_g12a *priv) > FIELD_PREP(USB_R1_P30_PCS_TX_SWING_FULL_MASK, 127)); > } There is something strange with dwc3_meson_g12a_usb2_init. enum phy_mode mode is added here but it's not used inside this function I also think that we should not pass enum phy_mode to dwc3_meson_g12a_usb_otg_apply_mode I'm aware that the original function used enum phy_mode inside but this doesn't seem right: we're not configuring a PHY there instead we're setting up the OTG switch so I think we should use enum usb_role instead [...] not part of this patch but should be: there's a still a direct call to dwc3_meson_g12a_usb_init() in dwc3_meson_g12a_resume() I think that needs to be changed to priv->drvdata->usb_init(priv); as well