Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp2907584pxb; Tue, 24 Aug 2021 10:20:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx63mJyajKfV3vIjuHQfwmrh0PYQ1AaylElKtt188S7CP5zio0qo9s1hqXgkZDG6W1or7f4 X-Received: by 2002:a17:907:217a:: with SMTP id rl26mr42494844ejb.9.1629825610779; Tue, 24 Aug 2021 10:20:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629825610; cv=none; d=google.com; s=arc-20160816; b=FBfFBwDGuH8/r4EONT+8PVdF5MAcObPfSi/8wy7DPy5FHhszaqgisgKNKZ00JwRm4B cgZ6BK9bLdCXYyan8LDGKMIco5rugO8ijHwHMXlipQN4BDb5BTYL/VcUjEpZVkwszuP2 bneQYzP0tbTr2FlZZcimGf+S5qdTZ3m12yTfrU3vdrY8jxzXY9mL1Zlfn1pr3kweJHIe ZvSN6+eRSZWIruZRuq24b1gMEXTkboROMxTfRGAUFTs0hMR43PfEcCFeDoOXQ+Mb+2PE zCT/KDyzIVhURksN6esF2f8gzgAjcA6lzGr2TH54z7Y74gwtnI1ohjJ4YhAwla0M896K YwIg== 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=4rPBmGsGKSgsNIIEFFPa6M8Q3BmPXayQyZH2RSaoEmg=; b=0lfpE+xsN20mXF6a7QA1fvh8NzNjCQ1NHbXhQDdgezRPYmEsx007Rb0ylnGGcB/N2d nPqzx0lT/JMHEZVMQx1CqRAjki8rfz4kvVcMnU9B3eB55pUhPOP+tXwdTH6G0KyVe3/a gnvsbfxGBwOBfnSWzpsceu1x8q5j77C98g5JpcFkSaVB+QPu7hMDMEyZl5qolcZawzuF q3vEvVjqmdKoqWkxDt4d8EfXFB4fiVDn6+LlITe01Pq+LghHz264oSWO1U9rFjGuW5Cr ywrapJmOwPUtdh2ma45QkK5oDezcvZZJ8Rc+ZptigsHTn24QisGlZR+tf/hxX7PJB/Vw 1zyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=t3LHbu6O; 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.19.47; Tue, 24 Aug 2021 10:20:10 -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=t3LHbu6O; 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 S239158AbhHXRSn (ORCPT + 99 others); Tue, 24 Aug 2021 13:18:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:55610 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240030AbhHXRQi (ORCPT ); Tue, 24 Aug 2021 13:16:38 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 398EB61ABB; Tue, 24 Aug 2021 17:01:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1629824516; bh=xB783NJEUlaFuKhiVOp50GRZsCnz3YuQeR+YZAr3PFQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=t3LHbu6OdHeIoN3WYxpqvqoyUefANVjtahPdrh+ByeEX0t2sr+JNaFPllpng9shwu LbXM45vm0AShz58kZM5rtromIrWqVcvq0z0ETLdJiqaytOqR9o89Cpv2pVBiavid84 sCRq40/MFApGYPIZuRe57hd4PVI8OmILrTUBVtF6DBvzRfdq090HeuHYhU21HtuJo+ 7I2+0sRJUXUwRPK4IGO7O/cqOSwFFagYhzN0euHHWyr0BLJcR8bRiSg/frqNokLCqN MndzS8JItIOm3actb/PDIhXBfqN0md9+sJatonDvnLvD3O5hGB35+861eNXX9PVYfD rXs/9fM3vKQqw== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Srinivas Kandagatla , Greg Kroah-Hartman , Sasha Levin Subject: [PATCH 5.4 49/61] slimbus: messaging: start transaction ids from 1 instead of zero Date: Tue, 24 Aug 2021 13:00:54 -0400 Message-Id: <20210824170106.710221-50-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210824170106.710221-1-sashal@kernel.org> References: <20210824170106.710221-1-sashal@kernel.org> MIME-Version: 1.0 X-KernelTest-Patch: http://kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.4.143-rc1.gz X-KernelTest-Tree: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git X-KernelTest-Branch: linux-5.4.y X-KernelTest-Patches: git://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git X-KernelTest-Version: 5.4.143-rc1 X-KernelTest-Deadline: 2021-08-26T17:01+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 d5879142dbef..3b77713f1e3f 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