Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2655045pxa; Mon, 17 Aug 2020 15:38:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxPWfQFZV0TYYflhMs6ugachnZfsc2eO1HwHjVpX83Xevuzrpv0dP11NB6EiaN+54hE9hab X-Received: by 2002:a17:906:ca8c:: with SMTP id js12mr17783813ejb.195.1597703928518; Mon, 17 Aug 2020 15:38:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597703928; cv=none; d=google.com; s=arc-20160816; b=P/ByHfxdtsPyG3Ha2xYsqwX+YeOurF2irAMJnccukmxmoII6xWoj2gGD4Whwv/ud/x By6nuzMoZP2hQW8em8iRyAbZw4HNY0fMC3VP1iWbLm8+tpJyqiqFkJDLOVQ3fXS88vLJ IRpcPGCdZn2RU8Kn2i7FnctABY0sLw7TEqcJNChjmgjc/KOEeGzXeifU5QKChwArQgL0 fIV93SNwLav9KfY1Vt5bXf1eXqhe2I9PaqXIXjPDXNnDe/hMDZEoHucsx+cQxVbK10dM D8nBdYIcA19C0cvZwTGySbBXOK24yYPI54WSJWF/7JFHAjensNzeo1/3JHWyRsGW/P4N 1vPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=v5ILFI53f36uziLSWFhslaBLU0N5sCyGpXyd9Dx3r2Y=; b=OPp18rXpo1raA1waufDYAf6NPzOg9VFzuBgAtIAu3HF13ShTcRZ+4LerDYcznjIiSU Ll1QVKjUZknoFI5QPdj/Ymlk7Ab5aGHoKHzWcAunJ8EceW6T+YiuNcliI4Gl0RL3aw7b DEHnt2iu8ZNfV8pbPKUj+JutCZrQqNzeF7NjJ0PpdW0VWvHWli/SQ8MEqbl4AtGQtNbO QEm4D74IrAik9wAwtPE8vfMFTjR8CVdw9qrCFyVAsWjXbdkMGgtxWoiNXJnMU8JKiUQ5 AL+iy4/GK/hiResZwMw0n9pXWuYgYGIUp93ko3kEPAiR+89JR+ga+15GaP82ylzeFVX4 +jsw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=OZVcX2y+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id pk23si11685003ejb.488.2020.08.17.15.38.25; Mon, 17 Aug 2020 15:38:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=@kernel.org header.s=default header.b=OZVcX2y+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731143AbgHQRge (ORCPT + 99 others); Mon, 17 Aug 2020 13:36:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:32874 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730275AbgHQQRe (ORCPT ); Mon, 17 Aug 2020 12:17:34 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E11DE22B47; Mon, 17 Aug 2020 16:17:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597681053; bh=vm0JTt6+eVIK/yRCTVuNoCfBLIqluknSd5JwM5Juwak=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OZVcX2y+LnlewSrRAfpOHqH/+mzeJU/6Cfg4SHbr+2M78XFagLBekBg+GZmumoDH3 JWDzfjVrEfyJW7KXMBrfIu2zvxQe0LA6rvrAZ6DdDF1jv/oW62K9ep8AjZ4dsBKFSw eq3cUcjFpiEWDG20dsUORnaTClHO3ljfLQXdErbA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sivaprakash Murugesan , Miquel Raynal Subject: [PATCH 4.19 161/168] mtd: rawnand: qcom: avoid write to unavailable register Date: Mon, 17 Aug 2020 17:18:12 +0200 Message-Id: <20200817143741.711267229@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200817143733.692105228@linuxfoundation.org> References: <20200817143733.692105228@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sivaprakash Murugesan commit 443440cc4a901af462239d286cd10721aa1c7dfc upstream. SFLASHC_BURST_CFG is only available on older ipq NAND platforms, this register has been removed when the NAND controller got implemented in the qpic controller. Avoid writing this register on devices which are based on qpic NAND controller. Fixes: dce84760b09f ("mtd: nand: qcom: Support for IPQ8074 QPIC NAND controller") Cc: stable@vger.kernel.org Signed-off-by: Sivaprakash Murugesan Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/1591948696-16015-2-git-send-email-sivaprak@codeaurora.org Signed-off-by: Greg Kroah-Hartman --- drivers/mtd/nand/raw/qcom_nandc.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) --- a/drivers/mtd/nand/raw/qcom_nandc.c +++ b/drivers/mtd/nand/raw/qcom_nandc.c @@ -466,11 +466,13 @@ struct qcom_nand_host { * among different NAND controllers. * @ecc_modes - ecc mode for NAND * @is_bam - whether NAND controller is using BAM + * @is_qpic - whether NAND CTRL is part of qpic IP * @dev_cmd_reg_start - NAND_DEV_CMD_* registers starting offset */ struct qcom_nandc_props { u32 ecc_modes; bool is_bam; + bool is_qpic; u32 dev_cmd_reg_start; }; @@ -2766,7 +2768,8 @@ static int qcom_nandc_setup(struct qcom_ u32 nand_ctrl; /* kill onenand */ - nandc_write(nandc, SFLASHC_BURST_CFG, 0); + if (!nandc->props->is_qpic) + nandc_write(nandc, SFLASHC_BURST_CFG, 0); nandc_write(nandc, dev_cmd_reg_addr(nandc, NAND_DEV_CMD_VLD), NAND_DEV_CMD_VLD_VAL); @@ -3022,12 +3025,14 @@ static const struct qcom_nandc_props ipq static const struct qcom_nandc_props ipq4019_nandc_props = { .ecc_modes = (ECC_BCH_4BIT | ECC_BCH_8BIT), .is_bam = true, + .is_qpic = true, .dev_cmd_reg_start = 0x0, }; static const struct qcom_nandc_props ipq8074_nandc_props = { .ecc_modes = (ECC_BCH_4BIT | ECC_BCH_8BIT), .is_bam = true, + .is_qpic = true, .dev_cmd_reg_start = 0x7000, };