From patchwork Wed Mar 22 20:07:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 95846 Delivered-To: patch@linaro.org Received: by 10.140.89.233 with SMTP id v96csp415394qgd; Wed, 22 Mar 2017 13:17:47 -0700 (PDT) X-Received: by 10.98.55.66 with SMTP id e63mr39784154pfa.100.1490213867918; Wed, 22 Mar 2017 13:17:47 -0700 (PDT) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [65.50.211.133]) by mx.google.com with ESMTPS id f1si3007635plf.93.2017.03.22.13.17.47 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Mar 2017 13:17:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 65.50.211.133 as permitted sender) client-ip=65.50.211.133; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org; dkim=neutral (body hash did not verify) header.i=@nifty.com; spf=pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 65.50.211.133 as permitted sender) smtp.mailfrom=linux-mtd-bounces+patch=linaro.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=IYv9SAVh5CTMzChI2WmvkJrozpb2wBNNi6cfg1ZwO+s=; b=Xm3+kbvR6EAaG4kB3P75NR+wI+ 3Jz4eXtxZwhtm5hA5h+c/SzbmFpJevSXMwGlXZg1/nLEMHN3i2bAbs5JAz/G3kCD+l7HZgw1OR5kE 2ATZ/GQiWlCiJSRznBhv0QSfrzCOHuppTdsbIg67Q18NvDn9rk1sC/nfCzgFGvYqrn8NtWQX6ONp0 yvoEBE9drhqLDxj4jwOlrbdZQ+xv4sqbIMOpsZ38FReCtMFx1x/tTHfRgziNy+WFpJ0c0ilGoHp0I vLRuws1mjUPU/c32vCtOKH//9OMSQuHOH1XYXjWAFpIBpRUNZ3inGIDhdif8H/chErmP72ZMl/gKs hYy8VoTA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cqmhR-0006BJ-Ui; Wed, 22 Mar 2017 20:17:41 +0000 Received: from conuserg-07.nifty.com ([210.131.2.74]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cqmZN-0001Rc-EV for linux-mtd@lists.infradead.org; Wed, 22 Mar 2017 20:09:28 +0000 Received: from grover.sesame (FL1-111-169-71-157.osk.mesh.ad.jp [111.169.71.157]) (authenticated) by conuserg-07.nifty.com with ESMTP id v2MK895p029452; Thu, 23 Mar 2017 05:08:18 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com v2MK895p029452 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1490213299; bh=K5pAGjBBkTdjVGiDIObZj3HixB3zRpLnJkyh+7jwstc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xLw8QMext5OtFfSsG06PbpPH+tt4seaTGXMK+PCvkgxh20aEoXbBaB1twOYWd5Keb 8C1WlRCg3W8yf44MkNZKyfGNO0lj4xoVOYgxDu+8uPRv0Ie8JbUxXg9XCcyQVWFuru HU9pqGAOXMKuBpLrIuQIzo8RNsRKiiTEDgE4VfWitIgRJCxfGHBOBc+OmuhmPxfbJE 4Nl0+ajNDdOsOqv5ST2PYMgXNarsnmoofh8Arokwy06E/SQjBhhKl9nTnKJG0t9rS7 Yo5j2sXa6+JWPi4ed17rcE4QaQf9T7SB+43MPtog6cC9JynzEB1LcbmG3JWnW0Tf7v 3OygnrAJHZ9Mw== X-Nifty-SrcIP: [111.169.71.157] From: Masahiro Yamada To: linux-mtd@lists.infradead.org Subject: [RESEND PATCH v2 01/53] mtd: nand: allow to set only one of ECC size and ECC strength from DT Date: Thu, 23 Mar 2017 05:07:00 +0900 Message-Id: <1490213273-8571-2-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1490213273-8571-1-git-send-email-yamada.masahiro@socionext.com> References: <1490213273-8571-1-git-send-email-yamada.masahiro@socionext.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170322_130922_052283_280C8999 X-CRM114-Status: GOOD ( 10.35 ) X-Spam-Score: -1.2 (-) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-1.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.7 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: laurent.monat@idquantique.com, Boris Brezillon , thorsten.christiansson@idquantique.com, Richard Weinberger , Marek Vasut , Masahiro Yamada , Artem Bityutskiy , Cyrille Pitchen , linux-kernel@vger.kernel.org, Dinh Nguyen , Masami Hiramatsu , Chuanxiao Dong , Jassi Brar , Brian Norris , Enrico Jorns , David Woodhouse , Graham Moore MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+patch=linaro.org@lists.infradead.org Currently, it is valid to specify both "nand-ecc-step-size" and "nand-ecc-strength", but not allowed to set only one of them. This requirement has a conflict with "nand-ecc-maximize"; this flag is used when you want the driver to choose the best ECC strength. If "nand-ecc-maximize" is set, "nand-ecc-strength" is very likely to be unset. It would be possible to make the if-conditional more complex by adding the check for the NAND_ECC_MAXIMIZE flag, but I chose to drop the check entirely. I thought of the situation where the hardware has a fixed ECC step size (so it can be hard-coded in the driver), whereas the ECC strength is configurable by software. In that case, we may want to only set "nand-ecc-strength" (or "nand-ecc-maximize") in DT. Signed-off-by: Masahiro Yamada --- The Denali NAND is the case. The ecc.size is fixed when the RTL is delivered, while the driver can choose ecc.strength from some supported values. For Intel and Altera, available ecc.strength are 8, 15. For Socionext UniPhier, available ecc.strength are 8, 16, 24. Changes in v2: None drivers/mtd/nand/nand_base.c | 6 ------ 1 file changed, 6 deletions(-) -- 2.7.4 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/ diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c index b0524f8..a3c0f47 100644 --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c @@ -4333,12 +4333,6 @@ static int nand_dt_init(struct nand_chip *chip) ecc_strength = of_get_nand_ecc_strength(dn); ecc_step = of_get_nand_ecc_step_size(dn); - if ((ecc_step >= 0 && !(ecc_strength >= 0)) || - (!(ecc_step >= 0) && ecc_strength >= 0)) { - pr_err("must set both strength and step size in DT\n"); - return -EINVAL; - } - if (ecc_mode >= 0) chip->ecc.mode = ecc_mode; From patchwork Wed Mar 22 20:07:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 95838 Delivered-To: patch@linaro.org Received: by 10.140.89.233 with SMTP id v96csp414971qgd; Wed, 22 Mar 2017 13:16:40 -0700 (PDT) X-Received: by 10.98.156.203 with SMTP id u72mr46945155pfk.127.1490213800350; Wed, 22 Mar 2017 13:16:40 -0700 (PDT) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [65.50.211.133]) by mx.google.com with ESMTPS id a1si2997483pln.158.2017.03.22.13.16.40 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Mar 2017 13:16:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 65.50.211.133 as permitted sender) client-ip=65.50.211.133; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org; dkim=neutral (body hash did not verify) header.i=@nifty.com; spf=pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 65.50.211.133 as permitted sender) smtp.mailfrom=linux-mtd-bounces+patch=linaro.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=EGMOIJ9UaHISLHpncgeU+6pRUTGr/+gUitkdInJ6Gno=; b=YdsV49Z9UbIOenCgi5zVfCn5SO +E19MuEemISccn2pJdIPJUECq0ifYhA6sDNeYOsnNsxjAlZpKOts97zklneFwmxwJzVZHamPDeyFh r8E8Q7fB56oR0vEyjLltxYgupLz4/pecLZQyTpvV/0TMcOvgagYp+g+MuP/y7hKsjdclIA38s8FLN zuFb6Bp+EBH9rNCbmvtdCjcQ3FmGemXQdJ8oYYLLH+thC/QWw45ArLoZeBJ/03+jV10bzoktkP0pX x/V1SewUsVntJo6wuynnw5dptVBAdV5wOnXZNoqDzxJkKBHmfkgOYSIb9x1h+dmP1tOIEb6FJRSzP 21T02IwA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cqmgL-0004d1-Fo; Wed, 22 Mar 2017 20:16:33 +0000 Received: from conuserg-07.nifty.com ([210.131.2.74]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cqmZN-0001Re-EZ for linux-mtd@lists.infradead.org; Wed, 22 Mar 2017 20:09:23 +0000 Received: from grover.sesame (FL1-111-169-71-157.osk.mesh.ad.jp [111.169.71.157]) (authenticated) by conuserg-07.nifty.com with ESMTP id v2MK895q029452; Thu, 23 Mar 2017 05:08:20 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com v2MK895q029452 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1490213301; bh=aC+G4L1ivWCzubp/gZ1RMNCmminZYxtmKyRD5jPgu2I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mmalt24Fjb480UsPXqt6kUqfpafG6YJjTU+7zbXyYqmlmxuLgrh1idfPfr+hAD3W0 7ddTifvvm6Ac84EN7rgA68udOm0ceqMxWHMxkEJWa9W5hv7U5ILWV1t6y+GSofpACt 6uTn66Q4X7oCS83wgoGKOp/wp6rvd7HwrDaF0iWMGGLE7UCkmByy6FN3DXZgFnvfB8 Wr/KRm3TsJ3W5oHVjkbghTJak8qX+BCbd8dzPJ8a+SS6ENtck7hHPsRlgWe9y99yHG QYgm2olgWS2LyDNzRqfy6WbCTzvCkC6lSs1MuwEpXm/OiPEYBlazhsnLo2EAIWKs5c acBzS2ccD52uA== X-Nifty-SrcIP: [111.169.71.157] From: Masahiro Yamada To: linux-mtd@lists.infradead.org Subject: [RESEND PATCH v2 02/53] mtd: nand: use read_oob() instead of cmdfunc() for bad block check Date: Thu, 23 Mar 2017 05:07:01 +0900 Message-Id: <1490213273-8571-3-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1490213273-8571-1-git-send-email-yamada.masahiro@socionext.com> References: <1490213273-8571-1-git-send-email-yamada.masahiro@socionext.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170322_130921_934238_66AF347E X-CRM114-Status: GOOD ( 12.91 ) X-Spam-Score: -1.2 (-) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-1.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.7 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: laurent.monat@idquantique.com, Boris Brezillon , thorsten.christiansson@idquantique.com, Richard Weinberger , Marek Vasut , Masahiro Yamada , Artem Bityutskiy , Cyrille Pitchen , linux-kernel@vger.kernel.org, Dinh Nguyen , Masami Hiramatsu , Chuanxiao Dong , Jassi Brar , Brian Norris , Enrico Jorns , David Woodhouse , Graham Moore MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+patch=linaro.org@lists.infradead.org The nand_default_block_markbad() and scan_block_fast() use high level APIs to get access to the BBM. On the other hand, nand_block_bad (the default implementation of ->block_bad) calls the lower level ->cmdfunc hook. This prevents drivers from using ->ecc.read_oob() even if optimized read operation is implemented. Besides, some NAND controllers may protect the BBM with ECC. Signed-off-by: Masahiro Yamada --- Changes in v2: - Error out immediately if the first page access fails - Use for() {} instead of do {} while() - Update git-log drivers/mtd/nand/nand_base.c | 34 +++++++++++++--------------------- 1 file changed, 13 insertions(+), 21 deletions(-) -- 2.7.4 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/ diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c index a3c0f47..807398d 100644 --- a/drivers/mtd/nand/nand_base.c +++ b/drivers/mtd/nand/nand_base.c @@ -354,40 +354,32 @@ static void nand_read_buf16(struct mtd_info *mtd, uint8_t *buf, int len) */ static int nand_block_bad(struct mtd_info *mtd, loff_t ofs) { - int page, res = 0, i = 0; + int page, page_end, res; struct nand_chip *chip = mtd_to_nand(mtd); - u16 bad; + u8 bad; if (chip->bbt_options & NAND_BBT_SCANLASTPAGE) ofs += mtd->erasesize - mtd->writesize; page = (int)(ofs >> chip->page_shift) & chip->pagemask; + page_end = page + (chip->bbt_options & NAND_BBT_SCAN2NDPAGE ? 2 : 1); - do { - if (chip->options & NAND_BUSWIDTH_16) { - chip->cmdfunc(mtd, NAND_CMD_READOOB, - chip->badblockpos & 0xFE, page); - bad = cpu_to_le16(chip->read_word(mtd)); - if (chip->badblockpos & 0x1) - bad >>= 8; - else - bad &= 0xFF; - } else { - chip->cmdfunc(mtd, NAND_CMD_READOOB, chip->badblockpos, - page); - bad = chip->read_byte(mtd); - } + for (; page < page_end; page++) { + res = chip->ecc.read_oob(mtd, chip, page); + if (res) + return res; + + bad = chip->oob_poi[chip->badblockpos]; if (likely(chip->badblockbits == 8)) res = bad != 0xFF; else res = hweight8(bad) < chip->badblockbits; - ofs += mtd->writesize; - page = (int)(ofs >> chip->page_shift) & chip->pagemask; - i++; - } while (!res && i < 2 && (chip->bbt_options & NAND_BBT_SCAN2NDPAGE)); + if (res) + return res; + } - return res; + return 0; } /** From patchwork Wed Mar 22 20:07:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 95842 Delivered-To: patch@linaro.org Received: by 10.140.89.233 with SMTP id v96csp415171qgd; Wed, 22 Mar 2017 13:17:12 -0700 (PDT) X-Received: by 10.99.112.18 with SMTP id l18mr29374524pgc.142.1490213832109; Wed, 22 Mar 2017 13:17:12 -0700 (PDT) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [65.50.211.133]) by mx.google.com with ESMTPS id f24si2139680pfj.22.2017.03.22.13.17.11 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Mar 2017 13:17:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 65.50.211.133 as permitted sender) client-ip=65.50.211.133; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org; dkim=neutral (body hash did not verify) header.i=@nifty.com; spf=pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 65.50.211.133 as permitted sender) smtp.mailfrom=linux-mtd-bounces+patch=linaro.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=hifJ66O6o3bJsC2wyKTzaYyKMmuSU05XsZaI3M5W+EE=; b=d6QxpazYEpQNu4Vo5aRawrBEEF eiSBug/hrZKlgKvfE4ZDKdOaNV0+ek5DmELP1kjgybdSkyulY18HlnBLDSnauj57GOjBEdyg1D9do ZpWw5el8egWPIUBicIb3lvqLVyNT6bz32bQmqG4BeFkl9qs42IP5THXmAHuvAYZers8k6/F8CHI10 crUWoG3RNWZbbNuCNjpwdxBxvhab8/V+ACa9AIYJqXO4dhGH+HhiZOy+J2AkkdB1+4+j1XBMjoVNO o5eqisXf85Nz/m8xQlGxNJ7yQgLMCS4pbBk50rhL+zVkLG26MnF6Q0wyTcc1ICKvSZGa3N9CI8/r+ pHyB4kiA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cqmgr-0005QS-Sk; Wed, 22 Mar 2017 20:17:05 +0000 Received: from conuserg-07.nifty.com ([210.131.2.74]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cqmZN-0001Rd-EX for linux-mtd@lists.infradead.org; Wed, 22 Mar 2017 20:09:25 +0000 Received: from grover.sesame (FL1-111-169-71-157.osk.mesh.ad.jp [111.169.71.157]) (authenticated) by conuserg-07.nifty.com with ESMTP id v2MK895s029452; Thu, 23 Mar 2017 05:08:22 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com v2MK895s029452 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1490213303; bh=kVnKMF1bU+yPNN1ErYOgKoEpFhCR98uosgBtITbRHQ8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=npgWHfWmCdeDH4SOORymyJRBKl1+SpE5z9fW3zhPcIlKQFTw/kiDlFWvHDrI+6FiM TgLf3v3fODtq07mixykfqLbBOJYqJgmHfG2tLKvFirjJTACJuARbchgwDX/FaeBG5a jEziMiqen79McpNw3wQD6yIJW4KW+zbNoi9d4kEVOwe5/Zn1/8+5R6Jle0cQgcbMnT QBjCyCPUvgw7b8NymTqyhCnjBHHNCUoa8KrRQQ8wYDZ7z8DCKMQ34UvawJwIUmz/ed EJ7P/3QqFpJSYisKWLCL/AfblqQkqPVHgPBenKk1WVYGNlaBs+ZDq1mKoW3cTaObav MtCJo8KhC2czw== X-Nifty-SrcIP: [111.169.71.157] From: Masahiro Yamada To: linux-mtd@lists.infradead.org Subject: [RESEND PATCH v2 04/53] mtd: nand: denali: remove redundant define of BANK(x) Date: Thu, 23 Mar 2017 05:07:03 +0900 Message-Id: <1490213273-8571-5-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1490213273-8571-1-git-send-email-yamada.masahiro@socionext.com> References: <1490213273-8571-1-git-send-email-yamada.masahiro@socionext.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170322_130921_955622_065472DA X-CRM114-Status: UNSURE ( 7.10 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -1.2 (-) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-1.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.7 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: laurent.monat@idquantique.com, Boris Brezillon , thorsten.christiansson@idquantique.com, Richard Weinberger , Marek Vasut , Masahiro Yamada , Artem Bityutskiy , Cyrille Pitchen , linux-kernel@vger.kernel.org, Dinh Nguyen , Masami Hiramatsu , Chuanxiao Dong , Jassi Brar , Brian Norris , Enrico Jorns , David Woodhouse , Graham Moore MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+patch=linaro.org@lists.infradead.org This macro is defined twice in denali.c (around line 98 and line 651), so remove the second one. Signed-off-by: Masahiro Yamada --- Changes in v2: None drivers/mtd/nand/denali.c | 1 - 1 file changed, 1 deletion(-) -- 2.7.4 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/ diff --git a/drivers/mtd/nand/denali.c b/drivers/mtd/nand/denali.c index f993e13..c9806e6 100644 --- a/drivers/mtd/nand/denali.c +++ b/drivers/mtd/nand/denali.c @@ -648,7 +648,6 @@ static irqreturn_t denali_isr(int irq, void *dev_id) spin_unlock(&denali->irq_lock); return result; } -#define BANK(x) ((x) << 24) static uint32_t wait_for_irq(struct denali_nand_info *denali, uint32_t irq_mask) { From patchwork Wed Mar 22 20:07:07 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 95844 Delivered-To: patch@linaro.org Received: by 10.140.89.233 with SMTP id v96csp415317qgd; Wed, 22 Mar 2017 13:17:35 -0700 (PDT) X-Received: by 10.98.7.86 with SMTP id b83mr47297693pfd.66.1490213855409; Wed, 22 Mar 2017 13:17:35 -0700 (PDT) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [65.50.211.133]) by mx.google.com with ESMTPS id z15si2126645pfg.211.2017.03.22.13.17.35 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Mar 2017 13:17:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 65.50.211.133 as permitted sender) client-ip=65.50.211.133; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org; dkim=neutral (body hash did not verify) header.i=@nifty.com; spf=pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 65.50.211.133 as permitted sender) smtp.mailfrom=linux-mtd-bounces+patch=linaro.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=bcSgOa2CcWbrjZKikfB2Z0oCwJwk+hawlCoWVyoa3Ys=; b=F0wMPIOAo5Mj+JIpeQJV2UYU4p djIQd7QsA3PcV9wB0UkIZcUYO2rytYbbR5UFU5LxrZ1rynyKa6T5nW4vr+UIqZ5AVhzOhkFQt4px9 E0UwWvfhKTPndtX/WCxAkezm52a/tmedDW2lrIfa/mLbcM+aVFFOfGEQDczPSdpVZAV4svnjfrBi1 kwVFRiIkEUQXnWNq0G1OxNdDWnLOoWGjT2SWtou2hi8Z3Sp7tASltX2Gqe2p+0jhqd7iNs/V4tyKK 0WP5Ud4rSl2OOp2JAl7xOLQgQIfjVnUrJxfvUtpFndCwXi0W3+G/4ATmTg4XljGdY2exQ07mrGH6+ kH8FS+Mg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cqmhG-0005wF-0L; Wed, 22 Mar 2017 20:17:30 +0000 Received: from conuserg-07.nifty.com ([210.131.2.74]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cqmZN-0001Rg-Ea for linux-mtd@lists.infradead.org; Wed, 22 Mar 2017 20:09:26 +0000 Received: from grover.sesame (FL1-111-169-71-157.osk.mesh.ad.jp [111.169.71.157]) (authenticated) by conuserg-07.nifty.com with ESMTP id v2MK895w029452; Thu, 23 Mar 2017 05:08:28 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com v2MK895w029452 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1490213309; bh=jriKrUNelDflGN2Y8S4wdpmJl8Y2pz1fU4VdZEfL4c0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Z++fvrWf0TADNP3ZtDyjBed8hRAtFuJx48AOlA0WlYq4hJkKIp0JH2kZvXvKoNVF+ fV6awcUX/sNW4D9ozGUJwG0ryz8Q7orE0Jf9LVtjtFv9WC2IqWJ50odGJ8zWNXVm0b LNcCWoEjPcEuuc0NV+/qlDjwQjwJik8321XeiKp8J9Sj3Ufm+IcODR13EFe2M55Q6O YVW1I8rrtKLo6NOpm3stXRY8KI4d5T5qu3P08iYAyNsjZvDCdsOcXjll5+18cYI6XS 4XGnIL6+UyMUeyavwWy+d2wWRsHg0HaBOBVTW6JFflwvgh2HlR+S+jnvhXBZdAsTuc 2Yq1q1t2DveXg== X-Nifty-SrcIP: [111.169.71.157] From: Masahiro Yamada To: linux-mtd@lists.infradead.org Subject: [RESEND PATCH v2 08/53] mtd: nand: denali: introduce capability flag Date: Thu, 23 Mar 2017 05:07:07 +0900 Message-Id: <1490213273-8571-9-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1490213273-8571-1-git-send-email-yamada.masahiro@socionext.com> References: <1490213273-8571-1-git-send-email-yamada.masahiro@socionext.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170322_130921_951809_8813697F X-CRM114-Status: GOOD ( 13.13 ) X-Spam-Score: -1.2 (-) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-1.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.7 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: laurent.monat@idquantique.com, Boris Brezillon , thorsten.christiansson@idquantique.com, Richard Weinberger , Marek Vasut , Masahiro Yamada , Artem Bityutskiy , Cyrille Pitchen , linux-kernel@vger.kernel.org, Dinh Nguyen , Masami Hiramatsu , Chuanxiao Dong , Jassi Brar , Brian Norris , Enrico Jorns , David Woodhouse , Graham Moore MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+patch=linaro.org@lists.infradead.org The Denali NAND controller IP has various customizable features. SoC vendors can choose desired functions when a delivery RTL is created. It means there are several variants for this IP. For example, the Intel version is equipped with 32bit DMA, whereas the IP for UniPhier SoC family with 64bit DMA. This driver was originally written for some Intel platforms with Intel specific things hard-coded. What is worse, the revision register of this IP does not work to distinguish such features. We need to do something to make the driver available for other SoCs. Let's introduce a caps member to the denali_nand_info structure to switch on/off various features. Also, add struct denali_dt_data to store the capability associated with compatible string. Boris suggested this approach in discussion [1] instead of a new DT property for every feature. [1] https://lkml.org/lkml/2016/3/29/142 Signed-off-by: Masahiro Yamada --- Changes in v2: None drivers/mtd/nand/denali.h | 1 + drivers/mtd/nand/denali_dt.c | 18 +++++++++--------- 2 files changed, 10 insertions(+), 9 deletions(-) -- 2.7.4 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/ diff --git a/drivers/mtd/nand/denali.h b/drivers/mtd/nand/denali.h index 8df2285..eed001d 100644 --- a/drivers/mtd/nand/denali.h +++ b/drivers/mtd/nand/denali.h @@ -338,6 +338,7 @@ struct denali_nand_info { uint32_t devnum; /* represent how many nands connected */ uint32_t bbtskipbytes; uint32_t max_banks; + unsigned int caps; }; extern int denali_init(struct denali_nand_info *denali); diff --git a/drivers/mtd/nand/denali_dt.c b/drivers/mtd/nand/denali_dt.c index 5607fcd..293ddb8 100644 --- a/drivers/mtd/nand/denali_dt.c +++ b/drivers/mtd/nand/denali_dt.c @@ -29,6 +29,10 @@ struct denali_dt { struct clk *clk; }; +struct denali_dt_data { + unsigned int caps; +}; + static const struct of_device_id denali_nand_dt_ids[] = { { .compatible = "denali,denali-nand-dt" }, { /* sentinel */ } @@ -42,23 +46,19 @@ static int denali_dt_probe(struct platform_device *ofdev) { struct resource *denali_reg, *nand_data; struct denali_dt *dt; + const struct denali_dt_data *data; struct denali_nand_info *denali; int ret; - const struct of_device_id *of_id; - - of_id = of_match_device(denali_nand_dt_ids, &ofdev->dev); - if (of_id) { - ofdev->id_entry = of_id->data; - } else { - pr_err("Failed to find the right device id.\n"); - return -ENOMEM; - } dt = devm_kzalloc(&ofdev->dev, sizeof(*dt), GFP_KERNEL); if (!dt) return -ENOMEM; denali = &dt->denali; + data = of_device_get_match_data(&ofdev->dev); + if (data) + denali->caps = data->caps; + denali->platform = DT; denali->dev = &ofdev->dev; denali->irq = platform_get_irq(ofdev, 0); From patchwork Wed Mar 22 20:07:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 95849 Delivered-To: patch@linaro.org Received: by 10.140.89.233 with SMTP id v96csp415652qgd; Wed, 22 Mar 2017 13:18:26 -0700 (PDT) X-Received: by 10.98.33.155 with SMTP id o27mr27154453pfj.5.1490213905942; Wed, 22 Mar 2017 13:18:25 -0700 (PDT) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [65.50.211.133]) by mx.google.com with ESMTPS id x5si3013396pls.60.2017.03.22.13.18.25 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Mar 2017 13:18:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 65.50.211.133 as permitted sender) client-ip=65.50.211.133; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org; dkim=neutral (body hash did not verify) header.i=@nifty.com; spf=pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 65.50.211.133 as permitted sender) smtp.mailfrom=linux-mtd-bounces+patch=linaro.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=cFiKhxZcc3DkqABmDBl72SEMaNolQgZ3BZauZ6mJuTU=; b=byecvXqv5czPLfn4Xyljpwwm7p B+HCMDymkzRRBv7xZ6lMOSD51hpMkiNGD63ECTc+iWCboTWmWRjBSfrnG0AtmhJYBLsS4pPuvKhFF YnLmzwRUpInra3nejJe6aK9jIXeNunLw+6cD0V5AV9dBRHivC2rpcMQDXcrqIA+o5X+53xNdE7pmt mtbYx/9ANmRNinvmizfNpFKnYca05+kWS/Ap4IzjjQ2UFhDi/vRWtBPQF5VTzw8c9DIHwgSGvSmjm +cmyADxMl2FsPIqnoh2KidYlCUUyxp0wmfjVTiEGtpl//TSglRMrm8zTZrt3xE2detXtv595+FI+G 8eYzlATg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cqmi4-00073J-7e; Wed, 22 Mar 2017 20:18:20 +0000 Received: from conuserg-07.nifty.com ([210.131.2.74]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cqmZV-0001SR-3c for linux-mtd@lists.infradead.org; Wed, 22 Mar 2017 20:09:30 +0000 Received: from grover.sesame (FL1-111-169-71-157.osk.mesh.ad.jp [111.169.71.157]) (authenticated) by conuserg-07.nifty.com with ESMTP id v2MK895x029452; Thu, 23 Mar 2017 05:08:29 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com v2MK895x029452 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1490213310; bh=6+m75OZlPBI+hfQ0sp61KS0/EN+hKn2K4d9pI5zhNHo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YvbQG0/q6rjhxybtExC9GFc2raXs00Uz7q3DJd+AEhuLr210KKa8dzHQyMQbXUyl4 w6gUGTeETZ0lGWFFFvnpOGH6aHRBAVFTwa2HdbuOuz6PC6XKUAz7UfZBaIZT8TgU1I Hkh5x8s7tAENmZsf4zavRLzQXNx3/HbfuBnp8ejG4FisKjiM6yGkZ2Ymi/AJAyvpTV 3pUZ3x9EED8M8/U+RVxYl7KtpFITmDzFYYLd85xp/xZvZPmgsd2sC10F6eznNBkbF4 l4mfibajRzddhrDiDpa+h2ukN9i7HvH2BnfqHPJ5/0g0w6hAXGfLTKdOAifElhqh5D JtjhmbgFTRkEQ== X-Nifty-SrcIP: [111.169.71.157] From: Masahiro Yamada To: linux-mtd@lists.infradead.org Subject: [RESEND PATCH v2 09/53] mtd: nand: denali: use int where no reason to use fixed width variable Date: Thu, 23 Mar 2017 05:07:08 +0900 Message-Id: <1490213273-8571-10-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1490213273-8571-1-git-send-email-yamada.masahiro@socionext.com> References: <1490213273-8571-1-git-send-email-yamada.masahiro@socionext.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170322_130929_449169_27EE2985 X-CRM114-Status: UNSURE ( 8.94 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -1.2 (-) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-1.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.7 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: laurent.monat@idquantique.com, Boris Brezillon , thorsten.christiansson@idquantique.com, Richard Weinberger , Marek Vasut , Masahiro Yamada , Artem Bityutskiy , Cyrille Pitchen , linux-kernel@vger.kernel.org, Dinh Nguyen , Masami Hiramatsu , Chuanxiao Dong , Jassi Brar , Brian Norris , Enrico Jorns , David Woodhouse , Graham Moore MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+patch=linaro.org@lists.infradead.org The page number is generally stored in an integer type variable. The uint16_t does not have enough width. I see no reason to use uint32_t for other members, either. Just use int. Signed-off-by: Masahiro Yamada --- Changes in v2: None drivers/mtd/nand/denali.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) -- 2.7.4 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/ diff --git a/drivers/mtd/nand/denali.h b/drivers/mtd/nand/denali.h index eed001d..7b2d785 100644 --- a/drivers/mtd/nand/denali.h +++ b/drivers/mtd/nand/denali.h @@ -325,7 +325,7 @@ struct denali_nand_info { struct nand_buf buf; struct device *dev; int total_used_banks; - uint16_t page; + int page; void __iomem *flash_reg; /* Register Interface */ void __iomem *flash_mem; /* Host Data/Command Interface */ @@ -335,9 +335,9 @@ struct denali_nand_info { uint32_t irq_status; int irq; - uint32_t devnum; /* represent how many nands connected */ - uint32_t bbtskipbytes; - uint32_t max_banks; + int devnum; /* represent how many nands connected */ + int bbtskipbytes; + int max_banks; unsigned int caps; }; From patchwork Wed Mar 22 20:07:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 95851 Delivered-To: patch@linaro.org Received: by 10.140.89.233 with SMTP id v96csp415815qgd; Wed, 22 Mar 2017 13:18:49 -0700 (PDT) X-Received: by 10.99.2.139 with SMTP id 133mr46210245pgc.168.1490213929460; Wed, 22 Mar 2017 13:18:49 -0700 (PDT) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [65.50.211.133]) by mx.google.com with ESMTPS id b10si2971655pgf.419.2017.03.22.13.18.49 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Mar 2017 13:18:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 65.50.211.133 as permitted sender) client-ip=65.50.211.133; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org; dkim=neutral (body hash did not verify) header.i=@nifty.com; spf=pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 65.50.211.133 as permitted sender) smtp.mailfrom=linux-mtd-bounces+patch=linaro.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=0WLD1+r4RZ521KvolW3fI8ShuxriOCenDc0saWZ5WIA=; b=SK36ha7Rj6Ca7z9oHQuDEgA8gm REd6XpzGAQ9ZwQ6pZY8WCyZ2ld6qF+qS9qt/NMAABnUmD097hZN51ubFNBuMc9ACPs7D5/lHjinwR GWkKqk1MHVnah4grUl5j/TE7SMJ2DxzA/CvJ+ZVay72CgQZ9FR2z2Bx8I217TiBOB4+J7ELAFu6e0 utmEMOmoO4O5xjIgRl/UYULzA0XpGPR8f9PfFDf6HsNXoZXeCwwi8uR05XC9fWr2DR6XAOjah6Yn+ tlyvWGBLxMOewuAUo+OrIkOoAg4hsGdtQtMG2q7+eGpjjqM+Eas4ZEeAeT7MPoTH+SGHNVBrKL/nH 0Ip2s+ag==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cqmiQ-0007YX-57; Wed, 22 Mar 2017 20:18:42 +0000 Received: from conuserg-07.nifty.com ([210.131.2.74]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cqmZV-0001SP-3j for linux-mtd@lists.infradead.org; Wed, 22 Mar 2017 20:09:33 +0000 Received: from grover.sesame (FL1-111-169-71-157.osk.mesh.ad.jp [111.169.71.157]) (authenticated) by conuserg-07.nifty.com with ESMTP id v2MK8966029452; Thu, 23 Mar 2017 05:08:38 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com v2MK8966029452 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1490213319; bh=a3rLts1afFC85LO0vi5BLOJST+6mgDYfvjfvZDZ00Pc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1RlJoF0uLJw//lCCZQ0o1V3WvL+rZTu/ZU682wTUamTGSfPA4dzyfGqrBEQdfqub5 oiOigh4rtonNCjoZPn6HzupxxavKW4kE9Kbsih+0FJ5OUnfah9ZVrosUPqH1dX39Wh Vl5pJfNKWNW4BiKMBB2Ms+37VF0c1C1/aH7nPKFA7ayR4FYYdyrQM5HGgswrsSZ3mn S8J+n+PG7EapoIlABbGnjpX5gVEFHysQMgBEHwow1YNrw2vZplBq4LVb74wQJqx+Tz I4kNYnf1KCjOdybJC1XTXRl++R0G62szdPs36sUsiM7nHgWlq/tOPyN1mvcBqoXebf b9ILoWla9mO2g== X-Nifty-SrcIP: [111.169.71.157] From: Masahiro Yamada To: linux-mtd@lists.infradead.org Subject: [RESEND PATCH v2 16/53] mtd: nand: denali_dt: use pdev instead of ofdev for platform_device Date: Thu, 23 Mar 2017 05:07:15 +0900 Message-Id: <1490213273-8571-17-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1490213273-8571-1-git-send-email-yamada.masahiro@socionext.com> References: <1490213273-8571-1-git-send-email-yamada.masahiro@socionext.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170322_130929_465172_62A61868 X-CRM114-Status: GOOD ( 10.82 ) X-Spam-Score: -1.2 (-) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-1.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.7 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: laurent.monat@idquantique.com, Boris Brezillon , thorsten.christiansson@idquantique.com, Richard Weinberger , Marek Vasut , Masahiro Yamada , Artem Bityutskiy , Cyrille Pitchen , linux-kernel@vger.kernel.org, Dinh Nguyen , Masami Hiramatsu , Chuanxiao Dong , Jassi Brar , Brian Norris , Enrico Jorns , David Woodhouse , Graham Moore MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+patch=linaro.org@lists.infradead.org "pdev" is much more often used to point a platform_device, so this will help the driver code look consistent across the kernel. While we are here, fix "line over 80 characters" coding style violations. Signed-off-by: Masahiro Yamada --- Changes in v2: None drivers/mtd/nand/denali_dt.c | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) -- 2.7.4 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/ diff --git a/drivers/mtd/nand/denali_dt.c b/drivers/mtd/nand/denali_dt.c index b8a8284..ada3863 100644 --- a/drivers/mtd/nand/denali_dt.c +++ b/drivers/mtd/nand/denali_dt.c @@ -46,7 +46,7 @@ static const struct of_device_id denali_nand_dt_ids[] = { }; MODULE_DEVICE_TABLE(of, denali_nand_dt_ids); -static int denali_dt_probe(struct platform_device *ofdev) +static int denali_dt_probe(struct platform_device *pdev) { struct resource *denali_reg, *nand_data; struct denali_dt *dt; @@ -54,36 +54,38 @@ static int denali_dt_probe(struct platform_device *ofdev) struct denali_nand_info *denali; int ret; - dt = devm_kzalloc(&ofdev->dev, sizeof(*dt), GFP_KERNEL); + dt = devm_kzalloc(&pdev->dev, sizeof(*dt), GFP_KERNEL); if (!dt) return -ENOMEM; denali = &dt->denali; - data = of_device_get_match_data(&ofdev->dev); + data = of_device_get_match_data(&pdev->dev); if (data) denali->caps = data->caps; denali->platform = DT; - denali->dev = &ofdev->dev; - denali->irq = platform_get_irq(ofdev, 0); + denali->dev = &pdev->dev; + denali->irq = platform_get_irq(pdev, 0); if (denali->irq < 0) { - dev_err(&ofdev->dev, "no irq defined\n"); + dev_err(&pdev->dev, "no irq defined\n"); return denali->irq; } - denali_reg = platform_get_resource_byname(ofdev, IORESOURCE_MEM, "denali_reg"); - denali->flash_reg = devm_ioremap_resource(&ofdev->dev, denali_reg); + denali_reg = platform_get_resource_byname(pdev, IORESOURCE_MEM, + "denali_reg"); + denali->flash_reg = devm_ioremap_resource(&pdev->dev, denali_reg); if (IS_ERR(denali->flash_reg)) return PTR_ERR(denali->flash_reg); - nand_data = platform_get_resource_byname(ofdev, IORESOURCE_MEM, "nand_data"); - denali->flash_mem = devm_ioremap_resource(&ofdev->dev, nand_data); + nand_data = platform_get_resource_byname(pdev, IORESOURCE_MEM, + "nand_data"); + denali->flash_mem = devm_ioremap_resource(&pdev->dev, nand_data); if (IS_ERR(denali->flash_mem)) return PTR_ERR(denali->flash_mem); - dt->clk = devm_clk_get(&ofdev->dev, NULL); + dt->clk = devm_clk_get(&pdev->dev, NULL); if (IS_ERR(dt->clk)) { - dev_err(&ofdev->dev, "no clk available\n"); + dev_err(&pdev->dev, "no clk available\n"); return PTR_ERR(dt->clk); } clk_prepare_enable(dt->clk); @@ -92,7 +94,7 @@ static int denali_dt_probe(struct platform_device *ofdev) if (ret) goto out_disable_clk; - platform_set_drvdata(ofdev, dt); + platform_set_drvdata(pdev, dt); return 0; out_disable_clk: @@ -101,9 +103,9 @@ static int denali_dt_probe(struct platform_device *ofdev) return ret; } -static int denali_dt_remove(struct platform_device *ofdev) +static int denali_dt_remove(struct platform_device *pdev) { - struct denali_dt *dt = platform_get_drvdata(ofdev); + struct denali_dt *dt = platform_get_drvdata(pdev); denali_remove(&dt->denali); clk_disable_unprepare(dt->clk); From patchwork Wed Mar 22 20:07:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 95848 Delivered-To: patch@linaro.org Received: by 10.140.89.233 with SMTP id v96csp415574qgd; Wed, 22 Mar 2017 13:18:13 -0700 (PDT) X-Received: by 10.99.110.138 with SMTP id j132mr44726428pgc.217.1490213893617; Wed, 22 Mar 2017 13:18:13 -0700 (PDT) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [65.50.211.133]) by mx.google.com with ESMTPS id s2si2138426pfe.85.2017.03.22.13.18.13 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Mar 2017 13:18:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 65.50.211.133 as permitted sender) client-ip=65.50.211.133; Authentication-Results: mx.google.com; dkim=pass header.i=@lists.infradead.org; dkim=neutral (body hash did not verify) header.i=@nifty.com; spf=pass (google.com: best guess record for domain of linux-mtd-bounces+patch=linaro.org@lists.infradead.org designates 65.50.211.133 as permitted sender) smtp.mailfrom=linux-mtd-bounces+patch=linaro.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=hI8ZoLDG2Qet5eqxBpKtyV2G12/DZ4kVMsmOD7Mx3nM=; b=T3pHjRgOQnJiD4+uwZt40ibOWi CnnFMMaTnniNFUpStNrLasoroFd39HDl0ANJxfZfhXtMO5FZrQ8P0jF9Ngum0E+6pFCcYG1kKkBTk aR7gind6w+kSbiYkHkaAoYJo02ADC4BsgQN4so0Fxx8wbhOWKqRNX8gWmEvBwouJ+LkRDE4m8LKMv vAxgjilMjmEXL420JNZQIqe0jdXu40+7bJGGred0p3eW4fJ+gJJZ75Qz0/pLMZuJEp9XxDQR6bJTc dN67A1J4D4MBsuSmH1zmU4MBAq9f5C6mVI4+ORhLvbMlYRZvbHfgtZjqBJQXcpDkbLbuGY5j7g5OO bVQqwlsw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cqmhr-0006mQ-LB; Wed, 22 Mar 2017 20:18:07 +0000 Received: from conuserg-07.nifty.com ([210.131.2.74]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cqmZV-0001SN-3i for linux-mtd@lists.infradead.org; Wed, 22 Mar 2017 20:09:30 +0000 Received: from grover.sesame (FL1-111-169-71-157.osk.mesh.ad.jp [111.169.71.157]) (authenticated) by conuserg-07.nifty.com with ESMTP id v2MK8969029452; Thu, 23 Mar 2017 05:08:42 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com v2MK8969029452 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1490213323; bh=rMa0lku6DEo0FOdbBMD5myFgjMBe4kX+PT3nhB+ETsY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EaVjpMFffzmeQ9FUAu09pR8XPqJVIyTPvdp4DETaAUlPpNGkNa9YFaVdnwRsYG0e0 Zk72yCfT98F1jLlbkU3YeprC1gsFSaN2N7WzePWp+lF22/D7aCHnM4CkKGuat57qzV /88NrjwtrN7w8NFN+SoBiSQcdmME6c1qX6yVrVO5MNkVbe4V3e0IWCHWdM0a90WsVl T/8roj9DN/2mGCX5mNKF+1QZU8ZNnCxpMPZGjmBQIzndUmsSh0Vl4ibE99xG3Tsk/n kWZXfHP0qkFPgLkY8Vbd+1KC8T8Mm5tB4neXkLfhfrPMLd4WHcjhMJFKazwniBEugM QuYlW3pMT6VJA== X-Nifty-SrcIP: [111.169.71.157] From: Masahiro Yamada To: linux-mtd@lists.infradead.org Subject: [RESEND PATCH v2 19/53] mtd: nand: denali: call nand_set_flash_node() to set DT node Date: Thu, 23 Mar 2017 05:07:18 +0900 Message-Id: <1490213273-8571-20-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1490213273-8571-1-git-send-email-yamada.masahiro@socionext.com> References: <1490213273-8571-1-git-send-email-yamada.masahiro@socionext.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170322_130929_482969_FFF9210F X-CRM114-Status: UNSURE ( 8.50 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -1.2 (-) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-1.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.7 SPF_SOFTFAIL SPF: sender does not match SPF record (softfail) -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: laurent.monat@idquantique.com, Boris Brezillon , thorsten.christiansson@idquantique.com, Richard Weinberger , Marek Vasut , Masahiro Yamada , Artem Bityutskiy , Cyrille Pitchen , linux-kernel@vger.kernel.org, Dinh Nguyen , Masami Hiramatsu , Chuanxiao Dong , Jassi Brar , Brian Norris , Enrico Jorns , David Woodhouse , Graham Moore MIME-Version: 1.0 Sender: "linux-mtd" Errors-To: linux-mtd-bounces+patch=linaro.org@lists.infradead.org This will allow nand_dt_init() to parse DT properties in the NAND controller device node. Signed-off-by: Masahiro Yamada --- Changes in v2: None drivers/mtd/nand/denali.c | 1 + 1 file changed, 1 insertion(+) -- 2.7.4 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/ diff --git a/drivers/mtd/nand/denali.c b/drivers/mtd/nand/denali.c index 24c35a6..3badb1d 100644 --- a/drivers/mtd/nand/denali.c +++ b/drivers/mtd/nand/denali.c @@ -1496,6 +1496,7 @@ int denali_init(struct denali_nand_info *denali) /* now that our ISR is registered, we can enable interrupts */ denali_set_intr_modes(denali, true); mtd->name = "denali-nand"; + nand_set_flash_node(chip, denali->dev->of_node); /* register the driver with the NAND core subsystem */ chip->select_chip = denali_select_chip;