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: 13124740 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AB661C38142 for ; Wed, 1 Feb 2023 16:54:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230147AbjBAQy5 (ORCPT ); Wed, 1 Feb 2023 11:54:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53914 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230095AbjBAQy4 (ORCPT ); Wed, 1 Feb 2023 11:54:56 -0500 Received: from mail-pf1-x429.google.com (mail-pf1-x429.google.com [IPv6:2607:f8b0:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A7F9466FB5 for ; Wed, 1 Feb 2023 08:54:54 -0800 (PST) Received: by mail-pf1-x429.google.com with SMTP id z1so10037002pfg.12 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=MPyf3njgKgyJs8BSUXJu0Kwt7u9elzt1HClJC0G/oPTXcJZszyfSyKykYJW2VvNbRa kNlDFthB/qiyP+04x4fpX93+aEQd+F7r90jTRRGg5Db1rLQl2nkBzdb2pnM5GrbW3+Lw WEvTn5A65Wxtcd3kBuOIUw6NOGF3eiR9E0arDG6N3pVnJhn1f0E8wkn0EY86YG/jSoA2 QfcuTblUTNAkijpRlIcp+mmI/lszYQJB8MV0pBO9dpXBlvdZfiwxrWo8we5DXHxg1cQP J2BCGpxVmrEQ8fKzNI+eXLM4Lsd0ZLXAQphuCoYniSKWX3ENIL6Sg6mLMr58FDX72+Uk meFQ== X-Gm-Message-State: AO0yUKUf+FLJiRD0cLMnqNUaJL3A9CPf8M+pqZrN/NFs6ED6XydjDqUe kxnGamku4oH/z3uMJJKsYnx2ag== X-Google-Smtp-Source: AK7set/Ngk6EWKR6yWWn0hLrOjHifSFiaIyR4hRkotMraLijRfBa3zbKNX1T18IRweHaOow9z4BwTg== 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 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org 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: 13124741 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 74FABC636D7 for ; Wed, 1 Feb 2023 16:55:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231434AbjBAQzJ (ORCPT ); Wed, 1 Feb 2023 11:55:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54272 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230481AbjBAQzF (ORCPT ); Wed, 1 Feb 2023 11:55:05 -0500 Received: from mail-pj1-x1032.google.com (mail-pj1-x1032.google.com [IPv6:2607:f8b0:4864:20::1032]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C5A3D728ED for ; Wed, 1 Feb 2023 08:54:56 -0800 (PST) Received: by mail-pj1-x1032.google.com with SMTP id pj3so5053018pjb.1 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=CoT7OaYqtG/0mMqaIQ7CVsMWO/3Se5GrL2bayEGKaJxpuekDrhTYL6ZtHbEApoeIY7 PHmj3Z4u7jtKSBoyKl7WcFdckZ7oFuk2DD08Gc+JieihvAVoosHXhemQgD9jh5a7F2Nn 4jTh0+ZP9esAGOK+4nFB3uo5HYqmlgkN4gXCF0AmG67UvKIgcIUVxIwgjVG/ilsFiXkV I+LdK+EaWlw7qe/JLeYZa6Tl4d4mInHD0wDoYPvE8oCGEj+kLK1HFLLIdEJFPZzjHqbF u2vsrDzzL9/JtnSd3dH2rXsDM+kcaPDqF5t29VASy5MMNq1/7wrgqAC4y0m6365Lx49M 9JOA== X-Gm-Message-State: AO0yUKWY0/mO+KrQ4+Ig+swQ7W6PPbjAyMOtwBlP9lEKN+pHW0u9Yo7p mrkJph/ZeZBuPHAocEii9NsZkg== X-Google-Smtp-Source: AK7set9yAZQ6+dqWsBd9DE4iXXS9o4iyPyJ7iSp8CiKtvLQ+kk68I2UOsZmjpeyAcBcmjYLHtzQXLQ== 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 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org 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");