mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dmitry Osipenko <digetx@gmail.com>
To: Peter Chen <peter.chen@nxp.com>
Cc: Thierry Reding <thierry.reding@gmail.com>,
	Jonathan Hunter <jonathanh@nvidia.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Alan Stern <stern@rowland.harvard.edu>,
	Felipe Balbi <balbi@kernel.org>,
	Matt Merhar <mattmerhar@protonmail.com>,
	Nicolas Chauvet <kwizart@gmail.com>,
	Peter Geis <pgwipeout@gmail.com>,
	"linux-tegra@vger.kernel.org" <linux-tegra@vger.kernel.org>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v1 5/8] usb: chipidea: tegra: Support host mode
Date: Wed, 16 Dec 2020 12:22:22 +0300	[thread overview]
Message-ID: <f5571caf-9a17-3b03-14fa-dc988b10747a@gmail.com> (raw)
In-Reply-To: <bb617167-e6a4-221e-5e3b-c9d7a1b50c87@gmail.com>

16.12.2020 12:07, Dmitry Osipenko пишет:
>>>  static int ehci_ci_portpower(struct usb_hcd *hcd, int portnum, bool enable)
>>>  {
>>>  	struct ehci_hcd *ehci = hcd_to_ehci(hcd);
>>> @@ -160,14 +166,14 @@ static int host_start(struct ci_hdrc *ci)
>>>  		pinctrl_select_state(ci->platdata->pctl,
>>>  				     ci->platdata->pins_host);
>>>  
>>> +	ci->hcd = hcd;
>>> +
>>>  	ret = usb_add_hcd(hcd, 0, 0);
>>>  	if (ret) {
>>>  		goto disable_reg;
>>>  	} else {
>>>  		struct usb_otg *otg = &ci->otg;
>>>  
>>> -		ci->hcd = hcd;
>>> -
>> Why this changed?
> The ci->hcd is used by tegra_usb_notify_event() to handle reset event
> and the reset happens once usb_add_hcd() is invoked.  Hence we need to
> pre-assign the hcd pointer, otherwise there will be a NULL dereference.

Actually, not a NULL dereference, but the reset will be skipped since we
check whether ci->hcd is NULL in the tegra's reset handler.

  reply	other threads:[~2020-12-16  9:23 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-15 20:21 [PATCH v1 0/8] Support Runtime PM and host mode by Tegra ChipIdea USB driver Dmitry Osipenko
2020-12-15 20:21 ` [PATCH v1 1/8] usb: phy: tegra: Add delay after power up Dmitry Osipenko
2020-12-16  8:51   ` Sergei Shtylyov
2020-12-16  9:09     ` Dmitry Osipenko
2020-12-15 20:21 ` [PATCH v1 2/8] usb: phy: tegra: Support waking up from a low power mode Dmitry Osipenko
2020-12-15 20:21 ` [PATCH v1 3/8] usb: chipidea: tegra: Remove MODULE_ALIAS Dmitry Osipenko
2020-12-16 17:58   ` Thierry Reding
2020-12-16 18:06     ` Dmitry Osipenko
2020-12-15 20:21 ` [PATCH v1 4/8] usb: chipidea: tegra: Rename UDC to USB Dmitry Osipenko
2020-12-15 20:21 ` [PATCH v1 5/8] usb: chipidea: tegra: Support host mode Dmitry Osipenko
2020-12-16  6:08   ` Peter Chen
2020-12-16  9:07     ` Dmitry Osipenko
2020-12-16  9:22       ` Dmitry Osipenko [this message]
2020-12-16  9:32       ` Peter Chen
2020-12-16  9:53         ` Dmitry Osipenko
2020-12-16 15:56         ` Dmitry Osipenko
2020-12-15 20:21 ` [PATCH v1 6/8] usb: chipidea: tegra: Support runtime PM Dmitry Osipenko
2020-12-15 20:21 ` [PATCH v1 7/8] usb: host: ehci-tegra: Remove the driver Dmitry Osipenko
2020-12-16 16:45   ` Alan Stern
2020-12-16 17:09     ` Dmitry Osipenko
2020-12-16 17:22       ` Alan Stern
2020-12-16 17:28         ` Dmitry Osipenko
2020-12-15 20:21 ` [PATCH v1 8/8] ARM: tegra_defconfig: Enable USB_CHIPIDEA and remove USB_EHCI_TEGRA Dmitry Osipenko

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=f5571caf-9a17-3b03-14fa-dc988b10747a@gmail.com \
    --to=digetx@gmail.com \
    --cc=balbi@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jonathanh@nvidia.com \
    --cc=kwizart@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mattmerhar@protonmail.com \
    --cc=peter.chen@nxp.com \
    --cc=pgwipeout@gmail.com \
    --cc=stern@rowland.harvard.edu \
    --cc=thierry.reding@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome