Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp503737pxt; Fri, 6 Aug 2021 07:13:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx3Fot/4F0A1WRzjfd6H3ae1r12+SQzABufANbeuB+8Rhj78Isnk9sSI5VyqbAJDBbHpS4s X-Received: by 2002:a92:7b10:: with SMTP id w16mr669613ilc.241.1628259192224; Fri, 06 Aug 2021 07:13:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628259192; cv=none; d=google.com; s=arc-20160816; b=gQFfCPW3clwvTmp3nBF+KAeM+l4c/GxKhInEUEu5QKGA4ridbqzkanUUccS+mlvXHY X3Dd5yPSylRnPICFolLZWATJi/hK469wllDCnYTw6RmI/pIs+o9zYBVUTh7/YCAxIWHT D3YdVshnUsr497rkTB0sochWqXov3kN3NcYAJECTryjBpLIvZNY4k5wH1P8mfouEK258 QE8onkjl780kNM9+CN+GK6pvrTqGMOgd3mVtCVphWBuzPV3Iopvek6k2uf+Ey7jNTjR4 JO56Ywr67hmQJOaYKtYc9fTf3UZm1ohdOOGxOJdyJHQjpd4tjT1mkrxsGHOyyNxr5RcE OukQ== 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=8M4d0Uxz/0+0kMFPkk4zFO2m4csYlGTmBy9HzP7nwc4=; b=XaW7l40UAf+n/8ZVPGVOwWD8aGx8QEvnngB9Syv//2KgExRvoAGfiBVbqNPO2FT18p tWGhdJt4xCdlbAaA3udc5/aLcNJWtTCUplmmufnsfTBSZ9vvptFc9DSPHOfZy0ZhWbwp UpJn3wbwKQ5lv1ocIFyb1cnTHuQqjc8KLHP9Cwj+FAkr8sxshk7olhS8BnyQG0HJwZy4 7Pa/ebCMDVrySI/4cNjGne5CcudkWPKgPTp3DiRa7btzyRe8+h4gxxLecTBwm2DkVmK6 NfTV/Ds7Fe4Si2umjBUOOs7jTbIgkVRS0zlptdFSmOz/KHxb4lJZWmZ3tzvUvKcBwEoJ SGEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NDNa8CSx; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r17si10177105iov.104.2021.08.06.07.12.59; Fri, 06 Aug 2021 07:13:12 -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=@linaro.org header.s=google header.b=NDNa8CSx; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244400AbhHFJRF (ORCPT + 99 others); Fri, 6 Aug 2021 05:17:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42738 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244093AbhHFJRD (ORCPT ); Fri, 6 Aug 2021 05:17:03 -0400 Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 947D2C06179A for ; Fri, 6 Aug 2021 02:16:47 -0700 (PDT) Received: by mail-wm1-x333.google.com with SMTP id m19so5177218wms.0 for ; Fri, 06 Aug 2021 02:16:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=8M4d0Uxz/0+0kMFPkk4zFO2m4csYlGTmBy9HzP7nwc4=; b=NDNa8CSxRoQ91d6lqFXRz3nSHq0My/Nma95MTVyL/jnxP7OT39/uNT6L1dG9frwSq5 +f2Uq7dzvOStYq0NvabTdUdKo1fRcEFCXHuTOFyMWZzSUgvAHFAJhQfwUPNjFM7RYqfL wINr5PM2rr9TwV490Cx4asjLZipz77JOaZ2+rKgz7leMu1eXxXP2MeuQs3Ryqtko0mNl xhWS0YcT5FQ0EExhusaEvK7XWGD7Yc83dn8RS3aw2/oV2wn7nCzlMqvcjb0nGPf2KN+I 5gys4Qoiv3pa+exlxkBGOzHaZfCDf8L5wwIFtF13JRY/LP3UDr83p51dd0I7fZvw4gAx GR0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=8M4d0Uxz/0+0kMFPkk4zFO2m4csYlGTmBy9HzP7nwc4=; b=VbDpGx8K3dCXxJx4qdZjUE5zPLC0D5bibS1iD9yVLhQjY2MpLo9Csp439hG5UReYB8 iDaqgsKaIYnt5BB5uF+udM6dFXsG6Ah7fMbDCqOTt4RtjcCezHa+NtcqbBKemoK8+Ww/ jULigeWGTv2MQHFri6vLEvJ2zKjTvd0G6I3jZ9oTLTsZJYeO80+uQd3Z31WFhU8dsAMN JVhFK4c/KqHWS8pM4JL5VxrAAW66W8SmR6zxyEkOQytuxVbqq0iM4FyyTJSCoSjoC4Y6 tlfGnarilRtpP2PpiAeWFo4b/lV/1cEOv8oUOKeCAnIYvpwzBxKqoqOKVQzCLYg1uYsW zhyA== X-Gm-Message-State: AOAM531pmwDHOSqrIymeRnO4Nh+Ni1z6ZIG2JYouresoKmJ/3wySbbIL gmzWWKsYdvHl/dYTs5azPTCXdA== X-Received: by 2002:a05:600c:1906:: with SMTP id j6mr18507085wmq.108.1628241406206; Fri, 06 Aug 2021 02:16:46 -0700 (PDT) Received: from srini-hackbox.lan (cpc86377-aztw32-2-0-cust226.18-1.cable.virginm.net. [92.233.226.227]) by smtp.gmail.com with ESMTPSA id w3sm7811760wmi.44.2021.08.06.02.16.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Aug 2021 02:16:45 -0700 (PDT) From: Srinivas Kandagatla To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, Srinivas Kandagatla , stable@vger.kernel.org Subject: [PATCH 1/4] slimbus: messaging: start transaction ids from 1 instead of zero Date: Fri, 6 Aug 2021 10:16:36 +0100 Message-Id: <20210806091639.532-2-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20210806091639.532-1-srinivas.kandagatla@linaro.org> References: <20210806091639.532-1-srinivas.kandagatla@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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.21.0