Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp5078879ybp; Mon, 7 Oct 2019 19:36:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqzY9P4juZNqQWKAaFpvM4X4/tC7ExyJDw3ezeeEC2fb2Cu3D08o5Z9hnr+1Cm89QKc5WR2f X-Received: by 2002:a17:906:a01:: with SMTP id w1mr26546358ejf.240.1570502210789; Mon, 07 Oct 2019 19:36:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570502210; cv=none; d=google.com; s=arc-20160816; b=vKfJThS7ztNGXsQ4m0T6L6DT/eVPb6PDDpTsVVekOwhAoyzG4BWeGD81pYkbDTlPb2 V6bFkDbVrrAkL0rIistreKYeS+B38YqOm19vRRYIppKwE10c+2eWRJJVDlpgBkNeSo/O WdFMSTBlObSLbK1jWz334jJK6auZSJ5QYIKByJY1GKFsd1rwLKZpDObOJtimQytaWSba c8xak8IPctpPjcviTEU2m05HAqGwoCieXQb6YRhLj+yHk9ofDROoyv2AX6UkOMwHC25M 5au4+U0rBZNthxpsc0pByGVlPVjlQbaTF0MZLNns3Ru1ub6O9rvsf5h0gT75E1fZXaED 3hXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:from:message-id:mime-version:subject :cc:to:references:in-reply-to; bh=bMrDxdE0riN0j12uoY29cOmCNo9iZfa+34MDK0g+PpQ=; b=q1aNI67k0mFjDYJyvaHVXtyV7+/qiGI8UiBAXN6Gzyf8tTK/jMRu37TWUgBbkUVs6L i5JqHT01GgaxhX36QQtBuqjvpSGlOnEG1oEQkN8AgGO63bN+1HPPTjIAmf+WEKnq8A69 nDNu5ki6n2JQ3hu1LDuSMbHwy6+myE2BWfxQlWTHMLtIFMWdo0NVV6l0DBydDOgVFU70 eoE0zS4ukuz1uMJtISlUAtQyC6/Cgf/upITHAhhqg/Osmc6Cygd0+bpwrig3j7FKn6wD Tvkwj7wHUxqxvk+nOPKEjGScCa/xs4ABnV3Jcn1c8hFUCyjwYXXcQhFx/fdykJ+qVR2F 1vbA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r16si8917824edo.307.2019.10.07.19.36.26; Mon, 07 Oct 2019 19:36:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729814AbfJHCdR (ORCPT + 99 others); Mon, 7 Oct 2019 22:33:17 -0400 Received: from twhmllg3.macronix.com ([211.75.127.131]:38981 "EHLO TWHMLLG3.macronix.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729212AbfJHCdR (ORCPT ); Mon, 7 Oct 2019 22:33:17 -0400 Received: from twhfmlp1.macronix.com (twhfm1p1.macronix.com [172.17.20.91]) by TWHMLLG3.macronix.com with ESMTP id x982XAwX085399; Tue, 8 Oct 2019 10:33:10 +0800 (GMT-8) (envelope-from masonccyang@mxic.com.tw) Received: from MXML06C.mxic.com.tw (mxml06c.mxic.com.tw [172.17.14.55]) by Forcepoint Email with ESMTP id 0E9BF9080964A92859FC; Tue, 8 Oct 2019 10:33:11 +0800 (CST) In-Reply-To: <20191007112442.783e4fbe@xps13> References: <1568793387-25199-1-git-send-email-masonccyang@mxic.com.tw> <1568793387-25199-2-git-send-email-masonccyang@mxic.com.tw> <20191007104511.5aa7b8f2@xps13> <20191007112442.783e4fbe@xps13> To: "Miquel Raynal" Cc: bbrezillon@kernel.org, computersforpeace@gmail.com, dwmw2@infradead.org, frieder.schrempf@kontron.de, gregkh@linuxfoundation.org, juliensu@mxic.com.tw, linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, marcel.ziswiler@toradex.com, marek.vasut@gmail.com, richard@nod.at, tglx@linutronix.de, vigneshr@ti.com Subject: Re: [PATCH RFC 2/3] mtd: rawnand: Add support Macronix Block Protection function MIME-Version: 1.0 X-KeepSent: EDE76FEE:8BC48D9E-4825848D:000BCC94; type=4; name=$KeepSent X-Mailer: Lotus Notes Release 8.5.3FP4 SHF90 June 10, 2013 Message-ID: From: masonccyang@mxic.com.tw Date: Tue, 8 Oct 2019 10:33:11 +0800 X-MIMETrack: Serialize by Router on MXML06C/TAIWAN/MXIC(Release 9.0.1FP10 HF265|July 25, 2018) at 2019/10/08 AM 10:33:11, Serialize complete at 2019/10/08 AM 10:33:11 Content-Type: text/plain; charset="US-ASCII" X-MAIL: TWHMLLG3.macronix.com x982XAwX085399 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Miquel, > > > > > Macronix AC series support using SET/GET_FEATURES to change > > > Block Protection and Unprotection. > > > > > > MTD default _lock/_unlock function replacement by manufacturer > > > postponed initialization. > > > > Why would we do that? > > > > Anyway your solution looks overkill, if we ever decide to > > implement these hooks for raw nand, it is better just to not > > overwrite them in nand_scan_tail() if they have been filled > > previously (ie. by the manufacturer code). > > Actually you should add two NAND hooks that do the interface with the > MTD hooks. In the NAND hooks, check that the request is to lock all the > device, otherwise return -ENOTSUPP. sorry, can't get your point. Because the NAND entire chip will be protected if PT(protection) pin is active high at power-on. > > Then fill-in these two hooks from the manufacturer code, without the > postponed init. > But in the final of nand_scan_tail(), mtd->_lock/_unlock will be filled by NULL, right ? thanks & best regards, Mason CONFIDENTIALITY NOTE: This e-mail and any attachments may contain confidential information and/or personal data, which is protected by applicable laws. Please be reminded that duplication, disclosure, distribution, or use of this e-mail (and/or its attachments) or any part thereof is prohibited. If you receive this e-mail in error, please notify us immediately and delete this mail as well as its attachment(s) from your system. In addition, please be informed that collection, processing, and/or use of personal data is prohibited unless expressly permitted by personal data protection laws. Thank you for your attention and cooperation. Macronix International Co., Ltd. ===================================================================== ============================================================================ CONFIDENTIALITY NOTE: This e-mail and any attachments may contain confidential information and/or personal data, which is protected by applicable laws. Please be reminded that duplication, disclosure, distribution, or use of this e-mail (and/or its attachments) or any part thereof is prohibited. If you receive this e-mail in error, please notify us immediately and delete this mail as well as its attachment(s) from your system. In addition, please be informed that collection, processing, and/or use of personal data is prohibited unless expressly permitted by personal data protection laws. Thank you for your attention and cooperation. Macronix International Co., Ltd. =====================================================================