Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp5429510ybp; Tue, 8 Oct 2019 02:44:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqxmhveDB5E0+ZVf5092vGMEQOaKAb6MaaC2aYrsUV5p2erdVIWX3BSfhze1u6ytAxEJSpSI X-Received: by 2002:a17:906:2cc8:: with SMTP id r8mr28078824ejr.197.1570527850086; Tue, 08 Oct 2019 02:44:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570527850; cv=none; d=google.com; s=arc-20160816; b=utL3VdYfpYAJh4maogSMfOplgVoU7D5yNYKx5WRhQGHl1HvBQrrQ28kajKZTZqvJl5 nA+L0YJ7LaY2fsvhLtzgawSPcekj304F5cxQWD29qpGN6HvX3QGSgbv3zLFf2nEya33h QSYM5nRgphOGqyOyuj4SSJ/N+PZPplqZBWpexBeabSxv/a2pzjqVsk1nFZoakv90LZ6c 8b1B6CcxCoDkoGVo/5mMyvHKJ9wotNJEX3M15RMeKxUMl058bknTsbDnk8pD69oCLArI WMmNykOX5qpPSCy2aEgrGNK73hdbl+P0Q8OYmeWkau1Xr1ojHHp2BnDNUl6aYbDOHFWU KTfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=6toEYcd/QGcUGM9UREyyXj/V8NYWbxfV95700fLW2gg=; b=WWHIu972FPOcHfKokB8aZY4QWcgQME0J+YRYm1iLWcVGgWgApfK9s1Plp5onEpyf/n +vk5oSAoz8heyh+6nki38q993iBRvPwbgcUCiw64oRpCV1KMgfYIEFSVnHjqoeG9xcKh LzQCJt+/makw5Nu0hyXXCvbwFAM8M5N9hXLDdEqfvY+HlA1DiDDvt7Wf7Q9kxUP6w8/H 67ECMe43iadnMlbEnny8Pcb+Ersh5XSnLw28WqxC5qT6GirvJ95eFiPjJLdBkJD6L9N1 cTeTAfmphFm+d//C8De2tmErxKeVkohvUfNjlAxGBi2qpIqlfRdS2yGoBLufgWahz5yL V7/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Y999RLk5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e13si9427488edr.429.2019.10.08.02.43.45; Tue, 08 Oct 2019 02:44:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Y999RLk5; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730256AbfJHJkc (ORCPT + 99 others); Tue, 8 Oct 2019 05:40:32 -0400 Received: from mail-ed1-f67.google.com ([209.85.208.67]:37526 "EHLO mail-ed1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728866AbfJHJkb (ORCPT ); Tue, 8 Oct 2019 05:40:31 -0400 Received: by mail-ed1-f67.google.com with SMTP id r4so15041670edy.4; Tue, 08 Oct 2019 02:40:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=6toEYcd/QGcUGM9UREyyXj/V8NYWbxfV95700fLW2gg=; b=Y999RLk5KBrJ+pc6BtDE61uCoVg7RzzWgyDIMcJfrgCB44ugqjGGCSO6Ds2LhDMvwp 1wi8/Yn8mYPZLOB0BnPOTSc5WjRTXVY/le+DjypmWVDc3No45fOOkioW8UT2QOyp9vHk A5tXloDC1TwyVExTgjJPHZ+7Ya5serZeo2rCYZcgD6caoi4y+WY7+UNb38oPse22mJN1 WEUgCYGvMZ9nRlqBiDeT8R99oPGLC+533UjGzVTX8n6j3QjIIQK+lWtLQ9wji1EvtEWi KsEh/aslh5RWL8w71N1ladle+V/Wv3O592Q95eRB68XW7WXh3EKgRyVxLKqpfk0//t09 Kjgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=6toEYcd/QGcUGM9UREyyXj/V8NYWbxfV95700fLW2gg=; b=jNfDeO+GK8EED+dp8WJh5dyqH2sTUkSs60J4IEmIg//VPOTDgrfQvTwnKUqW7DZpL0 22yP+uSS4V7JueSIC10zVf/BW1obSpPaVNBkKAx4MU1MWL2wLZgxRxuPrsqSXT2wvzHb nxJFm1HouuINlMQhlZ7bA7/c0eaeKzLAklaXUS3MkMMQaAI+qdjVJRUlfBUShg+lDdcU p2bwMbZxsQFalSTAr+oWdwLzoP91OrAu3q7DTGklE0mvwTJP9BEVJT7p4xH5URmCwQWj bPTdysOa00ql/zEOe8UzVgPgZ//yCOqsOj6rMBwYu17KK+xjzZjV4B1K4CShEG1gt//O yYWg== X-Gm-Message-State: APjAAAVq6kMm99eDuTf+sUIHglnNbV31FNPm1RPzQs4J6ieCsJvqkq7G EobC1T4tau2cBvcCU9fe5Lnj9xRRmGOkitGtPFm5MkIR X-Received: by 2002:a05:6402:2054:: with SMTP id bc20mr34283549edb.55.1570527629145; Tue, 08 Oct 2019 02:40:29 -0700 (PDT) MIME-Version: 1.0 References: <20191007124607.20618-1-igor.opaniuk@gmail.com> <20191007124607.20618-2-igor.opaniuk@gmail.com> <20191008032326.GB5670@b29397-desktop> In-Reply-To: <20191008032326.GB5670@b29397-desktop> From: Igor Opaniuk Date: Tue, 8 Oct 2019 12:40:17 +0300 Message-ID: Subject: Re: [RFC PATCH v1 2/3] usb: chipidea: set mode for usb phy driver To: Peter Chen Cc: "linux-usb@vger.kernel.org" , Marcel Ziswiler , Philippe Schenker , Stefan Agner , Max Krummenacher , Oleksandr Suvorov , Igor Opaniuk , Jun Li , Greg Kroah-Hartman , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Peter, On Tue, Oct 8, 2019 at 6:23 AM Peter Chen wrote: > > On 19-10-07 15:46:06, Igor Opaniuk wrote: > > From: Igor Opaniuk > > > > After enters one specific role, notify usb phy driver. > > > > Signed-off-by: Li Jun > > Signed-off-by: Igor Opaniuk > > --- > > > > drivers/usb/chipidea/ci.h | 21 ++++++++++++++++++--- > > 1 file changed, 18 insertions(+), 3 deletions(-) > > > > diff --git a/drivers/usb/chipidea/ci.h b/drivers/usb/chipidea/ci.h > > index 6911aef500e9..a11d23910b12 100644 > > --- a/drivers/usb/chipidea/ci.h > > +++ b/drivers/usb/chipidea/ci.h > > @@ -275,9 +275,21 @@ static inline int ci_role_start(struct ci_hdrc *ci= , enum ci_role role) > > return -ENXIO; > > > > ret =3D ci->roles[role]->start(ci); > > - if (!ret) > > - ci->role =3D role; > > - return ret; > > + if (ret) > > + return ret; > > + > > + ci->role =3D role; > > + > > + if (ci->usb_phy) { > > + if (role =3D=3D CI_ROLE_HOST) > > + usb_phy_set_mode(ci->usb_phy, > > + USB_MODE_HOST); > > + else > > + usb_phy_set_mode(ci->usb_phy, > > + USB_MODE_DEVICE); > > + } > > + > > + return 0; > > } > > > > static inline void ci_role_stop(struct ci_hdrc *ci) > > @@ -290,6 +302,9 @@ static inline void ci_role_stop(struct ci_hdrc *ci) > > ci->role =3D CI_ROLE_END; > > > > ci->roles[role]->stop(ci); > > + > > + if (ci->usb_phy) > > + usb_phy_set_mode(ci->usb_phy, USB_MODE_NONE); > > } > > > > static inline enum usb_role ci_role_to_usb_role(struct ci_hdrc *ci) > > -- > > Hi Igor, > > Thanks for doing that. > > We just find this series patch will break ARM32 multi_v7_defconfig > build. You may need to fix it at next revision, see below. > > CC [M] drivers/gpu/drm/nouveau/nvkm/subdev/fb/gm200.o > In file included from /home/b29397/work/projects/usb/drivers/phy/ti/phy-o= map-usb2.c:20:0: > /home/b29397/work/projects/usb/include/linux/phy/omap_control_phy.h:36:2:= error: redeclaration of enumerator =E2=80=98USB_MODE_HOST=E2=80=99 > USB_MODE_HOST, > ^~~~~~~~~~~~~ > In file included from /home/b29397/work/projects/usb/include/linux/usb/ot= g.h:14:0, > from /home/b29397/work/projects/usb/include/linux/phy/om= ap_usb.h:13, > from /home/b29397/work/projects/usb/drivers/phy/ti/phy-o= map-usb2.c:14: > /home/b29397/work/projects/usb/include/linux/usb/phy.h:69:2: note: previo= us definition of =E2=80=98USB_MODE_HOST=E2=80=99 was here > USB_MODE_HOST, > ^~~~~~~~~~~~~ > In file included from /home/b29397/work/projects/usb/drivers/phy/ti/phy-o= map-usb2.c:20:0: > /home/b29397/work/projects/usb/include/linux/phy/omap_control_phy.h:37:2:= error: redeclaration of enumerator =E2=80=98USB_MODE_DEVICE=E2=80=99 > USB_MODE_DEVICE, > ^~~~~~~~~~~~~~~ > In file included from /home/b29397/work/projects/usb/include/linux/usb/ot= g.h:14:0, > from /home/b29397/work/projects/usb/include/linux/phy/om= ap_usb.h:13, > from /home/b29397/work/projects/usb/drivers/phy/ti/phy-o= map-usb2.c:14: > /home/b29397/work/projects/usb/include/linux/usb/phy.h:70:2: note: previo= us definition of =E2=80=98USB_MODE_DEVICE=E2=80=99 was here > USB_MODE_DEVICE, > ^~~~~~~~~~~~~~~ > /home/b29397/work/projects/usb/scripts/Makefile.build:280: recipe for tar= get 'drivers/phy/ti/phy-omap-usb2.o' failed > make[4]: *** [drivers/phy/ti/phy-omap-usb2.o] Error 1 > make[4]: *** Waiting for unfinished jobs.... > CC drivers/pinctrl/qcom/pinctrl-ssbi-gpio.o > CC drivers/regulator/bcm590xx-regulator.o > CC drivers/pinctrl/qcom/pinctrl-spmi-mpp.o > CC drivers/pinctrl/qcom/pinctrl-ssbi-mpp.o > CC drivers/rpmsg/imx_rpmsg.o > CC [M] drivers/rpmsg/rpmsg_core.o > CC drivers/regulator/da9210-regulator.o > CC drivers/gpu/drm/drm_crtc_helper.o > CC drivers/pinctrl/samsung/pinctrl-exynos.o > CC drivers/gpu/drm/drm_dp_helper.o > /home/b29397/work/projects/usb/scripts/Makefile.build:497: recipe for tar= get 'drivers/phy/ti' failed > make[3]: *** [drivers/phy/ti] Error 2 > > -- > > Thanks, > Peter Chen Seems familiar to me, AFAIK we already fixed that in our downstream kernel, will add the fix for v1. Thanks! -- Best regards - Freundliche Gr=C3=BCsse - Meilleures salutations Igor Opaniuk mailto: igor.opaniuk@gmail.com skype: igor.opanyuk +380 (93) 836 40 67 http://ua.linkedin.com/in/iopaniuk