linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Martin Kepplinger <martin.kepplinger@puri.sm>
To: Lorenzo Bianconi <lorenzo@kernel.org>,
	Jonathan Cameron <jic23@kernel.org>
Cc: lorenzo.bianconi@redhat.com, linux-iio@vger.kernel.org
Subject: Re: [BUG] Re: [PATCH] iio: imu: st_lsm6dsx: remove invalid gain value for LSM9DS1
Date: Fri, 30 Aug 2019 08:01:50 +0200	[thread overview]
Message-ID: <f34694f0-ea7c-0327-532d-7a2904952771@puri.sm> (raw)
In-Reply-To: <20190829083714.GA2880@localhost.localdomain>

On 29.08.19 10:37, Lorenzo Bianconi wrote:
>> On 27.08.19 22:08, Jonathan Cameron wrote:
>>> On Tue, 27 Aug 2019 10:26:35 +0200
>>> Lorenzo Bianconi <lorenzo@kernel.org> wrote:
>>>
>>>> Get rid of invalid sensitivity value for LSM9DS1 gyro sensor
>>>>
>>>> Fixes: 687a60feb9c6 ("iio: imu: st_lsm6dsx: add support for accel/gyro unit of lsm9ds1")
>>>> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
>>> The zero degree scale is certainly odd otherwise, so good to tidy
>>> this up.
>>>
>>> Applied to the togreg branch of iio.git.
>>>
>>
>> Hi Jon,
>>
>> you have applied this too quickly. I've left that zero value in there
>> for a reason, see below:
>>
>>
>>> Thanks,
>>>
>>> Jonathan
>>>
>>>> ---
> 
> [...]
> 
>>
>> You Ooops here and it's pretty obvious! You don't have
>> ST_LSM6DSX_FS_LIST_SIZE number of elements in the array anymore, but you
>> try to access it (the 4th).
> 
> Hi Martin,
> 
> according to pahole (x86_64): 
> 
> struct st_lsm6dsx_fs {
> 	 [...]
> 	 /* size: 8, cachelines: 1, members: 2 *
> };
> 
> struct st_lsm6dsx_fs_table_entry {
> 	[...]
> 	struct st_lsm6dsx_fs fs_avl[4];                  /*     4    32 */
> 	/* size: 36, cachelines: 1, members: 2 */
> };
> 
> struct st_lsm6dsx_settings {
> 	[...]
> 	struct st_lsm6dsx_fs_table_entry fs_table[2];    /*   284    72 */
> 	/* size: 464, cachelines: 8, members: 14 */
> };
> 
> struct st_lsm6dsx_fs_table_entry in st_lsm6dsx_settings will always have 4
> elements for fs_avl array and since the array is defined as static the
> uninitialized elements are set to 0.
> 
> Could you please share the ops you are getting?
> 

How this oops during startup can look like is appended below. I know
that exactly this change causes it. Can you test this too please?

Given the cleanup nature of this patch, I think it's best to revert it
in case of any doubt.

thanks,

                          martin



