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 C44F5C6FD19 for ; Thu, 16 Mar 2023 06:17:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229638AbjCPGRL (ORCPT ); Thu, 16 Mar 2023 02:17:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56046 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229573AbjCPGRK (ORCPT ); Thu, 16 Mar 2023 02:17:10 -0400 Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com [IPv6:2a00:1450:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 005B862300 for ; Wed, 15 Mar 2023 23:17:08 -0700 (PDT) Received: by mail-ed1-x52c.google.com with SMTP id w9so3387630edc.3 for ; Wed, 15 Mar 2023 23:17:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1678947427; h=mime-version:subject:user-agent:references:in-reply-to:message-id :date:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=jJrgBFvW3DIOQ35W9TFR+Snp/hRFAqtkZHeTFQ8YFxU=; b=QznOHhMN4Ol7uF2E3BKr0JWWgNA3DzSx095urOcecFCA+SWvXqBBmZqLh/MODwrjKG IuiOZflUehdnzUKZkunvVZ3ZBpdwsHHWfHWsDnuf2I1NZPdLzsKtu5WtFI3HYQcNso2C V81TholzFA72DhJ5v3P37MGy64oXSXA5b16Bg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678947427; h=mime-version:subject:user-agent:references:in-reply-to:message-id :date:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=jJrgBFvW3DIOQ35W9TFR+Snp/hRFAqtkZHeTFQ8YFxU=; b=yobhq2rqCQ6rcajGMl1nmPO3dodIWw0d7NlFnvh1/G4D7ZZ90VO5xAvcM5KE2oi6jr jEz83ZzJouaMZBSMzpG02i6ja+rGkUgQqMD+IzgBNbAlul/voIWADkD+bmL57mmrECtt r/yANP8Pos6KoUQ7qyoO+boLGc8CGUbj8g8MucumW1g8+wxxaZP+EvpnJhAcHrwXdCUE D7aQ+vS3BzIiBO50DF2IGKHQl4ucnYTLIH1PtFSkiV7nWBaH4PKCTYtnzhGQ7USwuH80 s0ksvu0rC7IbmWz89B3RDDvCzEV8wNc7JRx0ihmjxZ0YiK8nYIMY5cdj3Ce4pF+ctbUd +bUw== X-Gm-Message-State: AO0yUKXhAuQjOD3hmcRu9+CpCaB27GLclz9KbbNwY0SGk3j6UZqErqHk CmRwl2vC0MtnQo/0Al0oSlwR9w== X-Google-Smtp-Source: AK7set+Fr6ugMiX54V/PNraP95blFBOdaBquz+2a/6sXC9ww/JO/dzgB+VytbOJ+IBBJUyusdNibfg== X-Received: by 2002:a17:906:194b:b0:8ae:e82a:3230 with SMTP id b11-20020a170906194b00b008aee82a3230mr9608200eje.70.1678947427337; Wed, 15 Mar 2023 23:17:07 -0700 (PDT) Received: from [192.168.178.38] (f215227.upc-f.chello.nl. [80.56.215.227]) by smtp.gmail.com with ESMTPSA id ju9-20020a17090798a900b0093099aae903sm215299ejc.115.2023.03.15.23.17.06 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 Mar 2023 23:17:06 -0700 (PDT) From: Arend Van Spriel To: Michael Stapelberg CC: Johannes Berg , Kalle Valo , Franky Lin , "Pieter-Paul Giesberts" , Hante Meuleman , Date: Thu, 16 Mar 2023 07:17:05 +0100 Message-ID: <186e9109ae8.279b.9b12b7fc0a3841636cfb5e919b41b954@broadcom.com> In-Reply-To: References: <186e23b5668.279b.9b12b7fc0a3841636cfb5e919b41b954@broadcom.com> <186e26dc0a8.279b.9b12b7fc0a3841636cfb5e919b41b954@broadcom.com> <186e4673718.279b.9b12b7fc0a3841636cfb5e919b41b954@broadcom.com> <89262772-7358-77e8-8913-c459819d544a@broadcom.com> User-Agent: AquaMail/1.43.0 (build: 104300275) Subject: Re: wifi breakage due to commit "wifi: brcmfmac: add support for vendor-specific firmware api" MIME-Version: 1.0 Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha-256; boundary="00000000000006ad0805f6fe69d8" Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org --00000000000006ad0805f6fe69d8 Content-Type: text/plain; format=flowed; charset="UTF-8" Content-Transfer-Encoding: 8bit On March 15, 2023 8:53:50 PM Michael Stapelberg wrote: > Hey Arend > > Thanks for looking into it. > > Your suspicion was spot on: we don’t have /sbin/modprobe (we don’t > even have /sbin!) > > I addressed this issue by loading the brcmfmac-wcc module where we > also load the others: > https://github.com/gokrazy/wifi/commit/f611656338b68faa5f42bc2c8bbf1e0231a74a50 > > I’m not entirely sure why I concluded in my earlier testing that > loading the module doesn’t help. > Perhaps the issue was that I was manually loading the module after the > wifi program > tried to use the interface already and had it fail its firmware load — > in either case, > loading brcmfmac-wcc from the wifi program seems to work fine. I was going to say it seems racy, but I am not sure why that works at all. In brcmf_fwvid_request_module it says: ret = request_module("brcmfmac-%s", fwvid_list[fwvid].name); if (ret) goto fail; and the missing modprobe would always cause request_module() to fail (see [1]) hence the device probe would fail. What am I missing here? Regards, Arend [1] https://elixir.bootlin.com/linux/latest/source/kernel/kmod.c#L138 > > I also realize that the error message gives a number of pointers once > you know how to interpret it: > > + brcmfmac: brcmf_fwvid_request_module: mod=wcc: failed -2 > > I now understand this was trying to tell me that > request_module("brcmfmac-wcc") failed > with error code -2 (ENOENT), which means that the kernel’s > request_module() function > could not find CONFIG_MODPROBE_PATH. > > For comparison, when the user space tool exists but fails, including > when it can’t find > the requested module (ENOENT), it always returns exit code 1: > https://salsa.debian.org/md/kmod/-/blob/7d761268ebb68245daf47167e418823c68c3eb98/tools/modprobe.c#L1025 > > I think it would be nice if the Linux kernel could print a more > descriptive error message in this case. > I’m not sure what the kernel conventions are: should the caller of > request_module() produce a good error message? > Ideally, the message would translate -2 into ENOENT, and mention the > name “brcmfmac-wcc”. > > Or maybe we could have a kconfig option to indicate there is no > CONFIG_MODPROBE_PATH, > and instead make any request_module() call fail loudly with a > descriptive error in dmesg? > > Thanks for considering > Best regards > Michael > > On Wed, 15 Mar 2023 at 11:11, Arend van Spriel > wrote: >> >> On 3/15/2023 10:57 AM, Johannes Berg wrote: >>> On Wed, 2023-03-15 at 10:12 +0100, Arend van Spriel wrote: >>>> >>>> I think it works pretty similar to firmware loading. These days firmware >>>> loading does not rely on a user-space helper and I assumed the same is >>>> true for module loading. Will look into it. >>> >>> As far as I know you still need the modprobe helper in >>> >>> /proc/sys/kernel/modprobe >> >> Hi Michael, >> >> With hint from Johannes I found this Kconfig option: >> >> config MODPROBE_PATH >> string "Path to modprobe binary" >> default "/sbin/modprobe" >> help >> When kernel code requests a module, it does so by calling >> the "modprobe" userspace utility. This option allows you to >> set the path where that binary is found. This can be changed >> at runtime via the sysctl file >> /proc/sys/kernel/modprobe. Setting this to the empty string >> removes the kernel's ability to request modules (but >> userspace can still load modules explicitly). >> >> Now checking the .config that you sent it says: >> >> CONFIG_MODPROBE_PATH="/sbin/modprobe" >> >> So my suspicion is that modprobe is not at that given location? >> >> Regards, >> Arend --00000000000006ad0805f6fe69d8 Content-Type: application/pkcs7-signature; name="smime.p7s" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="smime.p7s" Content-Description: S/MIME Cryptographic Signature MIIQdwYJKoZIhvcNAQcCoIIQaDCCEGQCAQExDzANBglghkgBZQMEAgEFADALBgkqhkiG9w0BBwGg gg3OMIIFDTCCA/WgAwIBAgIQeEqpED+lv77edQixNJMdADANBgkqhkiG9w0BAQsFADBMMSAwHgYD VQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMzETMBEG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