From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.bootlin.com ([62.4.15.54]) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gJbEp-0007m8-Ee for linux-mtd@lists.infradead.org; Mon, 05 Nov 2018 09:32:05 +0000 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> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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. > >=20 > > Signed-off-by: Naga Sureshkumar Relli > > --- > > Changes in v12: =20 >=20 > I attempted to apply this v12 together with the v11 of pl353-smc (which s= eems > to be the latest version) onto a vanilla v4.19 kernel tree. Application w= as > smooth and a build was without errors. During boot, my dmesg was spammed = with > lots of repetitions of this: >=20 > [ 5.816275] ------------[ cut here ]------------ > [ 5.820981] WARNING: CPU: 0 PID: 1 at .../linux/drivers/mtd/nand/raw/n= and_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:=20 > [ 5.836981] [] (dump_backtrace) from [] (show_stac= k+0x20/0x24) > [ 5.837004] r7:c062e618 r6:00000000 r5:600f0013 r4:c062e618 > [ 5.837027] [] (show_stack) from [] (dump_stack+0x= ac/0xd8) > [ 5.837055] [] (dump_stack) from [] (__warn+0x118/= 0x130) > [ 5.837079] r10:00000000 r9:c0270be8 r8:00000ad5 r7:c0550358 r6:00000= 009 r5:00000000 > [ 5.837097] r4:00000000 r3:de4c6000 > [ 5.837122] [] (__warn) from [] (warn_slowpath_nul= l+0x50/0x58) > [ 5.837146] r9:de4c78c5 r8:da4d1010 r7:de4c78f8 r6:c0270be8 r5:00000a= d5 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 [] (n= and_op_parser_exec_op+0x484/0x4e8) > [ 5.837285] r10:00000002 r9:00000014 r8:de4c790c r7:00000004 r6:c0634= 260 r5:c052cc44 > [ 5.837301] r4:c0620bcc > [ 5.837325] [] (nand_op_parser_exec_op) from [] (p= l353_nfc_exec_op+0x24/0x2c) > [ 5.837348] r10:de4c7a18 r9:00000080 r8:03463678 r7:89705f41 r6:36b4a= 597 r5:de4c78d0 > [ 5.837364] r4:da4d1010 > [ 5.837387] [] (pl353_nfc_exec_op) from [] (nand_e= rase_op+0x150/0x1f0) > [ 5.837411] [] (nand_erase_op) from [] (single_era= se+0x28/0x2c) > [ 5.837434] r9:e08c1000 r8:00000006 r7:00000040 r6:00000001 r5:0001ff= 80 r4:da4d1010 > [ 5.837459] [] (single_erase) from [] (nand_erase_= nand+0x1f8/0x3f8) > [ 5.837484] [] (nand_erase_nand) from [] (write_bb= t+0x30c/0x748) > [ 5.837508] r10:00000006 r9:e08c1000 r8:00000006 r7:00000002 r6:da4d1= 010 r5:00000000 > [ 5.837524] r4:0ffc0000 > [ 5.837549] [] (write_bbt) from [] (nand_create_bb= t+0x30c/0x6d0) > [ 5.837572] r10:c061fd2c r9:c061fce8 r8:00000000 r7:c061fd2c r6:00000= 000 r5:00000003 > [ 5.837587] r4:00000000 > [ 5.837614] [] (nand_create_bbt) from [] (nand_sca= n_with_ids+0x1248/0x1e74) > [ 5.837636] r10:c0620524 r9:00000004 r8:00000001 r7:00000004 r6:da4d1= 378 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:da4d8= e10 r5:da4d8e00 > [ 5.837715] r4:da4d1010 > [ 5.837738] [] (pl353_nand_probe) from [] (platfor= m_drv_probe+0x44/0x7c) > [ 5.837757] r6:c0e0205c r5:c0620ae0 r4:da4d8e10 > [ 5.837783] [] (platform_drv_probe) from [] (reall= y_probe+0x27c/0x408) > [ 5.837801] r5:da4d8e10 r4:c0e02058 > [ 5.837827] [] (really_probe) from [] (driver_prob= e_device+0x138/0x198) > [ 5.837850] r10:00000000 r9:00000000 r8:c0e02014 r7:00000001 r6:de4c7= c70 r5:c0620ae0 > [ 5.837865] r4:da4d8e10 > [ 5.837891] [] (driver_probe_device) from [] (__de= vice_attach_driver+0xc8/0x144) > [ 5.837913] r9:00000000 r8:c0e02014 r6:de4c7c70 r5:da4d8e10 r4:c0620a= e0 > [ 5.837938] [] (__device_attach_driver) from [] (b= us_for_each_drv+0x70/0xa4) > [ 5.837958] r7:00000001 r6:c0251f0c r5:de4c7c70 r4:00000000 > [ 5.837982] [] (bus_for_each_drv) from [] (__devic= e_attach+0xb0/0x11c) > [ 5.838001] r6:c061e8d0 r5:da4d8e44 r4:da4d8e10 > [ 5.838027] [] (__device_attach) from [] (device_i= nitial_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:de595= e00 r5:00000000 > [ 5.838180] r4:da4d8e00 > [ 5.838205] [] (of_device_add) from [] (of_platfor= m_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:000000= 00 r4:de595e00 > [ 5.838280] [] (of_platform_device_create) from []= (pl353_smc_probe+0x1b0/0x244) > [ 5.838305] [] (pl353_smc_probe) from [] (amba_pro= be+0xa4/0xb8) > [ 5.838328] r10:00000000 r9:c06262f4 r8:c0633ba0 r7:00000000 r6:c0626= 2f4 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_prob= e_device+0x138/0x198) > [ 5.838439] r10:c06311e0 r9:00000000 r8:00000000 r7:c0633ac8 r6:c0626= 2f4 r5:c06262f4 > [ 5.838455] r4:de595e00 > [ 5.838480] [] (driver_probe_device) from [] (__dr= iver_attach+0x138/0x154) > [ 5.838502] r9:00000000 r8:00000000 r6:c06262f4 r5:de595e34 r4:de595e= 00 > [ 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_dr= iver+0x1b8/0x278) > [ 5.838641] [] (bus_add_driver) from [] (driver_re= gister+0x88/0x11c) > [ 5.838663] r8:c05eeeec r7:c06311e0 r6:c05ff420 r5:c05c8be0 r4:c06262= f4 > [ 5.838687] [] (driver_register) from [] (amba_dri= ver_register+0x60/0x64) > [ 5.838704] r5:c05c8be0 r4:c0630960 > [ 5.838730] [] (amba_driver_register) from [] (pl3= 53_smc_driver_init+0x20/0x24) > [ 5.838756] [] (pl353_smc_driver_init) from [] (do= _one_initcall+0x8c/0x368) > [ 5.838779] [] (do_one_initcall) from [] (kernel_i= nit_freeable+0x3ac/0x484) > [ 5.838802] r9:c063a9c0 r8:c05eeeec r7:c063a9c0 r6:c05ff420 r5:000000= 07 r4:de4c6000 > [ 5.838827] [] (kernel_init_freeable) from [] (ker= nel_init+0x1c/0x108) > [ 5.838849] r10:00000000 r9:00000000 r8:00000000 r7:00000000 r6:00000= 000 r5:c043a390 > [ 5.838866] r4:0000a9c0 > [ 5.838888] [] (kernel_init) from [] (ret_from_for= k+0x14/0x28) > [ 5.838905] Exception stack(0xde4c7fb0 to 0xde4c7ff8) > [ 5.838925] 7fa0: 00000000 0000000= 0 00000000 00000000 > [ 5.838947] 7fc0: 00000000 00000000 00000000 00000000 00000000 0000000= 0 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_u= nlock+0x4bc/0x664 > [ 5.839053] hardirqs last disabled at (224964): [] console_u= nlock+0xe4/0x664 > [ 5.839078] softirqs last enabled at (224936): [] __do_soft= irq+0x458/0x540 > [ 5.839103] softirqs last disabled at (224921): [] irq_exit+= 0x148/0x14c > [ 5.839123] ---[ end trace eb0330276aefb0c8 ]--- >=20 > The respective mtd character devices were created, but e.g. reading them > results in -EIO. >=20 > The device tested on works fine with v4.14 and a driver close to the > xilinx kernel tree at github. >=20 > I acknowledge that th v12 submission predates the v4.19 release, but at > this time, the driver will need reworking. >=20 > 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=C3=A8l --=20 Miquel Raynal, Bootlin Embedded Linux and Kernel engineering https://bootlin.com