Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp960504rdh; Thu, 26 Oct 2023 23:58:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFLSfHpEdTw0ltd41+cn4o/e/kyLz+QRJ9b3e+4t1F+R1yVY9I1qBrQGPgi50ZFJ16pXAbx X-Received: by 2002:a25:b318:0:b0:da0:c49a:5fdf with SMTP id l24-20020a25b318000000b00da0c49a5fdfmr1667653ybj.7.1698389900752; Thu, 26 Oct 2023 23:58:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698389900; cv=none; d=google.com; s=arc-20160816; b=u39LM634RWk+d0KO7IMgjz5RL6H0OPnvyfNh7s6LR0swXXDZtR4ySGZxmIbZkzGKW2 8KcMCtGYMMP/uzUKbvclAjw2ghavQundSe7TakHvjvDJ462cdMLk2vobAs2Cz+Sd3ViL FY79qhIyZzMAkCYglGbamWpuFumY8U/UbQSplKKhzlgRZnptj9eCg7LagikrBiQA5r/P ZzjkaCD9WdQkJUhSynfgkjx4wxbWl6b4BalSZ1JEaOx9hFdA2eHlDv6YMoDbwg4srruY 3hUy+V/hSak38g30EtG/wSdQr8VWi0CM/2BEeYsLRx2WOpQlLZ+d23xH2pL9nCDs6Aiv qjaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:message-id:content-transfer-encoding :mime-version:subject:date:from:dkim-signature; bh=kj3Zu6WMlpxQr17sM16EXcoz5cOx2Zq8aggknXeJGWY=; fh=zhTXiDXPoir0s8iWbHwymI8V15ZnHtwX4FLH+8iMdv8=; b=efEDNakQ9/ypuaBB/pPsMq/uDvISU4yhEB/Dg83kug1KCuD7NGr8BZVPcfxiizR6dN P6dCe4TiL3BqEmMc8fTimUqKSQbdKt01aH+bp0M266Ehjlng+Vc2kD8dKQHvajeQbLKW X+R1LaUPbwEcyCTLZh+AxWNGDBo4pRrNx+uvNaFU5iizrNReecZjZtvKaLIipDnghgZO QOQRyo1p3hKSJ7tbxO58htBq/MeNkVKOucJIo2EonkzIUbppYDStxmCTVVChs0pOipPC pU0kHKKEpQUtAKeoaGkjEp8ZPCjbCZOnRC98dgNmWaAPgF9YyU7206Y+cKc4Eqs4E7jp 7FGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fairphone.com header.s=fair header.b=JN948EZB; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=fairphone.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id bu32-20020a056902092000b00d9ab6c99aa4si2194271ybb.589.2023.10.26.23.58.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Oct 2023 23:58:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@fairphone.com header.s=fair header.b=JN948EZB; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=fairphone.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id F2D568112AAF; Thu, 26 Oct 2023 23:57:30 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234999AbjJ0G50 (ORCPT + 52 others); Fri, 27 Oct 2023 02:57:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49070 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234978AbjJ0G5Z (ORCPT ); Fri, 27 Oct 2023 02:57:25 -0400 Received: from mail-ej1-x62c.google.com (mail-ej1-x62c.google.com [IPv6:2a00:1450:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7612B1B5 for ; Thu, 26 Oct 2023 23:57:22 -0700 (PDT) Received: by mail-ej1-x62c.google.com with SMTP id a640c23a62f3a-9a6190af24aso271933466b.0 for ; Thu, 26 Oct 2023 23:57:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fairphone.com; s=fair; t=1698389841; x=1698994641; darn=vger.kernel.org; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:from:to:cc:subject:date:message-id:reply-to; bh=kj3Zu6WMlpxQr17sM16EXcoz5cOx2Zq8aggknXeJGWY=; b=JN948EZBExUcOWDWNBCyXB7eXJTLvHeQgvMLPe7NICB1+aIqkhHu6x1TNOtsCaOnLB Mk1VsZcik65aIEirET+Dbu2FICYmMvkPeZqiEkZgRaxEGeBsRqPSrCe207P31kxxqPDr 7tA2Zc+dMs1FEQ6LuvYR5p02u6yUeWxFRLEGNnpMC51HEU3VcWuqnZGibuHpUpUlf4L9 dSfWQa2ccNjJHwSud8X4e/qTjYhdy6W1spdy1aCj/bzoeR7cr2AIez7kg3BsXz7xQy8j 9Z+ixaXR4OtTAwn9GFgFacH/terwG40qJs7DUWIM5HDHLSVkV1faUiZ8sUw18cWoQ66c PRGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698389841; x=1698994641; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=kj3Zu6WMlpxQr17sM16EXcoz5cOx2Zq8aggknXeJGWY=; b=jxDjI0TCRH77u100QLdz/OYM9qN44rGEssniXL2b+AjlAmgyhgr+i4HL06OJtDdgik UWC88Zxi8aTdsdhDcdGJtAvc1GpXymKoialY/J+SbCJyR+gEWsqmXEbpsRMlXuSlMDxH qZiz7nzRVe3D2MFe4VpxzDrQeBFWSnm4oGYxJCc6e6I6F6a+RK6LeUgGyURD9KqL5Y1s BGER9O12v5FX8LPfQu0atIDFB0gEVH91QhrKmVTr24K1/88R/kSDldzEhx8uc8IIOb4T JvqDMbE1r5kDYMnaFhlQ8kRVVWOCMB6GlPTT/ElPmaP4822KMxDopI0y0qaSyodKyft2 p1zA== X-Gm-Message-State: AOJu0Yx2By5FMMEoCe4kXQuIPPJvRwUVoHgraagIDgUufmxxUTCUkpjc PQm3+xw8ZFGUz7AJu2GIouUW1Q== X-Received: by 2002:a17:907:9718:b0:9be:6395:6b0f with SMTP id jg24-20020a170907971800b009be63956b0fmr1436632ejc.29.1698389840852; Thu, 26 Oct 2023 23:57:20 -0700 (PDT) Received: from otso.luca.vpn.lucaweiss.eu (144-178-202-138.static.ef-service.nl. [144.178.202.138]) by smtp.gmail.com with ESMTPSA id rp28-20020a170906d97c00b009b296ce13a3sm731381ejb.18.2023.10.26.23.57.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Oct 2023 23:57:20 -0700 (PDT) From: Luca Weiss Date: Fri, 27 Oct 2023 08:57:18 +0200 Subject: [PATCH] wifi: ath11k: Defer on rproc_get failure MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20231027-ath11k-rproc-defer-v1-1-f6b6a812cd18@fairphone.com> X-B4-Tracking: v=1; b=H4sIAE1fO2UC/x3MMQqAMAxA0atIZgNNBYteRRxKm2oQVFIRQXp3i +Mb/n8hswpnGJsXlG/JcuwV1DYQVr8vjBKrwRrbkbEO/bUSbainHgEjJ1aM1PfODckTdVDDUzn J80+nuZQPzjDaZmQAAAA= To: Kalle Valo , Jeff Johnson Cc: ~postmarketos/upstreaming@lists.sr.ht, phone-devel@vger.kernel.org, ath11k@lists.infradead.org, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Luca Weiss X-Mailer: b4 0.12.3 X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, 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 agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Thu, 26 Oct 2023 23:57:31 -0700 (PDT) If we already have gotten the rproc_handle (meaning the "qcom,rproc" property is defined in the devicetree), it's a valid state that the remoteproc module hasn't probed yet so we should defer probing instead of just failing to probe. This resolves a race condition when the ath11k driver probes and fails before the wpss remoteproc driver has probed, like the following: [ 6.232360] ath11k 17a10040.wifi: failed to get rproc [ 6.232366] ath11k 17a10040.wifi: failed to get rproc: -22 [ 6.232478] ath11k: probe of 17a10040.wifi failed with error -22 ... [ 6.252415] remoteproc remoteproc2: 8a00000.remoteproc is available [ 6.252776] remoteproc remoteproc2: powering up 8a00000.remoteproc [ 6.252781] remoteproc remoteproc2: Booting fw image qcom/qcm6490/fairphone5/wpss.mdt, size 7188 So, defer the probe if we hit that so we can retry later once the wpss remoteproc is available. Signed-off-by: Luca Weiss --- drivers/net/wireless/ath/ath11k/ahb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ath/ath11k/ahb.c b/drivers/net/wireless/ath/ath11k/ahb.c index 235336ef2a7a..f8f5e653cd03 100644 --- a/drivers/net/wireless/ath/ath11k/ahb.c +++ b/drivers/net/wireless/ath/ath11k/ahb.c @@ -803,8 +803,8 @@ static int ath11k_core_get_rproc(struct ath11k_base *ab) prproc = rproc_get_by_phandle(rproc_phandle); if (!prproc) { - ath11k_err(ab, "failed to get rproc\n"); - return -EINVAL; + ath11k_dbg(ab, ATH11K_DBG_AHB, "failed to get rproc, deferring\n"); + return -EPROBE_DEFER; } ab_ahb->tgt_rproc = prproc; --- base-commit: 2ef7141596eed0b4b45ef18b3626f428a6b0a822 change-id: 20231027-ath11k-rproc-defer-d166779fa113 Best regards, -- Luca Weiss