From patchwork Tue Jan 24 19:01:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 647488 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 EF08CC54E94 for ; Tue, 24 Jan 2023 19:01:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234323AbjAXTB3 (ORCPT ); Tue, 24 Jan 2023 14:01:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38828 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229503AbjAXTB1 (ORCPT ); Tue, 24 Jan 2023 14:01:27 -0500 Received: from mail-pj1-x1033.google.com (mail-pj1-x1033.google.com [IPv6:2607:f8b0:4864:20::1033]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6363A4DBC6 for ; Tue, 24 Jan 2023 11:01:25 -0800 (PST) Received: by mail-pj1-x1033.google.com with SMTP id n20-20020a17090aab9400b00229ca6a4636so18754861pjq.0 for ; Tue, 24 Jan 2023 11:01:25 -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=SEJDfnpuHczelrJ6vp0fb1JDaeIwWS2iq2BACn7e/IE=; b=ZPjYuk0ya4aeNvJO7qCFVWhUdg0oqrtCfCmpbpBLA+ntney22BIz/3+x+FcjsEArwy EhC1rTUOzPpnWRcgDlgTPkpWxjQVhxbNJKGVBjVKQb4u+qsL8owwjnObWFkBj3oGR3sl BW7yKEPe0fUVC9ATGwooiBc7H5EhIV8q26nao= 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=SEJDfnpuHczelrJ6vp0fb1JDaeIwWS2iq2BACn7e/IE=; b=m/2yzIvXfFl1hQYL17kbD86kAB8Lg1tC9caAm21FLVCYePViHLbLb4d+vufnEE4et6 pFo0viuT4XXkQV53bPck2irIAFWIJuAVmMPeI3Svrp0mjUqCl8SDWuCVOfytBxQMYFc+ qKlsGMpL7eRmPemwo+H2X6bJ2IBExJ/iGadNUII43Cgf+IIvOu9q2SidvbfLyS7yDWLF yXe7pQP7W+aDvFDNmIt82fKGoSAGOK5IHSmRQESsS/1leJt3w4NT/Vx9XCeginrPRQgC vwCKhOuYNpyRrJ/t4kUVtQujYWZtBrKh+fH2l8oBQmW3+ELW0MXJjW63hZAeT3nPfWWT 245Q== X-Gm-Message-State: AO0yUKWkraGw7OIrB/i8hW//lN1HmHQVOOYZEI83IPXg6dfW5FipGsEt BVlpRZPSe+kx1ptucXut08GZfQ== X-Google-Smtp-Source: AK7set9PfKKjjgxVS13+YwcKa14yZ/3qzh0IOTUKCI7B6Y/ZCJe76Mnqs2L7VttHh0r/YqkC2bCS7Q== X-Received: by 2002:a17:902:e747:b0:196:1d89:7002 with SMTP id p7-20020a170902e74700b001961d897002mr1941570plf.31.1674586884928; Tue, 24 Jan 2023 11:01:24 -0800 (PST) Received: from tictac2.mtv.corp.google.com ([2620:15c:9d:2:7b28:de8d:ee0:2cd6]) by smtp.gmail.com with ESMTPSA id f10-20020a17090274ca00b001948720f6bdsm2010415plt.98.2023.01.24.11.01.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Jan 2023 11:01:24 -0800 (PST) From: Douglas Anderson To: ath11k@lists.infradead.org, linux-wireless@vger.kernel.org Cc: Luis Chamberlain , Nick Kossifidis , Youghandhar Chintala , junyuu@chromium.org, Kalle Valo , Jiri Slaby , Douglas Anderson , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Manikanta Pubbisetty , Paolo Abeni , linux-kernel@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH 1/2] wifi: ath11k: Use platform_get_irq() to get the interrupt Date: Tue, 24 Jan 2023 11:01:00 -0800 Message-Id: <20230124110057.1.I69cf3d56c97098287fe3a70084ee515098390b70@changeid> X-Mailer: git-send-email 2.39.1.405.gd4c25cc71f-goog MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org For the same reasons talked about in commit 9503a1fc123d ("ath9k: Use platform_get_irq() to get the interrupt"), we should be using platform_get_irq() in ath11k. Let's make the switch. 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. Digging into the platform device there truly were no IRQs present in the list of resources when the call was made. I didn't dig into what changed between 5.15 (where platform_get_resource() seems to work) and mainline Linux (where it doesn't). Given the zeal robot report for ath9k I assume it's a known issue. I'll mark this as "fixing" the patch that introduced the platform_get_resource() call since it should have always been fine to just call platform_get_irq() and that'll make sure it goes back as far as it needs to go. Tested-on: WCN6750 hw1.0 AHB WLAN.MSL.1.0.1-00887-QCAMSLSWPLZ-1 Fixes: 00402f49d26f ("ath11k: Add support for WCN6750 device") Signed-off-by: Douglas Anderson --- 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 Tue Jan 24 19:01:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 646537 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 02BB5C54E94 for ; Tue, 24 Jan 2023 19:01:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232827AbjAXTBc (ORCPT ); Tue, 24 Jan 2023 14:01:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38810 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234381AbjAXTBa (ORCPT ); Tue, 24 Jan 2023 14:01:30 -0500 Received: from mail-pj1-x1036.google.com (mail-pj1-x1036.google.com [IPv6:2607:f8b0:4864:20::1036]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 561824C6EA for ; Tue, 24 Jan 2023 11:01:27 -0800 (PST) Received: by mail-pj1-x1036.google.com with SMTP id k10-20020a17090a590a00b0022ba875a1a4so12628174pji.3 for ; Tue, 24 Jan 2023 11:01:27 -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=50cO/6ZppDTgK/hTEwdsnZtIUmof/i6Am5RFe+y6fDg=; b=jfE7I7WvzTda77if8o0AnlZyXeVHxwVIDww/9+S2ljpISGdXCqTC5lnP6jAn25+P3s JiEJswbNMHjeomPV9fvhWaP1X+eg4zcs17gt/efjfnNzHMspdGlPF5yq+/Cfg1HOvLg2 Kp5IWDoo6CYqTnsILJ5HtBvSIVzD/oqlSVKFI= 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=50cO/6ZppDTgK/hTEwdsnZtIUmof/i6Am5RFe+y6fDg=; b=RMTg2b7b+TMLLE8DnqpVdYA2Rw4F5ubgLpXi29K5rK8Fyp0hrdfLmFQXZCF3qeKUUV NOXtfZuvu2ZZUF3FSpTnaQ8EMMJr5cn/ORfxg45jngU1aAlzSdvB153Z59xqdM+6dVSs DfF1Etbqbvhg+C7EreGJ3Nf+s6lpLr0w8Z0S7fPTlQ/8KUDF47hIUj1d97ZmwDn8f0/D xv1zntdbjiTnIr9qPpHecoh4zIwCw3dgPSdHrsNPLpUwaRg6S8SO5rnn73qmyNPwoM2A vaji07flA5oI7VXHq1/OYvcV6K/Uh9Dlz+eMdw6Rmoc5wFXWtj5WLACl2NKtwLYNQUd5 widw== X-Gm-Message-State: AO0yUKUa3/sQsX+4dwlg3s5kB9EDU6r7DUGhhhx0G3CCx3txpULonXhI jLNOBYBYx2NqlvpEI8N+seJkww== X-Google-Smtp-Source: AK7set8UGHGugxZPfIDZziY43UqyiSusorvSQsjCeo4te4wOprdvp/KbTUT4tFW/IJ4PPfPd66crVg== X-Received: by 2002:a17:903:18f:b0:196:cea:487a with SMTP id z15-20020a170903018f00b001960cea487amr6070801plg.53.1674586886656; Tue, 24 Jan 2023 11:01:26 -0800 (PST) Received: from tictac2.mtv.corp.google.com ([2620:15c:9d:2:7b28:de8d:ee0:2cd6]) by smtp.gmail.com with ESMTPSA id f10-20020a17090274ca00b001948720f6bdsm2010415plt.98.2023.01.24.11.01.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Jan 2023 11:01:26 -0800 (PST) From: Douglas Anderson To: ath11k@lists.infradead.org, linux-wireless@vger.kernel.org Cc: Luis Chamberlain , Nick Kossifidis , Youghandhar Chintala , junyuu@chromium.org, Kalle Valo , Jiri Slaby , Douglas Anderson , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linux-kernel@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH 2/2] wifi: ath5k: Use platform_get_irq() to get the interrupt Date: Tue, 24 Jan 2023 11:01:01 -0800 Message-Id: <20230124110057.2.Ic4f8542b0588d7eb4bc6e322d4af3d2064e84ff0@changeid> X-Mailer: git-send-email 2.39.1.405.gd4c25cc71f-goog In-Reply-To: <20230124110057.1.I69cf3d56c97098287fe3a70084ee515098390b70@changeid> References: <20230124110057.1.I69cf3d56c97098287fe3a70084ee515098390b70@changeid> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org For the same reasons talked about in commit 9503a1fc123d ("ath9k: Use platform_get_irq() to get the interrupt"), we should be using platform_get_irq() in ath5k. Let's make the switch. Signed-off-by: Douglas Anderson --- 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. 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");