Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp4551857pxk; Wed, 30 Sep 2020 06:06:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwmt0FRvVaJBofVaoe4Visv1cF5vzR8du71O6PRvbyyHdpxzbVTv/YEZgoD2r8sr9XsMdjO X-Received: by 2002:a17:906:b7c1:: with SMTP id fy1mr2643503ejb.342.1601471174859; Wed, 30 Sep 2020 06:06:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601471174; cv=none; d=google.com; s=arc-20160816; b=Cwx5P0Nhx75+tm7Z00EzOuBN73W9Wpzlodc92rEx2Su4HT3aIvSIhcAmYMvd+RDy80 W4RN82YMw/hcm3fXjPBdMp8jlmqp4btJgGyPW6Uez/Hs5OTiubN+WsBJ44U7aSv48iN4 mAW9gdlo+fxno+Czgqf7gLizSKZ3UFJSv7O5i06HQI2Vc13nCF+cdAImXHYKmdWlRLxU s1LKOjuW4i6FNhHOr8G3GVuU6iTdmG92AKPdWfNkhfg0xvS/xQ0xPfgES0X0pNnQ4LxI PAVsd6LQIvrTgyZr3FbGCUPgmBtsZje8Q6y27tpQJa+AKQO038snfbdXVQDgyrnDnih7 ac4g== 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 :user-agent:organization:references:in-reply-to:date:cc:to:from :subject:message-id:dkim-signature; bh=EauDJnoIS+CWG+OZO5GPCD9DN0POJzPA7ZahGmTFG1c=; b=FJzQ1aFND3goK0PGpzU7vcjkwbMi7CsM5IvaawF8Pd/I22RXddzm06gXSNf34B/hON cksoeAAUd1sQmmY7CLkNpwkq8W4j44nQ9ext3zcsLExkeCbuyNsR1kaLyLHs41jvrooF SlLUkklqd22QJn6X6vvGY0u/qC2KEN6Yzp9BcaKaPbNnlP1M73oyY6xGMXpTXvuIjTDe iaTtwZbG03mSrLWR7Ip4+3WXH8JlYG05OS88++/vCUauO6OHjUCGimlZqn9z/txMUjZ1 +AakrOfQ+YCIzR+3qcZkgr5o9GRq+r1Zvsqi5Vu7FZDGPwMdsJ3Vukbu22OQ0Px4AEXr O8/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@yadro.com header.s=mta-01 header.b=DzYrn8U4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=yadro.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d9si997010edz.97.2020.09.30.06.05.48; Wed, 30 Sep 2020 06:06:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@yadro.com header.s=mta-01 header.b=DzYrn8U4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=yadro.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730090AbgI3NED (ORCPT + 99 others); Wed, 30 Sep 2020 09:04:03 -0400 Received: from mta-02.yadro.com ([89.207.88.252]:48894 "EHLO mta-01.yadro.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725771AbgI3NED (ORCPT ); Wed, 30 Sep 2020 09:04:03 -0400 Received: from localhost (unknown [127.0.0.1]) by mta-01.yadro.com (Postfix) with ESMTP id E7FD14130F; Wed, 30 Sep 2020 13:04:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yadro.com; h= content-transfer-encoding:mime-version:user-agent:content-type :content-type:organization:references:in-reply-to:date:date:from :from:subject:subject:message-id:received:received:received; s= mta-01; t=1601471040; x=1603285441; bh=njVa9cplwqkKacO5snuH36/Bo YnsXd9WkIp7KVh22W4=; b=DzYrn8U4Ujk/W1+h6DsWmSjEeguylOsSX2hS2dMPA 4ePHPgmlTkpCQF+NH1q3Iw+7GyPrYCJ6eCIYl8MAwTRX/RdYCn0BPQ88qWRQfk/T bD3pdGK35uKUIu0XgL88EZpNNjKCoB6unKJ5qvJnAxbqgKDY2XFzTJwtfcoeHV3B +U= X-Virus-Scanned: amavisd-new at yadro.com Received: from mta-01.yadro.com ([127.0.0.1]) by localhost (mta-01.yadro.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id dvIGsKiEPSWw; Wed, 30 Sep 2020 16:04:00 +0300 (MSK) Received: from T-EXCH-04.corp.yadro.com (t-exch-04.corp.yadro.com [172.17.100.104]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mta-01.yadro.com (Postfix) with ESMTPS id C084041207; Wed, 30 Sep 2020 16:04:00 +0300 (MSK) Received: from localhost.localdomain (10.199.2.122) by T-EXCH-04.corp.yadro.com (172.17.100.104) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.669.32; Wed, 30 Sep 2020 16:04:00 +0300 Message-ID: <4a5945534f7b41cb799c044ec8c9d31c61d5beda.camel@yadro.com> Subject: Re: [RESEND PATCH 1/2] mtd: spi-nor: do not touch TB bit without SPI_NOR_HAS_TB From: Ivan Mikhaylov To: Vignesh Raghavendra , Tudor Ambarus , Miquel Raynal , Richard Weinberger CC: , Date: Wed, 30 Sep 2020 16:07:53 +0300 In-Reply-To: <9bfb10df-64d8-4a5e-b0ad-a8b5f4efc56f@ti.com> References: <20200921112450.4824-1-i.mikhaylov@yadro.com> <20200921112450.4824-2-i.mikhaylov@yadro.com> <9bfb10df-64d8-4a5e-b0ad-a8b5f4efc56f@ti.com> Organization: YADRO Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.32.5 (3.32.5-1.fc30) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Originating-IP: [10.199.2.122] X-ClientProxiedBy: T-EXCH-01.corp.yadro.com (172.17.10.101) To T-EXCH-04.corp.yadro.com (172.17.100.104) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2020-09-30 at 15:06 +0530, Vignesh Raghavendra wrote: > > On 9/21/20 4:54 PM, Ivan Mikhaylov wrote: > > Some chips like macronix don't have TB(Top/Bottom protection) > > bit in the status register. Do not write tb_mask inside status > > register, unless SPI_NOR_HAS_TB is present for the chip. > > > > Not entirely accurate.. Macronix chips have TB bit in config register > and is OTP and hence should not be touched ideally... > > You still need to "read" that bit to determine actual scheme (Top vs > Bottom). This is needs to be done before 2/2 enables SPI_NOR_HAS_LOCK > flag for macronix flashes. Vignesh, that's the point about this commit to generalize this part about TB bit plus there is already exist SPI_NOR_HAS_TB flag which representing state of TB existence. I didn't add any support for macronix's TB bit, that's true but that's enough to make macronix chips able to use lock mechanism with default 'use_top' or any other chips which doesn't have TB bit. > I guess macronix does not support SR_SRWD right? This needs special > treatment as well. It does support SR_SRWD as well. No need any special treatment here. Thanks.