From patchwork Mon Mar 25 10:30:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Marangi X-Patchwork-Id: 1915503 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=hr6ahs3P; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=HGPZhd0v; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4V38P83PGrz1yYJ for ; Mon, 25 Mar 2024 21:31:40 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=wp8iasjix8wNi8bM7VSt7pYJqr+XvjY6gaAHPzS/mkA=; b=hr6ahs3Pd7cBOf azC1VFyXD4aM5aJA+6lSPxaiC3GDGluyllw/5hE5cCebt7wIu//3XK4931ht940RaMV9cpAcRl1jo HqFIoMUH6NQheTjNGz5pmXVTWTcykm06tHjJgZVbRor6Af9ddEQdWILUyX0Q1xIqGG8wbVAE5tF+E 1MeG+f0NdhzfbQMk7cN1pOmJy5g4KKZs3DU4spvgX8Xu97zHfb++e2vydmf4Fb+BmbEBy8WQpppuS Lr1dFj7O4dVrr2jUVfJPhjL62PwgnuR10m1hgvZOKYoIKWQIbno4RxwjDC3SPIz+TXzyOxc8lMAnC T7hekPFEaidjbBXTSM8w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rohc1-0000000GlMf-2DBI; Mon, 25 Mar 2024 10:31:29 +0000 Received: from mail-lj1-x22f.google.com ([2a00:1450:4864:20::22f]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rohbo-0000000GlH3-06Ur for linux-mtd@lists.infradead.org; Mon, 25 Mar 2024 10:31:27 +0000 Received: by mail-lj1-x22f.google.com with SMTP id 38308e7fff4ca-2d46dd5f222so51823671fa.1 for ; Mon, 25 Mar 2024 03:31:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711362672; x=1711967472; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ITuIJ48ycyvFs85EZCOH/esp3dFgohObI9gAbMbkThw=; b=HGPZhd0vpYgwYX6CNxD0BsewFj6qXwhIOD8x+Qi84SZ/TQadBDIBv1rjGSpkgDTFFK yUCsJ+R7hAW86qHrbO1qm3IU5Voj/sNrnM4oFNpg1aoU0knff4tVQiHMbYMg2WLt9Xx6 SeMZ6c21KMdrqH/6xW9EY/seLYijfSKJcrBxwZwrgzEVL//MmuH2Nq8FeuED1jqOCr8U BDFDIght6hND672GjFGMXk5ROfqExeF8wLkF/xDe7SX50IhEwNM7RIOlTzX/wy5J3Brk vvK7Nb55VuTb0mDyRIc661nVEXVkTk0Da/juCVzlwLvWLMAPov4NDUhKpXU3QbvfpxqO XG5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711362672; x=1711967472; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ITuIJ48ycyvFs85EZCOH/esp3dFgohObI9gAbMbkThw=; b=YzncpLESu5BEre5LBEW6WJrmi1jeY0i9npUBiPAMlLhC8nRoVBxGhjB66s7+Ymf1Wj dfP1Jp3nrzRHcEYqT7IRDP0W+GblRa9bRKWqYInLPn/gUZe3BAw0SO2uq0eErFMKHpPT wnoRHBAbx+9xqhFIXqxNcT98ddl9C7kb3jCuG/sUjbQnRSTXAkU4JiozbF+poriKiIW2 qsgfLwKCaF3kuLvybPUDUSgYfaqTEEzCD5YXY1SV2jzITEeR7VXSFBNnr/bMrRShpL8Y d8GQu/nh10Y/c4cPrEtpWPXwc9yGN8+y5evMAtw1ZFUjG7l0bQTzvd61YHQ4WfV14k+v gYLw== X-Forwarded-Encrypted: i=1; AJvYcCWYgL73hI9ZZxDFIJxFeXOXNEz5vWRlw5iWa7qdhvVvgbnuNTiATufv8plIykBw0DBZ0i7cijuP1UC8NII+vNbgNjW0bQaLB9TYpRsqJw== X-Gm-Message-State: AOJu0YwMK6SGg1GbdWJ/tEf/KR50guY/9LO0p+YdrdAIDydW/QYQi9s4 QA78YlH31bfluIXN6P7ULw6XJTmr6c8dmmgEVgILpDzxztWjG6S/ X-Google-Smtp-Source: AGHT+IHbEvUfaHQnzm6ZbUyi1TE0Z3wDxGxFHJpDIwcA/5e6DTkA5nfqau/NqIPKGSOLrgKUIQmStA== X-Received: by 2002:a2e:994e:0:b0:2d4:2958:6daf with SMTP id r14-20020a2e994e000000b002d429586dafmr4358600ljj.20.1711362671784; Mon, 25 Mar 2024 03:31:11 -0700 (PDT) Received: from localhost.localdomain (93-34-89-13.ip49.fastwebnet.it. [93.34.89.13]) by smtp.googlemail.com with ESMTPSA id be3-20020a05600c1e8300b004140e701884sm8063878wmb.22.2024.03.25.03.31.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 03:31:11 -0700 (PDT) From: Christian Marangi To: Manivannan Sadhasivam , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Md Sadre Alam , Sricharan Ramabadhran , linux-mtd@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Christian Marangi , stable@vger.kernel.org Subject: [PATCH v2 2/2] mtd: rawnand: qcom: Fix broken reset in misc_cmd_type in exec_op Date: Mon, 25 Mar 2024 11:30:48 +0100 Message-ID: <20240325103053.24408-2-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240325103053.24408-1-ansuelsmth@gmail.com> References: <20240325103053.24408-1-ansuelsmth@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240325_033116_105043_99D7193B X-CRM114-Status: GOOD ( 15.25 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: misc_cmd_type in exec_op have multiple problems. With commit a82990c8a409 ("mtd: rawnand: qcom: Add read/read_start ops in exec_op path") it was reworked and generalized but actually dropped the handl [...] Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:22f listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [ansuelsmth(at)gmail.com] X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-mtd" Errors-To: linux-mtd-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org misc_cmd_type in exec_op have multiple problems. With commit a82990c8a409 ("mtd: rawnand: qcom: Add read/read_start ops in exec_op path") it was reworked and generalized but actually dropped the handling of the RESET_DEVICE command. The rework itself was correct with supporting case where a single misc command is handled, but became problematic by the addition of exiting early if we didn't had an ERASE or an OP_PROGRAM_PAGE operation. Add additional logic to handle the reset command and return early only if we don't have handling for the requested command. Fixes: a82990c8a409 ("mtd: rawnand: qcom: Add read/read_start ops in exec_op path") Cc: stable@vger.kernel.org Signed-off-by: Christian Marangi --- Changes v2: - Add this patch drivers/mtd/nand/raw/qcom_nandc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mtd/nand/raw/qcom_nandc.c b/drivers/mtd/nand/raw/qcom_nandc.c index 19d76e345a49..b8cff9240b28 100644 --- a/drivers/mtd/nand/raw/qcom_nandc.c +++ b/drivers/mtd/nand/raw/qcom_nandc.c @@ -2815,7 +2815,7 @@ static int qcom_misc_cmd_type_exec(struct nand_chip *chip, const struct nand_sub host->cfg0_raw & ~(7 << CW_PER_PAGE)); nandc_set_reg(chip, NAND_DEV0_CFG1, host->cfg1_raw); instrs = 3; - } else { + } else if (q_op.cmd_reg != OP_RESET_DEVICE) { return 0; }