Received: by 2002:ab2:6f44:0:b0:1fd:c486:4f03 with SMTP id l4csp241658lqq; Thu, 13 Jun 2024 01:28:56 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXrK0a4LgGAVC1ybQhFG9eDOMaSI1WP1b39opxjD2J9Hk6KewHO7AXrnxFp8TBxLwb0eJ9eY3oBkxG7LNiFJuME0sPVf8negZJ8zGmONQ== X-Google-Smtp-Source: AGHT+IGmzcEmZmNNjLHN2//2AGzkKhsiUC3ipE+2rZy2c/I9HZHfaGKERKQRHL5v0N9H/3VivcJk X-Received: by 2002:ac2:5dc8:0:b0:52c:9036:9866 with SMTP id 2adb3069b0e04-52c9a3e3d3bmr2904974e87.38.1718267336208; Thu, 13 Jun 2024 01:28:56 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718267336; cv=pass; d=google.com; s=arc-20160816; b=O3f6CvOSefi+JCtvrIF9oSfjhJPKd/BfN8u2TK1zdGtQZHOTknj5CzofpRasSyYtJg a7XC6AcVgG26R4P+aKM+iHcX/bak0nlCvacYirFmAk8rgMnb24ANYZQYInMijec0YaY+ MXSxV8wUHuKCiVePw3Rd+Go5YVmW0jc9BY/usc4K3/d1sHuHYZkKCwzxMRbXfZ03LDWR LngG8A9H5oNfLADSLfvzNcBx1F4NDFMJ51MO9FymXwFJqcr7q6bAEXT2LyyOo5dEPSml ROTELBvLi6zYB44OvpSbaal7XblVbOEXWt03kuO7lwFfjv4D/KaPCHDb7P0dsI1cVqAA hR6w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=tAEMR4VJ1zjdBk5zvtR3Vo5e9vJ3KQrS8U0kuWsRUbE=; fh=vUOCvH1NPBrwyrPEY94blgV8nkRdtK+qx05Z3dREJ9s=; b=vTSgwdJNZT3rPtoR3JzGuSdPy15JKH9YABN+xBtLMejMF8KCu7dpeQlIXcycbZMyOF BnvdwPdFa9Ub3I1+ScRCJP0Q3Mjr4+E6K6j3kj72YqiesX31SPMD74Hz6eK0ljvCCCrw msZ6V0GbOM1u4SZdK+PnQqleLYK5T9kbd9MRw+DZT1VOf03Urv5T4wlAh3ocgeEQD/MK vtgUgZzLYG1vwNmRreAK2cnJVM58Q0rbrGSp9oH0N9/exfA2nStjqYx3L4dv1W7EQa4Q uG0RpIRvDcNFO7p0LT/c/cbjyvPpPVYOwcnRWc36FRWNDSZYfCeOVjylPnZTCJ916abM 1wNQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=ZTQMvkIp; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-212808-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-212808-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a6f56d21a81si45182366b.92.2024.06.13.01.28.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jun 2024 01:28:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-212808-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=ZTQMvkIp; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-212808-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-212808-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id E30571F2177A for ; Thu, 13 Jun 2024 08:28:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DC93013E8B5; Thu, 13 Jun 2024 08:24:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ZTQMvkIp" Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6C7DC13E3F4; Thu, 13 Jun 2024 08:24:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718267096; cv=none; b=gRbpLbGwfmmoS32itB+d1L5N10bPG4HKaeFm1AKBxpmfiilXu9o7RpVC5jQEg7sSaExKsYfwMlYeyq1U6lkYdB6lTQ203EpOhpr0U64OaSJkAFvnEm1wQV4Rh/y75LTpQi5rWjY9eiiu6nnm34XDbPRk56dk+mwj7L/sQSO8iKc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718267096; c=relaxed/simple; bh=x2UOnZVpw5W6JMJEDnZM+FeWtuTLMmgaXmPFsBI9q/A=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=WjrOCAXxTJaBJsOJfnvY/mDG0+RNVhBnh8oXdo8e74IbPiDDRmy9bM1BLk0zv+PPQsKppbromlxXEU1bRA6bG+LOD31f5tH9YofJvS8s6S/Kx87T7EfzLxLDK++lmj6BIarCl1sYkmlc/4HTY89n95I5FsTEDeR70mCa1f4Pzb0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=ZTQMvkIp; arc=none smtp.client-ip=209.85.221.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wr1-f44.google.com with SMTP id ffacd0b85a97d-35f1c209893so874705f8f.2; Thu, 13 Jun 2024 01:24:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1718267092; x=1718871892; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=tAEMR4VJ1zjdBk5zvtR3Vo5e9vJ3KQrS8U0kuWsRUbE=; b=ZTQMvkIp7P32lSu2Z118klmmVxS0kEOG8SMcJoumWS9wnV3XaiVMsOn88KMGP5UEmm nizt5E7ht1JrCqcZjoiUj4hVoXCnSqbq/VbsNO0ZUdr0/KZvHfcBzzIdKcb3w+yvRiKA ZFksF3qn0XCb9g+NU/jF85Uaxqg0iATgXWNdci28n5lRu69ARnkYyUGwYRfk1zD3Jw5+ 9/0Sgm/SdLT1kx8RW6tiki2dXDU63bSwuLanROzNzNVim8WNoB4jIE7omgAmxUKrMpQS LLOr+02crKVZ2F7bn+1qgNmcqXGnvm7KRWdd2b9be1ieC51WAamqT/p/4zRiCvtsaaFH eWYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718267092; x=1718871892; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=tAEMR4VJ1zjdBk5zvtR3Vo5e9vJ3KQrS8U0kuWsRUbE=; b=fA1od3+e7HgOR6hSqllEJk8w1nwOYbv4o4Z0TKhX9Nz8pTzU/QWiiaqsw7i6CBOkLF XZIjmHAtuKXj+EA/m/PIRct9ayiSJxslfAP+HUeyAK/AI4qTLR+dvYxVF+Sp7obaRDRn IlYTBBFtyfqWueuE874k7mNh6r5I6fnvi/B3eODd/G6qsps7034/M9H/MRrGCt4mmTuV XRuyy6dr86o+GXfoGPK4hL67yfP/H6kXRyINlc9YUGLNultlKeGEncKk8cd3v4niBr1c MMWmuiauD0tyoPsCBUSteWpJxAH8IW2cyXcKPypCjEcPrdr2x8h7j4LtmdofSaD/doyv trag== X-Forwarded-Encrypted: i=1; AJvYcCWiuU/WG1BtmJ85p606tYHA6YHd/kuCnWEt/ETraVgJhGJEnYTC8oa6Oa0QI5VT2fQ5RLjk0RoAcWxYsOfP2yQNNz9l3+62NUhbjKvt X-Gm-Message-State: AOJu0YwPKT6OZyRgjRctW0DmcW6Ept9m0KucDZFHyulL806Hu00rVaMP IXG2lkId4vlKH1Nh5QwA29TRK2maj2ex096szFChmVKppO2gCGOEVWh0yDuC X-Received: by 2002:a05:6000:401f:b0:360:6e2f:b77 with SMTP id ffacd0b85a97d-3606e2f0c60mr3835288f8f.55.1718267091850; Thu, 13 Jun 2024 01:24:51 -0700 (PDT) Received: from fedora.iskraemeco.si ([193.77.86.250]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36075093615sm981462f8f.6.2024.06.13.01.24.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jun 2024 01:24:51 -0700 (PDT) From: Uros Bizjak To: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Uros Bizjak , Bjorn Helgaas Subject: [PATCH] PCI: hotplug: Use atomic_{fetch_}andnot() where appropriate Date: Thu, 13 Jun 2024 10:24:24 +0200 Message-ID: <20240613082449.197397-1-ubizjak@gmail.com> X-Mailer: git-send-email 2.45.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Use atomic_{fetch_}andnot(i, v) instead of atomic_{fetch_}and(~i, v). No functional changes intended. Cc: Bjorn Helgaas Signed-off-by: Uros Bizjak --- drivers/pci/hotplug/pciehp_ctrl.c | 4 ++-- drivers/pci/hotplug/pciehp_hpc.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/pci/hotplug/pciehp_ctrl.c b/drivers/pci/hotplug/pciehp_ctrl.c index dcdbfcf404dd..7c775d9a6599 100644 --- a/drivers/pci/hotplug/pciehp_ctrl.c +++ b/drivers/pci/hotplug/pciehp_ctrl.c @@ -121,8 +121,8 @@ static void remove_board(struct controller *ctrl, bool safe_removal) msleep(1000); /* Ignore link or presence changes caused by power off */ - atomic_and(~(PCI_EXP_SLTSTA_DLLSC | PCI_EXP_SLTSTA_PDC), - &ctrl->pending_events); + atomic_andnot(PCI_EXP_SLTSTA_DLLSC | PCI_EXP_SLTSTA_PDC, + &ctrl->pending_events); } pciehp_set_indicators(ctrl, PCI_EXP_SLTCTL_PWR_IND_OFF, diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c index b1d0a1b3917d..6d192f64ea19 100644 --- a/drivers/pci/hotplug/pciehp_hpc.c +++ b/drivers/pci/hotplug/pciehp_hpc.c @@ -307,8 +307,8 @@ int pciehp_check_link_status(struct controller *ctrl) /* ignore link or presence changes up to this point */ if (found) - atomic_and(~(PCI_EXP_SLTSTA_DLLSC | PCI_EXP_SLTSTA_PDC), - &ctrl->pending_events); + atomic_andnot(PCI_EXP_SLTSTA_DLLSC | PCI_EXP_SLTSTA_PDC, + &ctrl->pending_events); pcie_capability_read_word(pdev, PCI_EXP_LNKSTA, &lnk_status); ctrl_dbg(ctrl, "%s: lnk_status = %x\n", __func__, lnk_status); @@ -568,7 +568,7 @@ static void pciehp_ignore_dpc_link_change(struct controller *ctrl, * Could be several if DPC triggered multiple times consecutively. */ synchronize_hardirq(irq); - atomic_and(~PCI_EXP_SLTSTA_DLLSC, &ctrl->pending_events); + atomic_andnot(PCI_EXP_SLTSTA_DLLSC, &ctrl->pending_events); if (pciehp_poll_mode) pcie_capability_write_word(pdev, PCI_EXP_SLTSTA, PCI_EXP_SLTSTA_DLLSC); @@ -702,7 +702,7 @@ static irqreturn_t pciehp_ist(int irq, void *dev_id) pci_config_pm_runtime_get(pdev); /* rerun pciehp_isr() if the port was inaccessible on interrupt */ - if (atomic_fetch_and(~RERUN_ISR, &ctrl->pending_events) & RERUN_ISR) { + if (atomic_fetch_andnot(RERUN_ISR, &ctrl->pending_events) & RERUN_ISR) { ret = pciehp_isr(irq, dev_id); enable_irq(irq); if (ret != IRQ_WAKE_THREAD) -- 2.45.2