Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp2626993pxy; Mon, 3 May 2021 04:39:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwbUo3RxL+1xdh6jJShQxh1M1ArTA+TQsDCsU3pBGXjILaG6oTKANDrxO2dHkreu5tIA+KH X-Received: by 2002:a17:90b:17c7:: with SMTP id me7mr26396218pjb.96.1620041961995; Mon, 03 May 2021 04:39:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620041961; cv=none; d=google.com; s=arc-20160816; b=IMfCYeFE2y6ryyq3uaEm9tkaIszZ5IaXJ8lIGw1pxLv5Ba3Vuygj2HrBn56GJOS6Xa U3LG+Wwbi1PptTbG2AcqE2PxAoLoDMFzGNYwbyVGpJchn5L9R+prBOiOSsLXcJQtaONs Mrqb/UBHnPuxMZyq8SjqEmMxASjfEy0SfcZ0197xXzsDGIgln3UL8DA96WXwAzSJ29wx jGMpZUuDZ9QyuXSiti0gEFz1VQ8DFrM7Qukx5c+j/aHjH62EFTl9gc8uV+7p5C20KSiM K4KjPmn3BGAjOEm7lRIxhDUX09qP2wA9vUhwuiJoTtrdo39nwJ1nwNpMYjHNvWpl7mh8 oWjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:dkim-signature; bh=IbuW/+LVt4m1OF5wLP3Hhrtdw5c385jdVSh/4s3IaM4=; b=w4ZVWkp1NCX00BhRjljLv8bhoCiVqYrAHuz8Q34vOeyODqp2aDz91XBmNbcDH3oU4B FLS9rHMaJRVmFJk0AkfBmQOdTIC69zWNpzL/oBqMj6BNH+qk9uzUwg16jrqz22cJRcm0 M6uBKAFuCOU2e1MTAIbeF4CkQNHelKEh8udkNRJ19lF0Nh5ELoK0xFoGu0cqdgLCwnF1 5v1YQMpax8Tl0EC6tjFZda+66bMBPRVakHMr7CdcPgvNifsx8zjCdK1rKMhpUrfO0BlE UHgPJATw2JiXSKKhCpZieq0NvfgE9bLr9iusq4PRfgFRGejzfw1wZtWnVm/f01pTC7vL ZI7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VluLM+nk; 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 x2si11028066pjk.139.2021.05.03.04.39.09; Mon, 03 May 2021 04:39:21 -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=k20201202 header.b=VluLM+nk; 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 S232937AbhECLRj (ORCPT + 99 others); Mon, 3 May 2021 07:17:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:41568 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229811AbhECLRi (ORCPT ); Mon, 3 May 2021 07:17:38 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id CB99861175; Mon, 3 May 2021 11:16:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1620040605; bh=WtRNI/HtHndJvNU0bk3gx7XrZy0SCWWxUix7KU0CCT8=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=VluLM+nkItf/MvMrgc06+e9GiCmhGm1yY5A4bDJk+KJpieqqXDHPS7x14/Lsl/m5x HwqiYafVMz44set+IL7xO2UN3cenLOZUk+Ie4ITzLuUoyrXFWEViEQGnabXicKR4hr lbh7brIhUr5RAllXP2LQSotJZUe7e8lfGJlC1AAE20PkbZYCpr8aWOT5ecSo7pi6OA pS1MJS2wcQS0QI83juKb7z6bFrWUlf58i1nGmQMhU4utChEqwPQyq1OFGW90hTwnfG 4or+OXFsAd7i+sa/qgJEnvjRhc8hldNGkJj4pxiSNTvTaAZdIfGs488qQrhhVHkbre 6fqnYk4Dn9dKg== From: Felipe Balbi To: Sandeep Maheswaram , Andy Gross , Bjorn Andersson , Greg Kroah-Hartman , Stephen Boyd , Doug Anderson , Matthias Kaehlcke Cc: linux-arm-msm@vger.kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Manu Gautam Subject: Re: [PATCH v7 1/5] usb: dwc3: host: Set PHY mode during suspend In-Reply-To: References: <1619586716-8687-1-git-send-email-sanm@codeaurora.org> <1619586716-8687-2-git-send-email-sanm@codeaurora.org> <87tunqka2e.fsf@kernel.org> Date: Mon, 03 May 2021 14:16:34 +0300 Message-ID: <87k0oghxt9.fsf@kernel.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hi, Sandeep Maheswaram writes: >>> @@ -11,6 +11,14 @@ >>> #include >>>=20=20=20 >>> #include "core.h" >>> +#include "../host/xhci.h" >>> +#include "../host/xhci-plat.h" >>> + >>> +static int xhci_dwc3_suspend_quirk(struct usb_hcd *hcd); >>> + >>> +static const struct xhci_plat_priv xhci_plat_dwc3_xhci =3D { >>> + .suspend_quirk =3D xhci_dwc3_suspend_quirk, >>> +}; >> we're passing data using device_properties, why do you want this here? > Similar implemenation was done in=20 > drivers/usb/cdns3/host.c=20 then it seems we have two places to correct :-) >>> @@ -127,6 +142,50 @@ int dwc3_host_init(struct dwc3 *dwc) >>> return ret; >>> } >>>=20=20=20 >>> +static void dwc3_set_phy_mode(struct usb_hcd *hcd) >>> +{ >>> + >>> + int i, num_ports; >>> + u32 reg; >>> + unsigned int ss_phy_mode =3D 0; >>> + struct dwc3 *dwc =3D dev_get_drvdata(hcd->self.controller->parent); >>> + struct xhci_hcd *xhci_hcd =3D hcd_to_xhci(hcd); >>> + >>> + dwc->hs_phy_mode =3D 0; >>> + >>> + reg =3D readl(&xhci_hcd->cap_regs->hcs_params1); >>> + num_ports =3D HCS_MAX_PORTS(reg); >> there's a big assumption here that xhci is still alive. Why isn't this >> quirk implemented in xhci-plat itself? >> >>> +int xhci_dwc3_suspend_quirk(struct usb_hcd *hcd) >> who calls this? > This will be called from=20 > xhci_plat_suspend->xhci_priv_suspend_quirk->xhci_dwc3_suspend_quirk So xhci.ko calls a function from dwc3.ko? That sounds odd, doesn't it? It really looks like we're just finding ways to bypass the driver layering, rather than working with it. =2D-=20 balbi --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQFFBAEBCAAvFiEE9DumQ60WEZ09LIErzlfNM9wDzUgFAmCP25IRHGJhbGJpQGtl cm5lbC5vcmcACgkQzlfNM9wDzUg8cQgAgcA1k7PlPRRhtSjXfbru+EOxg/E+uu1U NwLMJ9rbbmh/BvV0HU/z+5dKAYX9lo20ftf4iRUPqsduA0UpmCEw68SNOYH9IMQj JVAfYOYcelrGXtem7womqEBERSJylQLThCUyI4AFYqLXSjFjcf+VvtAGuDB38s0X 9FY5k/KHDfDGlkJlFzfsrRfAMZugBEIOYLcsZOMQnUy/nZ2Q+DYillN0nMB0TZt1 D7+3ZzHQm2JeeiCG2VGDFUubyo31Ax6qP5sWgquRZrVjzXxp8oYdrYUbun11H9FD Y12JFzQ2UzLO3m2ZX9eB9+7317WxtyL/kWDjTY8kkkD8KNe4GZ46EA== =FazS -----END PGP SIGNATURE----- --=-=-=--