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