Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp336999imu; Mon, 5 Nov 2018 01:32:35 -0800 (PST) X-Google-Smtp-Source: AJdET5caoLcf308P/luscWChPva6q2jqQgMqNysMvIPiFClo4a/pDQiRehSmSK2Dv9biLzJJYMrg X-Received: by 2002:a63:5026:: with SMTP id e38mr19504236pgb.123.1541410355063; Mon, 05 Nov 2018 01:32:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541410355; cv=none; d=google.com; s=arc-20160816; b=lweY4crn18TikgpafYfoarefJ4R+mwPgOHav80l6iLTsuu6k9sOyutszB8Ff9A6OEl EIQ09ngF+66QiL9SER5RH8PoPAKYNknG8aYlIJXPTaNiaYQVWGjRPUM/RCtakcU/0VfO kOH93ROHCfMMknQw31kDfAO3LyBPgcyOK6BfiLoBo8IIu9q8VW7oraZz7/p4g7ZK84Tr dMLi57vwbYy9PskfYLee3f2S3F1bNqY6veTI8FAJtgJOefWIYTK2iWHC47TSdmqy0vns wUF5+D6zFy84laisi4f/yKNdNLMpwlZ4jW12n5vN7akHavWQhqiQt77YpXqcXhom+ezo Tttw== 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=hrRIyT95WqTb1xxmUov74v5vBOSoNSXR8x7NBSAfZQY=; b=A/Ep2qftP+bAjqenFHiJzpaSJ+gAuDdvkJ1d6eWkHhG7XSYJ84cdVpAlgBDVQDg1gL wCIXuNoAvba5EbyG8i+j2zNkWg55BUIBHI9dWr2+95kgd32M2rHHljsoqCSQeM3xorNO qfuJXQdZBifk/PMPe+lcA+vW94m7yLXH2kN00CJO9q36qpBGSJrQqgmLECFqTDTqmH3x e7mqoAj/nqJFvVDHL9s5rX8qzAZQNOUiPgjsYjwXpWv8TXABSQyHRESntbIvUkOYAuqx ysnAl4HcpZ5HrqXbZbRICPtTWoPkvUh91f7YH2wDOO4EZoNmCEC7YeJDOFwcCC9NHgMU fgbA== 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 u184si29637976pgd.93.2018.11.05.01.32.18; Mon, 05 Nov 2018 01:32:34 -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 S1728404AbeKESum convert rfc822-to-8bit (ORCPT + 99 others); Mon, 5 Nov 2018 13:50:42 -0500 Received: from mail.bootlin.com ([62.4.15.54]:59078 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726586AbeKESum (ORCPT ); Mon, 5 Nov 2018 13:50:42 -0500 Received: by mail.bootlin.com (Postfix, from userid 110) id C54A4207CF; Mon, 5 Nov 2018 10:31:45 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT shortcircuit=ham autolearn=disabled version=3.4.0 Received: from xps13 (aaubervilliers-681-1-93-44.w90-88.abo.wanadoo.fr [90.88.34.44]) by mail.bootlin.com (Postfix) with ESMTPSA id 4FE71206A1; Mon, 5 Nov 2018 10:31:45 +0100 (CET) Date: Mon, 5 Nov 2018 10:31:44 +0100 From: Miquel Raynal To: Helmut Grohne Cc: Naga Sureshkumar Relli , , , , , , , , , , , , , , Subject: Re: [LINUX PATCH v12] mtd: rawnand: pl353: Add basic driver for arm pl353 smc nand interface Message-ID: <20181105103144.363ffc49@xps13> In-Reply-To: <20181105084040.xyxzkmcrlg7iyics@laureti-dev> References: <1533620414-3332-1-git-send-email-naga.sureshkumar.relli@xilinx.com> <20181105084040.xyxzkmcrlg7iyics@laureti-dev> Organization: Bootlin X-Mailer: Claws Mail 3.16.0 (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 Helmut, Helmut Grohne wrote on Mon, 5 Nov 2018 09:40:43 +0100: > On Tue, Aug 07, 2018 at 11:10:14AM +0530, Naga Sureshkumar Relli wrote: > > Add driver for arm pl353 static memory controller nand interface with > > HW ECC support. This controller is used in Xilinx Zynq SoC for > > interfacing the NAND flash memory. > > > > Signed-off-by: Naga Sureshkumar Relli > > --- > > Changes in v12: > > I attempted to apply this v12 together with the v11 of pl353-smc (which seems > to be the latest version) onto a vanilla v4.19 kernel tree. Application was > smooth and a build was without errors. During boot, my dmesg was spammed with > lots of repetitions of this: > > [ 5.816275] ------------[ cut here ]------------ > [ 5.820981] WARNING: CPU: 0 PID: 1 at .../linux/drivers/mtd/nand/raw/nand_base.c:2773 nand_subop_get_data_len+0x60/0xa4 > [ 5.836868] Modules linked in: > [ 5.836912] CPU: 0 PID: 1 Comm: swapper/0 Tainted: G W 4.19.0-dirty #3 > [ 5.836929] Hardware name: Xilinx Zynq Platform > [ 5.836943] Backtrace: > [ 5.836981] [] (dump_backtrace) from [] (show_stack+0x20/0x24) > [ 5.837004] r7:c062e618 r6:00000000 r5:600f0013 r4:c062e618 > [ 5.837027] [] (show_stack) from [] (dump_stack+0xac/0xd8) > [ 5.837055] [] (dump_stack) from [] (__warn+0x118/0x130) > [ 5.837079] r10:00000000 r9:c0270be8 r8:00000ad5 r7:c0550358 r6:00000009 r5:00000000 > [ 5.837097] r4:00000000 r3:de4c6000 > [ 5.837122] [] (__warn) from [] (warn_slowpath_null+0x50/0x58) > [ 5.837146] r9:de4c78c5 r8:da4d1010 r7:de4c78f8 r6:c0270be8 r5:00000ad5 r4:c0550358 > [ 5.837173] [] (warn_slowpath_null) from [] (nand_subop_get_data_len+0x60/0xa4) > [ 5.837192] r6:0000003c r5:00000003 r4:de4c7870 > [ 5.837217] [] (nand_subop_get_data_len) from [] (pl353_nand_exec_op_cmd+0x60/0x314) > [ 5.837238] r7:de4c78f8 r6:0000003c r5:de4c7870 r4:00000003 > [ 5.837262] [] (pl353_nand_exec_op_cmd) from [] (nand_op_parser_exec_op+0x484/0x4e8) > [ 5.837285] r10:00000002 r9:00000014 r8:de4c790c r7:00000004 r6:c0634260 r5:c052cc44 > [ 5.837301] r4:c0620bcc > [ 5.837325] [] (nand_op_parser_exec_op) from [] (pl353_nfc_exec_op+0x24/0x2c) > [ 5.837348] r10:de4c7a18 r9:00000080 r8:03463678 r7:89705f41 r6:36b4a597 r5:de4c78d0 > [ 5.837364] r4:da4d1010 > [ 5.837387] [] (pl353_nfc_exec_op) from [] (nand_erase_op+0x150/0x1f0) > [ 5.837411] [] (nand_erase_op) from [] (single_erase+0x28/0x2c) > [ 5.837434] r9:e08c1000 r8:00000006 r7:00000040 r6:00000001 r5:0001ff80 r4:da4d1010 > [ 5.837459] [] (single_erase) from [] (nand_erase_nand+0x1f8/0x3f8) > [ 5.837484] [] (nand_erase_nand) from [] (write_bbt+0x30c/0x748) > [ 5.837508] r10:00000006 r9:e08c1000 r8:00000006 r7:00000002 r6:da4d1010 r5:00000000 > [ 5.837524] r4:0ffc0000 > [ 5.837549] [] (write_bbt) from [] (nand_create_bbt+0x30c/0x6d0) > [ 5.837572] r10:c061fd2c r9:c061fce8 r8:00000000 r7:c061fd2c r6:00000000 r5:00000003 > [ 5.837587] r4:00000000 > [ 5.837614] [] (nand_create_bbt) from [] (nand_scan_with_ids+0x1248/0x1e74) > [ 5.837636] r10:c0620524 r9:00000004 r8:00000001 r7:00000004 r6:da4d1378 r5:00000001 > [ 5.837652] r4:da4d1010 > [ 5.837676] [] (nand_scan_with_ids) from [] (pl353_nand_probe+0x144/0x208) > [ 5.837699] r10:00000000 r9:c0620ae0 r8:c0633ba0 r7:00000000 r6:da4d8e10 r5:da4d8e00 > [ 5.837715] r4:da4d1010 > [ 5.837738] [] (pl353_nand_probe) from [] (platform_drv_probe+0x44/0x7c) > [ 5.837757] r6:c0e0205c r5:c0620ae0 r4:da4d8e10 > [ 5.837783] [] (platform_drv_probe) from [] (really_probe+0x27c/0x408) > [ 5.837801] r5:da4d8e10 r4:c0e02058 > [ 5.837827] [] (really_probe) from [] (driver_probe_device+0x138/0x198) > [ 5.837850] r10:00000000 r9:00000000 r8:c0e02014 r7:00000001 r6:de4c7c70 r5:c0620ae0 > [ 5.837865] r4:da4d8e10 > [ 5.837891] [] (driver_probe_device) from [] (__device_attach_driver+0xc8/0x144) > [ 5.837913] r9:00000000 r8:c0e02014 r6:de4c7c70 r5:da4d8e10 r4:c0620ae0 > [ 5.837938] [] (__device_attach_driver) from [] (bus_for_each_drv+0x70/0xa4) > [ 5.837958] r7:00000001 r6:c0251f0c r5:de4c7c70 r4:00000000 > [ 5.837982] [] (bus_for_each_drv) from [] (__device_attach+0xb0/0x11c) > [ 5.838001] r6:c061e8d0 r5:da4d8e44 r4:da4d8e10 > [ 5.838027] [] (__device_attach) from [] (device_initial_probe+0x1c/0x20) > [ 5.838047] r7:da4d8e10 r6:c061e8d0 r5:da4d8e10 r4:da4d8e18 > [ 5.838073] [] (device_initial_probe) from [] (bus_probe_device+0x98/0xa0) > [ 5.838097] [] (bus_probe_device) from [] (device_add+0x380/0x5dc) > [ 5.838117] r7:da4d8e10 r6:de595e00 r5:00000000 r4:da4d8e18 > [ 5.838142] [] (device_add) from [] (of_device_add+0x44/0x4c) > [ 5.838164] r10:c0563da4 r9:dfbf0a70 r8:dfbf0ac0 r7:00000000 r6:de595e00 r5:00000000 > [ 5.838180] r4:da4d8e00 > [ 5.838205] [] (of_device_add) from [] (of_platform_device_create_pdata+0xa0/0xd0) > [ 5.838229] [] (of_platform_device_create_pdata) from [] (of_platform_device_create+0x20/0x24) > [ 5.838252] r9:dfbf0a70 r8:dfbf0780 r7:c0470470 r6:ddfe9f50 r5:00000000 r4:de595e00 > [ 5.838280] [] (of_platform_device_create) from [] (pl353_smc_probe+0x1b0/0x244) > [ 5.838305] [] (pl353_smc_probe) from [] (amba_probe+0xa4/0xb8) > [ 5.838328] r10:00000000 r9:c06262f4 r8:c0633ba0 r7:00000000 r6:c06262f4 r5:de595e00 > [ 5.838345] r4:c04706bc r3:c02dfa98 > [ 5.838370] [] (amba_probe) from [] (really_probe+0x27c/0x408) > [ 5.838391] r7:00000000 r6:c0e0205c r5:de595e00 r4:c0e02058 > [ 5.838416] [] (really_probe) from [] (driver_probe_device+0x138/0x198) > [ 5.838439] r10:c06311e0 r9:00000000 r8:00000000 r7:c0633ac8 r6:c06262f4 r5:c06262f4 > [ 5.838455] r4:de595e00 > [ 5.838480] [] (driver_probe_device) from [] (__driver_attach+0x138/0x154) > [ 5.838502] r9:00000000 r8:00000000 r6:c06262f4 r5:de595e34 r4:de595e00 > [ 5.838527] [] (__driver_attach) from [] (bus_for_each_dev+0x68/0xa4) > [ 5.838547] r7:c0633ac8 r6:c0251db8 r5:c06262f4 r4:de595e00 > [ 5.838572] [] (bus_for_each_dev) from [] (driver_attach+0x2c/0x30) > [ 5.838591] r6:c061c22c r5:da4cc900 r4:c06262f4 > [ 5.838616] [] (driver_attach) from [] (bus_add_driver+0x1b8/0x278) > [ 5.838641] [] (bus_add_driver) from [] (driver_register+0x88/0x11c) > [ 5.838663] r8:c05eeeec r7:c06311e0 r6:c05ff420 r5:c05c8be0 r4:c06262f4 > [ 5.838687] [] (driver_register) from [] (amba_driver_register+0x60/0x64) > [ 5.838704] r5:c05c8be0 r4:c0630960 > [ 5.838730] [] (amba_driver_register) from [] (pl353_smc_driver_init+0x20/0x24) > [ 5.838756] [] (pl353_smc_driver_init) from [] (do_one_initcall+0x8c/0x368) > [ 5.838779] [] (do_one_initcall) from [] (kernel_init_freeable+0x3ac/0x484) > [ 5.838802] r9:c063a9c0 r8:c05eeeec r7:c063a9c0 r6:c05ff420 r5:00000007 r4:de4c6000 > [ 5.838827] [] (kernel_init_freeable) from [] (kernel_init+0x1c/0x108) > [ 5.838849] r10:00000000 r9:00000000 r8:00000000 r7:00000000 r6:00000000 r5:c043a390 > [ 5.838866] r4:0000a9c0 > [ 5.838888] [] (kernel_init) from [] (ret_from_fork+0x14/0x28) > [ 5.838905] Exception stack(0xde4c7fb0 to 0xde4c7ff8) > [ 5.838925] 7fa0: 00000000 00000000 00000000 00000000 > [ 5.838947] 7fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 > [ 5.838967] 7fe0: 00000000 00000000 00000000 00000000 00000013 00000000 > [ 5.838984] r5:c043a390 r4:00000000 > [ 5.839001] irq event stamp: 224953 > [ 5.839027] hardirqs last enabled at (224959): [] console_unlock+0x4bc/0x664 > [ 5.839053] hardirqs last disabled at (224964): [] console_unlock+0xe4/0x664 > [ 5.839078] softirqs last enabled at (224936): [] __do_softirq+0x458/0x540 > [ 5.839103] softirqs last disabled at (224921): [] irq_exit+0x148/0x14c > [ 5.839123] ---[ end trace eb0330276aefb0c8 ]--- > > The respective mtd character devices were created, but e.g. reading them > results in -EIO. > > The device tested on works fine with v4.14 and a driver close to the > xilinx kernel tree at github. > > I acknowledge that th v12 submission predates the v4.19 release, but at > this time, the driver will need reworking. > > Helmut This is the result of a coverity-scan fix; we chose not to return an error value from nand_subop_get_addr/data_len() and instead WARN on error conditions (that are purely coding mistakes, easily fixable). The marvell_nand.c driver had the same issue, fixed there: 21a268069203 mtd: rawnand: marvell: prevent harmless warnings Thanks, Miquèl -- Miquel Raynal, Bootlin Embedded Linux and Kernel engineering https://bootlin.com