From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754030AbcHVIT3 (ORCPT ); Mon, 22 Aug 2016 04:19:29 -0400 Received: from mx0a-0016f401.pphosted.com ([67.231.148.174]:57241 "EHLO mx0b-0016f401.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753946AbcHVIT0 (ORCPT ); Mon, 22 Aug 2016 04:19:26 -0400 Date: Mon, 22 Aug 2016 16:14:44 +0800 From: Jisheng Zhang To: Peter Chen , CC: , , , , Subject: Re: [PATCH] usb: chipidea: support generic phy in PM code path Message-ID: <20160822161444.4ffb36d8@xhacker> In-Reply-To: <20160822072907.GD4362@shlinux2> References: <20160819121013.760-1-jszhang@marvell.com> <20160822053308.GA4362@shlinux2> <20160822143921.36b6f95a@xhacker> <20160822072907.GD4362@shlinux2> X-Mailer: Claws Mail 3.14.0 (GTK+ 2.24.30; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-08-22_04:,, signatures=0 X-Proofpoint-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 impostorscore=0 lowpriorityscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1604210000 definitions=main-1608220088 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org + Kishon Hi Peter, Kishon, On Mon, 22 Aug 2016 15:29:07 +0800 Peter Chen wrote: > On Mon, Aug 22, 2016 at 02:39:21PM +0800, Jisheng Zhang wrote: > > Hi Peter, > > > > On Mon, 22 Aug 2016 13:33:08 +0800 Peter Chen wrote: > > > > > On Fri, Aug 19, 2016 at 08:10:13PM +0800, Jisheng Zhang wrote: > > > > Support generic phy in PM code path: call phy_power_off/phy_power_on > > > > in ci_controller_suspend/ci_controller_resume. > > > > > > > > Signed-off-by: Jisheng Zhang > > > > --- > > > > drivers/usb/chipidea/core.c | 4 +++- > > > > 1 file changed, 3 insertions(+), 1 deletion(-) > > > > > > > > diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c > > > > index ae12595..ef9fb0b 100644 > > > > --- a/drivers/usb/chipidea/core.c > > > > +++ b/drivers/usb/chipidea/core.c > > > > @@ -1116,6 +1116,7 @@ static void ci_controller_suspend(struct ci_hdrc *ci) > > > > usleep_range(ci->platdata->phy_clkgate_delay_us, > > > > ci->platdata->phy_clkgate_delay_us + 50); > > > > usb_phy_set_suspend(ci->usb_phy, 1); > > > > + phy_power_off(ci->phy); > > > > > > How could you support USB wakeup after PHY is powered off? > > > > Per my understanding, the PHY's power off just power off data communication part > > but leaves the circuits involved in wakeup detection active. > > > > Ok, I hope so. If most parts of the phy can be powered off during runtime suspend to save power, or phy HW support suspend mode, with usb phy, usb_phy_set_suspend() could be used, but with the generic phy, it seems there's no corresponding API for this purpose. I'm not sure whether using phy_power_off() is correct here. Is it acceptable to extend the generic phy? such as, phy_suspend()/phy_resume()? Thanks, Jisheng