Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2618892rwd; Mon, 15 May 2023 14:26:44 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5B8v86TqqcB+PptU/CgABXRQoq6FCRrTuugGSls37psSEFVM6TDOCpozh095YVR03ourUn X-Received: by 2002:a05:6a20:9f90:b0:f0:6567:92ba with SMTP id mm16-20020a056a209f9000b000f0656792bamr34320224pzb.58.1684186004049; Mon, 15 May 2023 14:26:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684186004; cv=none; d=google.com; s=arc-20160816; b=G/uNvwbGFtFumc5vVeMB21gIq8kNECRg0Fw891z1+4Cc0HvW6/YCodfpURA42+/I+E g5z8gdQGngtTfkAZ9VdYJQQGxJVoi4F+UJm+Zc7QJ3wZYEblEC3MHgzH+iydIWi2zyX/ AW1/4kOaooMetWUIV4eX869/IEMjQK0FewsBCXEtinEu6/z0TJg8lcLnkaC51gVM+qvE TlscDiubQR1kKZcGy0sI9/rXcRbCgDSvPLdoq55i9bf3ACi829qJpHtk6cv7akwIsdlc d+XfHq/6myRxCOVtb5KRztorQc5aIhTXS2pg/iGfMnPjHFCOCWWmCR2sfYwbz3zwHrCn 3nGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=lLYcWF3g0AhEnmTvTwVN9qbSVpyELzroQFUDVQgVg+o=; b=WApDIQDZ1u0fRVNLgXRLujplrA8Sp7IwPktiEIL847VobQT509RTcjjE6La5CJuLoA HVZ1rOy9alKfZTv1Zi0YFwDwED3CmkYb+MEF9DTS1u7mTep3Yks7yYI8tBYEDBD21jwg V7kbKBguSNvLn2v8sBG550baDcNLfx7sFeR2fqHssaO0XBfv8W32R9dFqeH7PMeFxhaS HDq9WwAjm5lCk1u0RdvGnmlpIiXvzJzNFu8GywR+FdD/JF1mjwk1UXjPqPPwBIdchVYy NSAl0VlB1imfa9/zJkc6uU0nsM9S/hb4X1mZpmYV18WFK/YEpx3HZekbUk0ZO/8IDOWw d8Zg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=H3zjzNo6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v71-20020a63894a000000b0052d389c3ca7si17174325pgd.52.2023.05.15.14.26.31; Mon, 15 May 2023 14:26:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=H3zjzNo6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245460AbjEOVPk (ORCPT + 99 others); Mon, 15 May 2023 17:15:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45766 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245308AbjEOVPi (ORCPT ); Mon, 15 May 2023 17:15:38 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 50AD8A27C; Mon, 15 May 2023 14:15:37 -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 D96A6621BA; Mon, 15 May 2023 21:15:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F193FC433EF; Mon, 15 May 2023 21:15:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1684185336; bh=enJwNWaLT/meCbucP4lqULVPUm7Z2anbwiRCF5jSvnM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=H3zjzNo6kWA6B9UFM9EqS17kkmQTU5sYbi9N6m1jY7ALNqKsyxrcVmkMM9xGvwNdW 8t9TDkZDXpLshYYxrnACwUAqmfzaqSWi6xOGE///W8CnbmsoIconzPKo1uMAeMdn0a RM9P44Tr0g3plnCh8jE4vclyEnauJ34MkGPeVtlz9M1NU0KSRGk0BkjQ3tm2KdEMua XDKqoRao70IL3M2fbp6ldjniomCdKteN79SiTDM3dIlbkbTTkmppbNrriSXL5Hm7hr qUyIu9NbpHHZTrIim5JxeKGtVZ86Lh0sgA68Sjc5NOJRa3klD7F6wYyPC3A+4wmcVG xTzyYGSrtyoNg== Date: Mon, 15 May 2023 14:19:27 -0700 From: Bjorn Andersson To: Krishna Kurapati Cc: 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 4/9] usb: dwc3: core: Skip setting event buffers for host only controllers Message-ID: <20230515211927.bcartfqerpcgmp5w@ripper> References: <20230514054917.21318-1-quic_kriskura@quicinc.com> <20230514054917.21318-5-quic_kriskura@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230514054917.21318-5-quic_kriskura@quicinc.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, May 14, 2023 at 11:19:12AM +0530, Krishna Kurapati wrote: > On some SoC's like SA8295P where the tertiary controller is host-only Please add "Qualcomm" before SA8295P. > capable, GEVTADDRHI/LO, GEVTSIZ, GEVTCOUNT registers are not accessible. > Trying to setup them up during core_init leads to a crash. s/setup/access/ (or "write to"?) and presumably this is a problem beyond core_init, so I would suggest dropping "up during core_init" from the sentence. > > For DRD/Peripheral supported controllers, event buffer setup is done > again in gadget_pullup. Skip setup or cleanup of event buffers if > controller is host-only capable. > With that, this looks reasonable to me. Reviewed-by: Bjorn Andersson Regards, Bjorn > Signed-off-by: Krishna Kurapati > --- > drivers/usb/dwc3/core.c | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c > index e983aef1fb93..46192d08d1b6 100644 > --- a/drivers/usb/dwc3/core.c > +++ b/drivers/usb/dwc3/core.c > @@ -505,6 +505,11 @@ static int dwc3_alloc_event_buffers(struct dwc3 *dwc, unsigned int length) > int dwc3_event_buffers_setup(struct dwc3 *dwc) > { > struct dwc3_event_buffer *evt; > + unsigned int hw_mode; > + > + hw_mode = DWC3_GHWPARAMS0_MODE(dwc->hwparams.hwparams0); > + if (hw_mode == DWC3_GHWPARAMS0_MODE_HOST) > + return 0; > > evt = dwc->ev_buf; > evt->lpos = 0; > @@ -522,6 +527,11 @@ int dwc3_event_buffers_setup(struct dwc3 *dwc) > void dwc3_event_buffers_cleanup(struct dwc3 *dwc) > { > struct dwc3_event_buffer *evt; > + unsigned int hw_mode; > + > + hw_mode = DWC3_GHWPARAMS0_MODE(dwc->hwparams.hwparams0); > + if (hw_mode == DWC3_GHWPARAMS0_MODE_HOST) > + return; > > evt = dwc->ev_buf; > > -- > 2.40.0 >