From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752311AbcBLLC4 (ORCPT ); Fri, 12 Feb 2016 06:02:56 -0500 Received: from mail-ig0-f171.google.com ([209.85.213.171]:33391 "EHLO mail-ig0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751576AbcBLLCy (ORCPT ); Fri, 12 Feb 2016 06:02:54 -0500 MIME-Version: 1.0 In-Reply-To: <20160212091612.GB9276@lunn.ch> References: <1453995757-5051-1-git-send-email-andrew@lunn.ch> <1453995757-5051-4-git-send-email-andrew@lunn.ch> <20160212091612.GB9276@lunn.ch> Date: Fri, 12 Feb 2016 12:02:53 +0100 Message-ID: Subject: Re: [PATCH 3/7] eeprom: at24: extend driver to plug into the NVMEM framework From: Bartosz Golaszewski To: Andrew Lunn Cc: GregKH , Srinivas Kandagatla , Maxime Ripard , Wolfram Sang , broonie@kernel.org, vz@mleia.com, fd@ti.com, LKML , Pantelis Antoniou Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 2016-02-12 10:16 GMT+01:00 Andrew Lunn : > 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. Yes, this is from the config I used: CONFIG_LOCKDEP_SUPPORT=y CONFIG_LOCKDEP=y # CONFIG_DEBUG_LOCKDEP is not set Best regards, Bartosz Golaszewski > 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