From nobody Thu Dec 18 19:26:13 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 502F1CDB46E for ; Thu, 12 Oct 2023 05:52:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377170AbjJLFwZ (ORCPT ); Thu, 12 Oct 2023 01:52:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32848 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232808AbjJLFwY (ORCPT ); Thu, 12 Oct 2023 01:52:24 -0400 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 841DC9D for ; Wed, 11 Oct 2023 22:52:22 -0700 (PDT) Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 39C3tN9U029359; Thu, 12 Oct 2023 05:51:57 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding; s=qcppdkim1; bh=iLOCYuFvToEXWyeuR0V8GCWiuhk3vAizBPUCQ5xahXM=; b=SqD58/68G3dpgIliEWraaA7vG1gs7AMdtOvEALKYiFT49hRR1D9bk28wp++xiD0yGT4O mP/MDZifrM+FG6/tuMu7tCYwe8y5pArZQrMtgcwKbAxX+gLwLXfrTh24i91UCdI7FUW3 s2RGJd88Mql1ikIkBcxoPaF/kokTHkwm35rC0hiiD8eUIsSn8pjxUhlsrMCtVWfZzh8a 7CkUXrQtN5iQKkXh0UxXrmA9LrIUW9jxfU53l8UqcRFJVufsC0G4JESIcO1G7m5ba20h m/9P76qUZYNSAhRdEKLk0LINzcLp6cNmKc2nEROV0O2py78mFAEhlQWjDU+JEhwECB0Y VA== Received: from apblrppmta01.qualcomm.com (blr-bdr-fw-01_GlobalNAT_AllZones-Outside.qualcomm.com [103.229.18.19]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3tnstytfaw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 12 Oct 2023 05:51:57 +0000 Received: from pps.filterd (APBLRPPMTA01.qualcomm.com [127.0.0.1]) by APBLRPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTP id 39C5md07023136; Thu, 12 Oct 2023 05:51:52 GMT Received: from pps.reinject (localhost [127.0.0.1]) by APBLRPPMTA01.qualcomm.com (PPS) with ESMTPS id 3tk0dksk0c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 12 Oct 2023 05:51:52 +0000 Received: from APBLRPPMTA01.qualcomm.com (APBLRPPMTA01.qualcomm.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 39C5pqnB025355; Thu, 12 Oct 2023 05:51:52 GMT Received: from hu-devc-blr-u22-a.qualcomm.com (hu-mdalam-blr.qualcomm.com [10.131.36.157]) by APBLRPPMTA01.qualcomm.com (PPS) with ESMTPS id 39C5pqEg025354 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 12 Oct 2023 05:51:52 +0000 Received: by hu-devc-blr-u22-a.qualcomm.com (Postfix, from userid 466583) id 409B0412D9; Thu, 12 Oct 2023 11:21:51 +0530 (+0530) From: Md Sadre Alam To: tudor.ambarus@linaro.org, pratyush@kernel.org, michael@walle.cc, miquel.raynal@bootlin.com, richard@nod.at, vigneshr@ti.com, linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org Cc: quic_srichara@quicinc.com, quic_varada@quicinc.com, Md Sadre Alam Subject: [PATCH] mtd: spi-nor: Ensure operation completion before shutdown Date: Thu, 12 Oct 2023 11:21:48 +0530 Message-Id: <20231012055148.2445303-1-quic_mdalam@quicinc.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-QCInternal: smtphost X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: VgoyhuabBfVMOAxOj4MsziCZBct1asUr X-Proofpoint-GUID: VgoyhuabBfVMOAxOj4MsziCZBct1asUr X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-10-12_02,2023-10-11_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 mlxscore=0 bulkscore=0 malwarescore=0 suspectscore=0 priorityscore=1501 impostorscore=0 mlxlogscore=728 lowpriorityscore=0 clxscore=1011 spamscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2309180000 definitions=main-2310120049 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Ensure that there are no pending spi operation inprogress when system halts. Signed-off-by: Md Sadre Alam --- drivers/mtd/spi-nor/core.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c index 1c443fe568cf..adc4d2c68695 100644 --- a/drivers/mtd/spi-nor/core.c +++ b/drivers/mtd/spi-nor/core.c @@ -3690,6 +3690,9 @@ static void spi_nor_shutdown(struct spi_mem *spimem) { struct spi_nor *nor =3D spi_mem_get_drvdata(spimem); =20 + /* Ensure no pending spi operation in progress */ + spi_nor_wait_till_ready(nor); + spi_nor_restore(nor); } =20 --=20 2.34.1