From patchwork Thu Mar 23 11:33:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cai Huoqing X-Patchwork-Id: 74013 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp2858051wrt; Thu, 23 Mar 2023 04:40:52 -0700 (PDT) X-Google-Smtp-Source: AK7set+ljCiGXWkgCov0stukt4kLDPyngT5eVKBZS4jcrGlyT5MDw3Jx1nr8Yo7dbGxIQ+6T7HrD X-Received: by 2002:a17:906:2a47:b0:8b1:347c:85c8 with SMTP id k7-20020a1709062a4700b008b1347c85c8mr9454848eje.17.1679571652744; Thu, 23 Mar 2023 04:40:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679571652; cv=none; d=google.com; s=arc-20160816; b=witIfGIJn8BsdGwXiALilrD5rX16wrulPth0A/RmxmukbRz40BO0+99AJ18fQX3rFs /goeC7aGMhIVOENrpZ5oHC1e7EN9ErPRDl2ZDPvMKUctxFFW7t41Skbrvigpa/iTwTYp RPHrSk+UDHqdmfIns5nblrRg64npuMhWEAMrJBy23YpZA/fplQxLBQULTM7Mg9mxJ/Bl 2fa3Yl1ECi0olFJ1WPelIhAgVBhBhXNjk5o83x8rfpDrOJDv6Xr16LnqO31yqIiQnZiA Y3ZFiUruz98GCGc8ERH+snAc/HKCYGN7gzVaPj5dFaEOMKRNU63U0+XOf4voq8pVIsyX yarg== 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=QapdO998ju5K1h6JiZaLNUdVyFQrk/GIUE/NUv0juwU=; b=oYywtuhSQoXh2rls3p4tJFZ2HmbefGm2GWAcHajzy0rarrfJeQ7qG4gbAVm43OOhff zOHmftaNtiI96c+UwDRXgRVP/qggE6GR6mAo4QTqAORa2O0FDCo+62UXNBoCXKIsqFND gUQfAVG2qugN8lgjqSMeiIP5giDQTEBceE7/+LWY25SJD3VvBGK9UN65Bk827u26LAX9 Ftkxm55qGhfGQsVHGmZ9ZsQryNYuBAnImesc+CHFTr1cPK5pyQfdSmIKpsggoSJldZav ufpD2Wdyez24NBIzJwoICGfq50MOJzMvUnorKUc6iHKPNJzRrLR9KGfRItJhALIruVuG pVaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=h1ZCc6s1; 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 d5-20020a1709064c4500b009310d4decd9si17148856ejw.313.2023.03.23.04.40.29; Thu, 23 Mar 2023 04:40:52 -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=h1ZCc6s1; 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 S231308AbjCWLd3 (ORCPT + 99 others); Thu, 23 Mar 2023 07:33:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230404AbjCWLd1 (ORCPT ); Thu, 23 Mar 2023 07:33:27 -0400 Received: from out-49.mta0.migadu.com (out-49.mta0.migadu.com [IPv6:2001:41d0:1004:224b::31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B5A8B11E85 for ; Thu, 23 Mar 2023 04:33:25 -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=1679571203; 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=QapdO998ju5K1h6JiZaLNUdVyFQrk/GIUE/NUv0juwU=; b=h1ZCc6s1nZLIVwSUcH9w4+hK6WrZLdx5mTbAlgOreyGNwfVuQg/PiOCwS8FDzUUph4U+md /8YlhihBWY6Wrz7qu13MfwHhurQxa0Efwa6x/UiDiSssbTlWJ/dOFlE1GY5ZmCgzsT/fPT BaRi9CvAMs+/oq6V7FgWRAvLB9LEgnk= From: Cai Huoqing To: cai.huoqing@linux.dev Cc: Wolfgang Grandegger , Marc Kleine-Budde , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Pavel Pisa , Ondrej Ille , linux-can@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/3] can: c_can: Remove redundant pci_clear_master Date: Thu, 23 Mar 2023 19:33:15 +0800 Message-Id: <20230323113318.9473-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?1761158525207094405?= X-GMAIL-MSGID: =?utf-8?q?1761158525207094405?= 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/can/c_can/c_can_pci.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/net/can/c_can/c_can_pci.c b/drivers/net/can/c_can/c_can_pci.c index bf2f8c3da1c1..093bea597f4e 100644 --- a/drivers/net/can/c_can/c_can_pci.c +++ b/drivers/net/can/c_can/c_can_pci.c @@ -227,7 +227,6 @@ static int c_can_pci_probe(struct pci_dev *pdev, pci_iounmap(pdev, addr); out_release_regions: pci_disable_msi(pdev); - pci_clear_master(pdev); pci_release_regions(pdev); out_disable_device: pci_disable_device(pdev); @@ -247,7 +246,6 @@ static void c_can_pci_remove(struct pci_dev *pdev) pci_iounmap(pdev, addr); pci_disable_msi(pdev); - pci_clear_master(pdev); pci_release_regions(pdev); pci_disable_device(pdev); }