Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp698489ybc; Tue, 12 Nov 2019 07:54:45 -0800 (PST) X-Google-Smtp-Source: APXvYqx7ZOoF0VFjlcQaM6QHDSJcDH9pVU2vD36+KzRx2PJJuw3LLnXEeHECKeo1OHZyg2XsE9Zl X-Received: by 2002:a05:6402:706:: with SMTP id w6mr34523887edx.38.1573574085416; Tue, 12 Nov 2019 07:54:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573574085; cv=none; d=google.com; s=arc-20160816; b=pVxYTRMiKinTEbx4LPevq2e1VJJKggMg4oeCflFPQDFIq+3r9J2f//SORdQOGpMQE0 CSg+pF6aBNrroP4W0KGtS+UlJADQpZ2rSxezzFzTrSux0h9Cg4uMphAhdWqzEpPtsoeg lBK8hBB+w6rrj+33t/3b8UiWQrPim8Mtgue/VhQmwsOi4NwCqRjgmabzEksBipPLxI8G iO/19THrAbQmx2vWQf4wJaNmTfdKA0IePeXVs21J1sNLfrsAu2/3bD15mmSQN+i1nm0Q QNqx6BxqcDuSiUywMt7tvwWq0TzVvyep/aoaiLNNhlM0J94u9gaLdfYMZGcQXH2pOZ+g 1DIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=+1IEojNQRKaJ8R6eORbksbI7U86NwchAf1hHUgJqjpo=; b=creI8cQU4MDvM9XKEFuAlnJLY1jskLjBCCD4mUKGOkFUBfhjVhgjb8BnbOqOa398FI aL88XkSpLJdzv8+WzPrr47PKt1uAtygcucQVHciby+nHaMw29kAlhil1nZHykLuO51OF 5fbDBIEJG1xxz6UQ9tnvyhYoWqDo9xai2YF/WdsscxLvEhKsrD9iAXUjjhNxjiU25OSj VBZriYF1oPYbnojlh7atr2kppouDwE2Kajl6SbxuqCE/l3d40tW6xqNj0s3ONX8nN+44 at0WIKTWFt5563ioT+N3Wg96kpEOYfO9EDIDCVct3F+G50SRjQy1C+L1PjC/gO6cM+KE J2qw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=vYzeDsKt; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id rn10si218203ejb.325.2019.11.12.07.54.20; Tue, 12 Nov 2019 07:54:45 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=vYzeDsKt; spf=pass (google.com: best guess record for domain of linux-wireless-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726986AbfKLPyD (ORCPT + 99 others); Tue, 12 Nov 2019 10:54:03 -0500 Received: from mail-io1-f65.google.com ([209.85.166.65]:46880 "EHLO mail-io1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726659AbfKLPyD (ORCPT ); Tue, 12 Nov 2019 10:54:03 -0500 Received: by mail-io1-f65.google.com with SMTP id i11so2414931iol.13; Tue, 12 Nov 2019 07:54:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=+1IEojNQRKaJ8R6eORbksbI7U86NwchAf1hHUgJqjpo=; b=vYzeDsKt+LCERvwGBGKTwYAcLMKlX8aTKqabbg0JK21GrAPQcAhDLvykQYDpYPAfJD YSLYQ/FE+wZZfSIQTQ/Yfl7Kw7kSvXi9QyWB6LnGZyemMZ6LiHXsf8SBT7XwYboj2/fu Kc+wpOunu+fXCe3b7ri344w3kI5J9edQYl1tiVytFiYlbAwhRtaT0WXT5jCSWw716too Q02zA9iTCBInKENJ51YRMfMNNCjJ5PauBVoxh0PBk6wdYk9bDhvS9ZKW0ilYrVAtX7W1 Yn6Rx7f6IU9i++q919E5gjvTNU0yqQ0AZ4FGOiMGZB4HJ2Iq9ooJBWBWz0aO7yYrfqu8 BgbA== 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=+1IEojNQRKaJ8R6eORbksbI7U86NwchAf1hHUgJqjpo=; b=QTH5g4tuxBVRrZyQR9e/hMRksN/4FDMzP0nsD+QejUdrhd1IZzNYTpiuTd83qDUcMB 2UT7cLVIumxDlyMeqdxvNGioSMfa9TOzpQmL0EDh/kQ2ih1izIguMEn5pd13P+5qBLzu FyAVkXkMpDfVb/nwpRLAlReWPVR+MmB3y7srJQsU/EuYJLe8FBFIWxNJ4amCfCTUw07N Kd/9sVs+CY6IdOyS9YMTEQoCVGJihNsMZ6sGy1Cw9fwHAoCEDy8PbCJ9t/BmIt8cyxHu AabGWzFDdU5j3ZS1SCu0pWkeiSG7p3L2QZxyFl8oOTCWbaSJtm06Sz2PucvEoq70Gay/ ysXg== X-Gm-Message-State: APjAAAV+LjByOepCchutb13qyGV+oEtaN8y1UQ11Pr91dDaZ4ZwTwknO 9+5caMrzhypTUZdc7+XjVRV3iNm8Z4dU8LLgrAw= X-Received: by 2002:a5e:8a04:: with SMTP id d4mr31139489iok.42.1573574042003; Tue, 12 Nov 2019 07:54:02 -0800 (PST) MIME-Version: 1.0 References: <20191106234712.2380-1-jeffrey.l.hugo@gmail.com> <20191112090444.ak2xu67eawfgpdgb@netronome.com> In-Reply-To: <20191112090444.ak2xu67eawfgpdgb@netronome.com> From: Jeffrey Hugo Date: Tue, 12 Nov 2019 08:53:51 -0700 Message-ID: Subject: Re: [PATCH] ath10k: Handle "invalid" BDFs for msm8998 devices To: Simon Horman Cc: kvalo@codeaurora.org, davem@davemloft.net, ath10k@lists.infradead.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, MSM , lkml Content-Type: text/plain; charset="UTF-8" Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Tue, Nov 12, 2019 at 2:04 AM Simon Horman wrote: > > On Wed, Nov 06, 2019 at 03:47:12PM -0800, Jeffrey Hugo wrote: > > When the BDF download QMI message has the end field set to 1, it signals > > the end of the transfer, and triggers the firmware to do a CRC check. The > > BDFs for msm8998 devices fail this check, yet the firmware is happy to > > still use the BDF. It appears that this error is not caught by the > > downstream drive by concidence, therefore there are production devices > > in the field where this issue needs to be handled otherwise we cannot > > support wifi on them. So, attempt to detect this scenario as best we can > > and treat it as non-fatal. > > > > Signed-off-by: Jeffrey Hugo > > --- > > drivers/net/wireless/ath/ath10k/qmi.c | 11 +++++++---- > > 1 file changed, 7 insertions(+), 4 deletions(-) > > > > diff --git a/drivers/net/wireless/ath/ath10k/qmi.c b/drivers/net/wireless/ath/ath10k/qmi.c > > index eb618a2652db..5ff8cfc93778 100644 > > --- a/drivers/net/wireless/ath/ath10k/qmi.c > > +++ b/drivers/net/wireless/ath/ath10k/qmi.c > > @@ -265,10 +265,13 @@ static int ath10k_qmi_bdf_dnld_send_sync(struct ath10k_qmi *qmi) > > goto out; > > > > if (resp.resp.result != QMI_RESULT_SUCCESS_V01) { > > - ath10k_err(ar, "failed to download board data file: %d\n", > > - resp.resp.error); > > - ret = -EINVAL; > > - goto out; > > + if (!(req->end == 1 && > > + resp.resp.result == QMI_ERR_MALFORMED_MSG_V01)) { > > Would it make sense to combine the inner and outer condition, > something like this (completely untested) ? I guess, make sense from what perspective? Looks like the assembly ends up being the same, so it would be down to "readability" which is subjective - I personally don't see a major advantage to one way or the other. It does look like Kalle already picked up this patch, so I'm guessing that if folks feel your suggestion is superior, then it would need to be a follow on. > > if (resp.resp.result != QMI_RESULT_SUCCESS_V01 && > !(req->end == 1 && > resp.resp.result == QMI_ERR_MALFORMED_MSG_V01)) { > > > + ath10k_err(ar, "failed to download board data file: %d\n", > > + resp.resp.error); > > + ret = -EINVAL; > > + goto out; > > + } > > } > > > > remaining -= req->data_len; > > -- > > 2.17.1 > >