Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp973527imu; Wed, 16 Jan 2019 10:30:19 -0800 (PST) X-Google-Smtp-Source: ALg8bN5dQgOngadzqb5WKST8GarHxmjy+iTDww8PXkmmOBz0pJpb4SeE6kX2VTABf/cIyqUmTxGa X-Received: by 2002:a62:64d7:: with SMTP id y206mr11205659pfb.84.1547663419449; Wed, 16 Jan 2019 10:30:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547663419; cv=none; d=google.com; s=arc-20160816; b=DO2X46dn6Nr55U1oaEFDt/0cKny5GevISxeIOYj3YRo2ZK+mBnUVeL2KAOxrAKmwNs asC+kt+kNOfmbKaOekT53N3SQrLIIHl5Sia+HxUs2hKMlfWo4C0+UrEPtsWMq3dzvUXa 1vv8XSIRMa6ng/gk87ajT2giR/Be2iKrAUv8Iv20JLi0rASmEhi0KqrdFHPAalNZ7R6Q G9YBbmhE4zhLy2G1tyizPTGHmK9xk4TEj/SSkaoS5r05lNgh2K/5EZltO4sx6DtS5sGJ LW89z2Bt6nsEPjA9ZIeUeLpxAt4r1dh5O3WF6q4iQ+jyqPCM3jKKVbWYEhcGCcMyE2xA ZgXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from; bh=En0JemeBWTx2U7aM29er6dU7dvncJoUjG3K3YjT8Pik=; b=hiNPIsW4JKONIkEQO3kNktIxxJaI3JyQ7qf8+R02+HdH/Ns+bp4d32OHBbiptkee3W sH6XS7eDjEGsFhu5RF/TwIn7XTTL7YtKqM4tFy1EjE1t8iYAnRxp2zaXtM7RS0QU9/bG +GsAmslMqWeNBSuSXQ/sKpmzKpI6yFObnAdIxKbHkU7SLAulYut0f9ekqWcDsy0wQvUU LWWmVfbF5kTD61ckIQ5GzIJrdfrw30MlM9j/Eah220Q3pOdjTfpnvTtqi7jN1yrnRgdt kmWGQNgeM3B5f6DcCkTxjO+F+DpM4qQIa3R1Km1pHtUmVYUep8L9yeJ9aWZe/WXuGUuK tm7Q== 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q8si6514189pgc.580.2019.01.16.10.30.00; Wed, 16 Jan 2019 10:30:19 -0800 (PST) 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731406AbfAPIVX (ORCPT + 99 others); Wed, 16 Jan 2019 03:21:23 -0500 Received: from mga03.intel.com ([134.134.136.65]:46231 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730345AbfAPIVW (ORCPT ); Wed, 16 Jan 2019 03:21:22 -0500 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Jan 2019 00:21:22 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,485,1539673200"; d="asc'?scan'208";a="138685795" Received: from pipin.fi.intel.com (HELO localhost) ([10.237.72.175]) by fmsmga001.fm.intel.com with ESMTP; 16 Jan 2019 00:21:19 -0800 From: Felipe Balbi To: Ran Wang , Greg Kroah-Hartman , Rob Herring , Mark Rutland Cc: "linux-usb\@vger.kernel.org" , "devicetree\@vger.kernel.org" , "linux-kernel\@vger.kernel.org" , Ran Wang Subject: Re: [PATCH 2/2] usb: dwc3: Add workaround for host mode VBUS glitch when boot In-Reply-To: <20190116064820.20007-3-ran.wang_1@nxp.com> References: <20190116064820.20007-1-ran.wang_1@nxp.com> <20190116064820.20007-3-ran.wang_1@nxp.com> Date: Wed, 16 Jan 2019 10:21:15 +0200 Message-ID: <87y37lko78.fsf@linux.intel.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hi, Ran Wang writes: > +static void dwc3_power_off_all_roothub_ports(struct dwc3 *dwc) > +{ > + int i, port_num; > + u32 reg, op_regs_base, offset; > + void __iomem *xhci_regs; > + > + /* xhci regs is not mapped yet, do it temperary here */ > + if (dwc->xhci_resources[0].start) { > + xhci_regs =3D ioremap(dwc->xhci_resources[0].start, > + DWC3_XHCI_REGS_END); > + if (IS_ERR(xhci_regs)) { > + dev_err(dwc->dev, "Failed to ioremap xhci_regs\n"); > + return; > + } > + > + op_regs_base =3D HC_LENGTH(readl(xhci_regs)); > + reg =3D readl(xhci_regs + XHCI_HCSPARAMS1); > + port_num =3D HCS_MAX_PORTS(reg); > + > + for (i =3D 1; i <=3D port_num; i++) { > + offset =3D op_regs_base + XHCI_PORTSC_BASE + 0x10*(i-1); > + reg =3D readl(xhci_regs + offset); > + reg &=3D ~PORT_POWER; > + writel(reg, xhci_regs + offset); > + } > + > + iounmap(xhci_regs); why can't this be done during xhci_gen_setup()? =2D-=20 balbi --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEElLzh7wn96CXwjh2IzL64meEamQYFAlw+6XsACgkQzL64meEa mQaYthAA0N7cZj+TDKBtt13xQYprxukJbw0hJF5r+Xwp64RbDU04hHDxOqrV7S7G gI+RWTZ1p/dvBZ5z0cf9/5Wj4Uyzcnyesd/OCWvTzJA18zNVObO7Dx/KrZawzgJf B6s3deHMVN1wUVJprVqqUFEXOyJ0hgvup9dQOVeatZMJLYqgW1ubPrK/7LSW52vy 4KUBT4Ol4hXeJiz/SIngZopM9Vc1BTNXFs7ldR6UqWWtU9KnCajBz0QK5T0k4eqj cvw+jKj8PMts0beRRqTIRAL128aov+/+9o2X+1PEIrPYmiRlFDwUjSGTEaXfb/K2 wHg1Bt6FdBufnlWYTuhGkT5mp1MPe6L2q11m/q6rYnJJNfqnCAExp6hx8K6cQSHP SATYdBr/ZaOpYJ3RaNOHX3ehfhCkLKFeofT3I/DJEUqSld5s4AmDH8VYLkSx+YtC KCBjwhYq9Rs1MF66jVWL+oaTG57q+Ta5FVlxlR/ARnZf3Rp65+NvSzZfckmze8p7 pR+G1J34nziVWCNLV4YXmkfYVV3CHLdPl1YM6hvzEZiBOY0lAHPK40f56L9I/IIF I+eQmDT/SDNqXcEBs5pZh+2UXZSd1GWFGl2z6C5qXzXo8nGXjhHMg8powkudXxp4 8OFNnT6Se2d9OYRnADDbMR1valZ3spQbsnjX1YPyh2s9ztsEfaU= =lIIu -----END PGP SIGNATURE----- --=-=-=--