Received: by 2002:ac8:156:0:b0:3e0:cd10:60c8 with SMTP id f22csp2499337qtg; Thu, 23 Mar 2023 04:57:49 -0700 (PDT) X-Google-Smtp-Source: AKy350aaUnOpr0l0nUcYSE7BScECrQL1/SUzHFZprjl+TMszSHmmbc8+XbVGTF0cPCZHCYv+JOOm X-Received: by 2002:a17:903:5cc:b0:1a1:97b5:c64f with SMTP id kf12-20020a17090305cc00b001a197b5c64fmr4974785plb.11.1679572669060; Thu, 23 Mar 2023 04:57:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679572669; cv=none; d=google.com; s=arc-20160816; b=0lPjgDR8NpALLbWpGKjoKUo6zhXFILY6cAz8nwhJwkZEaycaM6IjrvQ4+gbP5+eM78 H01UDk9q8W+uao1nkgy25qYMAcDa5qzJGm3Ri/6vAO819Sfh+rUlF3VZPdV2q/rOcdJq 2JuMT/Vgv+QbtbBzhfut9i7061z5TLn7QIltLKgEJRiIlxS3LP0cUcSFtXrs4GKLNnyL Pptauw73zEfQZECUVZQB7IlQZAgqHqtkiJ/FLRK4b1fDSFUYznSS5p9kzw5ePqwAKZyG nmzbOMVE3FeX7ebQON/+oerQNVPnG12QoCbv0OnoHGFCLUoutnbKJH4Tay4c3BQAJsVI Yofw== 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=P4FY3EEAjGMGaZUzTwyD8wRiA7SbipJR+ORYUAZzQpA=; b=AUFTWZ8W2bN5TyjmK8tMOQRMYuXuWPhSmN58p+0qveTJyt3oZSBjxxWOqerwB2L8MR NaP4ZHQlZlHtLvNSyadJy8Wdoyab7mLtuW8QJmvY2QUVcyfU/bI48EyLJMUN8J/fSeIS QL3bpqWxoHRj+49OkcpUIDN0gwrH333IFL8qHGKYzcUrZwmUHr7gKWJSzsbIzLrf6DSs HFtwVh9XRXhIkddXGudMwStzTSVYN+UIzW65lT1zWHvljAEvicVQMcCgGFfA/fcYnOhL YXxicOX28Jk2UUtNdMGB3Z1Iu2z4ZqJrKpKL4i4jHWbs1N+ZWriGFHbfv2pjPp9XYXpH vIjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=jm990LnV; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 125-20020a630183000000b0050be5c0b5d6si18125020pgb.617.2023.03.23.04.57.37; Thu, 23 Mar 2023 04:57:49 -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=jm990LnV; 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 S231774AbjCWLyG (ORCPT + 99 others); Thu, 23 Mar 2023 07:54:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52958 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231508AbjCWLx7 (ORCPT ); Thu, 23 Mar 2023 07:53:59 -0400 Received: from out-39.mta0.migadu.com (out-39.mta0.migadu.com [IPv6:2001:41d0:1004:224b::27]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 89D9134C10 for ; Thu, 23 Mar 2023 04:53:53 -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=1679572431; 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=P4FY3EEAjGMGaZUzTwyD8wRiA7SbipJR+ORYUAZzQpA=; b=jm990LnVNAP4u+eLYixqUc+RFWiz/m/delvGMV7SYM09mn+kQAKNx9ZKhmPrfr4eHOq/kM 9TJyan3qKtRl5UP7+ESwgKwbnYRdGrlCTB+i07snUggXzSAh6qnV2dKC/tDhRuBJv/vcMG 4dVZRDnB3FHV3edpYV2OJnKIaCHXHpQ= From: Cai Huoqing To: cai.huoqing@linux.dev Cc: Sanjay R Mehta , Shyam Sundar S K , Jon Mason , Dave Jiang , Allen Hubbe , Frank Li , ntb@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH 3/3] ntb: intel: Remove redundant pci_clear_master Date: Thu, 23 Mar 2023 19:53:35 +0800 Message-Id: <20230323115336.12986-3-cai.huoqing@linux.dev> In-Reply-To: <20230323115336.12986-1-cai.huoqing@linux.dev> References: <20230323115336.12986-1-cai.huoqing@linux.dev> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 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 --- 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); -- 2.34.1