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