From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7C8F2C4332F for ; Mon, 13 Sep 2021 07:48:26 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9F98960F9F for ; Mon, 13 Sep 2021 07:48:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 9F98960F9F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=siemens.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B49AF83A2C; Mon, 13 Sep 2021 09:48:22 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=siemens.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id E7FCE83A2D; Mon, 13 Sep 2021 09:48:20 +0200 (CEST) Received: from david.siemens.de (david.siemens.de [192.35.17.14]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 9A6B583A2A for ; Mon, 13 Sep 2021 09:48:17 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=siemens.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jan.kiszka@siemens.com Received: from mail2.sbs.de (mail2.sbs.de [192.129.41.66]) by david.siemens.de (8.15.2/8.15.2) with ESMTPS id 18D7mCN1021439 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 13 Sep 2021 09:48:12 +0200 Received: from [139.22.39.76] ([139.22.39.76]) by mail2.sbs.de (8.15.2/8.15.2) with ESMTP id 18D7mBTN001272; Mon, 13 Sep 2021 09:48:11 +0200 Subject: Re: [PATCH] sf: Querying write-protect status before operating the flash To: chaochao2021666 , Jagan Teki Cc: U-Boot-Denx , Vignesh R , Chao Zeng References: <20210622052126.49853-1-chaochao2021666@163.com> <50e1e113.2ed6.17bc3c269af.Coremail.chaochao2021666@163.com> From: Jan Kiszka Message-ID: <17d14fef-de26-f3ca-f1dd-de011e011bde@siemens.com> Date: Mon, 13 Sep 2021 09:48:11 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <50e1e113.2ed6.17bc3c269af.Coremail.chaochao2021666@163.com> Content-Type: text/plain; charset=gbk Content-Language: en-US Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean Hi all, Chao, please no top-post on mailing list. Also check your mail client, it seems to inject a lot of bogus newlines. On 08.09.21 06:55, chaochao2021666 wrote: > > > > HI Jagan > > > > sorry for the delay response. > > > And I have checked the maser. There is still a problem with this feature¡£ > > > reproduce steps: > 1. enable the flash protect function > 2. using sf cmd to erase the flash. I can get the erase "OK",not the "error". > > > > I think the root cause is that the detection mechanism is missing and to judge the permissions of the action > > So pull this PR to improve the erase flow > > > another question: > how can I visit the u-boot-spi/next? do there any link? > See MAINTAINERS: https://source.denx.de/u-boot/custodians/u-boot-spi.git But also that tree contains no usage of the flash_is_locked callback. That was once evaluated by drivers/mtd/spi/spi_flash.c but then forgotten in the new SPI NOR framework it seems. Chao's patch makes sense to me to restore this feature. Jan > > > > > BRs > Chao > > > > At 2021-06-29 21:50:28, "Jagan Teki" wrote: >> On Tue, Jun 22, 2021 at 10:51 AM chao zeng wrote: >>> >>> From: Chao Zeng >>> >>> When operating the write-protection flash,spi_flash_std_write() and >>> spi_flash_std_erase() would return wrong result.The flash is protected, >>> but write or erase the flash would show "OK". >>> >>> Check the flash write protection state if the write-protection has enbale >>> before operating the flash. >>> >>> Signed-off-by: Chao Zeng >>> --- >> >> Does it broken on master? if yes can you check in u-boot-spi/next? >> >> Jagan. -- Siemens AG, T RDA IOT Corporate Competence Center Embedded Linux