Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp2895726pxb; Tue, 24 Aug 2021 10:04:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxhh9Fge44ET6rpwMymI4DJfI94Io+CnZvdM+DTrZVp7SZC/PAGktxoT1iocv/6McdLwRe+ X-Received: by 2002:a2e:9c08:: with SMTP id s8mr32447668lji.331.1629824686769; Tue, 24 Aug 2021 10:04:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629824686; cv=none; d=google.com; s=arc-20160816; b=L0t6ZInsvagdtYdI+bMKFlkTXcYt7KGZnW31yDp3LFar+IQ5cO/KGxF0VRbXajHJsO b3RhTzLoI0eWXjweyq6Y6LSWEAyd8arrxElK+POH5BJyw4uABmVuzV3TYyJrs3s2tEKa oEbct6a7uZUMG1tMuJu0mFeN+wZN961/5jwsoWU9PuMFC43Gs98a22WpkTxiDiIW2jrF LJhPtbx7FYFL6yJ603fKakP8PRGuHBdIlMP6Wa4OQO+YD/u1z094Qs7cOMrmtDNZN/XQ a0KpPPhR63RPytqjeHPtv0NTdumit4OiFcNepkaX02NR0AyCBNgT0owlWLDiqBW9rUTM PiMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=8dpF2HnZYODQ4PRl7C+/aMRkdMciZe8zqxI3JhOlyJQ=; b=zRXQgf4coRfMApvFixhhv6uRGX9SU5rXz9HDgqgdp33ccfRBafU61AxuDuD/D5LC+/ jZ8cgdTn/pIQGY7XTDFYhxHTOSvGqkV3U0xv09yreeI4wJKJUrIqUYiKRb+T4MLIasRm sj7HAaY96OYs6U4wf3ilzAFmBgKT58M6/8jgt13NV68tNXlxE1ZNfBwX5oCzVpC3qv2t m45G7U9Vfcw7kqa/Per9Zbsc6Si0mAqrZLsqxyeUAi8r/1bF8HFTHps/NDlNoxnpwliR h+YP43tmBKkwwUG4sItQkkhOiH8koaj/2hRpBhP5ois2a0NdDT1bugwd0jZOLMEzDac+ ZRKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=emInxPET; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q12si9661779edw.452.2021.08.24.10.04.23; Tue, 24 Aug 2021 10:04:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=emInxPET; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S230472AbhHXRDW (ORCPT + 99 others); Tue, 24 Aug 2021 13:03:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:39584 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239175AbhHXQ76 (ORCPT ); Tue, 24 Aug 2021 12:59:58 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C1BA7615A3; Tue, 24 Aug 2021 16:57:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1629824263; bh=DfhTGNP3AfyA7aPRyDsJ5vap6bZ3mZkVRYrxpiSjWsk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=emInxPETh5GKdLFz4uSIY8fguBsEx9WaUK0ymFPzkVx12idtoB+F1OukHTBFTRhOa 6onv/Hfi9fTPazyTl5hx4fyjy9YaiY7BU8RsRkcfOwCsFQrGAnLp9uaNThYpCsNg3C u+HkEnRRENJh7sVrP9uT+QFnGNUcKkeVHb3ORkCuGmtrO8iyp9Pim5h/Z9hoTSRhK/ VIMa+h0GnkF6kl81i5BFbZ8A18/A/5TRnzNSlArcH7MOtA6MDpZY+f2qx2FQbSH/+R OYehQZRl7/k0Q1Blxv8ZYbokio8KBy2XIJajvTtGai6d4lHzR/0hZULslf+pWbKWOZ QHLDVx6+7+V9g== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Srinivas Kandagatla , Greg Kroah-Hartman , Sasha Levin Subject: [PATCH 5.13 096/127] slimbus: messaging: start transaction ids from 1 instead of zero Date: Tue, 24 Aug 2021 12:55:36 -0400 Message-Id: <20210824165607.709387-97-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210824165607.709387-1-sashal@kernel.org> References: <20210824165607.709387-1-sashal@kernel.org> MIME-Version: 1.0 X-KernelTest-Patch: http://kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.13.13-rc1.gz X-KernelTest-Tree: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git X-KernelTest-Branch: linux-5.13.y X-KernelTest-Patches: git://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git X-KernelTest-Version: 5.13.13-rc1 X-KernelTest-Deadline: 2021-08-26T16:55+00:00 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Srinivas Kandagatla [ Upstream commit 9659281ce78de0f15a4aa124da8f7450b1399c09 ] As tid is unsigned its hard to figure out if the tid is valid or invalid. So Start the transaction ids from 1 instead of zero so that we could differentiate between a valid tid and invalid tids This is useful in cases where controller would add a tid for controller specific transfers. Fixes: d3062a210930 ("slimbus: messaging: add slim_alloc/free_txn_tid()") Cc: Signed-off-by: Srinivas Kandagatla Link: https://lore.kernel.org/r/20210809082428.11236-2-srinivas.kandagatla@linaro.org Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/slimbus/messaging.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/slimbus/messaging.c b/drivers/slimbus/messaging.c index f2b5d347d227..6097ddc43a35 100644 --- a/drivers/slimbus/messaging.c +++ b/drivers/slimbus/messaging.c @@ -66,7 +66,7 @@ int slim_alloc_txn_tid(struct slim_controller *ctrl, struct slim_msg_txn *txn) int ret = 0; spin_lock_irqsave(&ctrl->txn_lock, flags); - ret = idr_alloc_cyclic(&ctrl->tid_idr, txn, 0, + ret = idr_alloc_cyclic(&ctrl->tid_idr, txn, 1, SLIM_MAX_TIDS, GFP_ATOMIC); if (ret < 0) { spin_unlock_irqrestore(&ctrl->txn_lock, flags); -- 2.30.2