From patchwork Sat Jan 18 04:24:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amol Grover X-Patchwork-Id: 11340025 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D4F55138D for ; Sat, 18 Jan 2020 04:25:37 +0000 (UTC) Received: from web01.groups.io (web01.groups.io [66.175.222.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 727432467E for ; Sat, 18 Jan 2020 04:25:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=linux.kernel.org header.i=@linux.kernel.org header.b="Zh9M4dH+" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 727432467E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=bounce+26986+1270+1554929+3438807@linux.kernel.org X-Received: by 127.0.0.2 with SMTP id YYbpYY1556264xusXf4RC6hG; Fri, 17 Jan 2020 20:25:37 -0800 X-Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by mx.groups.io with SMTP id smtpd.web12.3708.1579321536882866657 for ; Fri, 17 Jan 2020 20:25:36 -0800 X-Received: by mail.kernel.org (Postfix) id 6E6D12467F; Sat, 18 Jan 2020 04:25:36 +0000 (UTC) X-Received: from mail-pj1-f66.google.com (mail-pj1-f66.google.com [209.85.216.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2DA8024656; Sat, 18 Jan 2020 04:25:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2DA8024656 X-Received: by mail-pj1-f66.google.com with SMTP id m13so4287370pjb.2; Fri, 17 Jan 2020 20:25:36 -0800 (PST) X-Gm-Message-State: a40f9ANoZtnlhuJrkmDtPqCex1554929AA= X-Google-Smtp-Source: APXvYqzfq2rQlvfACHCOS+RwFwK6woYWos+WSMvOBXpfFgrS0GmGE6BLdwKkUxdrfeti3s13++vWpQ== X-Received: by 2002:a17:90b:4398:: with SMTP id in24mr10196469pjb.29.1579321535509; Fri, 17 Jan 2020 20:25:35 -0800 (PST) X-Received: from localhost.localdomain ([146.196.37.181]) by smtp.googlemail.com with ESMTPSA id r37sm8995812pjb.7.2020.01.17.20.25.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Jan 2020 20:25:34 -0800 (PST) From: Amol Grover To: Linuxkernel+Patchwork-Soc via Email Integration Cc: santosh.shilimkar@oracle.com, arm@kernel.org, soc@kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel-mentees@lists.linuxfoundation.org, Joel Fernandes , Madhuparna Bhowmik , "Paul E . McKenney" , Amol Grover Subject: [PATCH v2] drivers: soc: ti: knav_qmss_queue: Pass lockdep expression to RCU lists Date: Sat, 18 Jan 2020 09:54:34 +0530 Message-Id: <20200118042433.4968-1-frextrite@gmail.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: Sender: patchwork-soc@linux.kernel.org List-Id: Mailing-List: list patchwork-soc@linux.kernel.org; contact patchwork-soc+owner@linux.kernel.org Delivered-To: mailing list patchwork-soc@linux.kernel.org Reply-To: patchwork-soc+owner@linux.kernel.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux.kernel.org; q=dns/txt; s=20140610; t=1579321537; bh=In66dqY6nAl+U6JDAJZP7adVU6+abU9Z3D2lqqADeqA=; h=Cc:Date:From:Reply-To:Subject:To; b=Zh9M4dH+1rbmBfL2L+vEcII5DFhSoMv7e9ndq4QvUd7HI3pDtkxCAY4bFnB71x+SSN6 wk1CTEdrP8gqsoxlwC0Uc+bftq6PALcMvB6L/dUPuDMEiNrgcq65iQLN0XzHQOfaMwdEg qbPWyMhMJwKrJmNXR8f7FH8XWTNwoH5sKl0= inst->handles is traversed using list_for_each_entry_rcu outside an RCU read-side critical section but under the protection of knav_dev_lock. Hence, add corresponding lockdep expression to silence false-positive lockdep warnings, and harden RCU lists. Add macro for the corresponding lockdep expression. Signed-off-by: Amol Grover Acked-by: Santosh Shilimkar --- v2: - Remove rcu_read_lock_held() from lockdep expression since it is implicitly checked for. drivers/soc/ti/knav_qmss_queue.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/soc/ti/knav_qmss_queue.c b/drivers/soc/ti/knav_qmss_queue.c index 1ccc9064e1eb..37f3db6c041c 100644 --- a/drivers/soc/ti/knav_qmss_queue.c +++ b/drivers/soc/ti/knav_qmss_queue.c @@ -25,6 +25,8 @@ static struct knav_device *kdev; static DEFINE_MUTEX(knav_dev_lock); +#define knav_dev_lock_held() \ + lockdep_is_held(&knav_dev_lock) /* Queue manager register indices in DTS */ #define KNAV_QUEUE_PEEK_REG_INDEX 0 @@ -52,8 +54,9 @@ static DEFINE_MUTEX(knav_dev_lock); #define knav_queue_idx_to_inst(kdev, idx) \ (kdev->instances + (idx << kdev->inst_shift)) -#define for_each_handle_rcu(qh, inst) \ - list_for_each_entry_rcu(qh, &inst->handles, list) +#define for_each_handle_rcu(qh, inst) \ + list_for_each_entry_rcu(qh, &inst->handles, list, \ + knav_dev_lock_held()) #define for_each_instance(idx, inst, kdev) \ for (idx = 0, inst = kdev->instances; \