Message ID | 20230323120043.15081-1-cai.huoqing@linux.dev |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp2871254wrt; Thu, 23 Mar 2023 05:09:46 -0700 (PDT) X-Google-Smtp-Source: AK7set9lZeizF6K6DVIz9sIk1rDwZzXkfCm7zANwpR0vgHXNrmJE/Q4gzJwum+bbv2IESWdbgiAv X-Received: by 2002:a17:906:a855:b0:930:963b:63a6 with SMTP id dx21-20020a170906a85500b00930963b63a6mr11089325ejb.66.1679573386378; Thu, 23 Mar 2023 05:09:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679573386; cv=none; d=google.com; s=arc-20160816; b=ZV7sX6FBNpuw6Ujc/AxeSDROqIuUlZCA6Xt/RqKsGXCiiKvF3OyuvgcXGmblQEYjc5 Y5Yn7YXHm1zq2pmCtvI0a4SYhJTFIsnZNlFJn9s8m2k6I2cE+l+ZnBPefXvDpaRmYG4C wkpbE+QYvMoB3v8ai1Jyz2RkSI4TavVl8sZwNaVGeV/jmO0QJKms7UpqOb/H9CZzNsom bK+61aSaBJ8oCL927BP5+JG+HaqS9NcSgRHlDufGvya55C63o8H1fjSBuPDS2dTERaxi bhh7rsoMDLPPTXf2HVyDmn1mm86OhNSrzOMT1W7G9IOec1TAE6HkhQXxWHmwe9/Kjk+T axjA== 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=PPCDJ/LTlfpDLEP+1PxEm8cw9BZfvQzfInAOwtqZhSE=; b=OL8XuFfUNFwTXzzjVVMQtc4OUSfsCKin98MbWDer5R4/jJinxzNqsKhWmvNztrhd+7 IEFUvSMrwXyrlDAAb1U34TyzHpsbIefge7lE2sEuoFphPww0REV55PV5ISOz4Vdd3XmQ ROcEx+KaoJZI4IH5o/yTNziBpZgkpQm8fXo0zq4ygPp+wZWZcgRElzMii7AVqKsreVsw pMzYyasQ17fXunVEtRXhj3qaTLEtcpQM+XrJTk0vmNm4DPMKUiT0T67sd1ov87b4it3/ OD21jbf9iF5Pdgdcoaw2M0rSd2Pw7wtrmxLx91p3eH+5CN45h7zcHRyma5ZneIg5gGKj MdiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=dSZ4xPSL; 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 hr8-20020a1709073f8800b0093545cb338esi12256919ejc.747.2023.03.23.05.09.21; Thu, 23 Mar 2023 05:09: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=dSZ4xPSL; 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 S231362AbjCWMCr (ORCPT <rfc822;ezelljr.billy@gmail.com> + 99 others); Thu, 23 Mar 2023 08:02:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45818 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231670AbjCWMCS (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 23 Mar 2023 08:02:18 -0400 Received: from out-63.mta1.migadu.com (out-63.mta1.migadu.com [95.215.58.63]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 270AB49FE for <linux-kernel@vger.kernel.org>; Thu, 23 Mar 2023 05:00:47 -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=1679572846; 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=PPCDJ/LTlfpDLEP+1PxEm8cw9BZfvQzfInAOwtqZhSE=; b=dSZ4xPSLxI/M2te8gMs/gl7qipP3r5uAZNYWgDwZpuUFMxzqkw/5q9qTVwCio9zjo+z25c swEOhxYZInWvPVhA7RvGqUuCdqx5DtG8BUwKyNdoMTr0lwdPMCnjrthDdDf+d4UH405jyR VUYTaVxX7wO7X9aP4ZeSW144spQ4Gfc= From: Cai Huoqing <cai.huoqing@linux.dev> To: cai.huoqing@linux.dev Cc: Alexandra Winter <wintera@linux.ibm.com>, Wenjia Zhang <wenjia@linux.ibm.com>, Heiko Carstens <hca@linux.ibm.com>, Vasily Gorbik <gor@linux.ibm.com>, Alexander Gordeev <agordeev@linux.ibm.com>, Christian Borntraeger <borntraeger@linux.ibm.com>, Sven Schnelle <svens@linux.ibm.com>, linux-s390@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] net/ism: Remove redundant pci_clear_master Date: Thu, 23 Mar 2023 20:00:43 +0800 Message-Id: <20230323120043.15081-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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1761160343257279989?= X-GMAIL-MSGID: =?utf-8?q?1761160343257279989?= |
Series |
net/ism: Remove redundant pci_clear_master
|
|
Commit Message
Cai Huoqing
March 23, 2023, noon UTC
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 <cai.huoqing@linux.dev>
---
drivers/s390/net/ism_drv.c | 2 --
1 file changed, 2 deletions(-)
Comments
Hello: This patch was applied to netdev/net-next.git (main) by David S. Miller <davem@davemloft.net>: On Thu, 23 Mar 2023 20:00:43 +0800 you wrote: > 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; > > [...] Here is the summary with links: - net/ism: Remove redundant pci_clear_master https://git.kernel.org/netdev/net-next/c/c85bd3dacc80 You are awesome, thank you!
diff --git a/drivers/s390/net/ism_drv.c b/drivers/s390/net/ism_drv.c index 05749c877990..8acb9eba691b 100644 --- a/drivers/s390/net/ism_drv.c +++ b/drivers/s390/net/ism_drv.c @@ -675,7 +675,6 @@ static int ism_probe(struct pci_dev *pdev, const struct pci_device_id *id) return 0; err_resource: - pci_clear_master(pdev); pci_release_mem_regions(pdev); err_disable: pci_disable_device(pdev); @@ -738,7 +737,6 @@ static void ism_remove(struct pci_dev *pdev) ism_dev_exit(ism); mutex_unlock(&ism_dev_list.mutex); - pci_clear_master(pdev); pci_release_mem_regions(pdev); pci_disable_device(pdev); device_del(&ism->dev);