From nobody Mon Feb 9 07:06:23 2026 Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D352818BBAF for ; Fri, 23 Aug 2024 15:55:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.175 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724428516; cv=none; b=quvFu1+UzUUDFk2UJfZytTTRQFE3/a92jvUl+Wkq89StA2UvmAmaQuMxicIuVbyxIBJsQW5a6ZE+OBW01UhsKjubizEaEoYlctZ7hphk6YRevOXEdOTqvyiXFtp5lTisTmXjKzTuulWL7LkbnslTv61o77OEd/lMpiYHVX0VLI4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724428516; c=relaxed/simple; bh=ePvfybwsiMnF/F9NOskCIksnUV52Y6+64BJ0Rc4npY0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=mOHR8ypDf+Jkn/KGBUDHIwqbkgC+Q76PwLQPZDQs4JaH56ftmUg0bW5w3nE1yP8IMl2rZ4+6jblwmi8LOpE1n6EVg9RV682IOsMS0SbKz7fKTpT/iXLe05W//03OWPcp8WrbdW8vFRdzDhx2xoXawVZCliYyPPs8v2ZBFB6t0Fs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=ttC93zR8; arc=none smtp.client-ip=209.85.214.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="ttC93zR8" Received: by mail-pl1-f175.google.com with SMTP id d9443c01a7336-1fee6435a34so15877685ad.0 for ; Fri, 23 Aug 2024 08:55:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1724428514; x=1725033314; darn=vger.kernel.org; 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=7h1sMGva4zvk+DO1CjXNG0vRsRviBRjI6p9NW+fVQK8=; b=ttC93zR8iD8yjBhEppCADprC9Fph+xnVABKdPIUIKVr1EgYxP8AhpbkCC1neT73RVi +/2B5LaSAPfQAxD67D/91nZIAPcly8ffhd5gzbrmWxGqI82bW3if+k7ogZLY+nd6rjSe /YeWHUpvPk4DX4V6ntWOgTweEFfvpYWYzHr46vvo8EWJuJvAbASg9vg/izQqQvdtGrAD v5w6w3bieKFbtAePwatNoozU4sS0uu7d9kD67uBxXomXjPmZ6DEX3R+AcfE2oqquFLV8 Xv5SqS687BbMCNogaBe3bF588+ehC4V+Jq+VLHEnhGqIHyN/MPuB9iYJSPHu6N84wqNU cKdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724428514; x=1725033314; 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=7h1sMGva4zvk+DO1CjXNG0vRsRviBRjI6p9NW+fVQK8=; b=otYE6TR3b4dKt0JSYddoAe4/LNbUzEhiDn3SF8oLBCbJkzeEirpjy7teVtR4mfqQ7E F0jBSb2YBthrr1ie60njQ1zArcc4yJUG5qtD2R8Kyvbv7Xe/p7MS/gPFwsOcmsg53DSv dUazrVIGmZICAaM8CPO/EhsepJ65furz3AqTRp20uaDGuejxyAwTYZ44TekYGs90C//I EkrGWk35kmq+sfsYg1uKE3gNx7IG5NxqOQcz4ae0Lm4Pfd7E38xx7Ow/9+NQ4bwwm4QC 7c2pOq6lrDl3JcF23QvhlmnZ8lm7ksrWopGrHaJR1evDVigwPxN8GTUbwTPy759bJiT/ YNAQ== X-Forwarded-Encrypted: i=1; AJvYcCVgcuq1Sa8iPiTv2EExdwylhwz3LsoPhIXDrIcBNXuJ/wlGnG/LDSjqmcz00vhUfF4X53KfBv5oo2HAtdk=@vger.kernel.org X-Gm-Message-State: AOJu0YxOV+16aUqMsWoYEjo5kw3R/H0u6Gzqyz+tUT/AZXWG+YL/hqt6 84VFkI9uxMvBzc1JJ0BUJsQJut4h00kFgRFszrfd0OxzpfrYW18Q+tF973aJqw== X-Google-Smtp-Source: AGHT+IHZT5UpGBKD3IsG3QWdp8UwkgHmxBD8wtk0Tk5ZI4z0cspx07kEdT1GkMzCcaK4JYmk/BQ8mA== X-Received: by 2002:a17:902:a705:b0:1fc:2e38:d3de with SMTP id d9443c01a7336-2039e443915mr21530405ad.7.1724428514080; Fri, 23 Aug 2024 08:55:14 -0700 (PDT) Received: from localhost.localdomain ([120.60.50.97]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2038556649bsm29824005ad.49.2024.08.23.08.55.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Aug 2024 08:55:13 -0700 (PDT) From: Manivannan Sadhasivam To: kvalo@kernel.org, jjohnson@kernel.org Cc: linux-wireless@vger.kernel.org, ath12k@lists.infradead.org, linux-kernel@vger.kernel.org, Manivannan Sadhasivam , Baochen Qiang Subject: [PATCH 1/3] wifi: ath11k: Set IRQ affinity hint after requesting all shared IRQs Date: Fri, 23 Aug 2024 21:25:00 +0530 Message-Id: <20240823155502.57333-2-manivannan.sadhasivam@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240823155502.57333-1-manivannan.sadhasivam@linaro.org> References: <20240823155502.57333-1-manivannan.sadhasivam@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" If a shared IRQ is used by the driver due to platform limitation, then the IRQ affinity hint is set right after the allocation of IRQ vectors in ath11k_pci_alloc_msi(). This does no harm unless one of the functions requesting the IRQ fails and attempt to free the IRQ. This results in the below warning: [ 29.804276] ath11k_pci 0000:01:00.0: failed to power up mhi: -110 [ 29.810564] ath11k_pci 0000:01:00.0: failed to start mhi: -110 [ 29.816566] ath11k_pci 0000:01:00.0: failed to power up :-110 [ 29.847202] ath11k_pci 0000:01:00.0: failed to create soc core: -110 [ 29.853735] ath11k_pci 0000:01:00.0: failed to init core: -110 [ 29.859745] ------------[ cut here ]------------ [ 29.864486] WARNING: CPU: 7 PID: 349 at kernel/irq/manage.c:1929 free_ir= q+0x278/0x29c [ 29.872529] Modules linked in: snd_soc_hdmi_codec ath11k_pci(+) venus_de= c venus_enc ath11k videobuf2_dma_contig videobuf2_memops nb7vpq904m lontium= _lt9611uxc mcp251xfd mac80211 can_dev libarc4 hci_uart btqca btbcm ax88179_178a usbnet option leds_qcom_lpg usb_wwan led_class_mu= lticolor usbserial crct10dif_ce qcom_pmic_tcpm tcpm venus_core aux_hpd_brid= ge qcom_spmi_adc_tm5 v4l2_mem2mem qcom_pon qcom_spmi_a dc5 videobuf2_v4l2 bluetooth videobuf2_common msm qcom_spmi_temp_alarm rtc_= pm8xxx qcom_vadc_common ocmem snd_soc_sm8250 gpu_sched snd_soc_qcom_sdw vid= eodev drm_exec phy_qcom_qmp_combo drm_display_helper s nd_soc_qcom_common qcom_stats mc i2c_qcom_geni llcc_qcom spi_geni_qcom drm_= dp_aux_bus aux_bridge icc_bwmon typec qcom_rng coresight_stm coresight_tmc = coresight_replicator stm_core coresight_funnel soundwi re_qcom qrtr pci_pwrctl_pwrseq qcrypto pci_pwrctl_core soundwire_bus snd_so= c_lpass_va_macro pinctrl_sm8250_lpass_lpi snd_soc_lpass_wsa_macro authenc l= pass_gfm_sm8250 coresight slimbus pinctrl_lpass_lpi [ 29.872610] snd_soc_lpass_macro_common qcom_q6v5_pas libdes qcom_pil_in= fo qcom_q6v5 qcom_sysmon qcom_common pwrseq_qcom_wcn qcom_glink_smem mdt_lo= ader pwrseq_core icc_osm_l3 qmi_helpers qcom_wdt socin fo display_connector drm_kms_helper cfg80211 rfkill fuse drm backlight ip_t= ables x_tables ipv6 [ 29.990067] CPU: 7 UID: 0 PID: 349 Comm: (udev-worker) Not tainted 6.11-= rc4 #50 [ 29.997564] Hardware name: Qualcomm Technologies, Inc. Robotics RB5 (DT) [ 30.004446] pstate: 604000c5 (nZCv daIF +PAN -UAO -TCO -DIT -SSBS BTYPE= =3D--) [ 30.011591] pc : free_irq+0x278/0x29c [ 30.015355] lr : free_irq+0xb4/0x29c [ 30.019030] sp : ffff800081f236e0 [ 30.022441] x29: ffff800081f236e0 x28: ffff64630d260000 x27: ffffd8d89a8= c3458 [ 30.029764] x26: ffff64630d26ac00 x25: 00000000000000d6 x24: ffff6463029= c58dc [ 30.037086] x23: ffff6463029c5990 x22: ffff64630d261c58 x21: 00000000000= 00000 [ 30.044408] x20: ffff646301431c00 x19: ffff6463029c5800 x18: 00000000000= 00010 [ 30.051730] x17: 0000000000010108 x16: ffffd8d8f1d8b840 x15: 07630720077= 40769 [ 30.059051] x14: 000000000000030d x13: ffff646306b35ae8 x12: ffffd8d8f38= 52b80 [ 30.066374] x11: ffff646306b356c0 x10: 0000000000000000 x9 : 00000000000= 000d6 [ 30.073696] x8 : 000000000000000f x7 : 1fffec8c605626a1 x6 : ffffd8d8f2e= 602b8 [ 30.081017] x5 : 0000000000000030 x4 : ffff646302b13580 x3 : ffff6463014= 31c98 [ 30.088339] x2 : 0000000000200880 x1 : ffff646301431c00 x0 : ffffd8d8f2b= 2c1b8 [ 30.095662] Call trace: [ 30.098183] free_irq+0x278/0x29c [ 30.101595] ath11k_pcic_free_irq+0x70/0x10c [ath11k] [ 30.106800] ath11k_pci_probe+0x800/0x820 [ath11k_pci] [ 30.112081] local_pci_probe+0x40/0xbc [ 30.115934] pci_device_probe+0x1d4/0x1e8 [ 30.120049] really_probe+0xbc/0x268 [ 30.123727] __driver_probe_device+0x78/0x12c [ 30.128204] driver_probe_device+0x40/0x11c [ 30.132505] __driver_attach+0x74/0x124 [ 30.136445] bus_for_each_dev+0x78/0xe0 [ 30.140383] driver_attach+0x24/0x30 [ 30.144059] bus_add_driver+0xe4/0x208 [ 30.147910] driver_register+0x60/0x128 [ 30.151849] __pci_register_driver+0x44/0x50 [ 30.156238] ath11k_pci_init+0x2c/0x6c [ath11k_pci] [ 30.161242] do_one_initcall+0x70/0x1b8 [ 30.165182] do_init_module+0x5c/0x1f0 [ 30.169034] load_module+0x19f0/0x1abc [ 30.172884] init_module_from_file+0x88/0xc8 [ 30.177273] __arm64_sys_finit_module+0x1c4/0x2b0 [ 30.182102] invoke_syscall+0x44/0x100 [ 30.185953] el0_svc_common.constprop.0+0xc0/0xe0 [ 30.190783] do_el0_svc+0x1c/0x28 [ 30.194196] el0_svc+0x34/0xdc [ 30.197335] el0t_64_sync_handler+0xc0/0xc4 [ 30.201635] el0t_64_sync+0x190/0x194 [ 30.205399] ---[ end trace 0000000000000000 ]--- [ 30.432731] ath11k_pci 0000:01:00.0: probe with driver ath11k_pci failed= with error -110 The warning is due to not clearing the affinity hint before freeing the IRQ. So to fix this, let's set the IRQ affinity hint after requesting all the shared IRQ. This will make sure that the affinity hint gets cleared in the error path before freeing the IRQ. Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-05266-QCAHSTSWPLZ_V2_TO_X86-1 Cc: Baochen Qiang Fixes: e94b07493da3 ("ath11k: Set IRQ affinity to CPU0 in case of one MSI v= ector") Signed-off-by: Manivannan Sadhasivam --- drivers/net/wireless/ath/ath11k/pci.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/net/wireless/ath/ath11k/pci.c b/drivers/net/wireless/a= th/ath11k/pci.c index 8d63b84d1261..0c22e18e65c7 100644 --- a/drivers/net/wireless/ath/ath11k/pci.c +++ b/drivers/net/wireless/ath/ath11k/pci.c @@ -886,16 +886,10 @@ static int ath11k_pci_probe(struct pci_dev *pdev, if (ret) goto err_pci_disable_msi; =20 - ret =3D ath11k_pci_set_irq_affinity_hint(ab_pci, cpumask_of(0)); - if (ret) { - ath11k_err(ab, "failed to set irq affinity %d\n", ret); - goto err_pci_disable_msi; - } - ret =3D ath11k_mhi_register(ab_pci); if (ret) { ath11k_err(ab, "failed to register mhi: %d\n", ret); - goto err_irq_affinity_cleanup; + goto err_pci_disable_msi; } =20 ret =3D ath11k_hal_srng_init(ab); @@ -916,6 +910,12 @@ static int ath11k_pci_probe(struct pci_dev *pdev, goto err_ce_free; } =20 + ret =3D ath11k_pci_set_irq_affinity_hint(ab_pci, cpumask_of(0)); + if (ret) { + ath11k_err(ab, "failed to set irq affinity %d\n", ret); + goto err_free_irq; + } + /* kernel may allocate a dummy vector before request_irq and * then allocate a real vector when request_irq is called. * So get msi_data here again to avoid spurious interrupt @@ -924,17 +924,20 @@ static int ath11k_pci_probe(struct pci_dev *pdev, ret =3D ath11k_pci_config_msi_data(ab_pci); if (ret) { ath11k_err(ab, "failed to config msi_data: %d\n", ret); - goto err_free_irq; + goto err_irq_affinity_cleanup; } =20 ret =3D ath11k_core_init(ab); if (ret) { ath11k_err(ab, "failed to init core: %d\n", ret); - goto err_free_irq; + goto err_irq_affinity_cleanup; } ath11k_qmi_fwreset_from_cold_boot(ab); return 0; =20 +err_irq_affinity_cleanup: + ath11k_pci_set_irq_affinity_hint(ab_pci, NULL); + err_free_irq: ath11k_pcic_free_irq(ab); =20 @@ -947,9 +950,6 @@ static int ath11k_pci_probe(struct pci_dev *pdev, err_mhi_unregister: ath11k_mhi_unregister(ab_pci); =20 -err_irq_affinity_cleanup: - ath11k_pci_set_irq_affinity_hint(ab_pci, NULL); - err_pci_disable_msi: ath11k_pci_free_msi(ab_pci); =20 --=20 2.25.1 From nobody Mon Feb 9 07:06:23 2026 Received: from mail-pl1-f176.google.com (mail-pl1-f176.google.com [209.85.214.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5638A1898F4 for ; Fri, 23 Aug 2024 15:55:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724428518; cv=none; b=nq++KeasIS2/QXIbJRgeSH+7h9b7Q1W6+ox0ctnnQ86qku0kAinRTG6h3yogtQ66yLeuX/d3fB4pKjSy5HDU1IsvBrULHthQQXXmh2fdiAoyQKFkrz3KHyG5JZv5aq4RrqyFjj2HMwI62VPxYFb0Q/3oO5wq8fCqylqNiackoJA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724428518; c=relaxed/simple; bh=I2OaP2G9ZSUZb5B1yFwzmWeX6kKkcvOPS4FPAh5q6eA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=OcgO4HJFp+i9ghPr0QdhrwsoedwG04MeRZ4em+Yoll7LjsyLQX1hibXlSLHTQgpsEh21nFHTvTkZGqplVWohl+by5OCd/QyKXpObInNhM+ZWIebSToj1MMz3Tk2fWG7oj3IFFEvxDE/+/xE5lAy8mcleqRc9+FRXYD834FnyKFA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=JbGnkPte; arc=none smtp.client-ip=209.85.214.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="JbGnkPte" Received: by mail-pl1-f176.google.com with SMTP id d9443c01a7336-202508cb8ebso15382695ad.3 for ; Fri, 23 Aug 2024 08:55:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1724428516; x=1725033316; darn=vger.kernel.org; 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=Z6OlRtyM144d7+hDbDg/Ar+tRLxHvv6vXiCYuDqqU2U=; b=JbGnkPteAEQrYJX4bDnXAdGh0kF4bQqOdV/rSoz2NipOgo/Kq8cPvYgi8YB5cm2pIX nj9IMzaOEwqi/2zTu5ma3L9oIlBgxGbAd8GCusD+zG/s2NIaBfKVAJl0GQEGKig5GoWV VAVjLtRymVJ6l+9MU26mdIFxTQhO9dJPiXr1oAM+hTcVFKniIfLqCHbj+AlKA3t0VBuf oymosoViVjefimOs+3RCkxKwi3MDk+mtI1n0uN5Wkf8n3HTK0yzgb/FV2jTUEsTP76xF jR8ir7xT0PgzMrma+7Tzp+r3khrpSJcXJq+lgVvFdKB226WFavdHrENEPNFQummPLnB5 2N5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724428516; x=1725033316; 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=Z6OlRtyM144d7+hDbDg/Ar+tRLxHvv6vXiCYuDqqU2U=; b=M7kTxsTjKdxzS6aT9q2HyiHMaUI8OZW4AToJkeW/InPUvQ3V31Ib6YVOqHfP4P5Rja AukTR/2NdO9Bqq9AQKPq/aNZqZ6ioJg3zkF0XC9CFqiPF+KBhEX5OTSaN+0VRnSZ5eCo cJekZOw0s7CcO/LhlUmw1W4gxnKZB3FgHzIEZmMzvLC1KjpQda0KUqOzTUfLnPHG4521 DypRAnMLnX2bFyAJgM+vzc7aqDHxglIGkRliJq5vvxRAp9gsX+zqoyL/VgiugFV9DNE2 V+16hzjqbvRnaa6kUN4bYIGhFRxeeyRQazkdkW2y/QbYyo/LjLxt90uuWZk+y0vkj2ZI rtKg== X-Forwarded-Encrypted: i=1; AJvYcCUbv4aHqF4K8MGwdIENbqxrYurQ2N7l8yGmWFQiVskNh4Cgjfs68N+2MjcwGIH8CdaTRKH0Djh76yQysQc=@vger.kernel.org X-Gm-Message-State: AOJu0Yxn7l27RVCUN5d5jzCgxmEuQYbtjgjPhjaJB2/FqdV09hhER2je QEYeY6ppD2YxYEaa9M98a+L2MMoueCHKBWPH8OxQP3MIBYqd7aMLG+/T1TRfvA== X-Google-Smtp-Source: AGHT+IHU9XYQVlwdi75xAtVt2K4NPPU34/rpoSBNw0HOQIYbBIP/tEV3woHJzuCA/9MOnobrbzXezA== X-Received: by 2002:a17:903:244b:b0:203:a0c6:91e5 with SMTP id d9443c01a7336-203a0c691femr20981215ad.51.1724428516533; Fri, 23 Aug 2024 08:55:16 -0700 (PDT) Received: from localhost.localdomain ([120.60.50.97]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2038556649bsm29824005ad.49.2024.08.23.08.55.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Aug 2024 08:55:16 -0700 (PDT) From: Manivannan Sadhasivam To: kvalo@kernel.org, jjohnson@kernel.org Cc: linux-wireless@vger.kernel.org, ath12k@lists.infradead.org, linux-kernel@vger.kernel.org, Manivannan Sadhasivam Subject: [PATCH 2/3] wifi: ath12k: Set IRQ affinity hint after requesting all shared IRQs Date: Fri, 23 Aug 2024 21:25:01 +0530 Message-Id: <20240823155502.57333-3-manivannan.sadhasivam@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240823155502.57333-1-manivannan.sadhasivam@linaro.org> References: <20240823155502.57333-1-manivannan.sadhasivam@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" If a shared IRQ is used by the driver due to platform limitation, then the IRQ affinity hint is set right after the allocation of IRQ vectors in ath11k_pci_alloc_msi(). This does no harm unless one of the functions requesting the IRQ fails and attempt to free the IRQ. This may end up with a warning from the IRQ core that is expecting the affinity hint to be cleared before freeing the IRQ: kernel/irq/manage.c: /* make sure affinity_hint is cleaned up */ if (WARN_ON_ONCE(desc->affinity_hint)) desc->affinity_hint =3D NULL; So to fix this, let's set the IRQ affinity hint after requesting all the shared IRQ. This will make sure that the affinity hint gets cleared in the error path before freeing the IRQ. Signed-off-by: Manivannan Sadhasivam --- drivers/net/wireless/ath/ath12k/pci.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/net/wireless/ath/ath12k/pci.c b/drivers/net/wireless/a= th/ath12k/pci.c index 9e0b9e329bda..f265c1b8ce4e 100644 --- a/drivers/net/wireless/ath/ath12k/pci.c +++ b/drivers/net/wireless/ath/ath12k/pci.c @@ -1446,16 +1446,10 @@ static int ath12k_pci_probe(struct pci_dev *pdev, if (ret) goto err_pci_msi_free; =20 - ret =3D ath12k_pci_set_irq_affinity_hint(ab_pci, cpumask_of(0)); - if (ret) { - ath12k_err(ab, "failed to set irq affinity %d\n", ret); - goto err_pci_msi_free; - } - ret =3D ath12k_mhi_register(ab_pci); if (ret) { ath12k_err(ab, "failed to register mhi: %d\n", ret); - goto err_irq_affinity_cleanup; + goto err_pci_msi_free; } =20 ret =3D ath12k_hal_srng_init(ab); @@ -1476,6 +1470,12 @@ static int ath12k_pci_probe(struct pci_dev *pdev, goto err_ce_free; } =20 + ret =3D ath12k_pci_set_irq_affinity_hint(ab_pci, cpumask_of(0)); + if (ret) { + ath12k_err(ab, "failed to set irq affinity %d\n", ret); + goto err_free_irq; + } + /* kernel may allocate a dummy vector before request_irq and * then allocate a real vector when request_irq is called. * So get msi_data here again to avoid spurious interrupt @@ -1484,16 +1484,19 @@ static int ath12k_pci_probe(struct pci_dev *pdev, ret =3D ath12k_pci_config_msi_data(ab_pci); if (ret) { ath12k_err(ab, "failed to config msi_data: %d\n", ret); - goto err_free_irq; + goto err_irq_affinity_cleanup; } =20 ret =3D ath12k_core_init(ab); if (ret) { ath12k_err(ab, "failed to init core: %d\n", ret); - goto err_free_irq; + goto err_irq_affinity_cleanup; } return 0; =20 +err_irq_affinity_cleanup: + ath12k_pci_set_irq_affinity_hint(ab_pci, NULL); + err_free_irq: ath12k_pci_free_irq(ab); =20 @@ -1509,9 +1512,6 @@ static int ath12k_pci_probe(struct pci_dev *pdev, err_pci_msi_free: ath12k_pci_msi_free(ab_pci); =20 -err_irq_affinity_cleanup: - ath12k_pci_set_irq_affinity_hint(ab_pci, NULL); - err_pci_free_region: ath12k_pci_free_region(ab_pci); =20 --=20 2.25.1 From nobody Mon Feb 9 07:06:23 2026 Received: from mail-pl1-f181.google.com (mail-pl1-f181.google.com [209.85.214.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A56C618BC2D for ; Fri, 23 Aug 2024 15:55:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724428521; cv=none; b=XDoGXXtO1kbd2IoBisQHjVFrocBh0MDxOXxvdU5yFTD8x5AP4deKhubyqyxlyoKQZjddzgaASrHAQ8/co90Cuet6ZBn/OfMfpsqibPCDn1GPpwoCiFXTnbP7tV3vMG5EnvZME+qi4uzMgm/7RpUudBghvEJbt9eFww3mCNq+HkU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724428521; c=relaxed/simple; bh=GIdg1XXy8Jro+0pgnDnKjFDZ8YdtGulgcZyNmxPxD1E=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=u8Q/esF2rnKsTMypXIRKqcqiqiwbE/42uv7xwxPmxWBJ8aiYOXFA7hbOI1j3Do0HY8paRoxSuG6yIX0/6oFtwj2un1t1O9HSBrFlFjIUgiG2WrCXgC3ECRkls5lGt2Z2Lt091Htadd3uLdLOGiA4ZVKQfAnX+tfy0ClAq7maPl4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=jD9ZOmVP; arc=none smtp.client-ip=209.85.214.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="jD9ZOmVP" Received: by mail-pl1-f181.google.com with SMTP id d9443c01a7336-201e52ca0caso16438575ad.3 for ; Fri, 23 Aug 2024 08:55:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1724428519; x=1725033319; darn=vger.kernel.org; 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=oxYL4taGoTZve5PyKphI9oILj7NZymoSkWXTcdSeKf8=; b=jD9ZOmVPQcNqzChc5kSqHkGByVJUI5fBTjtZPvNCgP3DEonjOqzOfyU+V0AnhvKBFj PRb3K/+MrsbOzHF83M82xDKuc/FAczHIf156AZwpnQ0gTJ1iZgqLztmMl/P/Z7kOOYBN LiRePjcT1od71mnG6YNnfeauOhmWPraihyiEoAOg2x5pJrPHji05SuJvUFSNEpbRIn/x aRXRwNqPxkUAp4pr93M5XFCO/lh+W0sRiZfjpFsrZWgUiC/nV0J2qtIKmLBLWmvS9wiS 2qVWdHsdkQUX4HdApiiMqT1MQmG4GGFKcI5f2UN5lclUrdMk5x+Blaj5VQGOiPrsxQ6A +89w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724428519; x=1725033319; 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=oxYL4taGoTZve5PyKphI9oILj7NZymoSkWXTcdSeKf8=; b=bhknggbVjbvfuNrBWcDDpc7r7yJcz+VSgDwOKp/ZNIndCaxgplTgLRwhHgRxsWEb6F n6Qo/LHj1E/RRYd2T90pc+LfBOwcaoRCXsUwxKwJ5eIbqFvx38pmn4UavE9Fk8fM/sj+ +xDfWwpA/G0cBumn/Gs4DmjoJZQnyi3PwBaRnIiWnzcLX8ymVLXA7DyXNUNPRg42PiBC 1hBhYnF1CdUNBoYL9Umkr0JVsKtmYeWGehSApvN2Z0yqwrIhTfVU0d/vL45YixegNsZn uDuu5ldXdojFpFapQuGCzNrNHP2UvVcSg63U/Fnbp7kEU8HncM8iD7w4vP8rJNoaKK9l Hp2g== X-Forwarded-Encrypted: i=1; AJvYcCUYE5oRKmAraCufE4DOu+KD5YQ+bGaYID+oeIsPkNMKZthYoQ1jDzCXW+nRQ6NRDsk5g0E9k7Aesw1FUd4=@vger.kernel.org X-Gm-Message-State: AOJu0YzBftqFmjXrsP5Z6CHHdqqFQCjfeCGdGvLoJ83xodXOnnpkEZV+ KMxS2qsMSnojLz8fj5t4nAXIiLhZlROBeWwqQi7m3lzgKQgf13uXounoYGVV2A== X-Google-Smtp-Source: AGHT+IG0hQCLMJ/jPI8GZvyX9YfaXQ63wg4NOQ3fxNxn6CdaQOyARVZhocSoJ0b7r/Slu5xTXGW1Bw== X-Received: by 2002:a17:903:40c6:b0:201:d659:4c29 with SMTP id d9443c01a7336-2039e46ce0emr26667785ad.21.1724428519003; Fri, 23 Aug 2024 08:55:19 -0700 (PDT) Received: from localhost.localdomain ([120.60.50.97]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2038556649bsm29824005ad.49.2024.08.23.08.55.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Aug 2024 08:55:18 -0700 (PDT) From: Manivannan Sadhasivam To: kvalo@kernel.org, jjohnson@kernel.org Cc: linux-wireless@vger.kernel.org, ath12k@lists.infradead.org, linux-kernel@vger.kernel.org, Manivannan Sadhasivam Subject: [PATCH 3/3] wifi: ath11k/ath12k: Replace irq_set_affinity_hint() with irq_set_affinity_and_hint() Date: Fri, 23 Aug 2024 21:25:02 +0530 Message-Id: <20240823155502.57333-4-manivannan.sadhasivam@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240823155502.57333-1-manivannan.sadhasivam@linaro.org> References: <20240823155502.57333-1-manivannan.sadhasivam@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" irq_set_affinity_hint() API is deprecated now, so let's use the recommended equivalent irq_set_affinity_and_hint(). Tested-on: QCA6390 hw2.0 PCI WLAN.HST.1.0.1-05266-QCAHSTSWPLZ_V2_TO_X86-1 Signed-off-by: Manivannan Sadhasivam --- drivers/net/wireless/ath/ath11k/pci.c | 2 +- drivers/net/wireless/ath/ath12k/pci.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ath/ath11k/pci.c b/drivers/net/wireless/a= th/ath11k/pci.c index 0c22e18e65c7..03aa371f0187 100644 --- a/drivers/net/wireless/ath/ath11k/pci.c +++ b/drivers/net/wireless/ath/ath11k/pci.c @@ -735,7 +735,7 @@ static int ath11k_pci_set_irq_affinity_hint(struct ath1= 1k_pci *ab_pci, if (test_bit(ATH11K_FLAG_MULTI_MSI_VECTORS, &ab_pci->ab->dev_flags)) return 0; =20 - return irq_set_affinity_hint(ab_pci->pdev->irq, m); + return irq_set_affinity_and_hint(ab_pci->pdev->irq, m); } =20 static int ath11k_pci_probe(struct pci_dev *pdev, diff --git a/drivers/net/wireless/ath/ath12k/pci.c b/drivers/net/wireless/a= th/ath12k/pci.c index f265c1b8ce4e..c3fb2886f24b 100644 --- a/drivers/net/wireless/ath/ath12k/pci.c +++ b/drivers/net/wireless/ath/ath12k/pci.c @@ -644,7 +644,7 @@ static int ath12k_pci_set_irq_affinity_hint(struct ath1= 2k_pci *ab_pci, if (test_bit(ATH12K_PCI_FLAG_MULTI_MSI_VECTORS, &ab_pci->flags)) return 0; =20 - return irq_set_affinity_hint(ab_pci->pdev->irq, m); + return irq_set_affinity_and_hint(ab_pci->pdev->irq, m); } =20 static int ath12k_pci_config_irq(struct ath12k_base *ab) --=20 2.25.1