From patchwork Wed Feb 28 00:45:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 129882 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp433055lja; Tue, 27 Feb 2018 16:45:31 -0800 (PST) X-Google-Smtp-Source: AH8x226UI3oX2anUIXP9DvQE8/kcy0h2ad5LFN7SXAMZXDGvlxT9WJzkcIUrjy1Yd6obXXmr1mzc X-Received: by 10.101.93.135 with SMTP id f7mr12322465pgt.82.1519778731647; Tue, 27 Feb 2018 16:45:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519778731; cv=none; d=google.com; s=arc-20160816; b=1HM9RGNz2mOd/oujU66LXNbw7IFZdri2kBEjEVSATRS0C6s/55f4e/vmKSArXFstwH HKXtRxsWXD/x4q7l9B09IMSw5d74HJT0jUbhMQ/NKwKe1RCETHJ/u1hhF0OJXr50JgYL udfyfXloyfB4BUMdW9jR5cLBK4CkWjTvuTtXI6Lo43rtezTeK5aJjHyr/doZChkj9iG5 NwDlnUbWG3HfvNBqlMyQyxVDWvjIndrW82NlEUNwYkfBSY+W9qS6Ak3yJ6sSUuBeoldC hUpSjgJfYNnS9HOSjvC6nOJvc5uEsUmW5/IecuWzfIpSvXsLeqUiH9utp0OIBqrDL3my FMPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=Ru9SqayPLyPd5NEQq10Vm3cEibXDX5E+N41EZvh9r8g=; b=BVm4QB6AKm2pBXCHsZyCBcN7ilRVO5osdC7gs820WlZs/oHgiRWveW03OaQkvFsWjj osXzStd7o3GiNG0izu7Ktb3kgaOuiVOrTCpJ2orckmM61mSSewI69vFIbWWjN9wpRzXh +QF7KrjzlaWaiXp0fh2VLTi4OyihUIw48fVHyDIJU7bqRJdXihFh9xO60b7O7Nk19Jdf TmNF09mOcsOoHrKt50XA8TFbYGyU7YByI8WTjWc+vnCoHQG8qjdPjEQs7dFbMCjZUgqC Qtf9iO9Q6ZesbEjBRQDBEFtVilvtkhQiULrC0/8M1wXeMcrUuikpMYxgCK5vrDN3HZRp iYpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=cccftO+j; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w7si240426pgs.639.2018.02.27.16.45.31; Tue, 27 Feb 2018 16:45:31 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=cccftO+j; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751740AbeB1Apa (ORCPT + 10 others); Tue, 27 Feb 2018 19:45:30 -0500 Received: from mail-pf0-f194.google.com ([209.85.192.194]:40745 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751628AbeB1Ap2 (ORCPT ); Tue, 27 Feb 2018 19:45:28 -0500 Received: by mail-pf0-f194.google.com with SMTP id m5so307028pff.7 for ; Tue, 27 Feb 2018 16:45:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=6B9bShUrVRMl7N0vj7flUc6qkiG917sojcX1loV/zc0=; b=cccftO+jIJ/yEhin9fpwsW4XjPkJdlPpRBsJ59GmyrzEBLBa9UNLzSp1jJ7nZJAS3Q hVrdNR3Ib4hfluadH0Ftn9NGFpfLwe5hSlkdj023xzxvQVOUQopyveqWFF4EBk3lZUZp 0koza+tYBukZSrVakr3wwBUsr6cvGyKRRYN6c= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=6B9bShUrVRMl7N0vj7flUc6qkiG917sojcX1loV/zc0=; b=r5xMfqKhxV1DL2cVXtJAzat8FP46Brmf2vU+bo2Pizl9tMdGuVY/Sfd8d8daM0fsWq igT2E8ZfdAkFzRRlyP/bdW9XKUWVfzuiHXYDn7JlewSdC0x+VIRoJLhYnj5JPHXZPT5k eavpNeixp29Pvchxi+x2pSw+9khveguhIiTBaNFOIcmGUoRsIyd8p8qGoMGy4roS8Uw4 GilTfMuHpR8LOAM6nL5R4ft1GwIg5iOR05Slh3kGpvEfQcAZ5hlaKy5e5xt/taEO/GzL xr0H1VpikolAhK+0/YLjQCLBpjiEMXV48ZyoOj7jM057XLbm6lEpbQqxaFKWSm4yAHUG /sag== X-Gm-Message-State: APf1xPCB3u5CE72JUr33BrbC+iaPyuJG5RmKJ2kilKMbt/BPmd9a5Oim 37pGX7Yv2xyISUd9t2nOVyz+RQ== X-Received: by 10.101.100.144 with SMTP id e16mr2046387pgv.315.1519778728317; Tue, 27 Feb 2018 16:45:28 -0800 (PST) Received: from localhost.localdomain (104-188-17-28.lightspeed.sndgca.sbcglobal.net. [104.188.17.28]) by smtp.gmail.com with ESMTPSA id k192sm447972pfc.98.2018.02.27.16.45.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Feb 2018 16:45:27 -0800 (PST) From: Bjorn Andersson To: Andy Gross , David Brown Cc: Will Newton , linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] soc: qcom: wcnss_ctrl: Fix increment in NV upload Date: Tue, 27 Feb 2018 16:45:25 -0800 Message-Id: <20180228004525.5156-1-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.16.2 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org hdr.len includes both the size of the header and the fragment, so using this when stepping through the firmware causes us to skip 16 bytes every chunk of 3072 bytes; causing only the first fragment to actually be valid data. Instead use fragment size steps through the firmware blob. Fixes: ea7a1f275cf0 ("soc: qcom: Introduce WCNSS_CTRL SMD client") Reported-by: Will Newton Signed-off-by: Bjorn Andersson --- It's worth noting that the firmware does not complain about the broken NV blob nor does fixing this seem to alter the behavior of BT or WLAN - perhaps because the WLAN driver uploads the NV blob as well? drivers/soc/qcom/wcnss_ctrl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.16.2 -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/soc/qcom/wcnss_ctrl.c b/drivers/soc/qcom/wcnss_ctrl.c index e968559b0fc4..5429c91440b1 100644 --- a/drivers/soc/qcom/wcnss_ctrl.c +++ b/drivers/soc/qcom/wcnss_ctrl.c @@ -249,7 +249,7 @@ static int wcnss_download_nv(struct wcnss_ctrl *wcnss, bool *expect_cbc) /* Increment for next fragment */ req->seq++; - data += req->hdr.len; + data += NV_FRAGMENT_SIZE; left -= NV_FRAGMENT_SIZE; } while (left > 0);