Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1795147rwd; Wed, 17 May 2023 01:12:34 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4TvzkV72T0I6t4u1s16b+iyaqMnup5E544zHdha3+SWTwebH9jTVLaLb5CPG3V096Q+kFU X-Received: by 2002:a17:902:ab8f:b0:1ae:f37:c1a8 with SMTP id f15-20020a170902ab8f00b001ae0f37c1a8mr11443295plr.40.1684311153812; Wed, 17 May 2023 01:12:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684311153; cv=none; d=google.com; s=arc-20160816; b=K6udwqSbj/2883bdEFQD3zLrcpA7orplnJyol/2ARuknvYnsPTzzLQ/NftCjKRsTF3 wsXrLgAx3Efm850//QtTOdiOM6rjBei6q0/FSm5N3tTisMVyhB1v5aDIBeVvennP89yj dXqqCrA8JRGLG5qIwnZEEEl+oUrpfUnMa9++AuPZdyJFIPCYojC2WLHnkW9B+SvZV4ih RUS/WGJYkTqY4rlBtCgrBd3Lu6YTyuPETpk67HlEEK9FpkwOZNmx/o4vptRTOaUNskLK lvSE0ytN/TpYlfLmimhuwKUrtHGFfx10twgl2kJdUCoH0jDgANAS9NR9coRJ3HGUXl7r tzCQ== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=aLTv7c4j8vPZj+5r+v6xgdhn3HsAMJgdlmgT80R4ACE=; b=PmPLIx14zCaulv2Qzx49xVDe1LHbskw+EODoD+HmBABjN++6o+4/kXsoxR91tbKyYV v962S2KPgPnkJqepiFbFQP2Z2JqT4zHuiLJrlOOeyAtL89WkYK70HK0jfis2d168Etlf L8oa1G5X/zQrbTugNsNdCczFNHX96h/GW053PCU8odC7L75U7SgjI6F7DBf7TS7W9yJd Hx++oJgNrWYCeE8n4ur+Knh6cTNp/YBbMBl8QpOSRFigFRcWBdh8RubdZWW4e34e6EkI UTp1k8EJ6vz2aq0INzSc/LXiVNS2zGeNK8TH7seZ2xkXf0oo5r6kAtdWfvjeLb8CvE3y ArxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uL3TvCb7; 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 c19-20020a637253000000b0052c81b183a8si21016976pgn.385.2023.05.17.01.12.19; Wed, 17 May 2023 01:12:33 -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=uL3TvCb7; 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 S229645AbjEQHrH (ORCPT + 99 others); Wed, 17 May 2023 03:47:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43584 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230191AbjEQHrE (ORCPT ); Wed, 17 May 2023 03:47:04 -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 D90E5E0; Wed, 17 May 2023 00:47:00 -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 62898642FE; Wed, 17 May 2023 07:47:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BBC3EC433D2; Wed, 17 May 2023 07:46:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1684309619; bh=CrxLp3AHsiBT9omthbkFjUwyEAb+XuvYsglQMZaTHkY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=uL3TvCb7G2N4leJalPW+7SzBmp1qVn99MQN5zxSIWe4LmXtJdanQVSCI/6Vitmffi ezyE354obh8cYYNa1vEWEwJHOlp4asZGRgjCE6ppSk2UigLVS08SixnjVFlC0KqJSa Rreu/9K2T+TGcxrKhjqvPs1ou8dVyLichSKDofJJ+lg2XNMb3+5cwtNfTzmpMBCOIO O7zdkbPBNfMefF1SbkMUnzJS7edRwMQoGqSrwr0f/u3Dj+Bsf7FLyUkNZrKjll6z4Z sSbG91TR1AM5NFNba8qAAxkKBLig+MTLWbrx9JYVQ58VkqHxTRSniHIWVh5Ua75q35 e0943MYgcIFww== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1pzBsB-0002UC-7q; Wed, 17 May 2023 09:46:59 +0200 Date: Wed, 17 May 2023 09:46:59 +0200 From: Johan Hovold To: Thinh Nguyen Cc: Krishna Kurapati PSSNV , Greg Kroah-Hartman , Philipp Zabel , Andy Gross , Bjorn Andersson , 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 3/9] usb: dwc3: core: Access XHCI address space temporarily to read port info Message-ID: References: <20230514054917.21318-1-quic_kriskura@quicinc.com> <20230514054917.21318-4-quic_kriskura@quicinc.com> <20230517032124.rdh7ehnair3wjuvm@synopsys.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230517032124.rdh7ehnair3wjuvm@synopsys.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 Wed, May 17, 2023 at 03:21:24AM +0000, Thinh Nguyen wrote: > On Wed, May 17, 2023, Krishna Kurapati PSSNV wrote: > > On 5/16/2023 8:32 PM, Krishna Kurapati PSSNV wrote: > > > On 5/16/2023 5:41 PM, Johan Hovold wrote: > > > > You should not make another copy of xhci_find_next_ext_cap(), but rather > > > > use it directly. > > > > > > > > We already have drivers outside of usb/host using this function so it > > > > should be fine to do the same for now: > > > > > > > >     #include "../host/xhci-ext-caps.h" > > >   This was the approach which we followed when we first introduced the > > > patch [1]. But Thinh suggested to duplicate code so that we can avoid > > > any dependency on xhci (which seems to be right). So since its just one > > > function, I duplicated it here. > > Would like to know your opinion here on how to proceed further. > Please keep them separated. The xhci-ext-caps.h is for xhci driver only. > It's not meant to be exposed to other drivers. Same with other *.h files > under drivers/usb/host. As I mentioned earlier, it is already used by the xdbc earlyprintk driver which lives outside of drivers/usb/host, even if such a debug driver could be considered a special case. If it turns out that there's no way to avoid mapping those registers from the qcom glue driver, then I think at least the register defines need to be provided in a global header rather than being copied verbatim. But hopefully that can be avoided too as the xhci driver already parses these registers and stores the port information, even if accessing that data may require a bit more work currently. Johan