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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1357CC87FDC for ; Thu, 8 Jun 2023 09:44:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235548AbjFHJo3 (ORCPT ); Thu, 8 Jun 2023 05:44:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46112 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236040AbjFHJoS (ORCPT ); Thu, 8 Jun 2023 05:44:18 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8AD8526AD; Thu, 8 Jun 2023 02:44:17 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 2680E64B77; Thu, 8 Jun 2023 09:44:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 62952C433A0; Thu, 8 Jun 2023 09:44:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1686217456; bh=W7NMjnc+dhnyCpFKHFIFOZFZb+gFDdZ2hqitOzaHHOk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=lBH/Tmj3yorBORdNglBBZ/bMCSZSK5Fiizq28MFW46kQkRnV7aFFhLC7dr4NO4qmy WteUZnAwJ+d0dBDMKxrgMHwkn2LbKqZoK/xxmTTmmgubNbaTPmGP8bV4Bbb43ijNwv +bcUBa3mjoZwJCZj0I3o9phmkYDziB1geI7hx4Mvk3+8P3X8Ew7l1srMOSVSaxfPU+ 9M1M+M0Lq3zCOi7lf4ELj7dmHjdz8wznwzNLpUw9pW2anlA/SOTxueAxGUPVYwpS+p TD3JJYqsAgXoWlhEqGNsYqzvlf/qVoZ8WggQmOetbn1gdhDMfbHhUR4nOYcCUcKUMi dXppHBOqJebfQ== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1q7CC9-0004Ad-Fq; Thu, 08 Jun 2023 11:44:41 +0200 Date: Thu, 8 Jun 2023 11:44:41 +0200 From: Johan Hovold To: Krishna Kurapati PSSNV Cc: Bjorn Andersson , Thinh Nguyen , Greg Kroah-Hartman , Philipp Zabel , Andy Gross , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Felipe Balbi , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, quic_pkondeti@quicinc.com, quic_ppratap@quicinc.com, quic_wcheng@quicinc.com, quic_jackp@quicinc.com, quic_harshq@quicinc.com, ahalaney@redhat.com Subject: Re: [PATCH v8 6/9] usb: dwc3: qcom: Add multiport controller support for qcom wrapper Message-ID: References: <20230514054917.21318-1-quic_kriskura@quicinc.com> <20230514054917.21318-7-quic_kriskura@quicinc.com> <20230515222730.7snn2i33gkg6ctd2@ripper> <20230526025554.ni527gsr2bqxadl3@ripper> <37fd026e-ecb1-3584-19f3-f8c1e5a9d20a@quicinc.com> <3010d855-86b0-f87a-5eb7-85204be9b4b0@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3010d855-86b0-f87a-5eb7-85204be9b4b0@quicinc.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 08, 2023 at 01:25:25AM +0530, Krishna Kurapati PSSNV wrote: > On 6/7/2023 5:14 PM, Johan Hovold wrote: > > On Fri, May 26, 2023 at 08:55:22PM +0530, Krishna Kurapati PSSNV wrote: > >> On 5/26/2023 8:25 AM, Bjorn Andersson wrote: > > > >>> We need to fix the dwc3 glue design, so that the glue and the core can > >>> cooperate - and we have a few other use cases where this is needed (e.g. > >>> usb_role_switch propagation to the glue code). > > > >> Thanks for the comments on this patch. I had some suggestions come in > >> from the team internally: > >> > >> 1. To use the notifier call available in drivers/usb/core/notify.c and > >> make sure that host mode is enabled. That way we can access dwc or xhci > >> without any issue. > > > > I don't think this is a good idea and instead the callbacks should be > > dedicated for the xhci and dwc3 drivers. A struct with callbacks can be > > passed down to the child devices, which call back into the drivers of > > their parents for notifications and when they need services from them > > (e.g. during suspend or on role changes). > While I agree with you that these notifications are to be used during > role switch or suspend/resume, there is no restriction on using them for > checking whether we are in host mode or not. IMO, it would be cleaner as > we won't be dereferencing dwc driver data at all to check if we are in > host mode or not. I'm not sure I understand what you're saying here. Could you try to rephrase it? Johan