All of lore.kernel.org
 help / color / mirror / Atom feed
From: Felipe Balbi <balbi@kernel.org>
To: Ran Wang <ran.wang_1@nxp.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>
Cc: "linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: [2/2] usb: dwc3: Add workaround for host mode VBUS glitch when boot
Date: Wed, 16 Jan 2019 10:21:15 +0200	[thread overview]
Message-ID: <87y37lko78.fsf@linux.intel.com> (raw)

Hi,

Ran Wang <ran.wang_1@nxp.com> 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 = 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 = HC_LENGTH(readl(xhci_regs));
> +		reg = readl(xhci_regs + XHCI_HCSPARAMS1);
> +		port_num = HCS_MAX_PORTS(reg);
> +
> +		for (i = 1; i <= port_num; i++) {
> +			offset = op_regs_base + XHCI_PORTSC_BASE + 0x10*(i-1);
> +			reg = readl(xhci_regs + offset);
> +			reg &= ~PORT_POWER;
> +			writel(reg, xhci_regs + offset);
> +		}
> +
> +		iounmap(xhci_regs);

why can't this be done during xhci_gen_setup()?

WARNING: multiple messages have this Message-ID (diff)
From: Felipe Balbi <balbi@kernel.org>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>
Cc: "linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Ran Wang <ran.wang_1@nxp.com>
Subject: Re: [PATCH 2/2] usb: dwc3: Add workaround for host mode VBUS glitch when boot
Date: Wed, 16 Jan 2019 10:21:15 +0200	[thread overview]
Message-ID: <87y37lko78.fsf@linux.intel.com> (raw)
In-Reply-To: <20190116064820.20007-3-ran.wang_1@nxp.com>

[-- Attachment #1: Type: text/plain, Size: 973 bytes --]


Hi,

Ran Wang <ran.wang_1@nxp.com> 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 = 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 = HC_LENGTH(readl(xhci_regs));
> +		reg = readl(xhci_regs + XHCI_HCSPARAMS1);
> +		port_num = HCS_MAX_PORTS(reg);
> +
> +		for (i = 1; i <= port_num; i++) {
> +			offset = op_regs_base + XHCI_PORTSC_BASE + 0x10*(i-1);
> +			reg = readl(xhci_regs + offset);
> +			reg &= ~PORT_POWER;
> +			writel(reg, xhci_regs + offset);
> +		}
> +
> +		iounmap(xhci_regs);

why can't this be done during xhci_gen_setup()?

-- 
balbi

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: Felipe Balbi <balbi@kernel.org>
To: Ran Wang <ran.wang_1@nxp.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>
Cc: "linux-usb\@vger.kernel.org" <linux-usb@vger.kernel.org>,
	"devicetree\@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-kernel\@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Ran Wang <ran.wang_1@nxp.com>
Subject: Re: [PATCH 2/2] usb: dwc3: Add workaround for host mode VBUS glitch when boot
Date: Wed, 16 Jan 2019 10:21:15 +0200	[thread overview]
Message-ID: <87y37lko78.fsf@linux.intel.com> (raw)
In-Reply-To: <20190116064820.20007-3-ran.wang_1@nxp.com>

[-- Attachment #1: Type: text/plain, Size: 973 bytes --]


Hi,

Ran Wang <ran.wang_1@nxp.com> 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 = 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 = HC_LENGTH(readl(xhci_regs));
> +		reg = readl(xhci_regs + XHCI_HCSPARAMS1);
> +		port_num = HCS_MAX_PORTS(reg);
> +
> +		for (i = 1; i <= port_num; i++) {
> +			offset = op_regs_base + XHCI_PORTSC_BASE + 0x10*(i-1);
> +			reg = readl(xhci_regs + offset);
> +			reg &= ~PORT_POWER;
> +			writel(reg, xhci_regs + offset);
> +		}
> +
> +		iounmap(xhci_regs);

why can't this be done during xhci_gen_setup()?

-- 
balbi

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

             reply	other threads:[~2019-01-16  8:21 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-16  8:21 Felipe Balbi [this message]
2019-01-16  8:21 ` [PATCH 2/2] usb: dwc3: Add workaround for host mode VBUS glitch when boot Felipe Balbi
2019-01-16  8:21 ` Felipe Balbi
  -- strict thread matches above, loose matches on Subject: below --
2019-02-15  8:39 [2/2] " Ran Wang
2019-02-15  8:39 ` [PATCH 2/2] " Ran Wang
2019-01-22 13:45 [1/2] usb: dwc3: Add avoiding vbus glitch happen during xhci reset Rob Herring
2019-01-22 13:45 ` [PATCH 1/2] " Rob Herring
2019-01-22  2:38 [1/2] " Ran Wang
2019-01-22  2:38 ` [PATCH 1/2] " Ran Wang
2019-01-22  2:38 ` Ran Wang
2019-01-22  1:03 [1/2] " Rob Herring
2019-01-22  1:03 ` [PATCH 1/2] " Rob Herring
2019-01-16 13:11 [2/2] usb: dwc3: Add workaround for host mode VBUS glitch when boot kbuild test robot
2019-01-16 13:11 ` [PATCH 2/2] " kbuild test robot
2019-01-16 13:11 ` kbuild test robot
2019-01-16  7:05 [1/2] usb: dwc3: Add avoiding vbus glitch happen during xhci reset Ran Wang
2019-01-16  7:05 ` [PATCH 1/2] " Ran Wang
2019-01-16  6:48 [2/2] usb: dwc3: Add workaround for host mode VBUS glitch when boot Ran Wang
2019-01-16  6:48 ` [PATCH 2/2] " Ran Wang
2019-01-16  6:48 [1/2] usb: dwc3: Add avoiding vbus glitch happen during xhci reset Ran Wang
2019-01-16  6:48 ` [PATCH 1/2] " Ran Wang
2019-01-16  6:48 [PATCH 0/2] " Ran Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87y37lko78.fsf@linux.intel.com \
    --to=balbi@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=ran.wang_1@nxp.com \
    --cc=robh+dt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.