sob., 6 lip 2019 o 19:57 Claus H. Stovgaard <cst@xxxxxxxxxxxx> napisał(a): > > On lør, 2019-07-06 at 19:33 +0200, Bartosz Golaszewski wrote: > > Hi Claus, > > > > gpiod_set_value_cansleep() doesn't complain if the passed descriptor > > is NULL - it just quietly returns. Could you give me some more info > > on > > how you trigger this warning? > > > > Bart > > Hi Bart > > If you don't have enabled gpiolib, (E.g. CONFIG_GPIOLIB is not set) > gpiod_set_value_cansleep ends in /include/linux/gpio/consumer.h with > the following code > > --- > static inline void gpiod_set_value_cansleep(struct gpio_desc *desc, int > value) > { > /* GPIO can never have been requested */ > WARN_ON(1); > } > --- > > So we get warnings like this in the log > > [ 148.508317] WARNING: CPU: 0 PID: 1903 at > include/linux/gpio/consumer.h:396 at24_write+0x150/0x260 > [ 148.517187] Modules linked in: > [ 148.520236] CPU: 0 PID: 1903 Comm: DataObjects Tainted: > G W 4.19.0-p1-iq4-05669-g6fe8008-dirty #2 > [ 148.530394] Hardware name: P1 IQ4 (DT) > [ 148.534129] pstate: 60000005 (nZCv daif -PAN -UAO) > [ 148.538914] pc : at24_write+0x150/0x260 > [ 148.542741] lr : at24_write+0x11c/0x260 > [ 148.546565] sp : ffffff800d5f3c40 > [ 148.549864] x29: ffffff800d5f3c40 x28: 0000000000000000 > [ 148.555167] x27: 0000000000000001 x26: ffffffc975096304 > [ 148.560470] x25: ffffff8008d46980 x24: ffffffc975293020 > [ 148.565774] x23: 00000000ffff6c15 x22: ffffffc977484498 > [ 148.571077] x21: 00000000000006e2 x20: 0000000000000000 > [ 148.576381] x19: 00000000000006e1 x18: 0000000000000400 > [ 148.581684] x17: 0000000000000000 x16: ffffffc977008300 > [ 148.586988] x15: 0000000000000400 x14: 0000000000000088 > [ 148.592291] x13: 0000000000000000 x12: 0000000000000001 > [ 148.597595] x11: 0000000000000001 x10: 00000000000007f0 > [ 148.602898] x9 : ffffff800d5f37e0 x8 : ffffffc977008b50 > [ 148.608202] x7 : ffffffc97ff76800 x6 : 000000001fbe647a > [ 148.613505] x5 : 00000000ffff6c0f x4 : ffffffbf211a0d8f > [ 148.618809] x3 : ffffffbf211a0d90 x2 : ffffff80084e55c4 > [ 148.624113] x1 : 00000000000005dc x0 : 0000000000000001 > [ 148.629417] Call trace: > [ 148.631852] at24_write+0x150/0x260 > [ 148.635335] bin_attr_nvmem_write+0x6c/0xa0 > [ 148.639510] sysfs_kf_bin_write+0x64/0x80 > [ 148.643510] kernfs_fop_write+0xcc/0x1e0 > [ 148.647425] __vfs_write+0x30/0x158 > [ 148.650905] vfs_write+0xa4/0x1a8 > [ 148.654211] ksys_write+0x5c/0xc0 > [ 148.657519] __arm64_sys_write+0x18/0x20 > [ 148.661436] el0_svc_common+0x84/0xd8 > [ 148.665087] el0_svc_handler+0x68/0x80 > [ 148.668828] el0_svc+0x8/0xc > [ 148.671699] ---[ end trace f3f414c3b5f66f98 ]--- > Cc Linus Walleij I see. This isn't a problem with at24 but with the GPIO API. I Cc'ed you on a patch I've just sent. Please take a look a possibly test. Bart