From patchwork Thu Mar 23 09:03:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cai Huoqing X-Patchwork-Id: 73922 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp2805719wrt; Thu, 23 Mar 2023 02:24:39 -0700 (PDT) X-Google-Smtp-Source: AK7set/V+vuB7tXkOVVXzdyC4hDmZsB5rkirVw5qr110s86ux1YzKR85Emq7Bw4GoqzSnlO/ldbP X-Received: by 2002:aa7:991e:0:b0:624:9205:977d with SMTP id z30-20020aa7991e000000b006249205977dmr5681872pff.27.1679563479059; Thu, 23 Mar 2023 02:24:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679563479; cv=none; d=google.com; s=arc-20160816; b=siXEM+Cg04ChXqtPbO1G+gx/kPsTXtwJbff9ABFduqfGnbsFy/9F2WjcoVFb5ZE2wg Pq+ppn/dd26oNWMRxXKF0Tlouu5kYdI4qK3gbcEghjutERQI0BCx+MdhIbI8ZgLfDxO6 qsKO9yDJogV3UO0ieKCe8ckOMVMkcLnU7dC6tkDNWegp5LoPBHbLUOyXL6S6CJ9mxYnr pLnR47DBoJXMrZLkve5ieLLcxEuLnJx5G58lDi7aGKUVG0MGKfIVlUL5/7F2Lc+dJoXC YoZ0ElZZ6DsV4yZb3k6nH5Kv7t54r9F3yvWkU/e9C6LAyf7yzrAxapOOZ+75WxvlNbk+ e/lw== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=lTe9LISs2pflvSiuzz8njOhESiOpw5ulrZFB1bo8ej0=; b=ryddTLdv6UnhSrvzY7A3NcM+hGhNCJUKx2znlUmsudfMwFhp3ypc1GJxXKbCFYUFzt whf2vXdBsM5vHgQhD3WZ7yxKa60U4sDusKMfzQyUm5L9O68kprehQ18a7vtXLtO6N8/p q7zVmbjIqDIWwEGDkj+qIbuX+X+1C6ZzLpxOgWxonAnppoPmlPc4o62O41FC0hW4nSyF In+JRbsTKP6fKdU2bC5hhEvh8ZCbQoQOoBmrt4yauv9g+VZ0sCAtlsdV3O1m1BUweKVQ adTsCzeaopbmSIbLYTkyAEZOgaMi4cs6kGiSmMqhiUYTLR60ig3Uqx0/6WpK3H+JAo66 EFpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=uYcoUfKD; 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 z9-20020a634c09000000b004fbc4585c48si18025445pga.465.2023.03.23.02.24.26; Thu, 23 Mar 2023 02:24:39 -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=uYcoUfKD; 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 S231449AbjCWJDh (ORCPT + 99 others); Thu, 23 Mar 2023 05:03:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41306 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231272AbjCWJDg (ORCPT ); Thu, 23 Mar 2023 05:03:36 -0400 Received: from out-16.mta0.migadu.com (out-16.mta0.migadu.com [91.218.175.16]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CCDDD199E4 for ; Thu, 23 Mar 2023 02:03:28 -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=1679562206; 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; bh=lTe9LISs2pflvSiuzz8njOhESiOpw5ulrZFB1bo8ej0=; b=uYcoUfKDkxNQ6Id+Oa4CLl9EGelbi8sUDea8HTVwAAcsDQDyAVWO1CZOtQpqSBg17uAAXh My6s84gYx4X746OVkTIgmvhoXolDbjHgA9Kkg8EjTb7bRU0la49hQCaCO8BCOTQ//RyOAy KJhdS0oIe2rn0GN5fBK0vtCp5+r/btY= From: Cai Huoqing To: cai.huoqing@linux.dev Cc: Derek Chickles , Satanand Burla , Felix Manlunas , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Raju Rangoju , Dariusz Marcinkiewicz , Dimitris Michailidis , Yisen Zhuang , Salil Mehta , Saeed Mahameed , Leon Romanovsky , "K. Y. Srinivasan" , Haiyang Zhang , Wei Liu , Dexuan Cui , Shannon Nelson , Brett Creeley , drivers@pensando.io, Bjorn Helgaas , Jesse Brandeburg , Guangbin Huang , Jian Shen , Hao Lan , Jie Wang , Long Li , Jiri Pirko , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org, linux-hyperv@vger.kernel.org Subject: [PATCH 1/8] net: liquidio: Remove redundant pci_clear_master Date: Thu, 23 Mar 2023 17:03:00 +0800 Message-Id: <20230323090314.22431-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?1761149954518749629?= X-GMAIL-MSGID: =?utf-8?q?1761149954518749629?= 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/net/ethernet/cavium/liquidio/lio_main.c | 1 - drivers/net/ethernet/cavium/liquidio/lio_vf_main.c | 1 - 2 files changed, 2 deletions(-) diff --git a/drivers/net/ethernet/cavium/liquidio/lio_main.c b/drivers/net/ethernet/cavium/liquidio/lio_main.c index fd7c80edb6e8..9bd1d2d7027d 100644 --- a/drivers/net/ethernet/cavium/liquidio/lio_main.c +++ b/drivers/net/ethernet/cavium/liquidio/lio_main.c @@ -1129,7 +1129,6 @@ static void octeon_destroy_resources(struct octeon_device *oct) fallthrough; case OCT_DEV_PCI_ENABLE_DONE: - pci_clear_master(oct->pci_dev); /* Disable the device, releasing the PCI INT */ pci_disable_device(oct->pci_dev); diff --git a/drivers/net/ethernet/cavium/liquidio/lio_vf_main.c b/drivers/net/ethernet/cavium/liquidio/lio_vf_main.c index ac196883f07e..e2921aec3da0 100644 --- a/drivers/net/ethernet/cavium/liquidio/lio_vf_main.c +++ b/drivers/net/ethernet/cavium/liquidio/lio_vf_main.c @@ -577,7 +577,6 @@ static void octeon_destroy_resources(struct octeon_device *oct) fallthrough; case OCT_DEV_PCI_ENABLE_DONE: - pci_clear_master(oct->pci_dev); /* Disable the device, releasing the PCI INT */ pci_disable_device(oct->pci_dev); From patchwork Thu Mar 23 09:03:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cai Huoqing X-Patchwork-Id: 73911 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp2801188wrt; Thu, 23 Mar 2023 02:11:39 -0700 (PDT) X-Google-Smtp-Source: AK7set+Omv3ELmjXL6gZtgpe/oQ7kdUoFDkjYL6K9NJEhpyWeBahRPkPBA1Pa1jb3NlhVB5kgpHB X-Received: by 2002:a05:6a20:baa3:b0:db:8893:96ad with SMTP id fb35-20020a056a20baa300b000db889396admr2295852pzb.23.1679562698699; Thu, 23 Mar 2023 02:11:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679562698; cv=none; d=google.com; s=arc-20160816; b=y2VcoQ+MHdNi6OuRURFg0vdbOeevC0SYPBoQZUxTz05cKqS1bNIfhjbSi6hU7ZWlkB Az3cbKFh2/SR0zU8RO6DW3SJJNhljzGO6Z2czKAID0jvQOFDGthAwNOTcVuOe5hSb/t3 546NKDMlJNUFOMPje/VTA4oSQ9aMdZ2fVsN6MywRVJncoE5+4CIzJhVGSbCCLq/nBb5L a+EOuSo/UrOHQAuR5VLeR0tMglY6gPlNlN/ArQd+YK/dxuiTf7NpFJypQlBxOsa3ENxD f53Ubjbe0nY2KUTtH5xMoyj/lGjG1G0ZWyTnym7uqK5OwbA0HszJKdpn350C76jYMYFc rH6A== 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=IiRXdKppa9IBGp5kQGEXwtKfuR/2bgkSL+hNdkioQqs=; b=MlCLzGI5gXl02mcqwDCKJ7azLqkAfC0N4IFo4ze+np3hKMqRAMULJmAF9K0AbDp1t6 xdDnxl1GzbXh4msZafoVgLHMbTq64ZIy+QRX7K0fpMQySTfLWUHzR6LNLPnOQcxJyr3X /g/sRdRtcgOlIusESP5YHdLtd8YRcEMWLFhCge7RRSKk5KOLoDnwTpbIac+VjG4llWTh /eVTPACoxI+JR3ie0FAxNGSF4HH+vOMx+HpLc9cHkV26q/Unb38+4g6Opf9YhfmDzm+E +KoFvTKPKEq5tC9bxfz8M8wLH9Xb/e6iFbJpe57udHyfN4nblZCExGjW+/z3RkOffT2c dntQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b="MUeYVTo/"; 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 a15-20020a056a000c8f00b00625c6092a12si19188945pfv.215.2023.03.23.02.11.23; Thu, 23 Mar 2023 02:11:38 -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="MUeYVTo/"; 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 S231381AbjCWJDu (ORCPT + 99 others); Thu, 23 Mar 2023 05:03:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41762 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231462AbjCWJDs (ORCPT ); Thu, 23 Mar 2023 05:03:48 -0400 Received: from out-9.mta1.migadu.com (out-9.mta1.migadu.com [95.215.58.9]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B999E1ABF6 for ; Thu, 23 Mar 2023 02:03: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=1679562222; 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=IiRXdKppa9IBGp5kQGEXwtKfuR/2bgkSL+hNdkioQqs=; b=MUeYVTo/T72JuuTmN+VG/0fI78l9KiugDmSXdYzstalg0UCpuRmQnt59kKJLrc/m1EJMnw DzrmAnc9d9SFr3AI5gwjvc7RzfmXkLSjSFlIsjj6iY7Re6eVWnhRYDOI+YFMVHYQtPQUGe Wmizm0ZHpB7aJqHToDYspG/y2xBvCIc= From: Cai Huoqing To: cai.huoqing@linux.dev Cc: Derek Chickles , Satanand Burla , Felix Manlunas , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Raju Rangoju , Dariusz Marcinkiewicz , Dimitris Michailidis , Yisen Zhuang , Salil Mehta , Saeed Mahameed , Leon Romanovsky , "K. Y. Srinivasan" , Haiyang Zhang , Wei Liu , Dexuan Cui , Shannon Nelson , Brett Creeley , drivers@pensando.io, Jesse Brandeburg , Bjorn Helgaas , Guangbin Huang , Jian Shen , Hao Lan , Jie Wang , Long Li , Jiri Pirko , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org, linux-hyperv@vger.kernel.org Subject: [PATCH 2/8] net: hisilicon: Remove redundant pci_clear_master Date: Thu, 23 Mar 2023 17:03:01 +0800 Message-Id: <20230323090314.22431-2-cai.huoqing@linux.dev> In-Reply-To: <20230323090314.22431-1-cai.huoqing@linux.dev> References: <20230323090314.22431-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?1761149136051939064?= X-GMAIL-MSGID: =?utf-8?q?1761149136051939064?= 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/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 7 ++----- drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 6 ++---- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c index 07ad5f35219e..c3851a6e10c0 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -11365,7 +11365,7 @@ static int hclge_pci_init(struct hclge_dev *hdev) if (!hw->hw.io_base) { dev_err(&pdev->dev, "Can't map configuration register space\n"); ret = -ENOMEM; - goto err_clr_master; + goto err_release_regions; } ret = hclge_dev_mem_map(hdev); @@ -11378,8 +11378,7 @@ static int hclge_pci_init(struct hclge_dev *hdev) err_unmap_io_base: pcim_iounmap(pdev, hdev->hw.hw.io_base); -err_clr_master: - pci_clear_master(pdev); +err_release_regions: pci_release_regions(pdev); err_disable_device: pci_disable_device(pdev); @@ -11396,7 +11395,6 @@ static void hclge_pci_uninit(struct hclge_dev *hdev) pcim_iounmap(pdev, hdev->hw.hw.io_base); pci_free_irq_vectors(pdev); - pci_clear_master(pdev); pci_release_mem_regions(pdev); pci_disable_device(pdev); } @@ -11743,7 +11741,6 @@ static int hclge_init_ae_dev(struct hnae3_ae_dev *ae_dev) hclge_devlink_uninit(hdev); err_pci_uninit: pcim_iounmap(pdev, hdev->hw.hw.io_base); - pci_clear_master(pdev); pci_release_regions(pdev); pci_disable_device(pdev); out: diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c index e84e5be8e59e..f24046250341 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c @@ -2598,7 +2598,7 @@ static int hclgevf_pci_init(struct hclgevf_dev *hdev) if (!hw->hw.io_base) { dev_err(&pdev->dev, "can't map configuration register space\n"); ret = -ENOMEM; - goto err_clr_master; + goto err_release_regions; } ret = hclgevf_dev_mem_map(hdev); @@ -2609,8 +2609,7 @@ static int hclgevf_pci_init(struct hclgevf_dev *hdev) err_unmap_io_base: pci_iounmap(pdev, hdev->hw.hw.io_base); -err_clr_master: - pci_clear_master(pdev); +err_release_regions: pci_release_regions(pdev); err_disable_device: pci_disable_device(pdev); @@ -2626,7 +2625,6 @@ static void hclgevf_pci_uninit(struct hclgevf_dev *hdev) devm_iounmap(&pdev->dev, hdev->hw.hw.mem_base); pci_iounmap(pdev, hdev->hw.hw.io_base); - pci_clear_master(pdev); pci_release_regions(pdev); pci_disable_device(pdev); } From patchwork Thu Mar 23 09:03:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cai Huoqing X-Patchwork-Id: 73925 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp2806179wrt; Thu, 23 Mar 2023 02:26:01 -0700 (PDT) X-Google-Smtp-Source: AK7set8Foe7DnuIPPf4a3MfLV7PAlzTcYiB0+h8+jvwJDfs0ZHCN4mx1ILfPIcZxoIY7BDsx3Iai X-Received: by 2002:a17:903:2285:b0:1a1:d5fd:1e9a with SMTP id b5-20020a170903228500b001a1d5fd1e9amr6755719plh.40.1679563561639; Thu, 23 Mar 2023 02:26:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679563561; cv=none; d=google.com; s=arc-20160816; b=EQWfa+Sj+WANJqGcty1rZXQ9V9mS60Vqdt7ADFKFrzxerxQLZnjgKCVznyfR/qzNUF pOGTyNZlDfF0iRGK725KIOW966fupNv8eiwtMCehlO91JtHtq10YoNAonv+WDmg3V9oA Io6S4KGYcOp7GwMFZatAeGCaFYcqAIaxJVfivo+Db0pHGvNdzs9Zxlu89r/vOlzl+CdX oIG+XT00kUPAtknuHlwn8VAuHZFSvQj3pn0Iq70o3Dk0BGkMTF8GhXzOw1YSiuVM4sok wwM3DCfB7wK0BJQNisPJMtgNnw/fPCqYU1kj4nxm4I1n9+9egRGK+fmVJWU1m9w+UoZP VouA== 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=E9VZuBBTp04BDbs+ncOrUcdGIr1MtZeBvyGlNQPB6Mg=; b=aBjlZLFQSv7LDGGokfWj+vhM5ZE54rjpUU53qht8RKj2DzrS3vhGBn+C9MildgaNEl O+zTjhZBZoZa2/DiTm2gUIeX1e3NJ00e4+/asRsHraeArTBsFDZyD/ivyx51AC4p+KQ2 /dGIUfOFBe7YWfhe/0HdO+9SARQcXBstg809Idg6mCrO0rB48fHaqMnnh37KfyB6jZMU wUM0NP67hSKyhR3uQ3cYnbsNtbo7rFgaZT6iQTMQXcsTzgs0o4ASj0+HkZnbHWDoUiKE Lg6hM/mOuw7aLTxQhdiNgCrDpvmq8IFxg8C7FP4wvsbHkKE0/h20UGkeRdWHMQ44Ob4p Y/zQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=tOF2mLSO; 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 l6-20020a170902f68600b001a1c005bd52si13355802plg.34.2023.03.23.02.25.48; Thu, 23 Mar 2023 02:26:01 -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=tOF2mLSO; 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 S231537AbjCWJED (ORCPT + 99 others); Thu, 23 Mar 2023 05:04:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41970 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231503AbjCWJD4 (ORCPT ); Thu, 23 Mar 2023 05:03:56 -0400 Received: from out-20.mta0.migadu.com (out-20.mta0.migadu.com [91.218.175.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 32ABD1B565 for ; Thu, 23 Mar 2023 02:03:55 -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=1679562233; 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=E9VZuBBTp04BDbs+ncOrUcdGIr1MtZeBvyGlNQPB6Mg=; b=tOF2mLSO0gVV24esZPsvixYPG2lfpE5Hm5zHYAZRFK2gto6p6aSp+hW5wQljUvze36l6bP 8LdDEhzDomKyHbkjwkzxc7WR2PW9y+SMqiHHA84djwZzJx9VFMvsOUFNfH/Jerlg296PEW 5oBHFfiGkj39SEXCIR/boRnxE77C0Yg= From: Cai Huoqing To: cai.huoqing@linux.dev Cc: Derek Chickles , Satanand Burla , Felix Manlunas , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Raju Rangoju , Dariusz Marcinkiewicz , Dimitris Michailidis , Yisen Zhuang , Salil Mehta , Saeed Mahameed , Leon Romanovsky , "K. Y. Srinivasan" , Haiyang Zhang , Wei Liu , Dexuan Cui , Shannon Nelson , Brett Creeley , drivers@pensando.io, Jesse Brandeburg , Bjorn Helgaas , Guangbin Huang , Jian Shen , Hao Lan , Jie Wang , Long Li , Jiri Pirko , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org, linux-hyperv@vger.kernel.org Subject: [PATCH 3/8] net: cxgb4vf: Remove redundant pci_clear_master Date: Thu, 23 Mar 2023 17:03:02 +0800 Message-Id: <20230323090314.22431-3-cai.huoqing@linux.dev> In-Reply-To: <20230323090314.22431-1-cai.huoqing@linux.dev> References: <20230323090314.22431-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?1761150041529290651?= X-GMAIL-MSGID: =?utf-8?q?1761150041529290651?= 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/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c b/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c index 63b2bd084130..9ba0864592e8 100644 --- a/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c +++ b/drivers/net/ethernet/chelsio/cxgb4vf/cxgb4vf_main.c @@ -3258,7 +3258,6 @@ static int cxgb4vf_pci_probe(struct pci_dev *pdev, err_release_regions: pci_release_regions(pdev); - pci_clear_master(pdev); err_disable_device: pci_disable_device(pdev); @@ -3338,7 +3337,6 @@ static void cxgb4vf_pci_remove(struct pci_dev *pdev) * Disable the device and release its PCI resources. */ pci_disable_device(pdev); - pci_clear_master(pdev); pci_release_regions(pdev); } From patchwork Thu Mar 23 09:03:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cai Huoqing X-Patchwork-Id: 73916 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp2804134wrt; Thu, 23 Mar 2023 02:19:41 -0700 (PDT) X-Google-Smtp-Source: AK7set9oxtiFDDxNr5+UzKe6YKtVLBr9dIiHUgOhFW/NMGJcZI5wh6QJvftpWE9ThaimjPI2hMop X-Received: by 2002:aa7:dd44:0:b0:4fd:2346:7225 with SMTP id o4-20020aa7dd44000000b004fd23467225mr9728061edw.34.1679563180972; Thu, 23 Mar 2023 02:19:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679563180; cv=none; d=google.com; s=arc-20160816; b=hxhM5gUENdkRoOvTUpAUevKyCeNy5syfGG7Jr1sEw6s1w294H/XYBsZDKAzTtUSRdI PxIADpRnU3RqbUSucoQA59a+qGuVf5XOZ3FnFrJjwXbb9oiVM+wExlB/jyUTJ/Kjhc63 69EPSqwWmk2ZJJjbHNepvjqBK44UuABBgP0Ux1TKuToVygUgzOjVgenufn++39byaT7x JLpbpFTQ2ULyuRO1A4n4kG0ccqfyL51RhJsNGgZKLF73a0ePKPRdUTG83O7fpzmCHNe1 H+EbSE4Ttk0TIkHqJQHIVZ4T0Icrzs/L50N705u+Gx3OCOKnkpkeQY03QfkRga7OQBOr 2atw== 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=8heerTHq9kX+O1AlscOnshCW0sl+3t4ySnbmUTH08/4=; b=sm036/ewFx+nNhkVXX4KOE6v5dFQJVa6UfySfyu2qlVU1aFLJNDqQ2epIP4CQaGe0g fLDdB1pydMmCnFts/EVUjWpcb0giptX7RGPl6dZvzoGoxvFJa4mXJmVpLXPHlVA5/n5y qHj5iSpLQrSXdBBlX/kifkaIATLMdBd7aYYrGJjddFsF/sY2767SmPeaqUpD2KQ5aBHI 0s8FpumHBJiRn9kkJ5vMy3Vy5ITBPKeMzblyW8IYFSLrP699BBZLjzfRTAtWnf1wKJeY N8gtV26LWjNfNEbD16toQHXSEN+0MzhvPb5Div2vQEJZFJ8Ixo7dwO/Yd2Ebxonr4pTX 2C2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=SBkUHkqW; 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 r17-20020aa7d591000000b004ace203c6c8si17732143edq.202.2023.03.23.02.19.17; Thu, 23 Mar 2023 02:19:40 -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=SBkUHkqW; 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 S231597AbjCWJEW (ORCPT + 99 others); Thu, 23 Mar 2023 05:04:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42576 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231277AbjCWJEM (ORCPT ); Thu, 23 Mar 2023 05:04:12 -0400 Received: from out-11.mta1.migadu.com (out-11.mta1.migadu.com [95.215.58.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7419F1CAC9 for ; Thu, 23 Mar 2023 02:04:07 -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=1679562245; 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=8heerTHq9kX+O1AlscOnshCW0sl+3t4ySnbmUTH08/4=; b=SBkUHkqWpaPjzum4QPIb4aVPODL0367StZD4I/ykW1mdvDqjmZKLrtcVWcxHZmnwXzgUhv bbWsFsyl4IJ1R7f3c1XobImqKoy7BJ5q4Gtk8mfeAEUBQdilhkez2KCxOAYPZPgp7eKK+F 3r3urHWu+kTYihhYWuvmFVg9xYTwbjE= From: Cai Huoqing To: cai.huoqing@linux.dev Cc: Derek Chickles , Satanand Burla , Felix Manlunas , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Raju Rangoju , Dariusz Marcinkiewicz , Dimitris Michailidis , Yisen Zhuang , Salil Mehta , Saeed Mahameed , Leon Romanovsky , "K. Y. Srinivasan" , Haiyang Zhang , Wei Liu , Dexuan Cui , Shannon Nelson , Brett Creeley , drivers@pensando.io, Jesse Brandeburg , Bjorn Helgaas , Guangbin Huang , Jian Shen , Hao Lan , Jie Wang , Long Li , Jiri Pirko , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org, linux-hyperv@vger.kernel.org Subject: [PATCH 4/8] net/fungible: Remove redundant pci_clear_master Date: Thu, 23 Mar 2023 17:03:03 +0800 Message-Id: <20230323090314.22431-4-cai.huoqing@linux.dev> In-Reply-To: <20230323090314.22431-1-cai.huoqing@linux.dev> References: <20230323090314.22431-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?1761149642055775980?= X-GMAIL-MSGID: =?utf-8?q?1761149642055775980?= 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: Dimitris Michailidis --- drivers/net/ethernet/fungible/funcore/fun_dev.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/net/ethernet/fungible/funcore/fun_dev.c b/drivers/net/ethernet/fungible/funcore/fun_dev.c index 3680f83feba2..a7fbd4cd560a 100644 --- a/drivers/net/ethernet/fungible/funcore/fun_dev.c +++ b/drivers/net/ethernet/fungible/funcore/fun_dev.c @@ -746,7 +746,6 @@ void fun_dev_disable(struct fun_dev *fdev) bitmap_free(fdev->irq_map); pci_free_irq_vectors(pdev); - pci_clear_master(pdev); pci_disable_device(pdev); fun_unmap_bars(fdev); @@ -821,7 +820,6 @@ int fun_dev_enable(struct fun_dev *fdev, struct pci_dev *pdev, disable_admin: fun_disable_admin_queue(fdev); free_irq_mgr: - pci_clear_master(pdev); bitmap_free(fdev->irq_map); free_irqs: pci_free_irq_vectors(pdev); From patchwork Thu Mar 23 09:03:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cai Huoqing X-Patchwork-Id: 73917 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp2805176wrt; Thu, 23 Mar 2023 02:22:57 -0700 (PDT) X-Google-Smtp-Source: AK7set+6ufwod/WreVWGuB8kr7iTBuY/9MpqExn2C4cKi1i1GZ5ZhUfwECuqicpTUcEtKTVdwiyh X-Received: by 2002:a17:90b:2243:b0:237:b5d4:c0cc with SMTP id hk3-20020a17090b224300b00237b5d4c0ccmr7067200pjb.39.1679563377691; Thu, 23 Mar 2023 02:22:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679563377; cv=none; d=google.com; s=arc-20160816; b=iCM3nHs+2fwkuNu3U056Z74IY46XsNXKabMazcgUMPfldna0oAbnx9bbvKVTyb10y6 e1afj5T4mNGVxgSLOBw6qIeLxooWzBa2f5AOACdkeBk7prlU7RCIk3iLszTD1CuMRUfX FthDKZiwN6eJ86froTMbo+YWlMlF3sCj7YWirmRRv7Qy46OiJUHmaK72GUjtIf5PPHa5 iobwV1DjpMLsktrZVNnfEGkwoi5NS21lQNyL0pqr8lN1TXeNffsD6NoeGIcf9d5H3/n5 EsgnQglWrMqKDpjqbaD3j9QOBwXHXrSk5lFL01FCSDoIj7R671rIrk2HXey0PuwjI/7M bw7g== 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=NyEg017C1ywIX1wAn/q5NdZuOMZ8BdSt+EwBakRj+C0=; b=AlxlF22v81aiPe3exjdAXqv04B0Xqt+fFJV+aEKvQ3Oj8qA0wqKL/gLLpNzcJ7WGik 08iw6V8+C3KfDkmbsgCm30ISo7K7xel1wRy/GKtzN/FgWS2QMgCx3/0sCshTEVO0diUq 5FqGM84vk0aKoQVSq6+ulJrD3mH+asra+ldJ1fSH1qgck7nypWCPvZCt2Rq33KrpHLrD 1GfdDA3yaADD0yCle7OfpICg/BpinDXQDGM5srQHHFXnwLrs/jYuaiMBisTbEbzC+shd 647g1+3cCY0RXLex0eAdcU/OF2FKdZSPEqtWrd6iTTtxMOicc0OhyrRQdZVncI4AC1CE +Geg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=rL5is+VM; 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 e19-20020a63d953000000b00502e7159b0fsi18867867pgj.175.2023.03.23.02.22.45; Thu, 23 Mar 2023 02:22:57 -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=rL5is+VM; 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 S230261AbjCWJEt (ORCPT + 99 others); Thu, 23 Mar 2023 05:04:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43852 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231622AbjCWJEa (ORCPT ); Thu, 23 Mar 2023 05:04:30 -0400 Received: from out-36.mta1.migadu.com (out-36.mta1.migadu.com [95.215.58.36]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1808B1B567 for ; Thu, 23 Mar 2023 02:04:18 -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=1679562257; 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=NyEg017C1ywIX1wAn/q5NdZuOMZ8BdSt+EwBakRj+C0=; b=rL5is+VMlk/R/98gOQvo9hI/r3EWFTkJzCppl65GYIBeu3seWtEy3bFQ9T0ybZpf+HAloY ySfUBZFZ1dYGWavwB3uOqjfUAT6cVbIpUJR6bF90M7f6aT6tD8DECh3ltE0fPxI8wki0AH hQgilZvJ6OCwmyHPHogcL4Nqv+5b90g= From: Cai Huoqing To: cai.huoqing@linux.dev Cc: Derek Chickles , Satanand Burla , Felix Manlunas , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Raju Rangoju , Dariusz Marcinkiewicz , Dimitris Michailidis , Yisen Zhuang , Salil Mehta , Saeed Mahameed , Leon Romanovsky , "K. Y. Srinivasan" , Haiyang Zhang , Wei Liu , Dexuan Cui , Shannon Nelson , Brett Creeley , drivers@pensando.io, Bjorn Helgaas , Jesse Brandeburg , Guangbin Huang , Jian Shen , Hao Lan , Jie Wang , Long Li , Jiri Pirko , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org, linux-hyperv@vger.kernel.org Subject: [PATCH 5/8] net/mlx5: Remove redundant pci_clear_master Date: Thu, 23 Mar 2023 17:03:04 +0800 Message-Id: <20230323090314.22431-5-cai.huoqing@linux.dev> In-Reply-To: <20230323090314.22431-1-cai.huoqing@linux.dev> References: <20230323090314.22431-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?1761149848316229992?= X-GMAIL-MSGID: =?utf-8?q?1761149848316229992?= 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/net/ethernet/mellanox/mlx5/core/main.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/main.c b/drivers/net/ethernet/mellanox/mlx5/core/main.c index d39c3476b6d1..597174ceadc9 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/main.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/main.c @@ -918,7 +918,6 @@ static int mlx5_pci_init(struct mlx5_core_dev *dev, struct pci_dev *pdev, return 0; err_clr_master: - pci_clear_master(dev->pdev); release_bar(dev->pdev); err_disable: mlx5_pci_disable_device(dev); @@ -933,7 +932,6 @@ static void mlx5_pci_close(struct mlx5_core_dev *dev) */ mlx5_drain_health_wq(dev); iounmap(dev->iseg); - pci_clear_master(dev->pdev); release_bar(dev->pdev); mlx5_pci_disable_device(dev); } From patchwork Thu Mar 23 09:03:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cai Huoqing X-Patchwork-Id: 73921 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp2805695wrt; Thu, 23 Mar 2023 02:24:32 -0700 (PDT) X-Google-Smtp-Source: AK7set9o1ffH8yi4Fsd+hnfjKCdWvT/Gyshf6ZQcQM5sss7Mw/oPceVe4KP8j3XNo2RM0pu5K1bt X-Received: by 2002:a17:903:280b:b0:19e:500b:517a with SMTP id kp11-20020a170903280b00b0019e500b517amr4463447plb.69.1679563471721; Thu, 23 Mar 2023 02:24:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679563471; cv=none; d=google.com; s=arc-20160816; b=GPXhoTaRtn8G1VqTxogMpUDJaMWEMG5eYxR51qfFvEh1dYyPBAm33KPe63wTmXa0A8 lTD13bV3XLEz+1lbrPHpLtp91CSPK69cUVQisIHZORoeRcWq0F5Q1PCKPr+4uaxJHgMK 8HiVMQ9cJKBfQgnqOqClnUj9M5CRMVe81UjLIXJC1cqK56nmLuDTGBSEQAfT+7QeWdTe F3wpLs8GY8l0xdo5ImRG5YgXqvRggkzfbFOZh6WtCHBAsKbysbbcZr6HmLPQ/BwzzIT1 xxoqOmGvayOTzp86uAbnZGLaqnoatlEJX9sTEd7KX9vuPyqbh7i/gUXZFna6RRJ1iz98 sr1g== 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=WkdvHrdmTL100mQnwE6Lnhv0ImSnOgCjctLH9bKwcXE=; b=M38HMdnEsAyJRCNkdSu9ERTya45E5hCQ/WPVp38QRVtkheP3oPIwbqDFi+f1eb2sLX X5Sv6EeLzdSp1MBJ88wygBSZm3Y2s2fnLRa9jiSrcsk5d1Akjmu+eXdt6jj87AQVSWAN e/swT7LpPCpa/mfKc2F1GVEJQ2g9dZ9BQuLuxbGXYbb+tNUdHo+pP52N3TS3gpeYzFSh XOSDtHHCMSZCmy17xfPOva7ihDLUF4E8lawkwKp5P6waYNABFe7HXCCRCOA/0aGb3ibp ivz9gPgZ5skkv7TYRNuztwwomy+DqcD9joCBiMXbXAnJtFaUE3wxbLvfffi2GS9lILcI QSmg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=Ql7dbPkw; 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 o33-20020a635d61000000b004770fe95989si17797145pgm.496.2023.03.23.02.24.19; Thu, 23 Mar 2023 02:24:31 -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=Ql7dbPkw; 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 S231584AbjCWJEx (ORCPT + 99 others); Thu, 23 Mar 2023 05:04:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43170 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231553AbjCWJEf (ORCPT ); Thu, 23 Mar 2023 05:04:35 -0400 Received: from out-36.mta0.migadu.com (out-36.mta0.migadu.com [IPv6:2001:41d0:1004:224b::24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 043991DB84 for ; Thu, 23 Mar 2023 02:04:29 -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=1679562268; 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=WkdvHrdmTL100mQnwE6Lnhv0ImSnOgCjctLH9bKwcXE=; b=Ql7dbPkwPtVVv40kbYJwCExR/7AdHzcbhdBNTehLR3XeqZu/Jmv/PmcxjnWsYUAjuxdZh0 YVpI/JPA/YWsSxKClzdFA+R8LA3IgJXs9Ndmn9o8WKA+M3Cb8tqdRkAnfBjpwjaIjVUpfu a3RhpJyDXW5ay6bF9gTQ/ek5kUR7/5s= From: Cai Huoqing To: cai.huoqing@linux.dev Cc: Derek Chickles , Satanand Burla , Felix Manlunas , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Raju Rangoju , Dariusz Marcinkiewicz , Dimitris Michailidis , Yisen Zhuang , Salil Mehta , Saeed Mahameed , Leon Romanovsky , "K. Y. Srinivasan" , Haiyang Zhang , Wei Liu , Dexuan Cui , Shannon Nelson , Brett Creeley , drivers@pensando.io, Bjorn Helgaas , Jesse Brandeburg , Guangbin Huang , Jian Shen , Hao Lan , Jie Wang , Long Li , Jiri Pirko , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org, linux-hyperv@vger.kernel.org Subject: [PATCH 6/8] net: mana: Remove redundant pci_clear_master Date: Thu, 23 Mar 2023 17:03:05 +0800 Message-Id: <20230323090314.22431-6-cai.huoqing@linux.dev> In-Reply-To: <20230323090314.22431-1-cai.huoqing@linux.dev> References: <20230323090314.22431-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?1761149946863265635?= X-GMAIL-MSGID: =?utf-8?q?1761149946863265635?= 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/net/ethernet/microsoft/mana/gdma_main.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/net/ethernet/microsoft/mana/gdma_main.c b/drivers/net/ethernet/microsoft/mana/gdma_main.c index f9b8f372ec8a..8f3f78b68592 100644 --- a/drivers/net/ethernet/microsoft/mana/gdma_main.c +++ b/drivers/net/ethernet/microsoft/mana/gdma_main.c @@ -1439,7 +1439,6 @@ static int mana_gd_probe(struct pci_dev *pdev, const struct pci_device_id *ent) release_region: pci_release_regions(pdev); disable_dev: - pci_clear_master(pdev); pci_disable_device(pdev); dev_err(&pdev->dev, "gdma probe failed: err = %d\n", err); return err; @@ -1458,7 +1457,6 @@ static void mana_gd_remove(struct pci_dev *pdev) vfree(gc); pci_release_regions(pdev); - pci_clear_master(pdev); pci_disable_device(pdev); } From patchwork Thu Mar 23 09:03:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cai Huoqing X-Patchwork-Id: 73913 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp2801567wrt; Thu, 23 Mar 2023 02:12:40 -0700 (PDT) X-Google-Smtp-Source: AK7set+KjgFWQ3i8qlti1keW9sy261OsDx4Jp9FIQM9YPNnIf2853XpWUu5c8nZ3cKt0d3Onk4DA X-Received: by 2002:a17:903:22c6:b0:19c:ff35:35d1 with SMTP id y6-20020a17090322c600b0019cff3535d1mr7282679plg.6.1679562759774; Thu, 23 Mar 2023 02:12:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679562759; cv=none; d=google.com; s=arc-20160816; b=X2fMMgwIimTSP3KsDS3aWy3hQ32QgvC9Ygjy3Kf/NJP5qc4Fd4bow4f44LHqK8/vaP QtBiHyxbSksV86LC/cqFo836nvOiZvvWgJjQ+2wdvuN36nV6fLofZdRNqzBAO/DyHVMJ wJNbmovOOjpzv3tz32fF3T9UrYYmJckDxOUX6fRh5+WvvvtDc1ILdTmFkhh7hwT7fuXX d5yQ3SWt4Di162Q4pQJvH4jnZV/o+XDwFE5iSsSv0lcjNGSV9gyZQsd81dvomg0wDFuF Ke9N3Hq5BfGKdlBiaZbBh24AlnMZ8fACKaGwL5aN+WlJ1q8GU/yDfQwfwmakiE7MmTwd GuSg== 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=5nEaPllgZlxaf5JlJz0X6lv294PfQyE1/LsvcdyaxrU=; b=ntuICznhmm5nALCWfAZEVipP1Q9F9tnJb/us8G9AU8hXYuxy4A9ue5KnTNdQDfjz1R ecAUCvPdalrKEkF/dFMxzfblXeQzDT2fu8cucyPfOog5j0VzxnyGETQJ+TJzvkNjzAHA ewk+bNYCNhf5n3uje0UEnngz2gIBDSgUkL99vr9OkrKvihdhbTEIBEgNPIjzysDKGhIY 3tYqdMkkxY98UoXJSfy/4kS6sYwSjCLzf8TCxU4aKbP0vpruox+AkWeofmxtkweexhOO 2MiTTncad15ThWCk1kdKOlBcudi4gMlsBMdx3xkiuuuE5jxQkDevTLXejftFbmOUuF6C veAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b="qhKtb/HZ"; 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 w2-20020a170902e88200b001a1dc272022si9150790plg.22.2023.03.23.02.12.27; Thu, 23 Mar 2023 02:12:39 -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="qhKtb/HZ"; 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 S231667AbjCWJFX (ORCPT + 99 others); Thu, 23 Mar 2023 05:05:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44958 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231315AbjCWJEy (ORCPT ); Thu, 23 Mar 2023 05:04:54 -0400 Received: from out-49.mta0.migadu.com (out-49.mta0.migadu.com [91.218.175.49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1135B1B574 for ; Thu, 23 Mar 2023 02:04:41 -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=1679562279; 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=5nEaPllgZlxaf5JlJz0X6lv294PfQyE1/LsvcdyaxrU=; b=qhKtb/HZfXNjw65QQis9iDr7t12r8yC3e/GHiq2ISPlR53hm9nC2bBV57WUaDAiLAs978S ZB/Mibd2UwHRqjET0dnaGyZuc+OnYPxpYA6rADKF6JWQivgTJLZ0bKaSnsVXVYAnZdYUoF jeSQxTFo1iuIN6pZglrK93L10B3qGtM= From: Cai Huoqing To: cai.huoqing@linux.dev Cc: Derek Chickles , Satanand Burla , Felix Manlunas , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Raju Rangoju , Dariusz Marcinkiewicz , Dimitris Michailidis , Yisen Zhuang , Salil Mehta , Saeed Mahameed , Leon Romanovsky , "K. Y. Srinivasan" , Haiyang Zhang , Wei Liu , Dexuan Cui , Shannon Nelson , Brett Creeley , drivers@pensando.io, Bjorn Helgaas , Jesse Brandeburg , Guangbin Huang , Jian Shen , Hao Lan , Jie Wang , Long Li , Jiri Pirko , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org, linux-hyperv@vger.kernel.org Subject: [PATCH 7/8] ionic: Remove redundant pci_clear_master Date: Thu, 23 Mar 2023 17:03:06 +0800 Message-Id: <20230323090314.22431-7-cai.huoqing@linux.dev> In-Reply-To: <20230323090314.22431-1-cai.huoqing@linux.dev> References: <20230323090314.22431-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?1761149200762635758?= X-GMAIL-MSGID: =?utf-8?q?1761149200762635758?= 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: Shannon Nelson --- drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c b/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c index e508f8eb43bf..b8678da1cce5 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c @@ -392,7 +392,6 @@ static void ionic_remove(struct pci_dev *pdev) ionic_port_reset(ionic); ionic_reset(ionic); ionic_dev_teardown(ionic); - pci_clear_master(pdev); ionic_unmap_bars(ionic); pci_release_regions(pdev); pci_disable_device(pdev); From patchwork Thu Mar 23 09:03:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cai Huoqing X-Patchwork-Id: 73924 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp2806090wrt; Thu, 23 Mar 2023 02:25:47 -0700 (PDT) X-Google-Smtp-Source: AK7set9tQmR4begUYHbd/JgjVdsprPmj7GyABzI0FLRgvUMpDvTYDYCnz4ekO9A14Vu9qvEBRrJn X-Received: by 2002:a05:6a20:3949:b0:da:e9fa:9c29 with SMTP id r9-20020a056a20394900b000dae9fa9c29mr2850799pzg.26.1679563546915; Thu, 23 Mar 2023 02:25:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679563546; cv=none; d=google.com; s=arc-20160816; b=PqpOSizEYHx9IDtU0bt4jU721N0NQdtR2Sx9J7N4X82mYzmSaR04KCj5lhmqkPPuw6 yHwmed9D//7iy1Um4kPFGAV47TdnJPI4CavInwnjXpnaWKXtxIsoL1ln8WJQqPbKuLJ5 oMAsasKxtc+tVXnn+G/TFWwn3JNNXpV1lornUEcybrQAAKgKxZzy+SBFvGRLjx1yca+8 n6pbnGRPimbCgv6kIHj9LcgjZ2drxxKmNdlRrP9Lt8psNdHfSUZ0ckAg/vqz2tWTWXV4 0bUIHfUQ+h2WxUe06781Bou076GXnBcbmbIgv4uwMB3gEi0KF+BIuBj/rKQ5kEccSfXt oQ/Q== 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=ZuGH7lfals9FAOONYzJSHBoUi4ZX1DWn7Ng0ojEzetw=; b=cIhIYZjI0fJC/bDprg/aBCsDcKKqx/8GhUXFhsedbr9brehwuGO5quqBTgywhijjgN 1TzGFJO2XoUNivQ0aIEJjarOjaj2ECgzzBcFNYbNlPGIbPRmvROzkyWuSftuZpsRrrdI LFe5ONJK1h8PLXKrStgKJlVfTsB9JF5AsXqGRJFsF1e+Bu3ayas0j9EBbGej6vspRGnK jLKOtCpr1wf4KbuemSWw7wgqZ0gCjCo7/OmGQOG6w3VYT4SNNS5KdNdPHkdLiC0d8sa5 KYHxIwDlGi10No22e1QBG5EhT/6/ZdPQ4cy/y5HX4Ku2HeFNYjTn4iZdRd555QRTNm6s IN7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=bsykZhx6; 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 h62-20020a638341000000b005129cf03f2fsi3546720pge.128.2023.03.23.02.25.34; Thu, 23 Mar 2023 02:25:46 -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=bsykZhx6; 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 S231635AbjCWJFh (ORCPT + 99 others); Thu, 23 Mar 2023 05:05:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43770 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231231AbjCWJFH (ORCPT ); Thu, 23 Mar 2023 05:05:07 -0400 Received: from out-37.mta1.migadu.com (out-37.mta1.migadu.com [95.215.58.37]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 942DE21966 for ; Thu, 23 Mar 2023 02:04: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=1679562291; 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=ZuGH7lfals9FAOONYzJSHBoUi4ZX1DWn7Ng0ojEzetw=; b=bsykZhx6FsSoBkYkZ46VqTfzECb7zGc/RXwhrTSzX73HpY1FKoBLbvxTiJNDnSLjtOyngo DBfVQGQZFjZjJG0Ft2bkoxLc6CG+b0iCNKVd1YEBhe7ZjpqJG+jUKoI2z4P670P+IlUeBD d9/UO0K6nX2Mxgqqb/9zhmRZv5HLirI= From: Cai Huoqing To: cai.huoqing@linux.dev Cc: Derek Chickles , Satanand Burla , Felix Manlunas , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Raju Rangoju , Dariusz Marcinkiewicz , Dimitris Michailidis , Yisen Zhuang , Salil Mehta , Saeed Mahameed , Leon Romanovsky , "K. Y. Srinivasan" , Haiyang Zhang , Wei Liu , Dexuan Cui , Shannon Nelson , Brett Creeley , drivers@pensando.io, Bjorn Helgaas , Jesse Brandeburg , Guangbin Huang , Jian Shen , Hao Lan , Jie Wang , Long Li , Jiri Pirko , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org, linux-hyperv@vger.kernel.org Subject: [PATCH 8/8] ethernet: ec_bhf: Remove redundant pci_clear_master Date: Thu, 23 Mar 2023 17:03:07 +0800 Message-Id: <20230323090314.22431-8-cai.huoqing@linux.dev> In-Reply-To: <20230323090314.22431-1-cai.huoqing@linux.dev> References: <20230323090314.22431-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?1761150025828076269?= X-GMAIL-MSGID: =?utf-8?q?1761150025828076269?= 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/net/ethernet/ec_bhf.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/net/ethernet/ec_bhf.c b/drivers/net/ethernet/ec_bhf.c index 46e3a05e9582..c2c5c589a5e3 100644 --- a/drivers/net/ethernet/ec_bhf.c +++ b/drivers/net/ethernet/ec_bhf.c @@ -558,7 +558,6 @@ static int ec_bhf_probe(struct pci_dev *dev, const struct pci_device_id *id) err_release_regions: pci_release_regions(dev); err_disable_dev: - pci_clear_master(dev); pci_disable_device(dev); return err; @@ -577,7 +576,6 @@ static void ec_bhf_remove(struct pci_dev *dev) free_netdev(net_dev); pci_release_regions(dev); - pci_clear_master(dev); pci_disable_device(dev); }