From patchwork Wed Feb 1 16:54:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 51481 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp389202wrn; Wed, 1 Feb 2023 08:56:51 -0800 (PST) X-Google-Smtp-Source: AK7set8dbNvVyBY9auVSur7ALHGid9JEiadwqcXUMMwy9hiJHW9ELc/EnGwshfdH5u2/BMgznDxT X-Received: by 2002:a17:907:8dcd:b0:88d:5fd1:3197 with SMTP id tg13-20020a1709078dcd00b0088d5fd13197mr3284535ejc.50.1675270610806; Wed, 01 Feb 2023 08:56:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675270610; cv=none; d=google.com; s=arc-20160816; b=bEz36h6NEA3FFMwCiRaVNluaOt79pMvPtkWwOAsOs13pyd2PCNXOl9owKevTn/N9er UQ7cWA4l9yaRn7+OUSHQJie+Kk2bd0IICUZ+DUMc16oqxNwXWFt4T2vU7CsZC4n0DTwy lvmHP2kTM4IVwzlcR9inUrSpFiHA2adU7F9Q6TKxHsQ5eicHtBw5ruWhBYEvllwObA8P h2mC1rQB5h5zi95AWQgloa9SWL3M2OxAtMrYivYQqkT3Vylhhs+2xRwlrwbXHiSVwpr7 /Ld1XwClW5yJlDODfhJm/kVZ7H+5kEgRdp+e0aVFLNJ5srpaLlYw+76yWV0+Cu8H4yV+ XBdQ== 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=v42abFOaxIlmW4awj8kF2Nh0ZkUL+DGZkQ/FsMg5/Lo=; b=KMaEBZemewJ5EuEziWZL9AdWgJt8MC0gMOcZ7VSmEPcDAW1lEdSh5AHPg4rvzFXBPW WK4+BanPKATE8IjjjTVuy+ssGnvMPqNHXtkanV/hmT0v67Vbc6N6sIAJCtGYJwDbZLpa y+n2V0scFeDDI7GJWTzQzTOBbjbBaDzdu4mRsaKdrqaFE0P4CS6l3ks8m95WOYSpz3ZK 05obHo1gYlhwAVe3JLS6/FhvIWtZJrhvHRxzN5qW6kJi0nr8AXJrBrFsAwYmHQPKMw/w ZcOaYCVTs0BqcGL4SPdLj0Q7CR994P3hGwHL2bWY54CQiJJTEOKakbz5vY9WuHKDBhA2 AoLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=VrF1mG7z; 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=chromium.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id vz11-20020a17090704cb00b00881cca91716si13970480ejb.704.2023.02.01.08.56.27; Wed, 01 Feb 2023 08:56:50 -0800 (PST) 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=@chromium.org header.s=google header.b=VrF1mG7z; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230095AbjBAQy6 (ORCPT + 99 others); Wed, 1 Feb 2023 11:54:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53912 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229955AbjBAQy4 (ORCPT ); Wed, 1 Feb 2023 11:54:56 -0500 Received: from mail-pf1-x431.google.com (mail-pf1-x431.google.com [IPv6:2607:f8b0:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A22AD6C13E for ; Wed, 1 Feb 2023 08:54:54 -0800 (PST) Received: by mail-pf1-x431.google.com with SMTP id g9so13044386pfo.5 for ; Wed, 01 Feb 2023 08:54:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=v42abFOaxIlmW4awj8kF2Nh0ZkUL+DGZkQ/FsMg5/Lo=; b=VrF1mG7zFBzc+C7jPblzg3iCFvvDjx/+tr7aA+HecgsS4iWudNCaPX0qWgYt2dCN0e PUmM93Vz92MUceh+zk1SV2VAWdhH8oePYHYIgZI435fyTmnP9z3hGnrOY3I0PyzsNeWs tHMMajIgi3fbTPiqhxmZlJiypDtRj4yIt4mXo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=v42abFOaxIlmW4awj8kF2Nh0ZkUL+DGZkQ/FsMg5/Lo=; b=0juDqkhx+mO+4SQMSkkYDYlKbrviwIAYIvMeswJx0J1SeOyCi4wp7YnvSqKQORZLvd 3rMQn127Beq91tkG1gA9ySYRnyRmLwhZHtzkFHZymuqF+xzyV/8g6sbQroKLmG0G7pb+ jLyB9ve3dInPI1mNnITLjC1AslNpJks6D7mOyRIIbdpdgaGWkDEeBUUFl3JbPnOLEuQf FPg3gQJPiJDIsS9BfAfqwxEmHFIPUgUYaI1ACSDPoEcpNqfYs7K2V5FzFWmzTaXsO3Yg aPDdegla1nWI+bXXgndKph0FQorxQjddVeOO5o8Qnxao/fqcwFZD9+VuAsQxYxqB7OXV 2puA== X-Gm-Message-State: AO0yUKUcUv7akx9KS9WR6t4/qYFTGDIy+kKS8sPlU3NuHE86O97DPg0A eeAedvnfV6ZfkwWk90ScWIs0cQ== X-Received: by 2002:a05:6a00:1d9a:b0:592:6313:20fb with SMTP id z26-20020a056a001d9a00b00592631320fbmr2864421pfw.30.1675270494150; Wed, 01 Feb 2023 08:54:54 -0800 (PST) Received: from tictac2.mtv.corp.google.com ([2620:15c:9d:2:ba26:efe8:5132:5fcf]) by smtp.gmail.com with ESMTPSA id b15-20020aa7870f000000b0058119caa82csm11605090pfo.205.2023.02.01.08.54.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Feb 2023 08:54:53 -0800 (PST) From: Douglas Anderson To: ath11k@lists.infradead.org, linux-wireless@vger.kernel.org Cc: Kalle Valo , junyuu@chromium.org, Youghandhar Chintala , Jiri Slaby , Luis Chamberlain , Nick Kossifidis , Abhinav Kumar , Douglas Anderson , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Lad Prabhakar , Manikanta Pubbisetty , Marc Zyngier , Paolo Abeni , Rob Herring , linux-kernel@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH v2 1/2] wifi: ath11k: Use platform_get_irq() to get the interrupt Date: Wed, 1 Feb 2023 08:54:42 -0800 Message-Id: <20230201084131.v2.1.I69cf3d56c97098287fe3a70084ee515098390b70@changeid> X-Mailer: git-send-email 2.39.1.456.gfc5497dd1b-goog MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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?1756648555683534761?= X-GMAIL-MSGID: =?utf-8?q?1756648555683534761?= As of commit a1a2b7125e10 ("of/platform: Drop static setup of IRQ resource from DT core"), we need to use platform_get_irq() instead of platform_get_resource() to get our IRQs because platform_get_resource() simply won't get them anymore. This was already fixed in several other Atheros WiFi drivers, apparently in response to Zeal Robot reports. An example of another fix is commit 9503a1fc123d ("ath9k: Use platform_get_irq() to get the interrupt"). ath11k seems to have been missed in this effort, though. Without this change, WiFi wasn't coming up on my Qualcomm sc7280-based hardware. Specifically, "platform_get_resource(pdev, IORESOURCE_IRQ, i)" was failing even for i=0. Tested-on: WCN6750 hw1.0 AHB WLAN.MSL.1.0.1-00887-QCAMSLSWPLZ-1 Fixes: a1a2b7125e10 ("of/platform: Drop static setup of IRQ resource from DT core") Fixes: 00402f49d26f ("ath11k: Add support for WCN6750 device") Signed-off-by: Douglas Anderson Tested-by: Jun Yu Reviewed-by: Lad Prabhakar --- Changes in v2: - Update commit message and point to patch that broke us (Jonas) drivers/net/wireless/ath/ath11k/ahb.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/ath/ath11k/ahb.c b/drivers/net/wireless/ath/ath11k/ahb.c index d34a4d6325b2..f70a119bb5c8 100644 --- a/drivers/net/wireless/ath/ath11k/ahb.c +++ b/drivers/net/wireless/ath/ath11k/ahb.c @@ -859,11 +859,11 @@ static int ath11k_ahb_setup_msi_resources(struct ath11k_base *ab) ab->pci.msi.ep_base_data = int_prop + 32; for (i = 0; i < ab->pci.msi.config->total_vectors; i++) { - res = platform_get_resource(pdev, IORESOURCE_IRQ, i); - if (!res) - return -ENODEV; + ret = platform_get_irq(pdev, i); + if (ret < 0) + return ret; - ab->pci.msi.irqs[i] = res->start; + ab->pci.msi.irqs[i] = ret; } set_bit(ATH11K_FLAG_MULTI_MSI_VECTORS, &ab->dev_flags); From patchwork Wed Feb 1 16:54:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 51482 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp389532wrn; Wed, 1 Feb 2023 08:57:36 -0800 (PST) X-Google-Smtp-Source: AK7set8xDqF2k0Cb9sflMdDapq9Q0no9I36bw/eO9aMO7yCuX82D88siwUxy7XHSaXUm1Y9sxGKP X-Received: by 2002:a05:6402:352:b0:4a2:1d08:283b with SMTP id r18-20020a056402035200b004a21d08283bmr3024469edw.11.1675270656089; Wed, 01 Feb 2023 08:57:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675270656; cv=none; d=google.com; s=arc-20160816; b=l5dtRuuMdSMNohJNxSDMb8T9AEaq8v2/2Zdjt/aZm0Ne4FXctjeHkE5oCrioqCiPt5 4c+J5LGPp+C9vrORPpcJRQ4kZD34kVSWIJiTLwU1VPS621Xf+fxtdoo7oEP0c2PATDAc oovSPY7HE/E+ChSs1REMqnICrHWavI/giQ3+Bu9TowEQrBJgM1MNSaGQwBgtsJaCIgAX hQUuawFs0EjO+2pgvGTLffIceTMchoUd0KjFXbhitDR/p+eRf4gMzSRsE4U+G4GTah6W PHqMvrdp9ZYXCVuNbzFN91eRMqq/KBCqEkmErgBlTm+1tDpOHkut8WSat91T7cH2h8xt rBBw== 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=CuWcrDVG77MlzAzG1Dc9fCEJWh5XQzqPcKQwClqpGQk=; b=B6L++gFp3nSOxWC2KnLAAQHQ+GiekRm3mRqzXG/kxwgY8zZmohTUvkr3lobLEpMDWY C7yu6FVkdKRyj9uMJzes3jF/zSOoX/lTORth+K6o6pMoGfwwpzs90wuM1/WHURGqp62n yinvVrDvzqJEydAHYOeBoBc+iEVwvc8ePH51acyQFG3ycHt4a/S+d5VaP6aGlcYXISDC qT+if26e+aJ09F1VYiMOOXFTGzbO+Ys4ugJBBPIp2yh8t8dDfuZe4tnuuW+3nHfQJqvW Ki+6OCulKcsx02IvtNmQ/60iih1wL90d+TkXgmipLXVgIkGNpgjeRdUG9uItQLqgEUzj vG3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=elsctNm6; 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=chromium.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c6-20020a0564021f8600b0047b5ecde3d7si23552391edc.257.2023.02.01.08.57.11; Wed, 01 Feb 2023 08:57:36 -0800 (PST) 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=@chromium.org header.s=google header.b=elsctNm6; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230214AbjBAQzH (ORCPT + 99 others); Wed, 1 Feb 2023 11:55:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54038 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230225AbjBAQy7 (ORCPT ); Wed, 1 Feb 2023 11:54:59 -0500 Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 72E2664DBA for ; Wed, 1 Feb 2023 08:54:56 -0800 (PST) Received: by mail-pj1-x1034.google.com with SMTP id mi9so8732132pjb.4 for ; Wed, 01 Feb 2023 08:54:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=CuWcrDVG77MlzAzG1Dc9fCEJWh5XQzqPcKQwClqpGQk=; b=elsctNm6DvnStQNg/FiqgVT58WMOCUG7xRLbpU1S3BHrK2CrWN3bs69y3FSS53aQIT VGfpRUFDv+zQ/9PPxQBjX0Hn5y15GaAc1Lhq8hOuApj/9xVEah0bavBFheTs7kb6viHU uzT67e9IFG4XJUH4X4EBou9OUYS6NnHgTRD/I= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=CuWcrDVG77MlzAzG1Dc9fCEJWh5XQzqPcKQwClqpGQk=; b=a78ThYNIOT+opmkwsMxMZdT8R0xs7ZW/9RgkpTrr+Q6Dg0Q7K/XErZVACujw7CKZ1v cwS33XWxLLq4AWguUadu3x2qs1odcTWoWt8Q53If1/F0n5I6cRNjw+1oSOdDSUsKHlk/ ValktqseU1CYwQa8U2KoBXGmRwBQNe246+hrt8Z8F/KR4dEowTkn+laeTP83sxmYJlQd tzWaUeJqI0RDSivQpm69KA9S0PrLtHCXeWwOM5t8e94r4IX7nhze1+wNoMqDScq5jtY2 XGkZIhRYcvIZQwpAEGqA/ggGF9+g3zUkEmX8PsXXzcJ5BL8nUYgWyg22TaxDz9m44HNk Vyag== X-Gm-Message-State: AO0yUKW3D42E+JTJvS/W0K9EbpJ60+KUpi0ex0RUEnGoRj0q5iXtWx5u sUasfrb5ZJI4OBqNvFNTNWoALeHI0ichw0nYNvQ= X-Received: by 2002:a05:6a20:7da4:b0:bd:79a:a215 with SMTP id v36-20020a056a207da400b000bd079aa215mr4272667pzj.29.1675270496006; Wed, 01 Feb 2023 08:54:56 -0800 (PST) Received: from tictac2.mtv.corp.google.com ([2620:15c:9d:2:ba26:efe8:5132:5fcf]) by smtp.gmail.com with ESMTPSA id b15-20020aa7870f000000b0058119caa82csm11605090pfo.205.2023.02.01.08.54.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Feb 2023 08:54:55 -0800 (PST) From: Douglas Anderson To: ath11k@lists.infradead.org, linux-wireless@vger.kernel.org Cc: Kalle Valo , junyuu@chromium.org, Youghandhar Chintala , Jiri Slaby , Luis Chamberlain , Nick Kossifidis , Abhinav Kumar , Douglas Anderson , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Lad Prabhakar , Marc Zyngier , Paolo Abeni , Rob Herring , linux-kernel@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH v2 2/2] wifi: ath5k: Use platform_get_irq() to get the interrupt Date: Wed, 1 Feb 2023 08:54:43 -0800 Message-Id: <20230201084131.v2.2.Ic4f8542b0588d7eb4bc6e322d4af3d2064e84ff0@changeid> X-Mailer: git-send-email 2.39.1.456.gfc5497dd1b-goog In-Reply-To: <20230201084131.v2.1.I69cf3d56c97098287fe3a70084ee515098390b70@changeid> References: <20230201084131.v2.1.I69cf3d56c97098287fe3a70084ee515098390b70@changeid> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham 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?1756648603817031988?= X-GMAIL-MSGID: =?utf-8?q?1756648603817031988?= As of commit a1a2b7125e10 ("of/platform: Drop static setup of IRQ resource from DT core"), we need to use platform_get_irq() instead of platform_get_resource() to get our IRQs because platform_get_resource() simply won't get them anymore. This was already fixed in several other Atheros WiFi drivers, apparently in response to Zeal Robot reports. An example of another fix is commit 9503a1fc123d ("ath9k: Use platform_get_irq() to get the interrupt"). ath5k seems to have been missed in this effort, though. Fixes: a1a2b7125e10 ("of/platform: Drop static setup of IRQ resource from DT core") Signed-off-by: Douglas Anderson Reviewed-by: Lad Prabhakar --- I'm not setup to actually test this, but I figured that I might as well go all the way and fix all the instances of the same pattern that I found in the ath drivers since the old call was actually breaking me in ath11k. I did at least confirm that the code compiles for me. If folks would rather not land an untested patch like this, though, feel free to drop this and just land patch #1 as long as that one looks OK. Changes in v2: - Update commit message and point to patch that broke us (Jonas) drivers/net/wireless/ath/ath5k/ahb.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/net/wireless/ath/ath5k/ahb.c b/drivers/net/wireless/ath/ath5k/ahb.c index 2c9cec8b53d9..28a1e5eff204 100644 --- a/drivers/net/wireless/ath/ath5k/ahb.c +++ b/drivers/net/wireless/ath/ath5k/ahb.c @@ -113,15 +113,13 @@ static int ath_ahb_probe(struct platform_device *pdev) goto err_out; } - res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); - if (res == NULL) { - dev_err(&pdev->dev, "no IRQ resource found\n"); - ret = -ENXIO; + irq = platform_get_irq(pdev, 0); + if (irq < 0) { + dev_err(&pdev->dev, "no IRQ resource found: %d\n", irq); + ret = irq; goto err_iounmap; } - irq = res->start; - hw = ieee80211_alloc_hw(sizeof(struct ath5k_hw), &ath5k_hw_ops); if (hw == NULL) { dev_err(&pdev->dev, "no memory for ieee80211_hw\n");