Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp4544028ybv; Mon, 17 Feb 2020 01:04:18 -0800 (PST) X-Google-Smtp-Source: APXvYqzqHcN0Q+vHjBu7lFGF5sqL5StoxlWEJsbHYpxXRO9GPNffzmt9662vbQE9NdgPMduMgZ9a X-Received: by 2002:a9d:7509:: with SMTP id r9mr10939141otk.270.1581930258381; Mon, 17 Feb 2020 01:04:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581930258; cv=none; d=google.com; s=arc-20160816; b=gYksENh9nBcwt66HKIS9VRmn5OF/br9pF4j9fvMbmQ2Fa03PdCf7YVzeJJEPwzwACo OGT/whqMImdtUCSRqEGGMEUzKeiWeE7LPMbOzMFiWBzFO2su6cx74MFV8y6lAze+NfEB 7D39pK1lLDVJXSJiGZqP1G593S3LReCrDj4WFmH1Hw2oPSVl1JFY+4e378jXCrYoes+K glHnfEuv9/88T3TiJDWA/G2j/SspShXBOEcogrxIHAte7B1iFDoP3g9IV3XGEdDaf+iT DlqYkSciRsciiWMAJV0FMXwp3PyBlq+ZdNM86HJMkwlZAFFHtV7FAk6uPiwUntMgs4md +Vew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=zHomBPk8lYU3ZGIgMRWGs5rIewcys6cmlMMmAW4T/oM=; b=FoeXHRyHcM5QPpKIL2Y9meXvdbsReDWU0Je+sGf8ZJuGZf1TrpPXFvsenypca3VTai Fe1OIoYa2JR9K/NWYrDIi9jdVPLFSXZAQYowMdatcxuXPvQ5CRWnOm4Uipu0n/rQhViF CFAweI2oTU93lUnXuMZ1d17fjZ6aGWLXiNH7YCC/hNamp0Hu188ez78x3Sq2foQCbdXr /QiSDxGC7H5Kqj56tcKr3qwLypT4TCXX4zEnG6+2mtWI44H5E+x3EXht4YKvreviRpRB z84dNA+sXoKVRuEtCREFQWZ03awe5TqNit6ziLG4wF7uFA1Kb6j5WoxWUQ5zhdpQOfg5 cx1A== 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 v25si6854534otq.93.2020.02.17.01.04.05; Mon, 17 Feb 2020 01:04:18 -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 S1728663AbgBQJBb convert rfc822-to-8bit (ORCPT + 99 others); Mon, 17 Feb 2020 04:01:31 -0500 Received: from relay9-d.mail.gandi.net ([217.70.183.199]:41611 "EHLO relay9-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728640AbgBQJBb (ORCPT ); Mon, 17 Feb 2020 04:01:31 -0500 X-Originating-IP: 90.76.211.102 Received: from xps13 (lfbn-tou-1-1151-102.w90-76.abo.wanadoo.fr [90.76.211.102]) (Authenticated sender: miquel.raynal@bootlin.com) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id E71E8FF80E; Mon, 17 Feb 2020 09:01:24 +0000 (UTC) Date: Mon, 17 Feb 2020 10:01:24 +0100 From: Miquel Raynal To: masonccyang@mxic.com.tw Cc: "Boris Brezillon" , 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, richard@nod.at, vigneshr@ti.com Subject: Re: [PATCH v2 1/4] mtd: rawnand: Add support manufacturer specific lock/unlock operatoin Message-ID: <20200217100124.6ff71191@xps13> In-Reply-To: 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> Organization: Bootlin X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Mason, masonccyang@mxic.com.tw wrote on Mon, 17 Feb 2020 16:14:23 +0800: > 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. Right! > > 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); What about lock_area() unlock_area() ? Seems more accurate to me, tell me if I'm wrong. > > > thanks for your time & comments. > Mason Thanks, Miquèl