Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp2902211pxb; Tue, 24 Aug 2021 10:12:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw/nPcor55p4d1Eg8UWswYShhqt/LguoXc2tKzDfETS4gznMWa0QGAIAJUykW5xZQ2eOEbk X-Received: by 2002:a05:6e02:e51:: with SMTP id l17mr27965911ilk.73.1629825177876; Tue, 24 Aug 2021 10:12:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629825177; cv=none; d=google.com; s=arc-20160816; b=ntnqOWuXo6UdDxSKnH+9Xdho0NLDGrDyujtHdWFIMVcgd5m+6QNMFZ2XoPgYHCpzmL DsPAlJt0YbpayRJFHe3hXjUJe5rjafAoH+R6QGKP3HdNAz1KZaS/Kj9xTnyo+j523ECl uY9JB9SGlxcaS4h0FHqVQwbwjMBWZ0mP3XTe6r/6CGKiP+ZKdFUUbYoxF99Xuegjp5WF QUf6k1vqbreHXLlm2aBvCStqsejgOkliAsHRH0ZThXEPZDEpPNBNgdqkA6MeSMtn/0y2 JZUrQyF+HpQqcq1ZNqiYhaxRRVrqZ4TUsjFHIKChRMt3WtSb6UkDmZ8lxqR5kGgKSGR8 A5Zw== 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=SOX33QiP1YTlU/4DzqbCruIdJf+OrUQiPGMun8plWFbxRUD8RHDLbUz9twjVFUOewZ S7kaWG4x5ySKH7ZxxSz7hDz7QlwNYfaFXA/qUks4wEvPGonXQcBGqn26TjeZ7p0leGlB mcr5P9fXY/pa8+nCDatpJ9h7cW2TY5jQZ8+3I10ZVjEKsOzSsTZn8AmSfhqdG+xRB0+C KuQukDG8LzSNjQrGK+8V6DAvF7pU7Wj/YjN4hyOEeOzV/KMOSsByrV2KQAyvNAqOnlQa qDfvKdaRL+vWo61j7hTXsMe6HXUuybmEI7ImLYHYMB7Ol8tR9TIprh27QZ4LNO152DUG PQBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ril++eNo; 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 f14si21705385jat.94.2021.08.24.10.12.46; Tue, 24 Aug 2021 10:12:57 -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=ril++eNo; 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 S233050AbhHXRMq (ORCPT + 99 others); Tue, 24 Aug 2021 13:12:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:51788 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240097AbhHXRKC (ORCPT ); Tue, 24 Aug 2021 13:10:02 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1E7F8619F7; Tue, 24 Aug 2021 17:00:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1629824429; bh=xB783NJEUlaFuKhiVOp50GRZsCnz3YuQeR+YZAr3PFQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ril++eNogVhW5VGATVossNW4z1i5Bfp4GTQKUl3fgz0K490BG9KFFKK7qGcoRpyiB kGk3dIh4rE47v/22LffWNkxSzO1j/ssfsrCrSrcgE/a2QDVAWaG/LqZ/STWgUmp92m pwRTcsZx5l/RlTMsS+nVdRQBQMI/eXdGJ3piOjUYibuqVjpxl+vC4hHfadLnS2BXjS g0qK3+coZS3mSTuis4LNFbMI5x+80UbJHctXYlsxXcaiE7RcqBOtIYvhd2VHhjmMRZ fxg9+mp9KbGIqtgLMcnsdyI/UL7wS0X4AVQ7Z1eY0UiI6KAC049as46N/ET9aa+e15 bT/kyxsrBPXZA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Srinivas Kandagatla , Greg Kroah-Hartman , Sasha Levin Subject: [PATCH 5.10 80/98] slimbus: messaging: start transaction ids from 1 instead of zero Date: Tue, 24 Aug 2021 12:58:50 -0400 Message-Id: <20210824165908.709932-81-sashal@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210824165908.709932-1-sashal@kernel.org> References: <20210824165908.709932-1-sashal@kernel.org> MIME-Version: 1.0 X-KernelTest-Patch: http://kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.10.61-rc1.gz X-KernelTest-Tree: git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git X-KernelTest-Branch: linux-5.10.y X-KernelTest-Patches: git://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git X-KernelTest-Version: 5.10.61-rc1 X-KernelTest-Deadline: 2021-08-26T16:58+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