Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2379752pxb; Mon, 20 Sep 2021 20:47:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzTclpvVYyzTDYhMy8Ty2VbE1Q6y4/nXi73dWaSY1EjSS+86e1Qxpn1qemaw1K+ChQ0Ydkh X-Received: by 2002:a17:906:4c51:: with SMTP id d17mr15024106ejw.297.1632196042342; Mon, 20 Sep 2021 20:47:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632196042; cv=none; d=google.com; s=arc-20160816; b=Icr3luh+7NeQU0U4rM1Bi7qGTV2XlK6ANmIHEXAayKsa4na+4RlSq9SlLYCPpcecQ/ rqtL+Lgg5mRXjQ3p6/CzsEODjeq6eAqRXcO6j5SfDosiqundyf7iiGzxr4afYqPwNbjL Jjx141V3vivMNZW6lVVQIdiS38nFgdlv+U6Eg8Zu+AItwpOJPnI2k9qD85rukjNySiSw 7pKk+n49tK9PbiBnHAdsVrQFPF4O58+Ho5HWoeefMXnbfQrovDVzbcr61MecSjBmOMlB SYTShUgi2kt/rT9PDIz+EouOgFwCJ61O5da8fZYGXO6YHnWea6wAWey8ihE5hpCqkSDk vc7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=yclSDDK5oTzUs7EESk7d4cCngmAGln2DbKeUzN8pN1Q=; b=qVuyfQ3ZXrF3gusi4Jr8r07g0BcKilya6Qf2ihGMHSLU9NbW29rj/vnWap4ThAxnAg jnKwhHJ8OtpMC/hKHczAHmjEyVKJTMCQEYUPDiAvYU04SnudQVMzaKdie2p4fdjYouVQ gxZk31EVgu0C9JshcXSVIcfS8G/g39BRV/NG9WAh0sl86EXtYWq3yjAX4ZGVcGCrdFr2 kzaRx1yXlMhN+wswjKYsE/lvjSerOiPeId10QmcBoe5eXgr3zlidL6kkHhs9vwfp6dKY OB87oXPPOCTeg6HiXXHuUJUDKsdvdxBDvxlJz2P3UEuQASYqMJzLmGhpr0SRLTbziWJr MeXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=gEndKsxf; 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=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p4si20770437eju.288.2021.09.20.20.47.01; Mon, 20 Sep 2021 20:47:22 -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=@chromium.org header.s=google header.b=gEndKsxf; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239805AbhITXwy (ORCPT + 78 others); Mon, 20 Sep 2021 19:52:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35126 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239866AbhITXuw (ORCPT ); Mon, 20 Sep 2021 19:50:52 -0400 Received: from mail-ot1-x32a.google.com (mail-ot1-x32a.google.com [IPv6:2607:f8b0:4864:20::32a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A4753C0613D3 for ; Mon, 20 Sep 2021 10:48:35 -0700 (PDT) Received: by mail-ot1-x32a.google.com with SMTP id x10-20020a056830408a00b004f26cead745so24684861ott.10 for ; Mon, 20 Sep 2021 10:48:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=yclSDDK5oTzUs7EESk7d4cCngmAGln2DbKeUzN8pN1Q=; b=gEndKsxfPGxmHP9Pq2PECNpZexrMPtR0GJlrsGS+ytAceIceT6vYuxhmuBvOOexih1 CGUPVJfv92scFcNlZ+sfuvW/DIVufbmQyWUutx2eeQoBFyZPqwjtLn14k8Tp36T+FtQ+ OZ73BmQmbnaPMSfXRXtlMdLGf+ar1Un3OUdL0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=yclSDDK5oTzUs7EESk7d4cCngmAGln2DbKeUzN8pN1Q=; b=Yj/tO72E6mZvZP5Ge1izP0Xmj3SFD/IgBWb72Dnw1YNFBcA+JlbThf/Z4Lg2LYukA4 iagG8OZIljYXTul+cWOh5lajIdEEWFKuT7yw83ZglH2Qb4gxmTewtILewXou4RmVZbyX 4P1yWTcen9SQCrf/vHkHkepaoTpBnqTr7s/mZsx4x5mqZn71uCMLEaF+MaO35xCDTUt6 0FR2146+l0f56XYhIhjuwljY1P35s8tY+wcbX3Oix6/nbsCh3kr9ZB3sm5mO7w72Pcf6 2lzgGaiGDBc1WWVscwy0vU8X507lhGwrK9BxrUr5Q2fUQxCHgvbZPHMT03FMcBXvt/7y gvhw== X-Gm-Message-State: AOAM5308WxMMViZNrz6kOQUehE9WCuUl1b//WJt/UcsJxEsQn0Xqk9bx Z/f3AnG5NqdAOBsxhtMPHYJoGDHfHTqPSw== X-Received: by 2002:a9d:60de:: with SMTP id b30mr8790259otk.343.1632160114373; Mon, 20 Sep 2021 10:48:34 -0700 (PDT) Received: from mail-ot1-f54.google.com (mail-ot1-f54.google.com. [209.85.210.54]) by smtp.gmail.com with ESMTPSA id a1sm3626987otr.33.2021.09.20.10.48.32 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 20 Sep 2021 10:48:33 -0700 (PDT) Received: by mail-ot1-f54.google.com with SMTP id c8-20020a9d6c88000000b00517cd06302dso24641020otr.13 for ; Mon, 20 Sep 2021 10:48:32 -0700 (PDT) X-Received: by 2002:a9d:7483:: with SMTP id t3mr21162684otk.3.1632160112361; Mon, 20 Sep 2021 10:48:32 -0700 (PDT) MIME-Version: 1.0 References: <20210830123704.221494-1-verdre@v0yd.nl> <20210830123704.221494-2-verdre@v0yd.nl> <0ce93e7c-b041-d322-90cd-40ff5e0e8ef0@v0yd.nl> In-Reply-To: <0ce93e7c-b041-d322-90cd-40ff5e0e8ef0@v0yd.nl> From: Brian Norris Date: Mon, 20 Sep 2021 10:48:21 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 1/2] mwifiex: Use non-posted PCI register writes To: =?UTF-8?Q?Jonas_Dre=C3=9Fler?= Cc: Andy Shevchenko , Amitkumar Karwar , Ganapathi Bhat , Xinming Hu , Kalle Valo , "David S. Miller" , Jakub Kicinski , Tsuchiya Yuto , linux-wireless , "" , Linux Kernel , linux-pci , Maximilian Luz , Andy Shevchenko , Bjorn Helgaas , =?UTF-8?Q?Pali_Roh=C3=A1r?= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Sat, Sep 18, 2021 at 12:37 AM Jonas Dre=C3=9Fler wrote: > Thanks for the pointer to that commit Brian, it turns out this is > actually the change that causes the "Firmware wakeup failed" issues that > I'm trying to fix with the second patch here. Huh. That's interesting, although I guess it makes some sense given your theory of "dropped writes". FWIW, this strategy (post a single write, then wait for wakeup) is the same used by some other chips/drivers too (e.g., ath10k/pci), although in those cases card wakeup is much much faster. But if the bus was dropping writes somehow, those strategies would fail too. > Also my approach is a lot messier than just reverting > 062e008a6e83e7c4da7df0a9c6aefdbc849e2bb3 and also appears to be blocking > even longer... For the record, in case you're talking about my data ("blocking even longer"): I was only testing patch 1. Patch 2 isn't really relevant to my particular systems (Rockchip RK3399 + Marvell 8997/PCIe), because (a) I'm pretty sure my system isn't "dropping" any reads or writes (b) all my delay is in the read-back; the Rockchip PCIe bus is waiting indefinitely for the card to wake up, instead of timing out and reporting all-1's like many x86 systems appear to do (I've tested this). So, the 6ms delay is entirely sitting in the ioread32(), not a delay loop. I haven't yet tried your version 2 (which avoids the blocking read to wake up; good!), but it sounds like in theory it could solve your problem while avoiding 6ms delays for me. I intend to test your v2 this week. > Does anyone have an idea what could be the reason for the posted write > not going through, or could that also be a potential firmware bug in the > chip? I have no clue about that. That does sound downright horrible, but so are many things when dealing with this family of hardware/firmware. I'm not sure how to prove out whether this is a host bus problem, or an endpoint/firmware problem, other than perhaps trying the same module/firmware on another system, if that's possible. Anyway, to reiterate: I'm not fundamentally opposed to v2 (pending a test run here), even if it is a bit ugly and perhaps not 100% understood. Brian