Received: by 2002:ac0:f2c4:0:0:0:0:0 with SMTP id f4csp2181655imp; Mon, 25 Jul 2022 08:11:57 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tsxC1tHLm6T7uL7vewnPv/CeIaJzmaov4EuuUUs3+Qpb3RlgOIQi7jJ8alTqhvX8+MiAvL X-Received: by 2002:a17:907:3f9f:b0:72b:5af2:bc06 with SMTP id hr31-20020a1709073f9f00b0072b5af2bc06mr10509988ejc.381.1658761916842; Mon, 25 Jul 2022 08:11:56 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1658761916; cv=pass; d=google.com; s=arc-20160816; b=Mpooms9imgkiTTuvEKbv0SbT3jfcDFeH2nukI7fLLDNWSewAeKNnpwrxwT7KSCg4JF 6FuWizyAtAG5x+xF+StGtPyhoinvDWsswFb1KTV9Hi25DWrv5lpnlfzgt5tJg9J/FFHK y21cT+xcm8HZ3K+f/pfWw6PCrMbaXjfBnJj4d1mpRQlYo6y3Ngeu+Sm10McMKhxe+xrR cvWb/1H4eOSaDP8Rzhl8PNoHf/sSKs2ntu48CuCHbONgdw0bt4cVAy0yudPVSFslWllQ rEG4EKc/Q/YAsv4fF8LJOOyrJJN8Xo5gqh5cUrbGx9qmpccXwJNI5Xp5KB3dA3dA2cAV 8KcQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject :user-agent:date:message-id:dkim-signature; bh=YR2T9IGfwT+4Uw/14J5ibbMDD9NdkGliSUZZoFNscJk=; b=VO5lc+VYwhbGmyMJCCSkQr/+hOH56agP9CJWkBK/kwdQ5pos6IxEpTokBbGC9F/N6C +6cKjCJE5HrpmOaWBPe26VYApusK7hekHDXD6vI/+sr0snjPrnQ9lldHdgVL3p7axu3W 75//61ekIu9CnJ0olDEPpNt7S8ejZxIKaJmxM/LV90088fqDS0878bgHLEPfnlqRh8GD rI2d7FWTVGagxKA73QUJSLgLHd3VvvWdZPzyjcjwexsdzrh35VHg+CoKTupmarZaTNPZ FDhpKznAc8gB68Yj621hiK1c+HAlCxfcVAG9nSoapjWKYn4vR9CxkZF0oxVtz8HI6ups c++Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nokia.onmicrosoft.com header.s=selector1-nokia-onmicrosoft-com header.b=t9V3KTwe; arc=pass (i=1 spf=pass spfdomain=nokia.com dkim=pass dkdomain=nokia.com dmarc=pass fromdomain=nokia.com); 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=fail (p=NONE sp=NONE dis=NONE) header.from=nokia.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f19-20020a056402355300b0043be8f26148si4636546edd.255.2022.07.25.08.11.33; Mon, 25 Jul 2022 08:11:56 -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=@nokia.onmicrosoft.com header.s=selector1-nokia-onmicrosoft-com header.b=t9V3KTwe; arc=pass (i=1 spf=pass spfdomain=nokia.com dkim=pass dkdomain=nokia.com dmarc=pass fromdomain=nokia.com); 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=fail (p=NONE sp=NONE dis=NONE) header.from=nokia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235121AbiGYOyY (ORCPT + 99 others); Mon, 25 Jul 2022 10:54:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46060 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234839AbiGYOyW (ORCPT ); Mon, 25 Jul 2022 10:54:22 -0400 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2100.outbound.protection.outlook.com [40.107.22.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A33FF186F0 for ; Mon, 25 Jul 2022 07:54:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GsRB3y+/+LfQHRR7H1Fhlje0Vz9oCwDXbIIDY92/gx/47tsk+7HyIz7dKbcGQgY/YuiFcz2kc7peRsc2HCMRBGo+zzxGMUTTPhs+FfVyh2LUzq1oE1XSbXTgGW1qNKKcKVvKqMwtb9uTuqYlLkBvY35k+csBI8Smouru2bb2rDQ9f4bSjrbPBeDgOdLlHgwNq0C1Pb0+vKQYypJ5Bo4TkpTgXMpLFnbay04WK8gBi8d7b7DelAL7YDJQpxitADX5eolTkIsjTbOU3ZAvwZMIE9u92CdwIUMTBmHPxT6iw1wtO9/ANm+OPzVD9DZ0OxEXzYAixtrW4AgyMXb2lS2iEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=YR2T9IGfwT+4Uw/14J5ibbMDD9NdkGliSUZZoFNscJk=; b=lKfXoMBHMpGn4O9dw0IkrT8uJx0GJk6vI+8xz/4wquKmbYM1OBLAbz8Kvbn/WlGBXF+UPbyHf9RUWkcM0biEPAFl7Jc5mBm1JUh/oZ3abC0QLBVMSOv4iS9UCcXf1sdwirjCHWj2xqgKFz7VcMAwV4htM+kl0Kg1/GIqlgN+rWRorWYzJnTIhVOa7sokSY713Y3I48TCogFrbiF7xUjpSrlOsZ3WHvYW8Qz0uDmiCsYvfTof5PUpQ5ZS82ySXB+yAgNyt8mO+BXy5K0w3yyGl/Oo0U9vbpfWm7zgX9FoAFeo5q7gr65xI2ZYjRkicX1u/E18tZ6KzWKVFM3IY4sTaw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nokia.com; dmarc=pass action=none header.from=nokia.com; dkim=pass header.d=nokia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nokia.onmicrosoft.com; s=selector1-nokia-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=YR2T9IGfwT+4Uw/14J5ibbMDD9NdkGliSUZZoFNscJk=; b=t9V3KTwedah5Mi1jUlPRv/QSknH/d32cn0RIi6N4/AEZIuZgwhgU6lLhZv9nOzS7PX+DQe5ld6X4Ro+68uCFUCQXfIj6vGUUrCcn4n8Wbf+wM4o9cw01nuSq5W8rOAWiBYKJXPh3l1NzHzLzuvgQ90RRsD1UlVMy05EVs54ssdU= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nokia.com; Received: from AS4PR07MB8658.eurprd07.prod.outlook.com (2603:10a6:20b:4cd::12) by PR3PR07MB6491.eurprd07.prod.outlook.com (2603:10a6:102:67::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5482.2; Mon, 25 Jul 2022 14:54:19 +0000 Received: from AS4PR07MB8658.eurprd07.prod.outlook.com ([fe80::d58d:e18d:afdb:35b8]) by AS4PR07MB8658.eurprd07.prod.outlook.com ([fe80::d58d:e18d:afdb:35b8%7]) with mapi id 15.20.5482.001; Mon, 25 Jul 2022 14:54:19 +0000 Message-ID: <7caffdd6-2292-d454-7a76-5dbc30ab9c29@nokia.com> Date: Mon, 25 Jul 2022 16:54:16 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH 1/2] mtd: spi-nor: Introduce erase_proto Content-Language: en-US To: Tudor.Ambarus@microchip.com, p.yadav@ti.com Cc: linux-mtd@lists.infradead.org, michael@walle.cc, miquel.raynal@bootlin.com, richard@nod.at, vigneshr@ti.com, linux-kernel@vger.kernel.org References: <20211209100813.61713-1-alexander.sverdlin@nokia.com> <20211216200535.jikqd42nohr4477n@ti.com> From: Alexander Sverdlin In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: FR3P281CA0024.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:1c::15) To AS4PR07MB8658.eurprd07.prod.outlook.com (2603:10a6:20b:4cd::12) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: bfcc4eec-0452-47fa-90ad-08da6e4d8d6d X-MS-TrafficTypeDiagnostic: PR3PR07MB6491:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: J+K9+CUjrriF0LtZXPLwNosMmyU5Wq913YroDveJ15CNvH//eNgoMje0F87mdM4nUQCoBYpNQ8aaWOfLzFdwQVudqTc2dyz9GSea9cO9XUroymDyPkqiAgyxdm2BS06+RCaSCeRHqKl6+Ul1ebLgfGHgwgxcieV8Lp+3nZVQ8nzF+CD0e3dJ1zEUuIu02e5PuEMe10K5R0CQ803Pwvybg5Q3BpGVzaWd053bH3i134y8Ycb9bgucipI44UOzdETxkkCvY3yNpgJE9vAxp7n82Fxs40G5CMqpUOeAQEhU6UXDF6kTbuI9KmUcKNbQQH1Alxz2OiIlh+5i6RVDn7ZkwtOOnjBzKpiK+2Gh+3OrKONxMD4kkhJIwvuho7EY6LmKTuHL2/VMD8MRMUE07iy0vNwrbQylTdjWcawV/cW1lOMTKbMUmkHsOI0WO2qYCbPck4xSOXzGBIWdL0/7uuJlzCtIHeGzCJ+6984w0uDalYIs/Vdq2DuZN47SEWd680XH7ltkpEskqD1KCYD97Zd9f/7uoxTF05hzEgLYo8w6jVf9eAbV/3cvOlS2/0tnIq/kuGcWmpivyzwIgNhAio6lg2LaKEm1Zg9KEc52OF2pMi8x1SfcPsD6VTn5kKPNmLhD/Zqmtj030kyiS77gWiONAAy0z6IY9SQazIW0Vgv/OlH+3oMqgmsurcG0Xwpv3MnGPEDuUugO/8xCJ0N0VrXOg/c9bhvQD/S1gtXv0ZNqybF1FJSEAiFU5Gzy4F7QQch1MzWLuE/n9dkntFVrtetORc03Zq3vclyOtp9E5JtOHMMEp38NkTXiahL4dz6l3hvgovXsHpBOKjK+6H3PNfDvPJ8LDzob2kCOcJblTydX56PZamuc5lWD+I5J8DW6jHUQ X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AS4PR07MB8658.eurprd07.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(4636009)(366004)(39860400002)(376002)(396003)(346002)(136003)(316002)(41300700001)(6512007)(6506007)(6666004)(53546011)(26005)(186003)(966005)(6486002)(478600001)(66556008)(44832011)(2906002)(66946007)(66476007)(4326008)(5660300002)(8676002)(83380400001)(31696002)(82960400001)(36756003)(38100700002)(31686004)(86362001)(8936002)(2616005)(43740500002)(45980500001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?MEFTaTZEd2g0STk1dzU4aGRWbUJIODNvWDBIUWx3SkhBd0JIWUc3K3FWRVRJ?= =?utf-8?B?SUpnOURLSVZJYUtyZkhqK1FPODhCSXk3N25sNDMwN2JCQ2xEbVN1ZHFVMjJK?= =?utf-8?B?bXVkR2E0QU9sT1diMkUxa1dZdlNZS3RwSkc3amptNWZiWWZrMFVYZDBiTnAv?= =?utf-8?B?SExLcDNCbGlNUFlDeDNWUkU3UzVaY2U0aDJQc0NlbkZySFEwR1dPeVpxbHJV?= =?utf-8?B?YnhmVXorNHZpd2FJMkJySURmem05ZnBVMVRDNDJKcF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IcENocWhNbGVaUml4aURLeFBKaVp6dFd2TjBlS3JRWnNPa1lO?= =?utf-8?B?eGJZNlE3dUs1N1NTRSsyWEZIN3o1YkFjakhrdG5NM3RlclNXN21sOGk4eHNC?= =?utf-8?Q?dT2CT5Um2sivrR6io9W35TY=3D?= X-OriginatorOrg: nokia.com X-MS-Exchange-CrossTenant-Network-Message-Id: bfcc4eec-0452-47fa-90ad-08da6e4d8d6d X-MS-Exchange-CrossTenant-AuthSource: AS4PR07MB8658.eurprd07.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jul 2022 14:54:19.3619 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 5d471751-9675-428d-917b-70f44f9630b0 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: IUGmbmtxvDQc6+of8hM4KFrXSNqBXDv1LvgsO5RAvvXJs9RcRE+1dP0R8jvQPJB0bslthlYIv4ZCW2hD85+2t2w/PJEO43HnJMtXl9A/EuQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3PR07MB6491 X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,FORGED_SPF_HELO,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE autolearn=no 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 Hi Tudor! On 18/07/2022 18:50, Tudor.Ambarus@microchip.com wrote: >>> @@ -2727,6 +2727,9 @@ static void spi_nor_late_init_params(struct spi_nor *nor) >>> */ >>> if (nor->flags & SNOR_F_HAS_LOCK && !nor->params->locking_ops) >>> spi_nor_init_default_locking_ops(nor); >>> + >>> + if (!nor->erase_proto) >>> + nor->erase_proto = nor->write_proto; >> I get that you are trying to not break any existing flashes with this, >> but I don't quite like it. We should keep the same initialization flow >> with erase_proto as with write_proto, read_proto, etc. That is, >> initialize it to SNOR_PROTO_1_1_1 in spi_nor_scan() and then let the >> initialization procedure change it as needed. >> >> The problem with this is of course that it could break some flashes by >> selecting the wrong erase. I would expect _most_ flashes to use >> erase_proto as 1-1-1 but I of course haven't went and looked at every >> single flash to point out the exceptions. >> >> I would like to hear from others if they think it is okay to do this. >> > Doesn't [1] solve Alexander's problem? Alexander, would you please test > Patrice's patch and provide a Tested-by tag if everything is ok? Yes, looks good, provided the Tested-by tag. > Thanks, > ta > > [1] https://patchwork.ozlabs.org/project/linux-mtd/patch/20220629133013.3382393-1-patrice.chotard@foss.st.com/ > -- Best regards, Alexander Sverdlin.