From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2D4414779B3 for ; Fri, 15 May 2026 11:10:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778843454; cv=none; b=lFFRxC4ncmX/meBZJBoLj9L8+BkRYsf1G2WbTgASp8H7h0sl8wlk/Zk4vnUTGEuZxm4IOeIuiFQckoS7KdKyDC7vfrBhYAU2xPAgZXFMHSDSbADVuv8hW9rU/7kO0bxUpxhmJ+2UBVyuE9TNU8b0VAsUlx3NXyupBs7IgCxtPgE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778843454; c=relaxed/simple; bh=a22gACOL+4o9LB9ZYMEhdwcOlUOLQoOvT1cPJ/bW5i8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=QMpeaBfvbLMAD+w8EgDir6vBqj8vGNbIHFUN+kn1wn2CYeNjrnoTOMJn4Ns1lKW9mAbrE+vWA3fLotI7+VDZW87jZC/CIJyPMfkAiXziUvYarqJWc4yEMHl5Xl8gyZd/0NuFgoitWHeIeU3xSWSaMVUT64RzA2gtTEDg5lXf4pA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b=eDagEWBe; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.b="eDagEWBe" Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 6B37C22FC; Fri, 15 May 2026 04:10:44 -0700 (PDT) Received: from e129823.arm.com (e129823.arm.com [10.1.197.6]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 1AA993F85F; Fri, 15 May 2026 04:10:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1778843449; bh=a22gACOL+4o9LB9ZYMEhdwcOlUOLQoOvT1cPJ/bW5i8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=eDagEWBeUxnhn4JedIAUBQZ5fOJdr7ZAYVL4QjdrQM3OtN2tZrn2vEGyBKGO+Oxws RXW1qRglKr5kSy6uWVZrA140Dgj2Mes0d2txNzrF/0xX/U2thFC2jkVb6C8u8CPPf6 nYWrgsgDvcZNoGMu0MA89HnXVZq+/XvpKGJTxErs= Date: Fri, 15 May 2026 12:10:45 +0100 From: Yeoreum Yun To: Leo Yan Cc: coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, suzuki.poulose@arm.com, mike.leach@arm.com, james.clark@linaro.org, alexander.shishkin@linux.intel.com, jie.gan@oss.qualcomm.com Subject: Re: [PATCH v6 02/13] coresight: etm4x: fix underflow for nrseqstate Message-ID: References: <20260422132203.977549-1-yeoreum.yun@arm.com> <20260422132203.977549-3-yeoreum.yun@arm.com> <20260505161905.GA3778514@e132581.arm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260505161905.GA3778514@e132581.arm.com> Hi Leo, > On Wed, Apr 22, 2026 at 02:21:52PM +0100, Yeoreum Yun wrote: > > TCRSEQEVR is implemented only when TCRIDR5.NUMSEQSTATE is 0b100, > > in which case n ranges from 0 to 2; otherwise, TCRIDR5.NUMSEQSTATE is 0b000. > > > > Therefore, drvdata->nrseqstate should be checked before entering the loop. > > Since TRCSEQEVRn (n=0~2), to avoid confusion, we also need to rename > ETM_MAX_SEQ_STATES to ETM_MAX_SEQ_TRANSITIONS and define it as 3: > > #define ETM_MAX_SEQ_TRANSITIONS 3 > > Then we don't allocate 4 items but use only 3 of them. TBH, the number of transition is determinied by the MAX number of SEQ_STATE that's why I think define the ETM_MAX_SEQ_TRANSITIONS with #define ETM_MAX_SEQ_TRANSITIONS (ETM_MAX_SEQ_STATE - 1) and uses ETM_MAX_SEQ_TRANSITIONS for the TCRSEQEVR and seq_ctrl. Thought? -- Sincerely, Yeoreum Yun