Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp1703412rda; Tue, 24 Oct 2023 00:03:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGUGPQa9MOmoqEuJ5gP1iQ3EGaokladmGmyiLUtpk2sSqx8xfZdRe52eXc0lKkuO8+BIQcD X-Received: by 2002:a17:90a:9f06:b0:27d:a015:a783 with SMTP id n6-20020a17090a9f0600b0027da015a783mr8358967pjp.35.1698130991246; Tue, 24 Oct 2023 00:03:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698130991; cv=none; d=google.com; s=arc-20160816; b=FfjAMVGMazn9H3407D3Tlyak6n8VBHRWaYb37QCVC5Sw3GPjcVuj2rindLpjFBCadV FIRdy9HZyrcBIM9MoOqKJA+eVzDG4qqE3fqx2tP42/JjIqogOhb/OeFL4220ApQQy1Qu LI2wgMbgHP6kY9In72+/MIaBHJWti+Kbrb28VIvAoEmcYx76cuJnp8Nv8FK1J47tX4Qi Upd6a/3QhE72VtRitIQi4Bplw1EQDAsoQWqtDwMQrqRPh/0pXxoUsKGlw3qDFWq+jkyd Iuj5K4ozIDyCGYwks8CxoMBkUxiLEpLzyeESULHcfIgcUIq8BKbw6hynYEkwJ7fTKSYP GWpw== 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=mzUmdx3bzcT7aUfcZJHmtfcEeywMrbeBBsQVEmJDBJg=; fh=6zfQWYT84uMUkZK3d7KMOA01GAZ2SsielBpfOQKQ1Y4=; b=w9jSwert0E0shsYWO1j7R4Dhb4eSQ40Hi5erKZOCXlCNWBjE4L2VaUlRxKj8Hg2ifk +nUcH/hAeywtQ6LWIpVV17NwK6kpDKAnhK349+yXHWAw6aeEWDsHb5EMLXpdFnXJy9cy y4S0GNZBQHhTHh9c+fTCtElocI67t884wP30Lhn22CKYZa/FsT+USFxtCejh+okuHLbV tsG1zkq0qSFGZEjLQWYvTohdnrNxHxT95VFfUY5bLyZOu9uGpxeXhDuhM9DEbVsuK0PH kQ+KM/3bJ+lZiX3SVRqQEG6FEtrwt8ydmn3CkBU9RPMFxJszRZ+v9Q2BUFerQxrwYtTC Ha3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pJPpMnAX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 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 agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id k4-20020a170902d58400b001bc434b9d95si7833315plh.156.2023.10.24.00.03.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Oct 2023 00:03:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pJPpMnAX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id EC5E780AC593; Tue, 24 Oct 2023 00:03:08 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232396AbjJXHCz (ORCPT + 99 others); Tue, 24 Oct 2023 03:02:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57410 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231421AbjJXHCy (ORCPT ); Tue, 24 Oct 2023 03:02:54 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6D68592; Tue, 24 Oct 2023 00:02:52 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F2E37C433C8; Tue, 24 Oct 2023 07:02:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1698130972; bh=+EyzEkEY5OgBH2+OQ61ZdJ9Ly/9FG10TFtNjEehjNsg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=pJPpMnAXVejeJbmmYluzR5PJz6rlNHaLzBN4ufDFZvdwpp/V3H0bT8NtYbNoks4Pv sG8nNxxIZFu358PTCN6c6OfCurLkDSK8AP0SIgTiU3WhpvPoi8swif7Fw3lbb/b0XM X2+WKS7nuApX1oJM1Wx73opQL0FN3M0GPSGA1YkvDOTL8xtsPTb9ZLPksI15tlCiVk Pie6uzcSaEmamahNNKPbvBhDLYokik2RlnVvvHMq1Y96tS93OGHN8rqa2uVECZ/dD6 XA63YyKwtmKW7c/yyhU2Lx+SzxGYkuk90aWVv8nV4YntKec+guahN+0nldoEo/A+EJ B2eo/rWmp0uNg== Received: from johan by xi.lan with local (Exim 4.96) (envelope-from ) id 1qvBRU-0003bz-2A; Tue, 24 Oct 2023 09:03:08 +0200 Date: Tue, 24 Oct 2023 09:03:08 +0200 From: Johan Hovold To: Krishna Kurapati PSSNV Cc: Thinh Nguyen , Greg Kroah-Hartman , Philipp Zabel , Andy Gross , Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Felipe Balbi , Wesley Cheng , 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_jackp@quicinc.com, ahalaney@redhat.com, quic_shazhuss@quicinc.com Subject: Re: [PATCH v13 07/10] usb: dwc3: qcom: Add multiport suspend/resume support for wrapper Message-ID: References: <20231007154806.605-1-quic_kriskura@quicinc.com> <20231007154806.605-8-quic_kriskura@quicinc.com> <73168f4b-0dc2-4060-99f2-c5e9973dbf52@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <73168f4b-0dc2-4060-99f2-c5e9973dbf52@quicinc.com> X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Tue, 24 Oct 2023 00:03:09 -0700 (PDT) On Mon, Oct 23, 2023 at 10:52:38PM +0530, Krishna Kurapati PSSNV wrote: > On 10/23/2023 9:28 PM, Johan Hovold wrote: > > On Sat, Oct 07, 2023 at 09:18:03PM +0530, Krishna Kurapati wrote: > >> -#define PWR_EVNT_IRQ_STAT_REG 0x58 > >> +#define PWR_EVNT_IRQ1_STAT_REG 0x58 > >> +#define PWR_EVNT_IRQ2_STAT_REG 0x1dc > >> +#define PWR_EVNT_IRQ3_STAT_REG 0x228 > >> +#define PWR_EVNT_IRQ4_STAT_REG 0x238 > > > > Not sure these defines makes sense on their own. You now only use them > > via the array below. > > > > I think I already asked you whether these offsets depend on SoC and you > > said no, right? > > > There are only 3 QC SoC's today that support multiport. > The offsets mentioned here are for SC8280 based platforms. > > For Sc8180 based platforms, these are the offsets: > USB3_MP_PWR_EVNT_IRQ_STAT 0xA4F8858 > USB3_MP_PWR_EVNT_IRQ_1_STAT 0xA4F89DC > > These would translate to 0x58 and 0x1DC > > And for SX8380 the values are as follows: > > USB3_MP_PWR_EVNT_IRQ_STAT 0xA4F8858 > USB3_MP_PWR_EVNT_IRQ_1_STAT 0xA4F89DC > > So here also, the offsets are same. 0x58 and 0x1DC. > So these are not SoC specific (atleast looking at the controllers > present). But there is no mathematical pattern to denote this as in the > following form (x + (port_num) * y). So made an array like this. Sounds good. Thanks for confirming. > >> +#define NUM_PWR_EVENT_STAT_REGS 4 > > > > You already have MAX_PORTS, why are you defining a new define that will > > always have to be equal to MAX_PORTS? > > > Do you recommend using the same max_ports ? If so, I can remove this > macro altogether. Indeed, and perhaps also some (compile-time) assert as the driver breaks if they ever get out of sync. Johan