Feb 14 10:12:00 pureos kernel: [    4.056014] Data abort info:
Feb 14 10:12:00 pureos kernel: [    4.061361] bq25890-charger 0-006b:
Capacity for 4184000 is 99%
Feb 14 10:12:00 pureos kernel: [    4.064751]   ISV = 0, ISS = 0x00000004
Feb 14 10:12:00 pureos kernel: [    4.070942]   CM = 0, WnR = 0
Feb 14 10:12:00 pureos kernel: [    4.076588] user pgtable: 4k pages,
48-bit VAs, pgdp=00000000e4fa6000
Feb 14 10:12:00 pureos kernel: [    4.086256] [0000000000000018]
pgd=0000000000000000
Feb 14 10:12:00 pureos kernel: [    4.100224] Internal error: Oops:
96000004 [#1] PREEMPT SMP
Feb 14 10:12:00 pureos kernel: [    4.101985] Goodix-TS 2-005d: ID 5688,
version: 0100
Feb 14 10:12:00 pureos kernel: [    4.106038] Modules linked in:
crct10dif_ce(+) st_magn_i2c(+) st_lsm6dsx_i2c(+) st_magn st_lsm6dsx
snd_soc_sgtl5000(+) st_sensors_i2c st_sensors tcpci
industrialio_triggered_buffer vcnl4000 kfifo_buf snd_soc_simple_card
snd_soc_fsl_sai tcpm ghash_ce bq25890_charger snd_soc_gtm601
snd_soc_simple_card_utils imx_pcm_dma goodix(+) roles snd_soc_core typec
sha2_ce snd_pcm_dmaengine snd_pcm imx_sdma imx2_wdt sha1_ce snvs_pwrkey
gpio_vibra qoriq_thermal virt_dma snd_timer watchdog snd soundcore
usb_f_acm u_serial usb_f_rndis g_multi usb_f_mass_storage u_ether
libcomposite ip_tables x_tables ipv6 nf_defrag_ipv6 xhci_plat_hcd
xhci_hcd usbcore dwc3 ulpi udc_core usb_common phy_fsl_imx8mq_usb
Feb 14 10:12:00 pureos kernel: [    4.113252] Goodix-TS 2-005d: Direct
firmware load for goodix_5688_cfg.bin failed with error -2
Feb 14 10:12:00 pureos kernel: [    4.174094] CPU: 2 PID: 341 Comm:
systemd-udevd Tainted: G        W         5.3.0-rc2-gc652c7f46913 #141
Feb 14 10:12:00 pureos kernel: [    4.174096] Hardware name: Purism
Librem 5 devkit (DT)
Feb 14 10:12:00 pureos kernel: [    4.174100] pstate: 80000005 (Nzcv
daif -PAN -UAO)
Feb 14 10:12:00 pureos kernel: [    4.174113] pc :
st_lsm6dsx_i2c_probe+0x18/0x80 [st_lsm6dsx_i2c]
Feb 14 10:12:00 pureos kernel: [    4.174124] lr :
i2c_device_probe+0x1f0/0x2b8
Feb 14 10:12:00 pureos kernel: [    4.174126] sp : ffff8000a4837970
Feb 14 10:12:00 pureos kernel: [    4.174128] x29: ffff8000a4837970 x28:
0000000000000000
Feb 14 10:12:00 pureos kernel: [    4.174132] x27: ffff000010b70000 x26:
ffff8000a4837d68
Feb 14 10:12:00 pureos kernel: [    4.174135] x25: ffff000010860000 x24:
ffff000008a94038
Feb 14 10:12:00 pureos kernel: [    4.174139] x23: ffff000008a94038 x22:
ffff000008a94000
Feb 14 10:12:00 pureos kernel: [    4.174142] x21: ffff8000a55a0400 x20:
ffff000008a92000
Feb 14 10:12:00 pureos kernel: [    4.174146] x19: ffff8000a55a0400 x18:
ffffffffffffffff
Feb 14 10:12:00 pureos kernel: [    4.174149] x17: 0000000000000000 x16:
0000000000000000
Feb 14 10:12:00 pureos kernel: [    4.174152] x15: 0000000000040000 x14:
00000000fffffff0
Feb 14 10:12:00 pureos kernel: [    4.174156] x13: 0000000000000001 x12:
0000000000000000
Feb 14 10:12:00 pureos kernel: [    4.174159] x11: 0000000000000000 x10:
0101010101010101
Feb 14 10:12:00 pureos kernel: [    4.174162] x9 : fffffffffffffffc x8 :
0000000000000008
Feb 14 10:12:00 pureos kernel: [    4.174166] x7 : 0000000000000004 x6 :
1e0e1a00f2ade4ef
Feb 14 10:12:00 pureos kernel: [    4.174169] x5 : 6f642d72001a0e1e x4 :
8080808000000000
Feb 14 10:12:00 pureos kernel: [    4.174173] x3 : 0000000000000000 x2 :
ffff000008a93000
Feb 14 10:12:00 pureos kernel: [    4.193031] driver: 'Goodix-TS':
driver_bound: bound to device '2-005d'
Feb 14 10:12:00 pureos kernel: [    4.193105] x1 : 0000000000000000 x0 :
ffff8000a55a0400
Feb 14 10:12:00 pureos kernel: [    4.199343] bus: 'i2c': really_probe:
bound device 2-005d to driver Goodix-TS
Feb 14 10:12:00 pureos kernel: [    4.203445] Call trace:
Feb 14 10:12:00 pureos kernel: [    4.203456]
st_lsm6dsx_i2c_probe+0x18/0x80 [st_lsm6dsx_i2c]
Feb 14 10:12:00 pureos kernel: [    4.203462]  i2c_device_probe+0x1f0/0x2b8
Feb 14 10:12:00 pureos kernel: [    4.203468]  really_probe+0x168/0x368
Feb 14 10:12:00 pureos kernel: [    4.203471]
driver_probe_device.part.2+0x10c/0x128
Feb 14 10:12:00 pureos kernel: [    4.203475]
device_driver_attach+0x74/0xa0
Feb 14 10:12:00 pureos kernel: [    4.203478]  __driver_attach+0x84/0x130
Feb 14 10:12:00 pureos kernel: [    4.203481]  bus_for_each_dev+0x68/0xc8
Feb 14 10:12:00 pureos kernel: [    4.203484]  driver_attach+0x20/0x28
Feb 14 10:12:00 pureos kernel: [    4.203487]  bus_add_driver+0xd4/0x1f8
Feb 14 10:12:00 pureos kernel: [    4.203490]  driver_register+0x60/0x110
Feb 14 10:12:00 pureos kernel: [    4.203497]  i2c_register_driver+0x44/0x98
Feb 14 10:12:00 pureos kernel: [    4.216908] devices_kset: Moving sound
to end of list
Feb 14 10:12:00 pureos kernel: [    4.217738]
st_lsm6dsx_driver_init+0x1c/0x1000 [st_lsm6dsx_i2c]
Feb 14 10:12:00 pureos kernel: [    4.217744]  do_one_initcall+0x58/0x1a8
Feb 14 10:12:00 pureos kernel: [    4.217749]  do_init_module+0x54/0x1d4
Feb 14 10:12:00 pureos kernel: [    4.217752]  load_module+0x1998/0x1c40
Feb 14 10:12:00 pureos kernel: [    4.217755]
__se_sys_finit_module+0xc0/0xd8
Feb 14 10:12:00 pureos kernel: [    4.217761]
__arm64_sys_finit_module+0x14/0x20
Feb 14 10:12:00 pureos kernel: [    4.223515] PM: Moving platform:sound
to end of list
Feb 14 10:12:00 pureos kernel: [    4.228823]
el0_svc_common.constprop.0+0xb0/0x168
Feb 14 10:12:00 pureos kernel: [    4.228827]  el0_svc_handler+0x18/0x20
Feb 14 10:12:00 pureos kernel: [    4.228830]  el0_svc+0x8/0xc
Feb 14 10:12:00 pureos kernel: [    4.228838] Code: d2800003 910003fd
a90153f3 aa0003f3 (f9400c34)
Feb 14 10:12:00 pureos kernel: [    4.228843] ---[ end trace
4933f7b108d54662 ]---


  reply	other threads:[~2019-08-30  6:02 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-27  8:26 [PATCH] iio: imu: st_lsm6dsx: remove invalid gain value for LSM9DS1 Lorenzo Bianconi
2019-08-27 20:08 ` Jonathan Cameron
2019-08-29  5:27   ` [BUG] " Martin Kepplinger
2019-08-29  5:50     ` [PATCH] Revert "iio: imu: st_lsm6dsx: remove invalid gain value for LSM9DS1" Martin Kepplinger
2019-08-29  8:37     ` [BUG] Re: [PATCH] iio: imu: st_lsm6dsx: remove invalid gain value for LSM9DS1 Lorenzo Bianconi
2019-08-30  6:01       ` Martin Kepplinger [this message]
2019-08-30  7:23         ` Lorenzo Bianconi
2019-08-30 12:53           ` Martin Kepplinger
2019-08-31  9:32             ` Lorenzo Bianconi
2019-09-01 14:50               ` Jonathan Cameron
2019-09-03  5:22                 ` Martin Kepplinger
2019-09-03 12:37                   ` Jonathan Cameron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f34694f0-ea7c-0327-532d-7a2904952771@puri.sm \
    --to=martin.kepplinger@puri.sm \
    --cc=jic23@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=lorenzo.bianconi@redhat.com \
    --cc=lorenzo@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).