Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp4510278ybv; Mon, 17 Feb 2020 00:15:32 -0800 (PST) X-Google-Smtp-Source: APXvYqxypWRJnMB5WTdgTi4y2B2n4W1suAcXuGQIq+UcID02/Mslc+xhstrSSF7d9x4WlDzhszTZ X-Received: by 2002:a9d:7586:: with SMTP id s6mr11079196otk.342.1581927332596; Mon, 17 Feb 2020 00:15:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581927332; cv=none; d=google.com; s=arc-20160816; b=oYLvcvlZbhc5486eQ74iRGOp76eDYDbJ/3mJEVxefj8gOdZLTgqAZSRONemjtKiOBM cZVGY3G0OZXaap8KFfdOleK/plxGUwjLvSPI2wONGr0uPllfHCUwoj6hy6Dvo2Pt2l2P 5WL+UQJJ0vjzqqDiJNZOFNRN3I39053PPeo3kCVHzMw22zjIqhHatvK28o7Ry+h12tkQ jdGjTrWVQjwAcuERO9qogQtOhhu9Orq6iSfHbfSeGy4Nv9preD0FSryj2WReSrZIiMUX qVscmSgKxp30B3khDzHTR6haElA7XqVwq6+SeVUoNwTBc+cdvN+1yMsP/MGdKWxmnpmO KHqA== 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=hDRa+yZCp82A2ccKeejeWTvwFSYJAe/JKric6DYPsVQ=; b=EdjTnY26y3SoODCr7cgspCnFjja4k+wy+qEOZ2Bxk1aklmcpBhDShlaWjSOqFzfMw3 PrHXuE9EHpvWFsWEusIenEXvUGnw/D6cyVydhEuKBgt7mNDej728ZqvvaoRHqsWXAp59 YGx/6pcIb5nuIUwlGYEiwpQDaUQ6+1h7D3Hjvh5vk96WxYeom0AK8d6oOHPSg9ZaM4en PiXm8e1bk+5eBIZB6PMCsLaYCJAPXI7U/HRKlE04TyURvtvG+NTp/gT8j2V7PdTv177t 7mcDDfF1yA4MZbZ8azg7Sg5RW5cX28ByNuAyv8BlUJ4B2C3Mu5bxplkXEMJOaQt1RjaJ 4PVg== 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 a5si6752852oti.22.2020.02.17.00.15.19; Mon, 17 Feb 2020 00:15:32 -0800 (PST) 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 S1727931AbgBQIOf (ORCPT + 99 others); Mon, 17 Feb 2020 03:14:35 -0500 Received: from twhmllg3.macronix.com ([211.75.127.131]:56298 "EHLO TWHMLLG3.macronix.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727338AbgBQIOe (ORCPT ); Mon, 17 Feb 2020 03:14:34 -0500 Received: from twhfmlp1.macronix.com (twhfm1p1.macronix.com [172.17.20.91]) by TWHMLLG3.macronix.com with ESMTP id 01H8ENdB073564; Mon, 17 Feb 2020 16:14:23 +0800 (GMT-8) (envelope-from masonccyang@mxic.com.tw) Received: from MXML06C.mxic.com.tw (mxml06c.macronix.com [172.17.14.55]) by Forcepoint Email with ESMTP id 330F75CF8CA615BE2FE8; Mon, 17 Feb 2020 16:14:24 +0800 (CST) In-Reply-To: <20200109203055.2370a358@collabora.com> References: <1572256527-5074-1-git-send-email-masonccyang@mxic.com.tw> <1572256527-5074-2-git-send-email-masonccyang@mxic.com.tw> <20200109203055.2370a358@collabora.com> To: "Boris Brezillon" Cc: bbrezillon@kernel.org, computersforpeace@gmail.com, dwmw2@infradead.org, juliensu@mxic.com.tw, linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, marek.vasut@gmail.com, miquel.raynal@bootlin.com, richard@nod.at, vigneshr@ti.com Subject: Re: [PATCH v2 1/4] mtd: rawnand: Add support manufacturer specific lock/unlock operatoin MIME-Version: 1.0 X-KeepSent: 505D0437:0130F15A-48258511:002C7F75; type=4; name=$KeepSent X-Mailer: Lotus Notes Release 8.5.3FP4 SHF90 June 10, 2013 Message-ID: From: masonccyang@mxic.com.tw Date: Mon, 17 Feb 2020 16:14:23 +0800 X-MIMETrack: Serialize by Router on MXML06C/TAIWAN/MXIC(Release 9.0.1FP10 HF265|July 25, 2018) at 2020/02/17 PM 04:14:24, Serialize complete at 2020/02/17 PM 04:14:24 Content-Type: text/plain; charset="US-ASCII" X-MAIL: TWHMLLG3.macronix.com 01H8ENdB073564 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Boris, > > > /* Set default functions */ > > static void nand_set_defaults(struct nand_chip *chip) > > { > > @@ -5782,8 +5810,8 @@ static int nand_scan_tail(struct nand_chip *chip) > > mtd->_read_oob = nand_read_oob; > > mtd->_write_oob = nand_write_oob; > > mtd->_sync = nand_sync; > > - mtd->_lock = NULL; > > - mtd->_unlock = NULL; > > + mtd->_lock = nand_lock; > > + mtd->_unlock = nand_unlock; > > mtd->_suspend = nand_suspend; > > mtd->_resume = nand_resume; > > mtd->_reboot = nand_shutdown; > > diff --git a/include/linux/mtd/rawnand.h b/include/linux/mtd/rawnand.h > > index 4ab9bcc..2430ecd 100644 > > --- a/include/linux/mtd/rawnand.h > > +++ b/include/linux/mtd/rawnand.h > > @@ -1136,6 +1136,9 @@ struct nand_chip { > > const struct nand_manufacturer *desc; > > void *priv; > > } manufacturer; > > + > > + int (*_lock)(struct nand_chip *chip, loff_t ofs, uint64_t len); > > + int (*_unlock)(struct nand_chip *chip, loff_t ofs, uint64_t len); > > Please drop this _ prefix. Drop _ prefix of _lock will get compile error due to there is already defined "struct mutex lock" in struct nand_chip. What about keep this _ prefix or patch it to blocklock/blockunlock, i.e., int (*blocklock)(struct nand_chip *chip, loff_t ofs, uint64_t len); int (*blockunlock)(struct nand_chip *chip, loff_t ofs, uint64_t len); thanks for your time & comments. 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. =====================================================================