mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "WeitaoWang-oc@zhaoxin.com" <WeitaoWang-oc@zhaoxin.com>
To: Sergei Shtylyov <sergei.shtylyov@gmail.com>,
	<gregkh@linuxfoundation.org>, <mathias.nyman@intel.com>,
	<linux-usb@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Cc: <tonywwang@zhaoxin.com>, <weitaowang@zhaoxin.com>
Subject: Re: [PATCH 2/3] xhci: Add zhaoxin xHCI U1/U2 feature support
Date: Fri, 21 Apr 2023 04:21:40 +0800	[thread overview]
Message-ID: <f0f0d62d-edde-547d-5d6e-a02e2f8e8648@zhaoxin.com> (raw)
In-Reply-To: <c853436a-85c7-d0f8-0990-bc64977cbd47@gmail.com>

On 2023/4/20 17:39, Sergei Shtylyov wrote:
> On 4/20/23 8:21 PM, Weitao Wang wrote:
> 
>> Add U1/U2 feature support of xHCI for zhaoxin.
>>
>> Signed-off-by: Weitao Wang <WeitaoWang-oc@zhaoxin.com>
> [...]
> 
>> diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
>> index 6307bae9cddf..730c0f68518d 100644
>> --- a/drivers/usb/host/xhci.c
>> +++ b/drivers/usb/host/xhci.c
> [...]
>> @@ -4938,6 +4938,27 @@ static int xhci_update_timeout_for_interface(struct xhci_hcd *xhci,
>>   	return 0;
>>   }
>>   
>> +static int xhci_check_zhaoxin_tier_policy(struct usb_device *udev,
>> +		enum usb3_link_state state)
>> +{
>> +	struct usb_device *parent;
>> +	unsigned int num_hubs;
>> +
>> +	/* Don't enable U1/U2 if the device is on an external hub. */
>> +	for (parent = udev->parent, num_hubs = 0; parent->parent;
>> +			parent = parent->parent)
>> +		num_hubs++;
>> +
>> +	if (num_hubs < 1)
>> +		return 0;
>> +
>> +	dev_dbg(&udev->dev, "Disabling U1/U2 link state for device"
>> +			" below external hub.\n");
>> +	dev_dbg(&udev->dev, "Plug device into root hub "
>> +			"to decrease power consumption.\n");
> 
>     Please don't break up the message strings.

Thanks for your advice, and I will merge this message in next patch version.
> [...]
>> @@ -4965,6 +4986,8 @@ static int xhci_check_tier_policy(struct xhci_hcd *xhci,
>>   {
>>   	if (xhci->quirks & XHCI_INTEL_HOST)
>>   		return xhci_check_intel_tier_policy(udev, state);
>> +	else if (xhci->quirks & XHCI_ZHAOXIN_HOST)
> 
>     *else* not needed after *return*.
This function need a "int" type return value. If remove "else" branch,
vendor other than intel and zhaoxin will not get a return value.

Best Regards,
Weitao

>> +		return xhci_check_zhaoxin_tier_policy(udev, state);
>>   	else
>>   		return 0;
>>   }
> 
> MBR, Sergey
> .

  reply	other threads:[~2023-04-20 12:21 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-20 17:21 [PATCH 0/3] Fix some issues of xHCI for zhaoxin Weitao Wang
2023-04-20  9:29 ` Greg KH
2023-04-20 18:08   ` WeitaoWang-oc
2023-04-20 10:14     ` Greg KH
2023-04-20 20:56       ` WeitaoWang-oc
2023-04-20 17:21 ` [PATCH 1/3] xhci: Add a quirk for zhaoxin xhci to fix issues Weitao Wang
2023-04-20 17:21 ` [PATCH 2/3] xhci: Add zhaoxin xHCI U1/U2 feature support Weitao Wang
2023-04-20  9:39   ` Sergei Shtylyov
2023-04-20 20:21     ` WeitaoWang-oc [this message]
2023-04-20 14:22       ` Sergei Shtylyov
2023-04-21 10:51         ` WeitaoWang-oc
2023-04-20 14:07   ` Mathias Nyman
2023-04-21 10:56     ` WeitaoWang-oc
2023-04-21  7:51       ` Mathias Nyman
2023-04-20 17:21 ` [PATCH 3/3] xhci: Show zhaoxin xHCI root hub speed correctly Weitao 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=f0f0d62d-edde-547d-5d6e-a02e2f8e8648@zhaoxin.com \
    --to=weitaowang-oc@zhaoxin.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mathias.nyman@intel.com \
    --cc=sergei.shtylyov@gmail.com \
    --cc=tonywwang@zhaoxin.com \
    --cc=weitaowang@zhaoxin.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

all inboxes | Powered by JetHome®