[11/17] Bluetooth: hci_bcm4377: Use pcie_lnkctl_clear_and_set() for changing LNKCTL
Message ID | 20230511131441.45704-12-ilpo.jarvinen@linux.intel.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp4370857vqo; Thu, 11 May 2023 06:27:32 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ76oougXjE33SGbp0n0/9jbPBOX5mrPxt+c8P9p7fMzRQL00B5xo6hH6DeAYVFMITFbXkiq X-Received: by 2002:a05:6a20:840d:b0:f6:592a:7e29 with SMTP id c13-20020a056a20840d00b000f6592a7e29mr26570609pzd.3.1683811652305; Thu, 11 May 2023 06:27:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683811652; cv=none; d=google.com; s=arc-20160816; b=PD8yAqW0MEt5LyH8CiFfPMyj03QpIF4z0e98phcwsVk+nYz1h8drEy95sJi9APe7Hk tbnnUTu4pGIiXHPxJHMHhWfxhGsjfbVFJr6EhwlIVKpLac2+TW8S792Y/PdxafWjVTnj IjBmvGzSFUd+llXUDrLGh3vVuv4Uyu5O04+AjA2hFAm9bgszfJ9oZbMmCoxs1GmSZjvB IFc5VI2PW+HyvY2pcZD117gtR8uVoLicrxdGRo9xWarz+XlHh31gLZirOovbaNmivSxo udEZKvN9H7dtvMdUbHZISuF1lLtX4sHqPEklsV7s2t7zbG+Ie9PMW9/CobRwNUWUA45D C80w== 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=YfkUqhKOU3sefc0EE7zmMgbBzACfwFl3qQkrzEkp3A0=; b=lhErr1i8NsOI4gNC2kIW+j1qKdbXTsh4BulmDl5lrS8l9ISXXHOXKxKYQpFDLqGLI1 nahmSgaWl/zVek/OuHMuAnQCZev2KoSCK/Tv0fyaxFHWPidrgJ46TDHF96ShjylVwCA6 LYZgQnKJG7nWgemYrdFTgOHZVEAHvVvqQdCOyzAJVXwUPuN5wgJDaZWQIDI7mYUwqHUd lk5iwIrWgkDRczOdhqttiK0kPdT7NFz7p57c39AqVM78aHFW0O91brmRt7yeLQ92qAQt rCmFkdIHeGbaE2IAm4sdxj9Nt6Q7xtoxl1VTwfNYnJXta02xkdqH63DhBp0nXekoQmh2 H7zg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=mflnzpif; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g8-20020aa79dc8000000b0063b733e67c2si6656602pfq.121.2023.05.11.06.27.19; Thu, 11 May 2023 06:27:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=mflnzpif; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238193AbjEKNRa (ORCPT <rfc822;peekingduck44@gmail.com> + 99 others); Thu, 11 May 2023 09:17:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35026 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238135AbjEKNQ7 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 11 May 2023 09:16:59 -0400 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F072100DC; Thu, 11 May 2023 06:15:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1683810946; x=1715346946; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=8XQL7bYEaCNAsPYfNtNmF5YMRERIojn4B8v+BqlhGOQ=; b=mflnzpifX7zqm8eXAwHKvnk5a4hleC0Ctjaa1b5ho4zFevEThqLI7Y2o WJbJpN/YRgFYEbKyno1PUiMkoDnCEfjCfaGeBDZzgZ3QWZRbdHBZ3MGXB /rhZYT4LAi7cqJB3K7VoA+RTyC6FS2z5tQd0776DfXoxy5iLTqDTtHXVh DVMDxhUhgDYLcXB1MdsNt4HNGy0oE3N/yKVvgAPoVZZ5PQP9cEyc190i8 BT/xsfZS95yJW84QPmOzsFSn0/HMcj3cZF5J0k+v9Wc4ewbMeRuUxjCFc K/647eNMV594JyZdoMR8NuWvTHtsk9BJQPzrVMoO+odMmjeD5iO2JC6yk A==; X-IronPort-AV: E=McAfee;i="6600,9927,10706"; a="378619605" X-IronPort-AV: E=Sophos;i="5.99,266,1677571200"; d="scan'208";a="378619605" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 May 2023 06:15:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10706"; a="650169921" X-IronPort-AV: E=Sophos;i="5.99,266,1677571200"; d="scan'208";a="650169921" Received: from jsanche3-mobl1.ger.corp.intel.com (HELO ijarvine-MOBL2.ger.corp.intel.com) ([10.252.39.112]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 May 2023 06:15:35 -0700 From: =?utf-8?q?Ilpo_J=C3=A4rvinen?= <ilpo.jarvinen@linux.intel.com> To: linux-pci@vger.kernel.org, Bjorn Helgaas <helgaas@kernel.org>, Rob Herring <robh@kernel.org>, Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>, =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= <kw@linux.com>, Lukas Wunner <lukas@wunner.de>, Hector Martin <marcan@marcan.st>, Sven Peter <sven@svenpeter.dev>, Alyssa Rosenzweig <alyssa@rosenzweig.io>, Marcel Holtmann <marcel@holtmann.org>, Johan Hedberg <johan.hedberg@gmail.com>, Luiz Augusto von Dentz <luiz.dentz@gmail.com>, asahi@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org Cc: =?utf-8?q?Ilpo_J=C3=A4rvinen?= <ilpo.jarvinen@linux.intel.com> Subject: [PATCH 11/17] Bluetooth: hci_bcm4377: Use pcie_lnkctl_clear_and_set() for changing LNKCTL Date: Thu, 11 May 2023 16:14:35 +0300 Message-Id: <20230511131441.45704-12-ilpo.jarvinen@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230511131441.45704-1-ilpo.jarvinen@linux.intel.com> References: <20230511131441.45704-1-ilpo.jarvinen@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1765604487149289113?= X-GMAIL-MSGID: =?utf-8?q?1765604487149289113?= |
Series |
PCI: Improve LNKCTL & LNKCTL2 concurrency control
|
|
Commit Message
Ilpo Järvinen
May 11, 2023, 1:14 p.m. UTC
Don't assume that only the driver would be accessing LNKCTL. ASPM
policy changes can trigger write to LNKCTL outside of driver's control.
Use pcie_lnkctl_clear_and_set() which does proper locking to avoid
losing concurrent updates to the register value.
Suggested-by: Lukas Wunner <lukas@wunner.de>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
---
drivers/bluetooth/hci_bcm4377.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/bluetooth/hci_bcm4377.c b/drivers/bluetooth/hci_bcm4377.c index 19ad0e788646..e2b489f678d9 100644 --- a/drivers/bluetooth/hci_bcm4377.c +++ b/drivers/bluetooth/hci_bcm4377.c @@ -2232,8 +2232,7 @@ static void bcm4377_disable_aspm(struct bcm4377_data *bcm4377) * or if the BIOS hasn't handed over control to us. We must *always* * disable ASPM for this device due to hardware errata though. */ - pcie_capability_clear_word(bcm4377->pdev, PCI_EXP_LNKCTL, - PCI_EXP_LNKCTL_ASPMC); + pcie_lnkctl_clear_and_set(bcm4377->pdev, PCI_EXP_LNKCTL_ASPMC, 0); } static void bcm4377_pci_free_irq_vectors(void *data)