Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751910AbdGaKdh (ORCPT ); Mon, 31 Jul 2017 06:33:37 -0400 Received: from mail-he1eur01on0125.outbound.protection.outlook.com ([104.47.0.125]:21184 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751007AbdGaKdd (ORCPT ); Mon, 31 Jul 2017 06:33:33 -0400 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=peda@axentia.se; Subject: Re: [PATCH v2 2/3] usb: chipidea: Hook into mux framework to toggle usb switch To: Stephen Boyd , Peter Chen Cc: linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.infradead.org, Rob Herring , Rob Clark , Andy Gross , Greg Kroah-Hartman , devicetree@vger.kernel.org References: <20170714214005.14967-1-stephen.boyd@linaro.org> <20170714214005.14967-3-stephen.boyd@linaro.org> From: Peter Rosin Organization: Axentia Technologies AB Message-ID: <7080030c-c9c2-657d-aad4-aef636438cb1@axentia.se> Date: Mon, 31 Jul 2017 12:33:22 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <20170714214005.14967-3-stephen.boyd@linaro.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [81.224.168.30] X-ClientProxiedBy: AM5PR0102CA0030.eurprd01.prod.exchangelabs.com (2603:10a6:206::43) To HE1PR0202MB2554.eurprd02.prod.outlook.com (2603:10a6:3:90::7) X-MS-Office365-Filtering-Correlation-Id: 8b67f33f-a66d-49ac-9488-08d4d7ff94b1 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(2017082002075)(300000503095)(300135400095)(201703131423075)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:HE1PR0202MB2554; X-Microsoft-Exchange-Diagnostics: 1;HE1PR0202MB2554;3:hMvtdU4rzjOqBTCc6vSvBVKT97d5ikqDnL11Ougi7i1Zs977IywuQFBUiwik4m+yt870lYNSrtuPHbomwO3bfNCAbUn1GCBdlvKKswkO0plo0hEaZnf2sdE02JpLFQtQ881vJENmDsDzhFDiy64GZfQmr/pPuTBY9BLDlUIEZcIoQ6ANC/FU2v7XMO/rwlNaJVvapOmuIqREolJRCckWufsh5n8IZTaclqbULQrGxuk8PKQnJLTJ+4HGmGfZS7dvJxaN0XuGXMj8XdbCEM+SRV8Jkjo3eDcXdfL9rk/bD8uw4MFT3hMYhTUGEaKwvSjFaDxDoGSPhukYJFKExNze/sxHqPYvNGJ1hXTAeXl/udWO0fU/ANJdA0VYLWBwECjHCMVcFYhpoPweInNTewDn1mLTxClVY9PfQ+dteQbSrzt4b97PIhZP1POkW0BNwBM90ycco4PKlSQvR+fDpQscbZnDKUd21t1hKEwTffEu/uNaNValJpdD5ze07R1kpaxiJvvl+JSwjdYgltTIH0qo3z8oFLwXHGqKfRr5dOZtE77BXRUCiPGO2dGxN/HEIdvAm+LPIUr6ZD+KajlHccppjB9LibWXXZpMgdoM4IBu6C8karYheg+IyKv42ghGVDZ0LdTdXv1g8qIrIe95rjd8kHBk3AvFCaNakTLqdg0XPQcFWq9rMi8Iy0MNKBju64hwL6LEoAWOFmYXuJNmIMUI+W8YsFWRItNej5RL+6qiIbyxbb+SipV7zA5KEq9OjD+QGLr7thevzJN5kQeXHgfcMAsUEVCaX9wT0HaG2101CCo= X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: HE1PR0202MB2554: X-Microsoft-Exchange-Diagnostics: 1;HE1PR0202MB2554;25:NT1Ny88b/vLpUVZEEYL0JSdAP5K6lqn02NBJU2jymiJdCev8e8BSwHsdyoJ90OU6yXtbcs81wnqKXyxVQmSfQcNtMUCG27VLD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0C+/QR5g3gNVaH1dATaYeBKQ/+1UQUFas52zE8NvPEdiaxcI6cxgA2C+/Mib9exPSRdeDgFCycEFWfbuldoI3lv4MS3rypH3UPpVRb505q9WsUHQi70TeR1P/cWSQTFEq6Q9WiwgIL/GKGGBKEnCEPV7fP1NEjIPKW/kof8zkZuydX9+ZsByYTNXW6n34F2vJPmPtnQy2REQaxqATPCMBQlMTU0qOFtSgctzmvJ3O6zYowO001Im79Jeyfp4xEtkfaz9DwZg+LJxHGwtmALG/prUeIrFISya1zfsJQ3lg6Zh4Sh+1F0XzyXjY6ql1dIVDVvvcm8pdrEfI6+KI/8D33YKFqdllcSxWGkmSTZIqbRrNaP98WUpf8r0Q1jhq69NWuVU+TGxL/wiKadIPeeANDzKEXd4vgfFwXBvWtzN4RfxCnALj7+04nre0F0Ci3KsXupa7djbEF4eBgc7kfhGpGLhUO8NLbHoc4l3nPi9e+1FM/Kd8uc2cJvXzXZhy X-Exchange-Antispam-Report-Test: UriScan:(166708455590820)(9452136761055)(185117386973197); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(100000703101)(100105400095)(93006095)(93001095)(10201501046)(3002001)(6041248)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123562025)(2016111802025)(20161123560025)(20161123555025)(6043046)(6072148)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:HE1PR0202MB2554;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:HE1PR0202MB2554; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtIRTFQUjAyMDJNQjI1NTQ7NDpaVDVPbnUyWElHeHpZYXpsSFJ4NHByb0xa?= =?utf-8?B?T3UzTWRJbjZvc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39830400002)(39450400003)(39410400002)(39400400002)(189002)(24454002)(377424004)(199003)(38730400002)(6246003)(6666003)(105586002)(106356001)(68736007)(230700001)(31686004)(4001350100001)(2950100002)(65956001)(66066001)(42186005)(65806001)(575784001)(86362001)(229853002)(23676002)(189998001)(31696002)(966005)(6116002)(3846002)(81166006)(83506001)(33646002)(8676002)(6306002)(305945005)(7416002)(101416001)(478600001)(50986999)(53936002)(54356999)(76176999)(5660300001)(97736004)(65826007)(36756003)(64126003)(53546010)(4326008)(7736002)(54906002)(50466002)(2906002)(25786009)(81156014)(117156002)(77096006)(6486002)(47776003)(74482002)(7350300001)(3260700006)(8656003)(42262002);DIR:OUT;SFP:1102;SCL:1;SRVR:HE1PR0202MB2554;H:[192.168.13.3];FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtIRTFQUjAyMDJNQjI1NTQ7MjM6TXFOeWJTcm1taDdGSlZTN3VmOTRZbmdZ?= =?utf-8?B?c29GeGxLTUJ6TmxHcTZkaEVoamxkU1lDNXF6dVdYVFp1a1pjOXdGaDByMXdF?= =?utf-8?B?NVhUYnp2TmZxbHV2cFcyQU1FeWNKOEFJbEM0ajVid01XeGI3d05saWRyRUdk?= =?utf-8?B?VnRSekREdnVEZG1UTUIrMUJzTm5OazlkUGhxSVdPTktzZjVHU1B2VlU1MGI1?= =?utf-8?B?eXFwNTNMaXN0aTE1WS90UkoxRUVPc0JnQ0RDV1FsUDNhbWJ3dGRlNUxmeHFa?= =?utf-8?B?NkhqNUMybHNNTXhQb0U1Tkw0TEpXajR2cHU4ZVA2L1JuTGdCRjNjWi9UYjRC?= =?utf-8?B?aWdwT1ArZGlFbzFmSXhlQmNmMkc2UWFKNXFsOXlSTUtqdkxtcVhhU1VFMjRo?= =?utf-8?B?M3lLdUJjU09vZ01zWTNxOTFWQXZJcDRNYllCbnViajRUYlRrd25jZzdLWXhy?= =?utf-8?B?Rk9HZXVoMm1Xait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.se X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jul 2017 10:33:25.9568 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0202MB2554 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 7808 Lines: 202 On 2017-07-14 23:40, Stephen Boyd wrote: > On the db410c 96boards platform we have a TC7USB40MU on the board > to mux the D+/D- lines coming from the controller between a micro > usb "device" port and a USB hub for "host" roles[1]. During a > role switch, we need to toggle this mux to forward the D+/D- > lines to either the port or the hub. Add the necessary code to do > the role switch in chipidea core via the generic mux framework. > Board configurations like on db410c are expected to change roles > via the sysfs API described in > Documentation/ABI/testing/sysfs-platform-chipidea-usb2. > > [1] https://github.com/96boards/documentation/raw/master/ConsumerEdition/DragonBoard-410c/HardwareDocs/Schematics_DragonBoard.pdf > > Cc: Peter Rosin > Cc: Peter Chen > Cc: Greg Kroah-Hartman > Cc: > Signed-off-by: Stephen Boyd > --- > Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt | 6 ++++++ > drivers/usb/chipidea/Kconfig | 1 + > drivers/usb/chipidea/core.c | 5 +++++ > drivers/usb/chipidea/host.c | 7 +++++++ > drivers/usb/chipidea/udc.c | 13 ++++++++++++- > include/linux/usb/chipidea.h | 2 ++ > 6 files changed, 33 insertions(+), 1 deletion(-) > > diff --git a/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt b/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt > index 0e03344e2e8b..2e9318151df7 100644 > --- a/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt > +++ b/Documentation/devicetree/bindings/usb/ci-hdrc-usb2.txt > @@ -76,6 +76,10 @@ Optional properties: > needs to make sure it does not send more than 90% > maximum_periodic_data_per_frame. The use case is multiple transactions, but > less frame rate. > +- mux-controls: The mux control for toggling host/device output of this > + controller. It's expected that a mux state of 0 indicates device mode and a > + mux state of 1 indicates host mode. > +- mux-control-names: Shall be "usb_switch" if mux-controls is specified. > > i.mx specific properties > - fsl,usbmisc: phandler of non-core register device, with one > @@ -102,4 +106,6 @@ Example: > rx-burst-size-dword = <0x10>; > extcon = <0>, <&usb_id>; > phy-clkgate-delay-us = <400>; > + mux-controls = <&usb_switch>; > + mux-control-names = "usb_switch"; > }; > diff --git a/drivers/usb/chipidea/Kconfig b/drivers/usb/chipidea/Kconfig > index 51f4157bbecf..3798e0e69d57 100644 > --- a/drivers/usb/chipidea/Kconfig > +++ b/drivers/usb/chipidea/Kconfig > @@ -3,6 +3,7 @@ config USB_CHIPIDEA > depends on ((USB_EHCI_HCD && USB_GADGET) || (USB_EHCI_HCD && !USB_GADGET) || (!USB_EHCI_HCD && USB_GADGET)) && HAS_DMA > select EXTCON > select RESET_CONTROLLER > + select MULTIPLEXER > help > Say Y here if your system has a dual role high speed USB > controller based on ChipIdea silicon IP. It supports: > diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c > index b17ed3a9a304..d088c262ebb8 100644 > --- a/drivers/usb/chipidea/core.c > +++ b/drivers/usb/chipidea/core.c > @@ -64,6 +64,7 @@ > #include > #include > #include > +#include > > #include "ci.h" > #include "udc.h" > @@ -690,6 +691,10 @@ static int ci_get_platdata(struct device *dev, > if (of_find_property(dev->of_node, "non-zero-ttctrl-ttha", NULL)) > platdata->flags |= CI_HDRC_SET_NON_ZERO_TTHA; > > + platdata->usb_switch = devm_mux_control_get_optional(dev, "usb_switch"); > + if (IS_ERR(platdata->usb_switch)) > + return PTR_ERR(platdata->usb_switch); > + > ext_id = ERR_PTR(-ENODEV); > ext_vbus = ERR_PTR(-ENODEV); > if (of_property_read_bool(dev->of_node, "extcon")) { > diff --git a/drivers/usb/chipidea/host.c b/drivers/usb/chipidea/host.c > index 18cb8e46262d..9ef3ecf27ad3 100644 > --- a/drivers/usb/chipidea/host.c > +++ b/drivers/usb/chipidea/host.c > @@ -25,6 +25,7 @@ > #include > #include > #include > +#include > > #include "../host/ehci.h" > > @@ -175,6 +176,10 @@ static int host_start(struct ci_hdrc *ci) > if (ci_otg_is_fsm_mode(ci)) { > otg->host = &hcd->self; > hcd->self.otg_port = 1; > + } else { > + ret = mux_control_select(ci->platdata->usb_switch, 1); > + if (ret) > + goto disable_reg; > } > } > > @@ -195,6 +200,8 @@ static void host_stop(struct ci_hdrc *ci) > struct usb_hcd *hcd = ci->hcd; > > if (hcd) { > + if (!ci_otg_is_fsm_mode(ci)) > + mux_control_deselect(ci->platdata->usb_switch); > if (ci->platdata->notify_event) > ci->platdata->notify_event(ci, > CI_HDRC_CONTROLLER_STOPPED_EVENT); > diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c > index d68b125796f9..deb18099e168 100644 > --- a/drivers/usb/chipidea/udc.c > +++ b/drivers/usb/chipidea/udc.c > @@ -22,6 +22,7 @@ > #include > #include > #include > +#include > > #include "ci.h" > #include "udc.h" > @@ -1964,16 +1965,26 @@ void ci_hdrc_gadget_destroy(struct ci_hdrc *ci) > > static int udc_id_switch_for_device(struct ci_hdrc *ci) > { > + int ret = 0; > + > if (ci->is_otg) > /* Clear and enable BSV irq */ > hw_write_otgsc(ci, OTGSC_BSVIS | OTGSC_BSVIE, > OTGSC_BSVIS | OTGSC_BSVIE); > > - return 0; > + if (!ci_otg_is_fsm_mode(ci)) > + ret = mux_control_select(ci->platdata->usb_switch, 0); > + > + if (ci->is_otg && ret) > + hw_write_otgsc(ci, OTGSC_BSVIE | OTGSC_BSVIS, OTGSC_BSVIS); > + > + return ret; > } > > static void udc_id_switch_for_host(struct ci_hdrc *ci) > { > + mux_control_deselect(ci->platdata->usb_switch); > + This looks broken. You conditionally lock the mux and you unconditionally unlock it. Quoting the mux_control_deselect doc: * It is required that a single call is made to mux_control_deselect() for * each and every successful call made to either of mux_control_select() or * mux_control_try_select(). Think of the mux as a semaphore with a max count of one. If you lock it, you have to unlock it when you're done. If you didn't lock it, you have zero business unlocking it. If you try to lock it but fail, you also have no business unlocking it. Just like a semaphore. Another point: I do not know if udc_id_switch_for_host is *only* called when there has been a prior call to udc_id_switch_for_device that succeeded or how this works exactly. But this all looks fragile. Using mux_control_select and mux_control_deselect *must* be done in pairs. If you want a mux to be locked for "a while", such as in this case, you have to make sure you stay within the rules. There is no room for half measures, or you will likely cause a deadlock when something unexpected happens. Cheers, Peter > /* > * host doesn't care B_SESSION_VALID event > * so clear and disbale BSV irq > diff --git a/include/linux/usb/chipidea.h b/include/linux/usb/chipidea.h > index c5fdfcf99828..3b27e333de1d 100644 > --- a/include/linux/usb/chipidea.h > +++ b/include/linux/usb/chipidea.h > @@ -9,6 +9,7 @@ > #include > > struct ci_hdrc; > +struct mux_control; > > /** > * struct ci_hdrc_cable - structure for external connector cable state tracking > @@ -74,6 +75,7 @@ struct ci_hdrc_platform_data { > /* VBUS and ID signal state tracking, using extcon framework */ > struct ci_hdrc_cable vbus_extcon; > struct ci_hdrc_cable id_extcon; > + struct mux_control *usb_switch; > u32 phy_clkgate_delay_us; > }; > >