From patchwork Thu Mar 23 11:26: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: 74024 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp2864256wrt; Thu, 23 Mar 2023 04:57:29 -0700 (PDT) X-Google-Smtp-Source: AK7set/EVDJtxLahDPH23CrpZyRx6+y1N8IBPGV8KFOssfith6tA/w4LnknqRZF56fOjDHKym7cP X-Received: by 2002:a17:902:f68c:b0:19a:bbd0:c5ca with SMTP id l12-20020a170902f68c00b0019abbd0c5camr7832563plg.48.1679572649671; Thu, 23 Mar 2023 04:57:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679572649; cv=none; d=google.com; s=arc-20160816; b=Nrm6ldTDPbQ+NRnuGDIi+zO8avYdh8BzVJQK/hIlkzJtgg4cYl5UhJDrd0EdtKBdO5 v32btQbaPkzWVt2nyrPrh4xmbxmQnwXkVsyErDy0lbcHvhdQkB+Qg+8wt+C542knBQfq IaNWnzJ7wUa/xiZSHfD363jukcHYidkuBhN9aGhxZIsL05iV8j9BwoZvDBRSraec/Ow9 sm+mVBvg3LmIjLrFOl40+eMXKKEZo221+ZCSuMyeD20754F+q2mEq9x+gKQHBIMsg61D 7wEGIHIjE5l8GMVI2G6GVOgAkSIjRPDl7IaDXztMGvlgYfU4HmLdPAoFgRFmJtjCXchI Xw1Q== 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=rFrZeFL95bAADeoxTVP7Nzd5sq/6QShfuHH0D38gefI=; b=SZ9jiwp/EPZjPVFVGuaQ6qjhfoszdsGXbW/CJ/3WnrLU52ARNaKnKcgF2BgToul9gI dPGV+JrVMx/MvANh1idUzhe0Wz3HWUYcrIfYK6aJI9BTdoGvaHP5vJPStvB4m4pCEQaU k495C1BaB58nf+EJX2PIvvikMtQ5q32RMY/4pwjR7QgeIDD/lEV+pvGo/Twhb8UylKe1 M+4SiPr9S8K9KDxQGPMJAV+KkOjgswrTtVzjP4ajVXGkj6qSMNS3NXVnI4FtkF0QkqQr IJybyjHlKpxRZZVA5IV+rXEAIDWnurfdzpAEcZv4USFQJ+cWvfMqnC+Vmgs9ElrEgOUV ffYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=iieSNHbL; 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 l17-20020a170903245100b001a1c7fe5bccsi12978718pls.248.2023.03.23.04.57.16; Thu, 23 Mar 2023 04:57:29 -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=iieSNHbL; 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 S230072AbjCWL0c (ORCPT + 99 others); Thu, 23 Mar 2023 07:26:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42142 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230499AbjCWL03 (ORCPT ); Thu, 23 Mar 2023 07:26:29 -0400 Received: from out-23.mta1.migadu.com (out-23.mta1.migadu.com [95.215.58.23]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F0CDB2DE43 for ; Thu, 23 Mar 2023 04:26:24 -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=1679570783; 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=rFrZeFL95bAADeoxTVP7Nzd5sq/6QShfuHH0D38gefI=; b=iieSNHbLTfna/AJWw4ifxYEls++cBF9dlNm9peQh4RNpnr/S41QQfmoR6P1mfO93mmDEm/ sUOXphPRjd2lfzh8OKjD0eTzs73xofcjuI6u/1+T2KsrkL9xXCatCQFGOu976gs0BeEbgp oYmUYiuMI5+e3DM0+fDsGgf8JSQ62BM= From: Cai Huoqing To: cai.huoqing@linux.dev Cc: Kalle Valo , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Yan-Hsuan Chuang , Ping-Ke Shih , ath10k@lists.infradead.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, ath11k@lists.infradead.org, ath12k@lists.infradead.org Subject: [PATCH 1/5] wifi: ath11k: Remove redundant pci_clear_master Date: Thu, 23 Mar 2023 19:26:09 +0800 Message-Id: <20230323112613.7550-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?1761159570622205224?= X-GMAIL-MSGID: =?utf-8?q?1761159570622205224?= 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 Reviewed-by: Simon Horman --- drivers/net/wireless/ath/ath11k/pci.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/net/wireless/ath/ath11k/pci.c b/drivers/net/wireless/ath/ath11k/pci.c index 0aeef2948ff5..522d01e5e11c 100644 --- a/drivers/net/wireless/ath/ath11k/pci.c +++ b/drivers/net/wireless/ath/ath11k/pci.c @@ -540,7 +540,7 @@ static int ath11k_pci_claim(struct ath11k_pci *ab_pci, struct pci_dev *pdev) if (!ab->mem) { ath11k_err(ab, "failed to map pci bar %d\n", ATH11K_PCI_BAR_NUM); ret = -EIO; - goto clear_master; + goto release_region; } ab->mem_ce = ab->mem; @@ -548,8 +548,6 @@ static int ath11k_pci_claim(struct ath11k_pci *ab_pci, struct pci_dev *pdev) ath11k_dbg(ab, ATH11K_DBG_BOOT, "boot pci_mem 0x%pK\n", ab->mem); return 0; -clear_master: - pci_clear_master(pdev); release_region: pci_release_region(pdev, ATH11K_PCI_BAR_NUM); disable_device: @@ -565,7 +563,6 @@ static void ath11k_pci_free_region(struct ath11k_pci *ab_pci) pci_iounmap(pci_dev, ab->mem); ab->mem = NULL; - pci_clear_master(pci_dev); pci_release_region(pci_dev, ATH11K_PCI_BAR_NUM); if (pci_is_enabled(pci_dev)) pci_disable_device(pci_dev); From patchwork Thu Mar 23 11:26:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cai Huoqing X-Patchwork-Id: 74016 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp2863155wrt; Thu, 23 Mar 2023 04:54:34 -0700 (PDT) X-Google-Smtp-Source: AK7set8Eh+71r5aPZ2ru4h75PSMBOxHcuwssht+O82Gb73w55RrE6zH7D4qelb1HsizU7F1+rDUv X-Received: by 2002:a62:1a52:0:b0:625:975f:525d with SMTP id a79-20020a621a52000000b00625975f525dmr6477001pfa.28.1679572474689; Thu, 23 Mar 2023 04:54:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679572474; cv=none; d=google.com; s=arc-20160816; b=JJXmlR8MkNw0grlQsV51iIMk2kPJIEPe1BprAuRQ+dyHv8Z5nixu9yfTJdWYAOUQrX D/OdMfw24DN1JKC+YkF2c2vFVgad6W+cd56GlgFRIiajqrB16DqcXBmyjStl/BRKPys1 6+UGLYHf+sYJPF8eu5wfsCKanhAZyXu1IOu9NPrvz1rjv+drgYMgd41+bsY/f84e/rem Amm1ugn8Wujm96F4VT2heZ4KfxTtgnSUQNlTzz4fW2/XxPWk4XB+Uno0IGh0a9QDGY5t B7VedOAT6eO/kxp9Kd/w2jmbd3cSQYegHCqsi6XzQY6U8YkmVxH8FUa9Nw7pW9Adzv4o fejQ== 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=tooTxJ1S3+bY95x8JLOzf8Cr/9M9iNd5ycqcB6CNt6g=; b=qsYD9Cro5IegYHCnIp5SOGmL+DWXIb6D3LDeQvUlBSICP7avrMvRs4CoMEqKQ8EtnJ p/tBGdwqViLGsnZ8/m+izwEaaxtBOHIcZHH5zhqPYE8HSUkk1OG0e+zmMtILKt+Ee7HE Ns1IOHIwOC2VCpPRphB5z9QdNaWqTImivq5PexXtNFI2TnmuUfsHZIyQMzqQ61ecfY72 xvTe5DAcqSjeCqEVtD23ARx06tFiFa4ooewd/srmQQy8hZGp447yLkL5p1iYZfrxRbc8 ihYyLYpQr+yh31WK7AZA/b2aUgdI1F8xe0xfSJ27dCFmd7lcXU6kvI/hCuUONAwlnf/u 486w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=MPPbcgSR; 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 d10-20020a056a00244a00b006260e021ddesi19016724pfj.175.2023.03.23.04.54.22; Thu, 23 Mar 2023 04:54:34 -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=MPPbcgSR; 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 S231575AbjCWL0k (ORCPT + 99 others); Thu, 23 Mar 2023 07:26:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42350 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231473AbjCWL0f (ORCPT ); Thu, 23 Mar 2023 07:26:35 -0400 Received: from out-37.mta0.migadu.com (out-37.mta0.migadu.com [91.218.175.37]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6ADCC2E820 for ; Thu, 23 Mar 2023 04:26:32 -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=1679570789; 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=tooTxJ1S3+bY95x8JLOzf8Cr/9M9iNd5ycqcB6CNt6g=; b=MPPbcgSRYJtn4/oTx7vmZtr+8RpDlRdnN6QgSqBa/GWRXPjE+iDrG+orCzV826kNoxLPEk WALEbdE/Q9zmZ6Wf/cfnOibc5KyJqwOgKHl8pp8J/W1dC2nV6lP4vNajVT+51eSBQxS3v1 paQWnioiLt/iK77rFsMewk9UnlTlWMo= From: Cai Huoqing To: cai.huoqing@linux.dev Cc: Kalle Valo , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Yan-Hsuan Chuang , Ping-Ke Shih , ath10k@lists.infradead.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, ath11k@lists.infradead.org, ath12k@lists.infradead.org Subject: [PATCH 2/5] wifi: ath10k: Remove redundant pci_clear_master Date: Thu, 23 Mar 2023 19:26:10 +0800 Message-Id: <20230323112613.7550-2-cai.huoqing@linux.dev> In-Reply-To: <20230323112613.7550-1-cai.huoqing@linux.dev> References: <20230323112613.7550-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?1761159386957371538?= X-GMAIL-MSGID: =?utf-8?q?1761159386957371538?= 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 Reviewed-by: Simon Horman --- drivers/net/wireless/ath/ath10k/pci.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c index 728d607289c3..a7f44f6335fb 100644 --- a/drivers/net/wireless/ath/ath10k/pci.c +++ b/drivers/net/wireless/ath/ath10k/pci.c @@ -3406,15 +3406,12 @@ static int ath10k_pci_claim(struct ath10k *ar) if (!ar_pci->mem) { ath10k_err(ar, "failed to iomap BAR%d\n", BAR_NUM); ret = -EIO; - goto err_master; + goto err_region; } ath10k_dbg(ar, ATH10K_DBG_BOOT, "boot pci_mem 0x%pK\n", ar_pci->mem); return 0; -err_master: - pci_clear_master(pdev); - err_region: pci_release_region(pdev, BAR_NUM); @@ -3431,7 +3428,6 @@ static void ath10k_pci_release(struct ath10k *ar) pci_iounmap(pdev, ar_pci->mem); pci_release_region(pdev, BAR_NUM); - pci_clear_master(pdev); pci_disable_device(pdev); } From patchwork Thu Mar 23 11:26:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cai Huoqing X-Patchwork-Id: 74018 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp2863785wrt; Thu, 23 Mar 2023 04:56:20 -0700 (PDT) X-Google-Smtp-Source: AK7set/O+JTmRJPr6p7ioXukvdgNfUe0LgjFoGyi/jOd/RFqO9IF9GlPPwszpJ53dDRnE0uJx9xl X-Received: by 2002:a05:6a20:7a1f:b0:da:4e05:760 with SMTP id t31-20020a056a207a1f00b000da4e050760mr2281127pzh.55.1679572579884; Thu, 23 Mar 2023 04:56:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679572579; cv=none; d=google.com; s=arc-20160816; b=HWCzMY99OWR7DsrP0+J/JatKkP4J1cthdKPTptxG9NhVEOuVdm8X/AS3sAVqTVwTlB bMcePH68015wR6R9iQKKDi9h6dTkzw7aHgV1VzF1kccXTOVdT3xBGNOCiykImh309vWh ArkEXnsflCOhUBDCDDK4GrkR8KMnlHkJpLyDK61EVMfHZjpWr7DlIdCkopVfnY6Rk2Id ttGI4xH1kVCv1WrHQwkiPgqDKV4C5om4lxkv9ipcd/eDhKV+v7LNt9uh3e88KOwKDzv8 m3Z0X2gT4u7OfpNUsNPFRKlRtfajVPlWoCUf51D20RZNhUFC9sp1aC306BBgOH3OlAmU k0vg== 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=OTUWX3aTLswoFCHtkP0zXcRP9Ge0kmAhVIeOjF5/rGc=; b=q7o2OkEDbBzrM8SkGe2S6XNff8Q9e5UtIiTCneBShyMZKg+2v2fA8DgupQn/WyhNRF bE47SSEIFJBbdrYCn+qHp/exp1gphPx+EGEvnNfgQhOrG6lt54Y886WekTK69O0FTVof lllLjUtS2LJUxIpvbjIxC8WQQLEjxZi9nTMdoFVVHfRo305HAi9cjklKwILQiX9XUMaI O/Y/6mhU88CxIeGLQbLYyo791UObVS9LkvSl5+jlWhJ1u/Yc+/I1+jp4SI9FyMa+eYHg XaeOzJeNtaBFoSyjh4IfsQo/faAREdGi1LaCFO1iShcg/HlWCeOwYnwhE7yLvXKmvQAr r0NA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=tGiiSgjv; 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 s35-20020a056a0017a300b0062624d7193dsi20189291pfg.70.2023.03.23.04.56.07; Thu, 23 Mar 2023 04:56:19 -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=tGiiSgjv; 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 S231629AbjCWL0n (ORCPT + 99 others); Thu, 23 Mar 2023 07:26:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42396 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231573AbjCWL0k (ORCPT ); Thu, 23 Mar 2023 07:26:40 -0400 Received: from out-29.mta1.migadu.com (out-29.mta1.migadu.com [95.215.58.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 39FC02DE63 for ; Thu, 23 Mar 2023 04:26:37 -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=1679570795; 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=OTUWX3aTLswoFCHtkP0zXcRP9Ge0kmAhVIeOjF5/rGc=; b=tGiiSgjvr0b+Z7aAWVjX2r/RSBTRbfF/dareLKLdicHxsBVQ+Zgy38C5/P8Iap3KDd/lpi etzTUrtxWpnsW2G4MBYbkdgMdil/d8miyjYW4eFjJCqX6Xr0L3JGtvmgwYf67neCzmGbMe PGsYNpHJG7jSQRcfAuPzg0tb3MaqB9w= From: Cai Huoqing To: cai.huoqing@linux.dev Cc: Kalle Valo , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Yan-Hsuan Chuang , Ping-Ke Shih , ath10k@lists.infradead.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, ath11k@lists.infradead.org, ath12k@lists.infradead.org Subject: [PATCH 3/5] wifi: ath12k: Remove redundant pci_clear_master Date: Thu, 23 Mar 2023 19:26:11 +0800 Message-Id: <20230323112613.7550-3-cai.huoqing@linux.dev> In-Reply-To: <20230323112613.7550-1-cai.huoqing@linux.dev> References: <20230323112613.7550-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?1761159497553935060?= X-GMAIL-MSGID: =?utf-8?q?1761159497553935060?= 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 Reviewed-by: Simon Horman --- drivers/net/wireless/ath/ath12k/pci.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/net/wireless/ath/ath12k/pci.c b/drivers/net/wireless/ath/ath12k/pci.c index d32637b0113d..9ee47caf8485 100644 --- a/drivers/net/wireless/ath/ath12k/pci.c +++ b/drivers/net/wireless/ath/ath12k/pci.c @@ -755,14 +755,12 @@ static int ath12k_pci_claim(struct ath12k_pci *ab_pci, struct pci_dev *pdev) if (!ab->mem) { ath12k_err(ab, "failed to map pci bar %d\n", ATH12K_PCI_BAR_NUM); ret = -EIO; - goto clear_master; + goto release_region; } ath12k_dbg(ab, ATH12K_DBG_BOOT, "boot pci_mem 0x%pK\n", ab->mem); return 0; -clear_master: - pci_clear_master(pdev); release_region: pci_release_region(pdev, ATH12K_PCI_BAR_NUM); disable_device: @@ -778,7 +776,6 @@ static void ath12k_pci_free_region(struct ath12k_pci *ab_pci) pci_iounmap(pci_dev, ab->mem); ab->mem = NULL; - pci_clear_master(pci_dev); pci_release_region(pci_dev, ATH12K_PCI_BAR_NUM); if (pci_is_enabled(pci_dev)) pci_disable_device(pci_dev); From patchwork Thu Mar 23 11:26:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cai Huoqing X-Patchwork-Id: 74012 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp2857408wrt; Thu, 23 Mar 2023 04:39:15 -0700 (PDT) X-Google-Smtp-Source: AK7set/mkBg8/xmQfWur1GU2vS7TPyoOyevmOURnCuID6gxnaDOcULHAUoAcYZPc13TvXQLzozVX X-Received: by 2002:a17:907:7050:b0:932:b7ce:27b4 with SMTP id ws16-20020a170907705000b00932b7ce27b4mr9902094ejb.27.1679571555295; Thu, 23 Mar 2023 04:39:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679571555; cv=none; d=google.com; s=arc-20160816; b=wNgMoYT6yvcBCJwf5+6xtn3/9L2HPvaGv/x8EEkhL/pKz2Ojz7AhBs5VOimHMwd739 x4efsKQna74gdDpwjgPExaPRmKSgtu3h2cGrvtqLbJzmSWpQ9ULDbWiKXebs5OgGDF+5 b9g93GkzNiCZFQVZJCiqmBBNIUk3UWHKiOLQNDbm+9H/iGi5E+Ascv9NMpFUMTkA8cEm 4b2LA2IKvdaX/bBSbjBwrx62AMPm9nxVCAda/3/JwB6RPxmJ+Q+PyNQN9wFUAOCwL/us RMFlrNg2DDfjCG94Fws76yTbqI3WcB4PI1gRyoToXQrrpChN/vgmf1sF0jzFSv7mTRg5 svbw== 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=ZdgDBuT4R3jYSxR7mPDt2s0ue0mJFKZNVR81FCp1IBk=; b=gAkdpnqZYll8A9keO+EliSJBCUv6++oF91MhpbhZfv6Y5Ze7R+Ix+I9mMby2vBtkBh u5XNDNxAL76NUBln7nAhxPM2+RWQD0EEUu/WXkR/ukmI/4HhkLfqtmiPstMpDUmi1ZZJ CzEPvJckW4sVDxAy0InP6ukS/yHYbm6xTiKREcUnXxQfJIF5312TPKZ3SShH7K6ag8Ai Jn5uIUeBUPny9JlidBMQ6zcGG9t5x39jbCcztq1STqwUist1uThuGk2L9ROlbkOFnPMs tAYad4frLCCLKMsQ45ViexiF2w6dBa2lqji2A+yy03UsOyZeKjyw/420qpwXs4nhty65 xvkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=fqAbpCsa; 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 m27-20020a1709060d9b00b008f4625e4c16si17207008eji.577.2023.03.23.04.38.51; Thu, 23 Mar 2023 04:39:15 -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=fqAbpCsa; 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 S231676AbjCWL1A (ORCPT + 99 others); Thu, 23 Mar 2023 07:27:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42396 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231732AbjCWL0y (ORCPT ); Thu, 23 Mar 2023 07:26:54 -0400 Received: from out-46.mta0.migadu.com (out-46.mta0.migadu.com [IPv6:2001:41d0:1004:224b::2e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0B88E2E0E0 for ; Thu, 23 Mar 2023 04:26:45 -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=1679570800; 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=ZdgDBuT4R3jYSxR7mPDt2s0ue0mJFKZNVR81FCp1IBk=; b=fqAbpCsaP3fQqEmQ3WmwcgxofDhbTR9Foo+kABFooB5SEWA51oOArpWXh3+E22u+OvTuzl 4kB3mh11+EjwMt/cdDd8+Pd067J8e6UHBti+IDAsg28/AE1lDzENAJz/wauJWfkWbMKTQ+ TCjgMya52bHugLpy5CUatBZ8jTkvmz0= From: Cai Huoqing To: cai.huoqing@linux.dev Cc: Kalle Valo , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Yan-Hsuan Chuang , Ping-Ke Shih , ath10k@lists.infradead.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, ath11k@lists.infradead.org, ath12k@lists.infradead.org Subject: [PATCH 4/5] wifi: rtw88: Remove redundant pci_clear_master Date: Thu, 23 Mar 2023 19:26:12 +0800 Message-Id: <20230323112613.7550-4-cai.huoqing@linux.dev> In-Reply-To: <20230323112613.7550-1-cai.huoqing@linux.dev> References: <20230323112613.7550-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?1761158422792746455?= X-GMAIL-MSGID: =?utf-8?q?1761158422792746455?= 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 Reviewed-by: Simon Horman Reviewed-by: Ping-Ke Shih --- drivers/net/wireless/realtek/rtw88/pci.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/net/wireless/realtek/rtw88/pci.c b/drivers/net/wireless/realtek/rtw88/pci.c index b4bd831c9845..60145d2f3e5a 100644 --- a/drivers/net/wireless/realtek/rtw88/pci.c +++ b/drivers/net/wireless/realtek/rtw88/pci.c @@ -1552,7 +1552,6 @@ static int rtw_pci_claim(struct rtw_dev *rtwdev, struct pci_dev *pdev) static void rtw_pci_declaim(struct rtw_dev *rtwdev, struct pci_dev *pdev) { - pci_clear_master(pdev); pci_disable_device(pdev); } From patchwork Thu Mar 23 11:26:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cai Huoqing X-Patchwork-Id: 74026 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp2864591wrt; Thu, 23 Mar 2023 04:58:20 -0700 (PDT) X-Google-Smtp-Source: AK7set8NDFiC2vfl2iHB3kEzQzYBWl1ODMf3nWGP+0yhqk95ugPMIqncOcU5EOMwbDh32g5DLHsT X-Received: by 2002:a05:6a20:80c8:b0:da:dc14:33d with SMTP id d8-20020a056a2080c800b000dadc14033dmr2355135pza.53.1679572700305; Thu, 23 Mar 2023 04:58:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679572700; cv=none; d=google.com; s=arc-20160816; b=JLK1Pq/3IC5ZU13s7yj+E0HgP/pIR+Wr5H+e6FrtbAfHK1ZY5ZHK4x3WeRk/ujtqLC SvMCpbZnnu6Cc4z4NPYwNIYf77I6MK9psa9CEE7zxNOXFJkmj/cf9SQRxviIlEg6YlxF tTio9eoCW9022Xlzt6h/Ah/WE8j6tOuMtshw9ljgLFSsgwDF1CpWya1+cJn/r3h0bBx+ 6EPTS90lcStTjPOWxAaTyow4U02K1UGnYQ0BoNYQTwrNTesTeDkV6WotRxHXCgx8+jha QgTXsOlSBpxAWsR4K6FrXBY3M/hTsOAHhzyCYkvlkbzz31aIqz6Z5cQxIXljkjvQc1Ol ZaeQ== 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=rGX1VskIO2esd5iCrlayQqCszF4VgpeWWivrdPxtbg4=; b=DICfW20E2rjriFBYjxav8HRRDF96BPuhmyZ1BkROyoKacjdEsAUf0ZpfV8r56/9dQz 7pe2ls6VwytolEf3A/PllajBsAT5lc4wPKL5CW47UGSblwv1B2eBytDEvEZroppyqsO4 HUmY4FpbjKsq/x/1FlbePSlNqF2uB0vhKb8zjzdoR3NBHR7TM8tcIt7SJIGKmCbnKLeb u2Vcw6+Oejo9WjdjzIU+UndGSrtF2sMwxkzdoUD3YddHST+oyANeYmHZ0AM3PqkXa+H7 2Hu8TbmsOD7oQ1j9tCW5UZ9Vggurvh1FcQEr9XUQWT5T6RUV8IrG47DtcE60DEFyrt0c EH4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=DEC0eNYJ; 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 f16-20020a63f110000000b0050f8d6d85fcsi3290561pgi.303.2023.03.23.04.58.08; Thu, 23 Mar 2023 04:58:20 -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=DEC0eNYJ; 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 S231460AbjCWL1O (ORCPT + 99 others); Thu, 23 Mar 2023 07:27:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43818 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231754AbjCWL1E (ORCPT ); Thu, 23 Mar 2023 07:27:04 -0400 Received: from out-49.mta0.migadu.com (out-49.mta0.migadu.com [91.218.175.49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB7A72E835 for ; Thu, 23 Mar 2023 04:26:50 -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=1679570808; 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=rGX1VskIO2esd5iCrlayQqCszF4VgpeWWivrdPxtbg4=; b=DEC0eNYJuul660lvjxaoeqUvLhH6GgzbdTk1AxcCx2Kj5x96BZHZ6aIIUJVK+sncVZDQbr L9l0JBXZZCm4W/vQB+sibYpvqmQhuHR7E+rRTEisdt4Tig3SaANUsw7ODwTgZtri/miSV/ x9vbQkNC/yn23vno5LmkGylhSwUG/RI= From: Cai Huoqing To: cai.huoqing@linux.dev Cc: Kalle Valo , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Yan-Hsuan Chuang , Ping-Ke Shih , ath10k@lists.infradead.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, ath11k@lists.infradead.org, ath12k@lists.infradead.org Subject: [PATCH 5/5] wifi: rtw89: Remove redundant pci_clear_master Date: Thu, 23 Mar 2023 19:26:13 +0800 Message-Id: <20230323112613.7550-5-cai.huoqing@linux.dev> In-Reply-To: <20230323112613.7550-1-cai.huoqing@linux.dev> References: <20230323112613.7550-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?1761159623843224853?= X-GMAIL-MSGID: =?utf-8?q?1761159623843224853?= 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 Reviewed-by: Simon Horman Acked-by: Ping-Ke Shih --- drivers/net/wireless/realtek/rtw89/pci.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/net/wireless/realtek/rtw89/pci.c b/drivers/net/wireless/realtek/rtw89/pci.c index ec8bb5f10482..75bd3ac4dd71 100644 --- a/drivers/net/wireless/realtek/rtw89/pci.c +++ b/drivers/net/wireless/realtek/rtw89/pci.c @@ -2694,7 +2694,6 @@ static int rtw89_pci_claim_device(struct rtw89_dev *rtwdev, static void rtw89_pci_declaim_device(struct rtw89_dev *rtwdev, struct pci_dev *pdev) { - pci_clear_master(pdev); pci_disable_device(pdev); }