From patchwork Fri Aug 30 23:18:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Fernandes X-Patchwork-Id: 11124679 X-Patchwork-Delegate: bhelgaas@google.com 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 54F181399 for ; Fri, 30 Aug 2019 23:18:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 335042343B for ; Fri, 30 Aug 2019 23:18:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=joelfernandes.org header.i=@joelfernandes.org header.b="mJNxoFoP" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728248AbfH3XSf (ORCPT ); Fri, 30 Aug 2019 19:18:35 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:38846 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728122AbfH3XSf (ORCPT ); Fri, 30 Aug 2019 19:18:35 -0400 Received: by mail-pf1-f194.google.com with SMTP id o70so5552018pfg.5 for ; Fri, 30 Aug 2019 16:18:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=PRkLiK2zQKW37sHjUWJi7ClUsfSJsVnDy5LzPyDzYvE=; b=mJNxoFoPw68Pczu3Q5Tl9Hubb1oPwPMN4HNOUR5BMqcq1lrDlYBVP6S84iC0HCLgRk bxc9EPapppZF4nytHiwbl/a1svpheNULWsFifiCEEtJxbx/2Nd5ec0nyECglpbsmGi7n tU+hvwsEYwTZP9DetuJiTg4UUwmi2g/IyPVjU= 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:mime-version :content-transfer-encoding; bh=PRkLiK2zQKW37sHjUWJi7ClUsfSJsVnDy5LzPyDzYvE=; b=brIVydT5A2MZDpYKKNft05uGtgmQlp8XRcLbMb6l6/ZRH1d8usPStipSsf4l+Mt9t6 rPa2GFiKJWk9/LfRDhnNndp2kkcAk9k58YFy6e/9J7Y/AygpKPliaVLRzObbaGRNVC6x bRv1G3bA886g0xn7js3j7hJu1UvfOzOwE4P5NG+N6v3lqx2UtY8+KD4juYP6/TV416H4 t6FhnDh58O9c3AvdLHk8SH8iXDi/YUshkgTnHKb2Yc1SbrUKPKIjDHOXr9/4t2+aue8F qST9a1r52DyaYIejYYshulh080XJKjhDorxog0CPAOH3lrQ8QLw8HNrldxq3Q2QPb7LT a7Ow== X-Gm-Message-State: APjAAAX3SrFMzuLyxUArKangHk+b09MUHbjd/kXqrcNVC8ohSDrx7N8t E3avGSj4QC2NYsOk5ZnB45lhoyc9zUA= X-Google-Smtp-Source: APXvYqwWcIpjQmKfZ2KNw+QhAexpYhPxvb+SAlTByxWo8nuTzYepBvzn5LLXes3DPdl/v5VIIOmnfg== X-Received: by 2002:a17:90a:bc06:: with SMTP id w6mr1009296pjr.45.1567207114673; Fri, 30 Aug 2019 16:18:34 -0700 (PDT) Received: from joelaf.cam.corp.google.com ([2620:15c:6:12:9c46:e0da:efbf:69cc]) by smtp.gmail.com with ESMTPSA id t23sm8479395pfl.154.2019.08.30.16.18.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Aug 2019 16:18:33 -0700 (PDT) From: "Joel Fernandes (Google)" To: linux-kernel@vger.kernel.org Cc: "Joel Fernandes (Google)" , Andrew Morton , Arnd Bergmann , Bjorn Helgaas , Catalin Marinas , "Gustavo A. R. Silva" , Jonathan Derrick , Keith Busch , linux-pci@vger.kernel.org, Lorenzo Pieralisi Subject: [PATCH 1/2] pci: Convert to use built-in RCU list checking Date: Fri, 30 Aug 2019 19:18:16 -0400 Message-Id: <20190830231817.76862-1-joel@joelfernandes.org> X-Mailer: git-send-email 2.23.0.187.g17f5b7556c-goog MIME-Version: 1.0 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org CONFIG_PROVE_RCU_LIST requires list_for_each_entry_rcu() to pass a lockdep expression if using srcu or locking for protection. It can only check regular RCU protection, all other protection needs to be passed as lockdep expression. Signed-off-by: Joel Fernandes (Google) --- drivers/pci/controller/vmd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/pci/controller/vmd.c b/drivers/pci/controller/vmd.c index 4575e0c6dc4b..127631d0c6da 100644 --- a/drivers/pci/controller/vmd.c +++ b/drivers/pci/controller/vmd.c @@ -718,7 +718,8 @@ static irqreturn_t vmd_irq(int irq, void *data) int idx; idx = srcu_read_lock(&irqs->srcu); - list_for_each_entry_rcu(vmdirq, &irqs->irq_list, node) + list_for_each_entry_rcu(vmdirq, &irqs->irq_list, node, + srcu_read_lock_held(&irqs->srcu)) generic_handle_irq(vmdirq->virq); srcu_read_unlock(&irqs->srcu, idx); From patchwork Fri Aug 30 23:18:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Fernandes X-Patchwork-Id: 11124681 X-Patchwork-Delegate: bhelgaas@google.com 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 F244913B1 for ; Fri, 30 Aug 2019 23:18:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D097D2343B for ; Fri, 30 Aug 2019 23:18:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=joelfernandes.org header.i=@joelfernandes.org header.b="SRkoLbFd" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728325AbfH3XSi (ORCPT ); Fri, 30 Aug 2019 19:18:38 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:35392 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728242AbfH3XSh (ORCPT ); Fri, 30 Aug 2019 19:18:37 -0400 Received: by mail-pf1-f196.google.com with SMTP id 205so3086088pfw.2 for ; Fri, 30 Aug 2019 16:18:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Z7Fsc+37SdglEjx6/P+VaXoRvmLqI7xYMe39+8FKKog=; b=SRkoLbFdjxOOLUsGorlvwCDB8Y7h+4UZCxPAUooe5JUYDpPZoOm+hC88wSCIUVQUJi FedLK4Mry/31IytlGZFBo09jNfGHCQpy+KeCRFEAjd/CHA9NXZ0xgmevw0j+ww4PVOri NVgKz5E4oVN1UEDexyn1rDN7wNhQVIao8Kavw= 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=Z7Fsc+37SdglEjx6/P+VaXoRvmLqI7xYMe39+8FKKog=; b=TSP/1MNCUfNzugn1DE/6Lg2UUaOqNgptYcJYNwFD4K94zaDtf2nlYJFQFWxGwKa2Ke 5yvisxwV8HOILpRSSB9W9QE/HAZcnXPh5+jAbaEcG/v9dMuiX7/JaiKCT0i+yf3IB2y4 8ARCGcZO4fAhBbHx4yqFzGU6mRMsLe5p/wHMeVOolNIQant4h1zLif63b+JuKYqLE3zB /e7WaYbyLMEXhSEQsRrhQ9G+roIoIo0CDqM4CfCvdqjB13zd7j8bJRZG4BnoVdOZEkne oUTMl2qek86bUpQmrhXN8ifjD3SX56UEvq8ggdLCxQEYI4wp2hhUcAyZinRmK8S5+BpD Ey1w== X-Gm-Message-State: APjAAAV7C26ET9N5zS0HbRMeKYjxIpQ2+c+BxkhFKXfwtUc2EONR3NZC c9FFngKy4kiIv5MbUGV6uRqAUg== X-Google-Smtp-Source: APXvYqzsgIbQD1SS2U2BV8UWGEyzmoL50WWwQMMc6aPYggCkWNncKrpdEs1Qv0qQtklc19SPrZyVdA== X-Received: by 2002:a17:90a:3748:: with SMTP id u66mr1008427pjb.4.1567207116764; Fri, 30 Aug 2019 16:18:36 -0700 (PDT) Received: from joelaf.cam.corp.google.com ([2620:15c:6:12:9c46:e0da:efbf:69cc]) by smtp.gmail.com with ESMTPSA id t23sm8479395pfl.154.2019.08.30.16.18.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Aug 2019 16:18:36 -0700 (PDT) From: "Joel Fernandes (Google)" To: linux-kernel@vger.kernel.org Cc: "Joel Fernandes (Google)" , Andrew Morton , Arnd Bergmann , Bjorn Helgaas , Catalin Marinas , "Gustavo A. R. Silva" , Jonathan Derrick , Keith Busch , linux-pci@vger.kernel.org, Lorenzo Pieralisi Subject: [PATCH 2/2] ipc/sem: Convert to use built-in RCU list checking Date: Fri, 30 Aug 2019 19:18:17 -0400 Message-Id: <20190830231817.76862-2-joel@joelfernandes.org> X-Mailer: git-send-email 2.23.0.187.g17f5b7556c-goog In-Reply-To: <20190830231817.76862-1-joel@joelfernandes.org> References: <20190830231817.76862-1-joel@joelfernandes.org> MIME-Version: 1.0 Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org CONFIG_PROVE_RCU_LIST requires list_for_each_entry_rcu() to pass a lockdep expression if using srcu or locking for protection. It can only check regular RCU protection, all other protection needs to be passed as lockdep expression. Signed-off-by: Joel Fernandes (Google) --- ipc/sem.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ipc/sem.c b/ipc/sem.c index 7da4504bcc7c..ec97a7072413 100644 --- a/ipc/sem.c +++ b/ipc/sem.c @@ -1852,7 +1852,8 @@ static struct sem_undo *__lookup_undo(struct sem_undo_list *ulp, int semid) { struct sem_undo *un; - list_for_each_entry_rcu(un, &ulp->list_proc, list_proc) { + list_for_each_entry_rcu(un, &ulp->list_proc, list_proc, + spin_is_locked(&ulp->lock)) { if (un->semid == semid) return un; }