Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755597AbdIFQvx (ORCPT ); Wed, 6 Sep 2017 12:51:53 -0400 Received: from mail-pg0-f68.google.com ([74.125.83.68]:32822 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754214AbdIFQvt (ORCPT ); Wed, 6 Sep 2017 12:51:49 -0400 X-Google-Smtp-Source: ADKCNb5PA1tHmBEOFxhSIxkGnp7qInFZRsSXIxsyyppeZjlWMgPzCvBwxSCdxHhJPHQewGyzfnJ9ZA4PoX7+or62Pds= MIME-Version: 1.0 In-Reply-To: References: From: Geert Uytterhoeven Date: Wed, 6 Sep 2017 18:51:48 +0200 X-Google-Sender-Auth: 3Sdk0mrKTIxWNiCxlWLrXkDtk8M Message-ID: Subject: Re: [PATCH v3 2/2] mtd: spi-nor: parse Serial Flash Discoverable Parameters (SFDP) tables To: Cyrille Pitchen , Boris BREZILLON Cc: Marek Vasut , Brian Norris , Richard Weinberger , MTD Maling List , "linux-kernel@vger.kernel.org" , Mark Brown , Linux-Renesas Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4827 Lines: 105 Hi Cyrille, Boris, On Mon, Jun 26, 2017 at 3:10 PM, Cyrille Pitchen wrote: > This patch adds support to the JESD216 rev B standard and parses the SFDP > tables to dynamically initialize the 'struct spi_nor_flash_parameter'. > > Signed-off-by: Cyrille Pitchen This patch, which is now commit f384b352cbf0310f ("mtd: spi-nor: parse Serial Flash Discoverable Parameters (SFDP) tables") in -next, and which was included in the "MTD updates for 4.14" pull request, broke QSPI FLASH on R-Car Gen2. E.g. on r8a7794/alt, the following warning is printed with CONFIG_DMA_API_DEBUG=y: WARNING: CPU: 1 PID: 1 at lib/dma-debug.c:1188 check_for_stack+0xcc/0x114 rcar-dmac e6720000.dma-controller: DMA-API: device driver maps memory from stack [addr=ef43dad8] Modules linked in: CPU: 1 PID: 1 Comm: swapper/0 Not tainted 4.13.0-rcar2-initrd-00404-g3d49bfdcf5ecd040 #76 Hardware name: Generic R-Car Gen2 (Flattened Device Tree) [] (unwind_backtrace) from [] (show_stack+0x10/0x14) [] (show_stack) from [] (dump_stack+0x7c/0x9c) [] (dump_stack) from [] (__warn+0xcc/0xfc) [] (__warn) from [] (warn_slowpath_fmt+0x34/0x44) [] (warn_slowpath_fmt) from [] (check_for_stack+0xcc/0x114) [] (check_for_stack) from [] (debug_dma_map_sg+0xe4/0x168) [] (debug_dma_map_sg) from [] (spi_map_buf+0x2f4/0x32c) [] (spi_map_buf) from [] (__spi_pump_messages+0x430/0x4d8) [] (__spi_pump_messages) from [] (__spi_sync+0x168/0x194) [] (__spi_sync) from [] (spi_sync+0x24/0x3c) [] (spi_sync) from [] (m25p80_read+0x2e4/0x300) [] (m25p80_read) from [] (spi_nor_read_sfdp+0x58/0xa8) [] (spi_nor_read_sfdp) from [] (spi_nor_init_params+0x2e8/0x5f4) [] (spi_nor_init_params) from [] (spi_nor_scan+0xc4/0x830) [] (spi_nor_scan) from [] (m25p_probe+0x110/0x168) [] (m25p_probe) from [] (spi_drv_probe+0x84/0xa0) [] (spi_drv_probe) from [] (driver_probe_device+0x150/0x2d0) [] (driver_probe_device) from [] (bus_for_each_drv+0x84/0x94) [] (bus_for_each_drv) from [] (__device_attach+0x88/0xfc) [] (__device_attach) from [] (bus_probe_device+0x28/0x80) [] (bus_probe_device) from [] (device_add+0x3f8/0x50c) [] (device_add) from [] (spi_add_device+0xd0/0x14c) [] (spi_add_device) from [] (of_register_spi_device+0x200/0x2f4) [] (of_register_spi_device) from [] (spi_register_controller+0x47c/0x5e4) [] (spi_register_controller) from [] (devm_spi_register_controller+0x30/0x6c) [] (devm_spi_register_controller) from [] (rspi_probe+0x258/0x404) [] (rspi_probe) from [] (platform_drv_probe+0x50/0xa0) [] (platform_drv_probe) from [] (driver_probe_device+0x150/0x2d0) [] (driver_probe_device) from [] (__driver_attach+0x80/0xa4) [] (__driver_attach) from [] (bus_for_each_dev+0x6c/0x90) [] (bus_for_each_dev) from [] (bus_add_driver+0xc8/0x1e4) [] (bus_add_driver) from [] (driver_register+0x9c/0xe0) [] (driver_register) from [] (do_one_initcall+0xa8/0x14c) [] (do_one_initcall) from [] (kernel_init_freeable+0x114/0x: [] (kernel_init_freeable) from [] (kernel_init+0x8/0x10c) [] (kernel_init) from [] (ret_from_fork+0x14/0x2c) This leads to the SPI FLASH size being misdetected as zero: -m25p80 spi0.0: s25fl512s (65536 Kbytes) +m25p80 spi0.0: s25fl512s (0 Kbytes) 3 ofpart partitions found on MTD device spi0.0 Creating 3 MTD partitions on "spi0.0": 0x000000000000-0x000000040000 : "loader" +mtd: partition "loader" is out of reach -- disabled 0x000000040000-0x000000080000 : "system" +mtd: partition "system" is out of reach -- disabled 0x000000080000-0x000004000000 : "user" +mtd: partition "user" is out of reach -- disabled Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds