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);