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=-6.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS 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 1AADEC4338F for ; Wed, 25 Aug 2021 12:12:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EC2CF6112D for ; Wed, 25 Aug 2021 12:12:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240592AbhHYMNN (ORCPT ); Wed, 25 Aug 2021 08:13:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:57230 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232681AbhHYMNN (ORCPT ); Wed, 25 Aug 2021 08:13:13 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8450061178; Wed, 25 Aug 2021 12:12:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1629893547; bh=iRrgIZb6x6gSLL+IvnF6y+vPYTBLqazRKlY69EWADXc=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=RoPO65MJ9+AD30txEiQ/xi9V5vRY1bG7766W3m+mgMAVP5iDWTRSJHY1GdVjZ2MRT Gif9RhV+Ggd1cLqrOv7tMB0055pnVA7+eF++tDIeRbL1Ufs3ZblS/JAHzR2GzVwJBb uEK/Uts/a77alru9KwoLmg1JAbhCtx3KR6BmJ2R3xWsB8dPFey8PwY1/Rd8meZmf4o COH6+UDvLm7X6jx6l7UeqDTWgwrn83iZmCv3JrSzaj4K4afvAwBygWZwOxgfduD3lh x/UF835bi0ImxzAOWo5qTqCPBVoSkn9KaHxefr2t7gnLQw2RvLLvX2ceAlQjbmbUII EEf8edjBqFgZQ== Received: by mail-ej1-f52.google.com with SMTP id n27so19120613eja.5; Wed, 25 Aug 2021 05:12:27 -0700 (PDT) X-Gm-Message-State: AOAM531OGhAqZZSSd/bA8/uIIWDwyZP3hIYHM3ELWJEcUknHD81062qV kskP7WdgRB0rntQRMhT/ZzGtS0qVhW4Ngm/tpA== X-Google-Smtp-Source: ABdhPJw1uKoHYgEW5cFrmwc+eFCDKj4S2M5gn7ug/tBjrGQfwSYcqOijKoq2GA1se3Wt3yYEwzzkHUPaGTXZK6PZyyo= X-Received: by 2002:a17:906:ff41:: with SMTP id zo1mr15275941ejb.525.1629893546173; Wed, 25 Aug 2021 05:12:26 -0700 (PDT) MIME-Version: 1.0 References: <20210704013314.200951-1-bryan.odonoghue@linaro.org> <20210707015704.GA28125@nchen> <20210708030631.GA22420@nchen> <87zgt65avm.fsf@kernel.org> In-Reply-To: <87zgt65avm.fsf@kernel.org> From: Rob Herring Date: Wed, 25 Aug 2021 07:12:13 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 0/3] Implement role-switch notifications from dwc3-drd to dwc3-qcom To: Felipe Balbi Cc: Bjorn Andersson , Peter Chen , "Bryan O'Donoghue" , "Gross, Andy" , Greg Kroah-Hartman , Jack Pham , Wesley Cheng , Linux USB List , linux-arm-msm Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org On Wed, Aug 25, 2021 at 12:52 AM Felipe Balbi wrote: > > > Hi, > > Bjorn Andersson writes: > > On Wed 07 Jul 20:06 PDT 2021, Peter Chen wrote: > > > >> On 21-07-07 14:03:19, Bjorn Andersson wrote: > >> > On Tue 06 Jul 20:57 CDT 2021, Peter Chen wrote: > >> > > >> > Allow me to reorder your two questions: > >> > > >> > > And why using a notifier need to concern core's deferral probe? > >> > > >> > The problem at hand calls for the core for somehow invoking > >> > dwc3_qcom_vbus_overrride_enable() with a pointer to dwc3_qcom passed. > >> > > >> > This means that dwc3-qcom somehow needs to inform the dwc3-core about > >> > this (and stash the pointer). And this can't be done until dwc3-core > >> > actually exist, which it won't until dwc3_probe() has completed > >> > successfully (or in particular allocated struct dwc). > >> > >> Maybe you misunderstood the notifier I meant previous, my pointer was > >> calling glue layer API directly. > >> > >> Role switch is from dwc3-core, when it occurs, it means structure dwc3 has > >> allocated successfully, you could call glue layer notifier at function > >> dwc3_usb_role_switch_set directly. > >> Some references of my idea [1] [2] > >> > >> [1] Function ci_hdrc_msm_notify_event at ci_hdrc_msm_notify_event > >> [2] https://source.codeaurora.org/external/imx/linux-imx/tree/drivers/usb/dwc3/core.c?h=lf-5.10.y#n205 > >> > > > > Hi Peter, I took a proper look at this again, hoping to find a way to > > pass a callback pointer from dwc3-qcom to the dwc3 core, that can be > > called from __dwc3_set_mode() to inform the Qualcomm glue about mode > > changes. > > I would rather keep the strict separation between glue and core. On the surface that seems nice, but obviously there are issues with the approach. It's also not how pretty much every other instance of licensed IP blocks are structured. The specific need here seems to be multiple entities needing role switch notifications. Seems like that should be solved in a generic way. Rob