From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 462C8C3F68F for ; Mon, 13 Jan 2020 01:32:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 264E021556 for ; Mon, 13 Jan 2020 01:32:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732869AbgAMBcw (ORCPT ); Sun, 12 Jan 2020 20:32:52 -0500 Received: from mail-sh.amlogic.com ([58.32.228.43]:55777 "EHLO mail-sh.amlogic.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732864AbgAMBcw (ORCPT ); Sun, 12 Jan 2020 20:32:52 -0500 Received: from [10.18.38.198] (10.18.38.198) by mail-sh.amlogic.com (10.18.11.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1591.10; Mon, 13 Jan 2020 09:33:17 +0800 Subject: Re: [PATCH v5 4/6] usb: dwc3: Add Amlogic A1 DWC3 glue To: Martin Blumenstingl CC: Rob Herring , Victor Wan , Jianxin Pan , Neil Armstrong , Stephen Boyd , Kevin Hilman , Michael Turquette , , Yue Wang , Qiufang Dai , , Liang Yang , Jian Hu , Xingyu Chen , Greg Kroah-Hartman , Carlo Caione , , , Jerome Brunet References: <1578634957-54826-1-git-send-email-hanjie.lin@amlogic.com> <1578634957-54826-5-git-send-email-hanjie.lin@amlogic.com> From: Hanjie Lin Message-ID: <092ef08a-120e-4972-2f02-fa9d99aed059@amlogic.com> Date: Mon, 13 Jan 2020 09:33:17 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.3.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.18.38.198] X-ClientProxiedBy: mail-sh.amlogic.com (10.18.11.5) To mail-sh.amlogic.com (10.18.11.5) Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org On 2020/1/12 4:45, Martin Blumenstingl wrote: > Hi Hanjie, > > On Fri, Jan 10, 2020 at 6:43 AM Hanjie Lin wrote: > [...] >> - devm_add_action_or_reset(dev, >> - (void(*)(void *))clk_disable_unprepare, >> - priv->clk); >> + ret = clk_bulk_prepare_enable(priv->drvdata->num_clks, >> + priv->drvdata->clks); > I don't see clk_bulk_disable_unprepare in dwc3_meson_g12a_remove() > please test that the clocks are all disabled (see > /sys/kernel/debug/clk/clk_summary for example) when unloading all USB > related kernel modules > Ok, I will check and fix this if missing here. Thanks, Hanjie >> + >> + if (!priv->drvdata->otg_switch_supported) >> + goto setup_pm_runtime; > my brain doesn't like the goto in this place because this is not an > error condition. I was about to write that > usb_role_switch_unregister() is now skipped even though we're calling > usb_role_switch_register(). > > I want to hear Neil's opinion on this because I got confused while > reading the code again. > my proposal is to move all of this OTG related code from > dwc3_meson_g12a_probe() into a new function, for example called > dwc3_meson_g12a_otg_init() > then only call that function when OTG switching is supported > > > Martin > > _______________________________________________ > linux-amlogic mailing list > linux-amlogic@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-amlogic > > . >