Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp430719imn; Thu, 28 Jul 2022 05:18:21 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vcprkxl1IDtTngDLBXwTBH+daFqbhbgoAd5Iewo7MSXIuYNVP0g+wAm/C6b1WGqhqLhOME X-Received: by 2002:a05:6402:2549:b0:43a:dcf2:27f8 with SMTP id l9-20020a056402254900b0043adcf227f8mr27278664edb.143.1659010700833; Thu, 28 Jul 2022 05:18:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659010700; cv=none; d=google.com; s=arc-20160816; b=dO7NgUMK+i0diNqQ7XowioubYxCJM/cQDD5L/09sK8kg9l2gLFTK8lh/0I8HndjC/O vgV/HGC4HDkG9ihOJSHtm7F6g/7ePz5MbQu/kb5z1CW+iTwhbt+opH7VV+XodqFzw/Dd 4VSSYqN0tRH5jYEN1+vBYRhk+bp9MfcVLqFEdWLPQGtP3fqHXwXkuQsAVyACRUZ09fkg h1t+pgUs1Xhr2L2mNrPjs568HivtnLM5Wr2Iy68/4r+yoNhwnZs1wo5ntL5YPcoOBN5q 7fK97/vQO0cmptIfoYHn+vX+0epbjqrrJPGvbTPkIwixEFliXaiYfVQ9pDTgXAlHH1dS 09Cg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Gwkp9YWs1+s9Izg/ikYhApxD2YMgNM47uy+a9g1A4gY=; b=MJlMNtfN6BDmsEgPq+FU3zgyrmLgeW4P7zNxPTThpAhw99DvluP0pfSHJZ8Lpftdqh 1FUQ5Bu/U6q7NNg5WLroXemW7BnpgMygdEha07AXeYOjta5qLsFGym77f6zk9wnBNspx +DmD8AV63bOVmxQVTek+sIveXUtRtnOmErtsI2erIt5DDkgOG7aKd3nIg8KW7hPWaOKW bMdwJu+VHw73uwh/9BCTcDd4oM8FUpnTbZY16VyS6osKUYkxhjMLAfRAa6iCefc23Ua5 /6rbXG9TH9HujdyTa/MDbNVDjg7odiNTy0Mdse5NhxlXFMVOFViMEAbjb43wyJD+Rork g8Ig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b="mC4KL/Eo"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hr4-20020a1709073f8400b0072efc11c532si537745ejc.41.2022.07.28.05.17.55; Thu, 28 Jul 2022 05:18:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b="mC4KL/Eo"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231540AbiG1MGp (ORCPT + 99 others); Thu, 28 Jul 2022 08:06:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43946 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229508AbiG1MGo (ORCPT ); Thu, 28 Jul 2022 08:06:44 -0400 Received: from fllv0016.ext.ti.com (fllv0016.ext.ti.com [198.47.19.142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4FBEBCB for ; Thu, 28 Jul 2022 05:06:40 -0700 (PDT) Received: from lelv0265.itg.ti.com ([10.180.67.224]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 26SC6HOo078667; Thu, 28 Jul 2022 07:06:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1659009977; bh=Gwkp9YWs1+s9Izg/ikYhApxD2YMgNM47uy+a9g1A4gY=; h=Date:From:To:CC:Subject:References:In-Reply-To; b=mC4KL/EoxXrM8uuXGtMRaQCCBseMuPJv24aw8qh1ynl0FT0UhQbUKjugthGAiwS7n Mih/H1/NwbxcAZpJ7BTZVTkvxmlUECK+jWDtwpj9Ez+TfnPDbtWrxtTdDs2DzVrzVu kHp6qPG6W7USSZfJH+zPk4YCG92fXTc20RTSI5Gw= Received: from DLEE110.ent.ti.com (dlee110.ent.ti.com [157.170.170.21]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 26SC6G5g027812 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 28 Jul 2022 07:06:16 -0500 Received: from DLEE101.ent.ti.com (157.170.170.31) by DLEE110.ent.ti.com (157.170.170.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14; Thu, 28 Jul 2022 07:06:16 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DLEE101.ent.ti.com (157.170.170.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.14 via Frontend Transport; Thu, 28 Jul 2022 07:06:16 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id 26SC6FPJ016079; Thu, 28 Jul 2022 07:06:16 -0500 Date: Thu, 28 Jul 2022 17:36:15 +0530 From: Pratyush Yadav To: Tudor Ambarus CC: , , , , , , Subject: Re: [PATCH] mtd: spi-nor: core: Add an error message when failing to exit the 4-byte address mode Message-ID: <20220728120615.3422ojtdsfgmwy5p@ti.com> References: <20220728030159.68680-1-tudor.ambarus@microchip.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20220728030159.68680-1-tudor.ambarus@microchip.com> X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 28/07/22 06:01AM, Tudor Ambarus wrote: > Add an error message when failing to exit the 4-byte address mode. Do not > stop the execution and go through the spi_nor_soft_reset() method if used, > in the hope that the flash will default to 3-byte address mode after the > reset. > > Suggested-by: Pratyush Yadav > Signed-off-by: Tudor Ambarus Reviewed-by: Pratyush Yadav > --- > drivers/mtd/spi-nor/core.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c > index f2c64006f8d7..1cdbdad97136 100644 > --- a/drivers/mtd/spi-nor/core.c > +++ b/drivers/mtd/spi-nor/core.c > @@ -2841,7 +2841,8 @@ void spi_nor_restore(struct spi_nor *nor) > /* restore the addressing mode */ > if (nor->addr_nbytes == 4 && !(nor->flags & SNOR_F_4B_OPCODES) && > nor->flags & SNOR_F_BROKEN_RESET) > - nor->params->set_4byte_addr_mode(nor, false); > + if (nor->params->set_4byte_addr_mode(nor, false)) > + dev_err(nor->dev, "Failed to exit 4-byte address mode\n"); > > if (nor->flags & SNOR_F_SOFT_RESET) > spi_nor_soft_reset(nor); > -- > 2.25.1 > -- Regards, Pratyush Yadav Texas Instruments Inc.