Received: by 2002:a05:6a10:c7c6:0:0:0:0 with SMTP id h6csp3130840pxy; Wed, 4 Aug 2021 03:09:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyENxvyP18hG2b3O4/ZDhZebdsEjl3XRD+ztjGK5gw1G2xKt791dPB2mKZN/RHadJf7RTdB X-Received: by 2002:a17:906:abc2:: with SMTP id kq2mr22327593ejb.342.1628071791073; Wed, 04 Aug 2021 03:09:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628071791; cv=none; d=google.com; s=arc-20160816; b=Vfa9zOjBO+yzEZI9UM3ZY3xn+466HQoIDMUw+rpJULjFMGZ2hazRn9BiPFE85wZuwo IMYV+XI5rFMO7DkxIizvloLDeNQjgY3kQqjQmskQI1UXC+wrj7TcOqMwOC+kEp/++eO5 rjxyXdxCk2c6Jvbyvpoy4ZuMeD4YHklFms+ELhTDP7y8kUykRsFY70IHH1nLVvkGzabS 828Vc015CXuJClhpY3eMqDkyY2acpZt/WdDlfxwEQPEMMvGzr0GdclMBUfQEboxCmMV0 nPyyE33SVrwuLltmxodftGGIfCtAyMk//iaoCkJXkyIa2q7cdazKD6uS7WP7GPrd1hvO nalA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=00MkoO9yRS4eem+IKwQx2itkmAvUEX+DZFvq8lwGwxg=; b=LZAqi5UnY+f/zPlnjm8Rcpu5tB4LPSz4LxX8RvMO3kG6cZnccgs3lU1IAf8F6y6Pv0 bPTMxwhu+hWlffs4dRVK//Aak1QpWYs9hPKFibi5jrDB5FzhVM7xW5nuftd3iQWj0Jwx qJxWMQzaxOGSjUIY7B+subGwvuDkT+t7Thdt8ei+22qBQDhroy+zSGCwoUiOycE3+4uS a8x8isVpZ6aMzLld7lckjKKtEWoLaoeHPOKsqxHJigV0Rmzt+A592P1a7KKWn1ywGGPl ZBP3c5RyPBNNkIT03+wAwVvy9ryJSuN7279snGcN7ZN7NOKDeJHR72jMz+BxaoFDiAQ1 kHaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JJ6iqfFn; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l8si1773090ejc.721.2021.08.04.03.09.22; Wed, 04 Aug 2021 03:09:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JJ6iqfFn; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236804AbhHDJfx (ORCPT + 99 others); Wed, 4 Aug 2021 05:35:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43762 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236707AbhHDJfx (ORCPT ); Wed, 4 Aug 2021 05:35:53 -0400 Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com [IPv6:2a00:1450:4864:20::131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AD9DBC0613D5 for ; Wed, 4 Aug 2021 02:35:39 -0700 (PDT) Received: by mail-lf1-x131.google.com with SMTP id n17so697583lft.13 for ; Wed, 04 Aug 2021 02:35:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=00MkoO9yRS4eem+IKwQx2itkmAvUEX+DZFvq8lwGwxg=; b=JJ6iqfFnC8PRALywPvc9JXeiyJieXXpAcIQX/xIoSzw1El/pMNU5Kyw2C+j1vfyunL lcv/5b1C2guMIzq+Mz6CidieA7Y3IBqwlwwOZv/H801lGiAFdV0y0k3T5DnRlV3feFHJ EZTsez8JFumIL7efx0WWrtjX1DzWwD5+dW6gmtusJhOUShxqn9KuWmFVmcL8Pvs9AbK1 viFuw0z7NhcMQhxNqtWCbKDsu9tpdMLeQGVt454Zq2PGcxBBBnVSSj9Om6M+DhNq75m6 RWkYFf/MkMkVdfh6b3wz5xK7tvCystzDpJvgKVx/F86vniGBFjU9Clrp3rlH/GkTr8tg 93Kw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=00MkoO9yRS4eem+IKwQx2itkmAvUEX+DZFvq8lwGwxg=; b=AMacQKiZljua5uE1rEeL92IHNYd4RSSjBQpgXxh95Er4GEb+yUoApfkmdGIOhRRTLu BVU9ftOgdE46zvy5VhuQ/5eu9CMb0DoT+b8ZEm7pjR92zurEuLAwXt/GEtZhU2V1sIce nsZ94DZ9hvnkq02+hrxdXmAVhVZwUVutgSGQsuv6Dvt1Mio7vomGdMg9DSTjtpEnutTH 4m8t665bZm15taQ4MirlrBwdd56G8k1h5zjEuavxqJ6GW0QL9cne19gNlGYyxxsO0PHH cZhGMbeho6nOynlZSOvpPDPPjS6HQWRk/QW45gyaEQx+SzYviJMnXQtA6RJOWIlRgpOz J/lQ== X-Gm-Message-State: AOAM532vQQJSHLk/hZJiwdCR7S+TzuGme07fILvWxM8PDBpcAfp6sAti 9omVipJIYWmc4LY4aTpruOIj3w7fUvIHl0p4a1xQCA== X-Received: by 2002:a19:c7cd:: with SMTP id x196mr18874178lff.465.1628069737994; Wed, 04 Aug 2021 02:35:37 -0700 (PDT) MIME-Version: 1.0 References: <20210711231659.255479-1-linus.walleij@linaro.org> <02415358-6635-a974-7682-a721912ca4fc@gmail.com> In-Reply-To: From: Linus Walleij Date: Wed, 4 Aug 2021 11:35:26 +0200 Message-ID: Subject: Re: [PATCH] brcmfmac: firmware: Allow per-board firmware binaries To: Arend van Spriel Cc: Dmitry Osipenko , Arend van Spriel , Franky Lin , Hante Meuleman , Chi-hsien Lin , Wright Feng , Chung-hsien Hsu , linux-wireless , Kalle Valo , phone-devel@vger.kernel.org, newbyte@disroot.org, Stephan Gerhold Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Wed, Aug 4, 2021 at 10:48 AM Arend van Spriel wrote: > Right. I didn't get to looking at this earlier, but indeed the check > whether the requested firmware exists is done in another thread context > so the return value here only indicates whether the firmware request > could be scheduled or not. I think my recent patch fixes is, please have a look. > My first reaction to the patch was to reject it, but leaning towards > supporting this now. OEMs tend to get tailor-made firmware in terms of > features. Depending on their requirements they get their mix of firmware > features. That such difference lead to a crash in 3d engine is somewhat > surprising. I am curious if we can debug this more and learn how a > firmware variant could cause such a crash. Maybe some DMA issue? I am not certain what happens, but I think the 3D engine misses its interrupts. This may in turn be because GPIO IRQs are held low or fireing repeatedly for an extensive period of time, stressing the system to the point that other important IRQs are missed. This in turn can be caused by the wrong (non-custom) firmware managing these GPIO IRQs fireing left and right. I have noticed that the config files for brcmfmac contain words about GPIOs and so on and that is what makes me think this way. I can tell for sure that brcmfmac has definately had special firmware tailored by/for Samsung for these phones. We can just look at the files extracted from the platforms (the original files are named bcmdhd_sta.bin_b2 or similar): BRCMFMAC 4330 -rw-r--r--. 1 linus linus 213390 Mar 22 23:32 brcmfmac4330-sdio.samsung,janice.bin -rw-r--r--. 1 linus linus 203593 Jul 11 01:53 brcmfmac4330-sdio.samsung,codina.bin -rw-r--r--. 1 linus linus 212956 Mar 22 23:31 brcmfmac4330-sdio.samsung,gavini.bin BRCMFMAC 4334 -rw-r--r--. 1 linus linus 346151 Mar 16 22:53 brcmfmac4334-sdio.samsung,golden.bin -rw-r--r--. 1 linus linus 434236 Jul 7 00:43 brcmfmac4334-sdio.samsung,kyle.bin -rw-r--r--. 1 linus linus 434236 Mar 16 22:54 brcmfmac4334-sdio.samsung,skomer.bin All different file sizes, except Kyle and Skomer, who actually share the same firmware. (Those were the two last phones produced in this series BTW.) Doing strings * on each file reveals that they were compiled at different dates around the time these phones were produced. These are all for standard WiFi functionality. There is two more firmwares for each phone, one for the access point usecase and one more which I don't know what it is for, the actual set of firmware for each phone is for example (Skomer): bcmdhd_apsta.bin_b2 bcmdhd_mfg.bin_b2 bcmdhd_p2p.bin_b2 bcmdhd_sta.bin_b2 So I am half-guessing that bcmdhd_sta.bin_b2 is obviously for the ordinary use case, *mfg* is probably for manufacturing, *apsta* for mobile hotspot (access point) and *p2p* for some other cool thing where phones do peer-to-peer. If you could shed some light on the above it'd be great :) Yours, Linus Walleij