Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp3715565rdg; Wed, 18 Oct 2023 04:07:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFsxvUoHvhOZOlYF7gGaWlcg3g8EeM0QckfKkKxQz5jA98RbZDIdHRsFbHKJ1cRYuJ5a44r X-Received: by 2002:a05:6a00:14d1:b0:6bd:46e8:9b5a with SMTP id w17-20020a056a0014d100b006bd46e89b5amr4984249pfu.27.1697627257063; Wed, 18 Oct 2023 04:07:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697627257; cv=none; d=google.com; s=arc-20160816; b=Ot/xX5wyVlUvSoVivDHaPhGMVbJXgMXdwTKYJp8UQ9xKy2GDa3uVU/IAWC241jJHFA Eb9KIUZlZ84XmlYV+2GMnys6hmsoR9WUemZKWYIoWUiDZtKv7dM6HIkgZJseTV37HN4Q u3uIcLeP9opEhR/joGwthxJxJ8m0smZhJu78jpyKxrruf+/BJut7WYH/Hud0K+DSjyZ+ qvdWcR2XT9s6RdaKsH2G9aa04jnlQxK3+arxlbhzIbfima353Ty1KSJDJS6VimGhp7Uu +1xMa7IR45stmpQYJXaECVbJb91CICToDvxmkDj9FWtcP8Do+RR4tpJ5EfixkpzSZtWB Kjlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=0ZZzJrMCnz11NTdj9q9mswUtohFFrY5CF+zPZe52VIs=; fh=aWoOdIQub0QeA8PhpOQpUDlDp0X+UNPqWZD2MBjWBuE=; b=hTLWqUAfa9ofdtFY7Mv8PFmFBV6bucB+oC62mr/cs29NGXLqGcG7yscsSxOVAuDzEM aD1/7+X7LVZg2zh4WerGED6LnaaUvM+o+WtQjSJZOn8daTSCKb86HxqSatZcb0PT3YnR vnCZk4ataXd4M/wt+D5ZHiCoOwc4uhIJ90tTU+uzUuKO/tIfaCF0B2a0VE7F7I2BUnyV tMNquzQd4OEbD6PrO4S9cEHO5Kru6MvIwhzvQLyL1VYqiDJqxuYHBLi6Y7SgkzpHGTra kH+3HcuAyr1jHt5K2O1BAeK01pwhW2rttzuNN6MrkCfKoh83SNwHLmL4cpDo18FpBz3/ s9pg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=gCFwccLF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id u14-20020a056a00158e00b006be322191e1si3969090pfk.254.2023.10.18.04.07.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 04:07:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=gCFwccLF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (Postfix) with ESMTP id E74E7806228F; Wed, 18 Oct 2023 04:07:34 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229717AbjJRLH1 (ORCPT + 99 others); Wed, 18 Oct 2023 07:07:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35430 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229993AbjJRLHZ (ORCPT ); Wed, 18 Oct 2023 07:07:25 -0400 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 04623113 for ; Wed, 18 Oct 2023 04:07:23 -0700 (PDT) Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 39I5OKGP015238; Wed, 18 Oct 2023 11:07:02 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=qcppdkim1; bh=0ZZzJrMCnz11NTdj9q9mswUtohFFrY5CF+zPZe52VIs=; b=gCFwccLFIswHHl1Sj3+btNYVqhsEbgbMZAAOPT5t6tfxu9NjWkJQcAPSfAN82MyLXodw cEl5tOijGnh7u84/gmkf5C6QbDPxBi8Dlxs1udgzGuhZQoQDyORsQ7F5qTNSG4vXiQGs oZDgzPCTVFyPfyMaLxVSnRfhIuul9dkUHTKs9WQV2bNjZYEvLSmFBA5kAUMEufj8uPJH xxFyhbQZmxWDW6Xz+713nYr2B496yQajZuX1J3ndVCOaxslcNFDAi7w7ESEUe9FlZU/4 LuNpjiJ7H9ED6w42g089w+b/wu7Tj2EMYjlBbDdzZWO3i2XfB4QXPBuDlt2HNiGrAk4r /w== Received: from nasanppmta05.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3tt8xs8reb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 18 Oct 2023 11:07:01 +0000 Received: from nasanex01a.na.qualcomm.com (nasanex01a.na.qualcomm.com [10.52.223.231]) by NASANPPMTA05.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 39IB70dk010040 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 18 Oct 2023 11:07:00 GMT Received: from [10.201.3.104] (10.80.80.8) by nasanex01a.na.qualcomm.com (10.52.223.231) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.39; Wed, 18 Oct 2023 04:06:57 -0700 Message-ID: Date: Wed, 18 Oct 2023 16:36:33 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.9.1 Subject: Re: [PATCH] mtd: spi-nor: Ensure operation completion before shutdown To: Michael Walle CC: , , , , , , , , References: <20231012055148.2445303-1-quic_mdalam@quicinc.com> Content-Language: en-US From: Md Sadre Alam In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nasanex01a.na.qualcomm.com (10.52.223.231) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: RErKqp0_q_2ZBcl3Ksvz8nysHFS2zX1J X-Proofpoint-ORIG-GUID: RErKqp0_q_2ZBcl3Ksvz8nysHFS2zX1J X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-10-18_09,2023-10-18_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 lowpriorityscore=0 spamscore=0 mlxscore=0 suspectscore=0 clxscore=1015 impostorscore=0 phishscore=0 adultscore=0 priorityscore=1501 mlxlogscore=696 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2309180000 definitions=main-2310180092 X-Spam-Status: No, score=-4.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,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 howler.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 (howler.vger.email [0.0.0.0]); Wed, 18 Oct 2023 04:07:35 -0700 (PDT) On 10/12/2023 2:41 PM, Michael Walle wrote: > Hi, > > Am 2023-10-12 07:51, schrieb Md Sadre Alam: >> Ensure that there are no pending spi operation inprogress >> when system halts. > > What operation might be in progress here? Did you encounter some problems? > Please explain it in more detail in the commit message. > > Fixes tag? We have faced issue while doing nor flash read/write test with specific nor part. Will check once again with the same part and post new patch. > > -michael > >> 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); >>  }