From patchwork Fri Mar 24 01:32:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cai Huoqing X-Patchwork-Id: 74297 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp82430wrt; Thu, 23 Mar 2023 18:39:56 -0700 (PDT) Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=lV3kZeBr X-Google-Smtp-Source: AKy350bCBr+PPDqBpRHvfqSC5rBn4Rm/wmbVhhVzP1uZVmL/0ZRzLAC0m9CuaeltAVQfQuaY7CVY X-Received: by 2002:a17:902:e812:b0:19c:e440:9256 with SMTP id u18-20020a170902e81200b0019ce4409256mr1214586plg.35.1679621996089; Thu, 23 Mar 2023 18:39:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679621996; cv=none; d=google.com; s=arc-20160816; b=KvJda4BUv+ha67eOUTvW2rNocaxp7En4qCIuNSMfyGfxRCjKb4SsfHMyrAYx7sQ/er qBlOHbDMO/9qEDlk2aKBtTmICvXhtcVP1UOsOJ6ZH+IG/Zra4JdmbcnHZ8Hx3EOIMHFv K9Z6drGAvZwlKtrzuyTYUu9qJGNApQhJGSFuKKp/4G0SMqug2rp6GZP8EIAl4LKp0wG4 W4kD48u6xztI8TD1xQkQP757MLPNQMbPMz+/WhzogqbtlDuaVb6BvRUS7mQ0yPxaNrzk 9sjNqdHv6GzdKMpd0v3InFfHc1IEKm/AmyalmOmOyY3Kz2oJ6x678vTNI0RGRN9fdCEv bnQw== 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=M70XsVdJtUL81tuo2OKkYLLlk8pQMU03G6wBmbDiO64=; b=J+aKPTRPgFNhRMO4YlPEMwoYTBuP7dfVPzbYpty1rxOSDTjvx7Mq+jBqcSD9RaaCvN Wpl8kvbWIVQsbkult4q/Hb8CRwqJz4tyDy5Becfa88+CBKX7LObBdaXHDrjbiA2yhApY RY0aE3HAp5CtJ+D6Jh9M4IZ48h8w0BAp8wAaPRMHA1445mUOS1P5sU/ObrTRKatMQ9zP ZiVjMcAU3ttcpAUhKG7A74xEovEOF41o/K2jF9G1Bk8txY2+kNSJ77ZNsbt/bOrf0Zun h0+TfCVxBThNxI3zh9IEb3kqx9OqN+fGjJJCqIYjUWOqJ8H3ErUXs0Lf+Hvi+6Fe4puh rO1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=lV3kZeBr; 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=linux.dev Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mp5-20020a17090b190500b0023f2497e6f1si2960475pjb.182.2023.03.23.18.39.43; Thu, 23 Mar 2023 18:39:56 -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=@linux.dev header.s=key1 header.b=lV3kZeBr; 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=linux.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230430AbjCXBcs (ORCPT + 99 others); Thu, 23 Mar 2023 21:32:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50438 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230487AbjCXBcr (ORCPT ); Thu, 23 Mar 2023 21:32:47 -0400 Received: from out-12.mta0.migadu.com (out-12.mta0.migadu.com [91.218.175.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0CC84619F for ; Thu, 23 Mar 2023 18:32:44 -0700 (PDT) X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1679621563; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=M70XsVdJtUL81tuo2OKkYLLlk8pQMU03G6wBmbDiO64=; b=lV3kZeBrOOcFCbH1tQshhiHqpu5Z4QEJXzp9hx5KbtNMKoGZi/Dvw0G2zEPF+QC/y86Wy4 2rhYCkfdwv1CtazOnV2bOPZjMNVZ3bI+JO3R8w9fbgW7tA5MUkxF2bls339hOwWbJSjaZR 7Cl6cwRZpO6VRMlanzxxMRjXFEsSYyc= From: Cai Huoqing To: cai.huoqing@linux.dev Cc: Dave Jiang , Sanjay R Mehta , Shyam Sundar S K , Jon Mason , Allen Hubbe , Frank Li , ntb@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH v2 3/3] ntb: intel: Remove redundant pci_clear_master Date: Fri, 24 Mar 2023 09:32:20 +0800 Message-Id: <20230324013224.5963-3-cai.huoqing@linux.dev> In-Reply-To: <20230324013224.5963-1-cai.huoqing@linux.dev> References: <20230324013224.5963-1-cai.huoqing@linux.dev> MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS,TO_EQ_FM_DIRECT_MX autolearn=no 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761211314165767357?= X-GMAIL-MSGID: =?utf-8?q?1761211314165767357?= Remove pci_clear_master to simplify the code, the bus-mastering is also cleared in do_pci_disable_device, like this: ./drivers/pci/pci.c:2197 static void do_pci_disable_device(struct pci_dev *dev) { u16 pci_command; pci_read_config_word(dev, PCI_COMMAND, &pci_command); if (pci_command & PCI_COMMAND_MASTER) { pci_command &= ~PCI_COMMAND_MASTER; pci_write_config_word(dev, PCI_COMMAND, pci_command); } pcibios_disable_device(dev); }. And dev->is_busmaster is set to 0 in pci_disable_device. Signed-off-by: Cai Huoqing Acked-by: Dave Jiang --- v1->v2: No change v1 link: https://lore.kernel.org/lkml/20230323115336.12986-3-cai.huoqing@linux.dev/ drivers/ntb/hw/intel/ntb_hw_gen1.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/ntb/hw/intel/ntb_hw_gen1.c b/drivers/ntb/hw/intel/ntb_hw_gen1.c index 60a4ebc7bf35..9ab836d0d4f1 100644 --- a/drivers/ntb/hw/intel/ntb_hw_gen1.c +++ b/drivers/ntb/hw/intel/ntb_hw_gen1.c @@ -1791,7 +1791,6 @@ static int intel_ntb_init_pci(struct intel_ntb_dev *ndev, struct pci_dev *pdev) err_mmio: err_dma_mask: - pci_clear_master(pdev); pci_release_regions(pdev); err_pci_regions: pci_disable_device(pdev); @@ -1808,7 +1807,6 @@ static void intel_ntb_deinit_pci(struct intel_ntb_dev *ndev) pci_iounmap(pdev, ndev->peer_mmio); pci_iounmap(pdev, ndev->self_mmio); - pci_clear_master(pdev); pci_release_regions(pdev); pci_disable_device(pdev); pci_set_drvdata(pdev, NULL);