From patchwork Mon Aug 9 08:24:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 493837 Delivered-To: patch@linaro.org Received: by 2002:a05:6638:396:0:0:0:0 with SMTP id y22csp2688678jap; Mon, 9 Aug 2021 01:24:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxD3ei6uyYB+7wm2iP8oXJTtrp84JksN3Gs5Muk/98PlXwF70iMQ31Eqmq+Cx4YaXCWbQzT X-Received: by 2002:a6b:4f16:: with SMTP id d22mr200434iob.40.1628497484768; Mon, 09 Aug 2021 01:24:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628497484; cv=none; d=google.com; s=arc-20160816; b=tqFjbpgOWHLOVNgAWFjEMFHgwVgE9dJqjErb/GBvxjEO//AjoEySfUKFqUEe1iWAPN cGqIaaSv8c5Cj25KhVU0BUBvezeimMMIAF5ClR2kqcMIbKzu6FJI9uprhF9Cjy5j6Lo8 DgkHuGCv8o4mRzGjddPVkTbtCzB7Q3VFKpgMKXNv5wqqLjlkn7lFqllSLUXZEVJFUbJd wJJ8bWRU0XVs91nWu+FH106HnF7vNeRQkBIv8kk5chj8cg5tbJWqrwC++cYM3GvBcgaZ m8noKFUrPYWstC5Xbn66bHRCBKywMzmnIgeLRFGndPTByMUSteGuDqJ63mHI+QtRHhq6 DehQ== 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=Pcjr2o5wmA6UYd22/7Ra8kRVAQpnbJeGgcqKDfUyrvDdd9WGK1ZBsZ30IMOc9F+1L/ nJ6rLY0XkXEp2nThLx1++xUNO+UIlXnwCEDmMpcdyJpUeTdkxUaUOUyVkYkEkkSWO/j+ 5qGm6W7z8jqNLaG9bpTeUTfX1HftSa9OVm+rUA7EjZy4/DXCCsPOj6v/yr9mM4AM0oup Ki2n1bKUqd528WFsEnz0cW+0Fl6DDlbj4ziXhu5V6/OM2TxGWoDjeB4ffwrJO9zC/WL6 /pIHxxW8oEje++b/aUe6AyCut7Q+pQ8ZBMBwGOnxs8g19Hycp6rJpIacUVbfz0j6eQMI WIyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NwUHzMjo; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-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 e20si22414517iow.6.2021.08.09.01.24.44; Mon, 09 Aug 2021 01:24:44 -0700 (PDT) Received-SPF: pass (google.com: domain of stable-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=NwUHzMjo; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-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 S233857AbhHIIZD (ORCPT + 12 others); Mon, 9 Aug 2021 04:25:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45616 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233942AbhHIIZC (ORCPT ); Mon, 9 Aug 2021 04:25:02 -0400 Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2F726C0613D3 for ; Mon, 9 Aug 2021 01:24:42 -0700 (PDT) Received: by mail-wm1-x32a.google.com with SMTP id o11so3824705wms.0 for ; Mon, 09 Aug 2021 01:24:42 -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=NwUHzMjoQ5R5F5nGSCfQy+CR6Mbh323wn9co/8+otLrt9OyssZ2/yCQQ3BjkrC5KeX 7Ok8+86VSe9mw15Q7adCt3V7xIB6wD3xm7Z7CdUCEAiZgYdHQKJYPiuASKhEzcb4GJyI EdpJkfIj7ATYUJSjCdbkArd3V9PZilgW6Fn9AMhwDqK8UBmernuxwus+HDPK3Y4LtBJU WpyDA6Q8egGhl+M5Vx6T9uKNvk/tclwvVdqyoWXOcaP/WG72g5FtalkT0N6YMAPsXC1Z e6mpJ45V2D1rdOmoVQb5Ayc48mgJQSgwPAy5YYXk+eYnhAaejfYC2/KxEcEfVMP1MmCb yGyQ== 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=N/CA1WXOXn/a3c6kKKNvqwS1KiH+zXK8CccNKntfbg3jAs2xNCJk4krg937fjM3eYK AzZQ0D9UKdUXAay3BhyZh5dQlnfg4dmdgcVXGqkx30tjUekNrPRWNExGgGuwxqvU03jP rBp0/jPt4v9gsR32qMip51UzGiBUL6BbkgfBz2OZ0ry2jx+A8b0Hueqemz8eu7gqiJSu XIxAPfk2VGx5zstMZi7j48IDTSYPW5R95fRlueaJ+0KaBxhzilti4ZGu/dLP3+ZVLj2k XLb7DQ01uFuKBa2EKHYcveYxUCCzoCCl/3ynEettU+lH4V7vliorvHIOnYDL0TDL11Oz o0gA== X-Gm-Message-State: AOAM5335OajTeYFGsROr1GpkKaHnDfc3FXiBTwxOABuA/BMU8Kmiu5I8 RQdDjiBgMCboSD6yaNwyjG6nbZrPnLy5vg== X-Received: by 2002:a05:600c:2306:: with SMTP id 6mr15684677wmo.115.1628497480815; Mon, 09 Aug 2021 01:24:40 -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 t15sm18036371wrw.48.2021.08.09.01.24.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Aug 2021 01:24:40 -0700 (PDT) From: Srinivas Kandagatla To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, Srinivas Kandagatla , stable@vger.kernel.org Subject: [RESEND PATCH 1/4] slimbus: messaging: start transaction ids from 1 instead of zero Date: Mon, 9 Aug 2021 09:24:25 +0100 Message-Id: <20210809082428.11236-2-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20210809082428.11236-1-srinivas.kandagatla@linaro.org> References: <20210809082428.11236-1-srinivas.kandagatla@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@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(-) -- 2.21.0 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);