Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp94035rdg; Wed, 11 Oct 2023 22:52:42 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEnIe4rL9u7Goyd6tyVXwRW1i1zK8uzcQHMQcLyHWQl2Rx2PpQj9RH2IdWAqXikf3xg6hAM X-Received: by 2002:a05:6a00:21cc:b0:68e:351b:15b9 with SMTP id t12-20020a056a0021cc00b0068e351b15b9mr32172586pfj.4.1697089962410; Wed, 11 Oct 2023 22:52:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697089962; cv=none; d=google.com; s=arc-20160816; b=maMhpEYixebWoXQ/uskvy/5a+GjWHvK7oh1QkdGoiMZszH/tkgc6LPefiCq7GjE4zv ZDPXxuhtOipUMslF3konGZo5OyXk68Gejmul3HsGgqo7ZCWX1IXvLfTO+ae9+NxdFSyi NiV0L6TDoJzpj51x1NpyEratfE6DS588mUHkp8odzYFjDVfCyMwFZ6C76i0KVdsYGHvQ bs0Tnsl8xTfsGPMJe1561dqIzNj6cnWj3MmC+jjcAeWOrHIOnBkDlkzykSzfZeFtS2af zzX+glVEmfk2V4tLzefnPB2cZnO3boxUnJnrSbV+pDoGRWGqm6ZFm+q3ocUcJoUyV+yL 9Q4A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=iLOCYuFvToEXWyeuR0V8GCWiuhk3vAizBPUCQ5xahXM=; fh=4ItP+ZR1ZZ3dKgw/KJz0pGlW8bILBA2Ly9AQ71vb5kQ=; b=ze//KMxXviHlC42jLHlyePtO6/NB1ThATf6OkMrm2k1LQaFWbDR6lrqI1+/XR6KF2V 8QVj2gdwsxjJHUe3wz0lCx3WsfGc1V5ri9w9fgx5acdyB4ipppOykadnLa8FyMW5Tfgx esq1rGpKrLmQrzXzBXbg6kRQsra8HyO9eTpfpbQMTxIcOGmO/tvNiIoS4c+JFWJszMNf yjOATpxKjvAZkj5wzcDtWpSnZdLZretPE0DbYmrQIXL/kjUDcPYBE9fMZLmcMSHY+JEo ccUHV+SBcUxqArgChMeFc3GOH1uYW98robA2z1mf/nYUZW4hHj6O5db6ey9e3wad17p9 GIJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b="SqD58/68"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id cg19-20020a056a00291300b00693462e2553si13436473pfb.156.2023.10.11.22.52.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 22:52:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b="SqD58/68"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 2F05E8069439; Wed, 11 Oct 2023 22:52:40 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377117AbjJLFwZ (ORCPT + 99 others); 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: 8bit 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 X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Wed, 11 Oct 2023 22:52:40 -0700 (PDT) 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 = spi_mem_get_drvdata(spimem); + /* Ensure no pending spi operation in progress */ + spi_nor_wait_till_ready(nor); + spi_nor_restore(nor); } -- 2.34.1