From patchwork Thu Mar 23 11:37:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cai Huoqing X-Patchwork-Id: 74021 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp2863897wrt; Thu, 23 Mar 2023 04:56:35 -0700 (PDT) X-Google-Smtp-Source: AK7set9PpGSHlpsYADgs5jDBs7Va+NGc/rkGgJTnMSMsHmVchfXlgKAxJ2GIOyQ8W0fgFrgBDl6p X-Received: by 2002:a17:902:e2d3:b0:1a1:b238:d1a5 with SMTP id l19-20020a170902e2d300b001a1b238d1a5mr4693851plc.4.1679572595103; Thu, 23 Mar 2023 04:56:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679572595; cv=none; d=google.com; s=arc-20160816; b=k1IgnM+XrPqyeJIlekdkq8i5sWL5tjE1+T0+AKrt6XhRJYORDqFLczE3FO0EfYxYJ4 NU508WrVG/lb2oSm4uw0tOTFyeEP4OFzCWLudTVKBNUWk/gdY7QkKigCEhuv6ytingEK H2UC9e0Yj9k6js83hNiqdmRpQavN1HpABfDouthnA6miyXTZ7Q+55cjdQSd+88xU3Z8R u/28P4HVMT+eJ46/FpwLXF7rUn7YvLyQqHabZ1rLN9LjTL/UdKDR8s9dfCoYTQzOJZFg 7yJnHcOctY+3mTafGDpxuOYjE0GSixd1elEquU0XtlkIJS1EuQSRwXtWe7gvpjrm+UiL yIjw== 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=kZ7HVhRYzHGpfdqvyY+rJRqbLy8aj+vQEUBvMBADCEQ=; b=gCICdrEsc9/1a4piW27uOjo/JVODhHrMeWbDji1L1W0b9lyMbKroLdORogLMecSDvL H+dSpAybKV2XlQXqAoQ4W1cyTbnzq90u5tnhWjguSsCZ5LGXw0oX7PygeOA4J0oNhT+2 vqS/voBKzPCejWEvvPp2d/iNNV3F6aH75Dd6wMSad/Ea5NLBZMpbN+soo6mjafkZKX8K P5zUCpkZpR1BxHwLyiAhvqykCF6lfHQ4aZGSo8UzHfv4HHGX7Vo+Y4YVI45EBvrtBaqj BaYkJiugzrOYlnwQ+MSrOj03CmPBQzI9mOWf+E/0pjiu44QJMMQzdH/RsRZ7/Nrzp/9o UPgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=eNKOJfxK; 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 f5-20020a170902ce8500b001a1e4c61dd9si6772343plg.147.2023.03.23.04.56.22; Thu, 23 Mar 2023 04:56:35 -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=eNKOJfxK; 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 S231173AbjCWLhT (ORCPT + 99 others); Thu, 23 Mar 2023 07:37:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57580 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229563AbjCWLhS (ORCPT ); Thu, 23 Mar 2023 07:37:18 -0400 Received: from out-53.mta1.migadu.com (out-53.mta1.migadu.com [IPv6:2001:41d0:203:375::35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2EE17126EF for ; Thu, 23 Mar 2023 04:37:17 -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=1679571435; 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=kZ7HVhRYzHGpfdqvyY+rJRqbLy8aj+vQEUBvMBADCEQ=; b=eNKOJfxKmV59e1dfEBvaSpjVcGuskviaA9i1EIttR9DARw1+RW9lKRPhaLg3U8fWHAZhVX l8SN3SoLlCUkKRa5WyfSDa88u2qaOQHs76pPbH0sypcfkHS7euc/3Hgim1HP2rDUgsQO+5 eZTWHLABR2D/2d0Hl2zcYHPBBCgv0Yg= From: Cai Huoqing To: cai.huoqing@linux.dev Cc: Matt Porter , Alexandre Bounine , Andrew Morton , Tetsuo Handa , linux-kernel@vger.kernel.org Subject: [PATCH] rapidio/tsi721: Remove redundant pci_clear_master Date: Thu, 23 Mar 2023 19:37:09 +0800 Message-Id: <20230323113711.10523-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?1761159513218992604?= X-GMAIL-MSGID: =?utf-8?q?1761159513218992604?= 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/rapidio/devices/tsi721.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/rapidio/devices/tsi721.c b/drivers/rapidio/devices/tsi721.c index 0a42d6a2af24..83323c3d10af 100644 --- a/drivers/rapidio/devices/tsi721.c +++ b/drivers/rapidio/devices/tsi721.c @@ -2924,7 +2924,6 @@ static int tsi721_probe(struct pci_dev *pdev, iounmap(priv->odb_base); err_free_res: pci_release_regions(pdev); - pci_clear_master(pdev); err_disable_pdev: pci_disable_device(pdev); err_clean: @@ -2962,7 +2961,6 @@ static void tsi721_remove(struct pci_dev *pdev) pci_disable_msi(priv->pdev); #endif pci_release_regions(pdev); - pci_clear_master(pdev); pci_disable_device(pdev); pci_set_drvdata(pdev, NULL); kfree(priv); @@ -2977,7 +2975,6 @@ static void tsi721_shutdown(struct pci_dev *pdev) tsi721_disable_ints(priv); tsi721_dma_stop_all(priv); - pci_clear_master(pdev); pci_disable_device(pdev); }