From: Jiancheng Xue <xuejiancheng@hisilicon.com>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: <linux-usb@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<yanhaifeng@hisilicon.com>, <yanghongwei@hisilicon.com>,
<zhangzhenxing@hisilicon.com>, <suwenping@hisilicon.com>,
<raojun@hisilicon.com>, <ml.yang@hisilicon.com>,
<gaofei@hisilicon.com>, <hermit.wangheming@hisilicon.com>,
<jiangheng@hisilicon.com>, <lpc.li@hisilicon.com>
Subject: Re: [PATCH] usb: ehci-platform: add reset controller number in struct ehci_platform_priv
Date: Tue, 26 Apr 2016 09:16:28 +0800 [thread overview]
Message-ID: <571EC16C.2050704@hisilicon.com> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1604251042250.1819-100000@iolanthe.rowland.org>
Hi Alan,
On 2016/4/25 22:43, Alan Stern wrote:
> On Sat, 23 Apr 2016, Jiancheng Xue wrote:
>
>> Some generic-ehci compatible controllers have more than one reset signal
>> lines, e.g., Synopsys DWC USB2.0 Host-AHB Controller has two resets bus_reset
>> and roothub_reset. Two more resets are added in this patch in order for this
>> kind of controller to use this driver directly.
>>
>> Signed-off-by: Jiancheng Xue <xuejiancheng@hisilicon.com>
>
>
>> + for (rst = 0; rst < EHCI_MAX_RSTS; rst++) {
>> + priv->rsts[rst] = of_reset_control_get_by_index(
>> + dev->dev.of_node, rst);
>> + if (IS_ERR(priv->rsts[rst])) {
>> + err = PTR_ERR(priv->rsts[rst]);
>> + if (err == -EPROBE_DEFER)
>> + goto err_reset;
>> + priv->rsts[rst] = NULL;
>> + break;
>> + }
>> +
>> + err = reset_control_deassert(priv->rsts[rst]);
>> if (err)
>> - goto err_put_clks;
>> + goto err_reset;
>
> If an error occurs here...
>
Sorry. It's really a problem. I'll modify it in v2 like below:
err = reset_control_deassert(priv->rsts[rst]);
if(err) {
reset_control_put(priv->rsts[rst]);
goto err_reset;
}
>> }
>>
>> if (pdata->big_endian_desc)
>> @@ -300,8 +305,10 @@ err_power:
>> if (pdata->power_off)
>> pdata->power_off(dev);
>> err_reset:
>> - if (priv->rst)
>> - reset_control_assert(priv->rst);
>> + while (--rst >= 0) {
>> + reset_control_assert(priv->rsts[rst]);
>> + reset_control_put(priv->rsts[rst]);
>> + }
>
> You won't call reset_control_put() for the offending reset line.
>
See above.
Is it OK except this bug? If so, I'll send out v2 patch.
Thank you very much!
Regards.
Jiancheng
next prev parent reply other threads:[~2016-04-26 1:16 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-23 6:21 [PATCH] usb: ehci-platform: add reset controller number in struct ehci_platform_priv Jiancheng Xue
2016-04-25 14:43 ` Alan Stern
2016-04-26 1:16 ` Jiancheng Xue [this message]
2016-04-26 14:49 ` Alan Stern
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=571EC16C.2050704@hisilicon.com \
--to=xuejiancheng@hisilicon.com \
--cc=gaofei@hisilicon.com \
--cc=hermit.wangheming@hisilicon.com \
--cc=jiangheng@hisilicon.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=lpc.li@hisilicon.com \
--cc=ml.yang@hisilicon.com \
--cc=raojun@hisilicon.com \
--cc=stern@rowland.harvard.edu \
--cc=suwenping@hisilicon.com \
--cc=yanghongwei@hisilicon.com \
--cc=yanhaifeng@hisilicon.com \
--cc=zhangzhenxing@hisilicon.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