From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751486AbcBLJQ1 (ORCPT ); Fri, 12 Feb 2016 04:16:27 -0500 Received: from vps0.lunn.ch ([178.209.37.122]:44901 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751113AbcBLJQW (ORCPT ); Fri, 12 Feb 2016 04:16:22 -0500 Date: Fri, 12 Feb 2016 10:16:12 +0100 From: Andrew Lunn To: Bartosz Golaszewski Cc: GregKH , Srinivas Kandagatla , Maxime Ripard , Wolfram Sang , broonie@kernel.org, vz@mleia.com, fd@ti.com, LKML , Pantelis Antoniou Subject: Re: [PATCH 3/7] eeprom: at24: extend driver to plug into the NVMEM framework Message-ID: <20160212091612.GB9276@lunn.ch> References: <1453995757-5051-1-git-send-email-andrew@lunn.ch> <1453995757-5051-4-git-send-email-andrew@lunn.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 29, 2016 at 02:10:17PM +0100, Bartosz Golaszewski wrote: > Hi Andrew, > > the patch works, but I'm hitting the following BUG when instantiating > an at24c32 device: Hi Bortosz Sorry for taking so long to get back to you. Can you confirm you had lockdep turned on. Thanks Andrew > > # echo 24c32 0x54 > /sys/class/i2c-adapter/i2c-2/new_device > [ 3.741893] BUG: key de753e8c not in .data! > [ 3.749166] ------------[ cut here ]------------ > [ 3.756649] WARNING: CPU: 0 PID: 102 at > kernel/locking/lockdep.c:3002 __kernfs_create_file+0x60/0xc4() > [ 3.769048] DEBUG_LOCKS_WARN_ON(1) > [ 3.772463] Modules linked in: at24(+) nvmem_core cpufreq_dt > omap_wdt thermal_sys leds_gpio led_class hwmon > [ 3.788301] CPU: 0 PID: 102 Comm: udevd Not tainted 4.5.0-rc1-acme+ #7 > [ 3.797833] Hardware name: Generic AM33XX (Flattened Device Tree) > [ 3.806920] [] (unwind_backtrace) from [] > (show_stack+0x10/0x14) > [ 3.817762] [] (show_stack) from [] > (dump_stack+0x84/0x9c) > [ 3.828071] [] (dump_stack) from [] > (warn_slowpath_common+0x7c/0xb8) > [ 3.839284] [] (warn_slowpath_common) from [] > (warn_slowpath_fmt+0x30/0x40) > [ 3.851154] [] (warn_slowpath_fmt) from [] > (__kernfs_create_file+0x60/0xc4) > [ 3.863025] [] (__kernfs_create_file) from [] > (sysfs_add_file_mode_ns+0x98/0x1bc) > [ 3.875488] [] (sysfs_add_file_mode_ns) from [] > (sysfs_create_bin_file+0x38/0x44) > [ 3.888000] [] (sysfs_create_bin_file) from [] > (nvmem_register+0x2cc/0x34c [nvmem_core]) > [ 3.901190] [] (nvmem_register [nvmem_core]) from > [] (at24_probe+0x430/0x59c [at24]) > [ 3.914055] [] (at24_probe [at24]) from [] > (i2c_device_probe+0x168/0x1fc) > [ 3.925926] [] (i2c_device_probe) from [] > (driver_probe_device+0x208/0x2c0) > [ 3.938003] [] (driver_probe_device) from [] > (__driver_attach+0x94/0x98) > [ 3.949821] [] (__driver_attach) from [] > (bus_for_each_dev+0x6c/0xa0) > [ 3.961373] [] (bus_for_each_dev) from [] > (bus_add_driver+0x18c/0x214) > [ 3.973037] [] (bus_add_driver) from [] > (driver_register+0x78/0xf8) > [ 3.984458] [] (driver_register) from [] > (i2c_register_driver+0x2c/0x80) > [ 3.996349] [] (i2c_register_driver) from [] > (do_one_initcall+0x80/0x1e0) > [ 4.008344] [] (do_one_initcall) from [] > (do_init_module+0x5c/0x1d4) > [ 4.019910] [] (do_init_module) from [] > (load_module+0x1cc0/0x1f48) > [ 4.031378] [] (load_module) from [] > (SyS_finit_module+0x64/0x74) > [ 4.042665] [] (SyS_finit_module) from [] > (ret_fast_syscall+0x0/0x1c) > [ 4.054322] ---[ end trace 692db3ff57b96549 ]--- > [ 4.062228] at24 2-0054: 4096 byte 24c32 EEPROM, writable, 1 bytes/write > [ 4.073224] i2c i2c-2: new_device: Instantiated device 24c32 at 0x54 > > It seems to result in the nvmem attribute having 0 size while the > legacy eeprom file has size corresponding with the chip's memory area > size in bytes. > > Best regards, > Bartosz Golaszewski