linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [Bug 219192] New: drivers/iio/imu/adis16400.o: warning: objtool: adis16400_write_raw() falls through to next function adis16400_show_flash_count()
@ 2024-08-25  9:35 bugzilla-daemon
  2024-08-25  9:35 ` [Bug 219192] " bugzilla-daemon
                   ` (15 more replies)
  0 siblings, 16 replies; 23+ messages in thread
From: bugzilla-daemon @ 2024-08-25  9:35 UTC (permalink / raw)
  To: linux-iio

https://bugzilla.kernel.org/show_bug.cgi?id=219192

            Bug ID: 219192
           Summary: drivers/iio/imu/adis16400.o: warning: objtool:
                    adis16400_write_raw() falls through to next function
                    adis16400_show_flash_count()
           Product: Drivers
           Version: 2.5
          Hardware: All
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P3
         Component: IIO
          Assignee: drivers_iio@kernel-bugs.kernel.org
          Reporter: ionut_n2001@yahoo.com
        Regression: No

drivers/iio/imu/adis16400.o: warning: objtool: adis16400_write_raw() falls
through to next function adis16400_show_flash_count()

Kernel: 6.11.0-rc5 vanilla
GCC compiler: gcc (Debian 14.1.0-5) 14.1.0

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug 219192] drivers/iio/imu/adis16400.o: warning: objtool: adis16400_write_raw() falls through to next function adis16400_show_flash_count()
  2024-08-25  9:35 [Bug 219192] New: drivers/iio/imu/adis16400.o: warning: objtool: adis16400_write_raw() falls through to next function adis16400_show_flash_count() bugzilla-daemon
@ 2024-08-25  9:35 ` bugzilla-daemon
  2024-08-26 10:11 ` [Bug 219192] New: " Jonathan Cameron
                   ` (14 subsequent siblings)
  15 siblings, 0 replies; 23+ messages in thread
From: bugzilla-daemon @ 2024-08-25  9:35 UTC (permalink / raw)
  To: linux-iio

https://bugzilla.kernel.org/show_bug.cgi?id=219192

sander44 (ionut_n2001@yahoo.com) changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Kernel Version|                            |6.11.0-rc5

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [Bug 219192] New: drivers/iio/imu/adis16400.o: warning: objtool: adis16400_write_raw() falls through to next function adis16400_show_flash_count()
  2024-08-25  9:35 [Bug 219192] New: drivers/iio/imu/adis16400.o: warning: objtool: adis16400_write_raw() falls through to next function adis16400_show_flash_count() bugzilla-daemon
  2024-08-25  9:35 ` [Bug 219192] " bugzilla-daemon
@ 2024-08-26 10:11 ` Jonathan Cameron
  2024-08-26 10:11 ` [Bug 219192] " bugzilla-daemon
                   ` (13 subsequent siblings)
  15 siblings, 0 replies; 23+ messages in thread
From: Jonathan Cameron @ 2024-08-26 10:11 UTC (permalink / raw)
  To: bugzilla-daemon; +Cc: linux-iio

On Sun, 25 Aug 2024 09:35:37 +0000
bugzilla-daemon@kernel.org wrote:

> https://bugzilla.kernel.org/show_bug.cgi?id=219192
> 
>             Bug ID: 219192
>            Summary: drivers/iio/imu/adis16400.o: warning: objtool:
>                     adis16400_write_raw() falls through to next function
>                     adis16400_show_flash_count()
>            Product: Drivers
>            Version: 2.5
>           Hardware: All
>                 OS: Linux
>             Status: NEW
>           Severity: normal
>           Priority: P3
>          Component: IIO
>           Assignee: drivers_iio@kernel-bugs.kernel.org
>           Reporter: ionut_n2001@yahoo.com
>         Regression: No
> 
> drivers/iio/imu/adis16400.o: warning: objtool: adis16400_write_raw() falls
> through to next function adis16400_show_flash_count()
> 
> Kernel: 6.11.0-rc5 vanilla
> GCC compiler: gcc (Debian 14.1.0-5) 14.1.0

I think this is a false positive.  None of the cases of the switch statement
fail to return and there are unreachable() markings that this
check seems to not be able to see which were added to try and
point out to the compiler that it was failing to identify they
were not possible to get to.

We could add some returns the unreachable paths to work around
this warning I suppose.

Maybe we are doing something wrong otherwise?  I'd like more
eyes on this incase I'm just missing something obvious.

Jonathan


> 


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug 219192] drivers/iio/imu/adis16400.o: warning: objtool: adis16400_write_raw() falls through to next function adis16400_show_flash_count()
  2024-08-25  9:35 [Bug 219192] New: drivers/iio/imu/adis16400.o: warning: objtool: adis16400_write_raw() falls through to next function adis16400_show_flash_count() bugzilla-daemon
  2024-08-25  9:35 ` [Bug 219192] " bugzilla-daemon
  2024-08-26 10:11 ` [Bug 219192] New: " Jonathan Cameron
@ 2024-08-26 10:11 ` bugzilla-daemon
  2024-09-09 14:31 ` bugzilla-daemon
                   ` (12 subsequent siblings)
  15 siblings, 0 replies; 23+ messages in thread
From: bugzilla-daemon @ 2024-08-26 10:11 UTC (permalink / raw)
  To: linux-iio

https://bugzilla.kernel.org/show_bug.cgi?id=219192

--- Comment #1 from Jonathan Cameron (jic23@kernel.org) ---
On Sun, 25 Aug 2024 09:35:37 +0000
bugzilla-daemon@kernel.org wrote:

> https://bugzilla.kernel.org/show_bug.cgi?id=219192
> 
>             Bug ID: 219192
>            Summary: drivers/iio/imu/adis16400.o: warning: objtool:
>                     adis16400_write_raw() falls through to next function
>                     adis16400_show_flash_count()
>            Product: Drivers
>            Version: 2.5
>           Hardware: All
>                 OS: Linux
>             Status: NEW
>           Severity: normal
>           Priority: P3
>          Component: IIO
>           Assignee: drivers_iio@kernel-bugs.kernel.org
>           Reporter: ionut_n2001@yahoo.com
>         Regression: No
> 
> drivers/iio/imu/adis16400.o: warning: objtool: adis16400_write_raw() falls
> through to next function adis16400_show_flash_count()
> 
> Kernel: 6.11.0-rc5 vanilla
> GCC compiler: gcc (Debian 14.1.0-5) 14.1.0

I think this is a false positive.  None of the cases of the switch statement
fail to return and there are unreachable() markings that this
check seems to not be able to see which were added to try and
point out to the compiler that it was failing to identify they
were not possible to get to.

We could add some returns the unreachable paths to work around
this warning I suppose.

Maybe we are doing something wrong otherwise?  I'd like more
eyes on this incase I'm just missing something obvious.

Jonathan


>

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug 219192] drivers/iio/imu/adis16400.o: warning: objtool: adis16400_write_raw() falls through to next function adis16400_show_flash_count()
  2024-08-25  9:35 [Bug 219192] New: drivers/iio/imu/adis16400.o: warning: objtool: adis16400_write_raw() falls through to next function adis16400_show_flash_count() bugzilla-daemon
                   ` (2 preceding siblings ...)
  2024-08-26 10:11 ` [Bug 219192] " bugzilla-daemon
@ 2024-09-09 14:31 ` bugzilla-daemon
  2024-09-09 18:56   ` Jonathan Cameron
  2024-09-09 18:56 ` bugzilla-daemon
                   ` (11 subsequent siblings)
  15 siblings, 1 reply; 23+ messages in thread
From: bugzilla-daemon @ 2024-09-09 14:31 UTC (permalink / raw)
  To: linux-iio

https://bugzilla.kernel.org/show_bug.cgi?id=219192

Andy Shevchenko (andy.shevchenko@gmail.com) changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andy.shevchenko@gmail.com

--- Comment #2 from Andy Shevchenko (andy.shevchenko@gmail.com) ---
Might be related (read discussion in full):
https://lore.kernel.org/platform-driver-x86/Ztlto06GyFxLXz1y@smile.fi.intel.com/.

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [Bug 219192] drivers/iio/imu/adis16400.o: warning: objtool: adis16400_write_raw() falls through to next function adis16400_show_flash_count()
  2024-09-09 14:31 ` bugzilla-daemon
@ 2024-09-09 18:56   ` Jonathan Cameron
  0 siblings, 0 replies; 23+ messages in thread
From: Jonathan Cameron @ 2024-09-09 18:56 UTC (permalink / raw)
  To: bugzilla-daemon; +Cc: linux-iio

On Mon, 09 Sep 2024 14:31:02 +0000
bugzilla-daemon@kernel.org wrote:

> https://bugzilla.kernel.org/show_bug.cgi?id=219192
> 
> Andy Shevchenko (andy.shevchenko@gmail.com) changed:
> 
>            What    |Removed                     |Added
> ----------------------------------------------------------------------------
>                  CC|                            |andy.shevchenko@gmail.com
> 
> --- Comment #2 from Andy Shevchenko (andy.shevchenko@gmail.com) ---
> Might be related (read discussion in full):
> https://lore.kernel.org/platform-driver-x86/Ztlto06GyFxLXz1y@smile.fi.intel.com/.
> 
Thanks.
https://lore.kernel.org/platform-driver-x86/20240906031601.4yodvhurcyi26qb2@treble/
Looks like the relevant info.  So current view from Josh seems to be that
it's a clang bug.  Interesting to see if that holds up if reported to clang
folk (or if there is undefined behaviour none of us are seeing!)

Jonathan




^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug 219192] drivers/iio/imu/adis16400.o: warning: objtool: adis16400_write_raw() falls through to next function adis16400_show_flash_count()
  2024-08-25  9:35 [Bug 219192] New: drivers/iio/imu/adis16400.o: warning: objtool: adis16400_write_raw() falls through to next function adis16400_show_flash_count() bugzilla-daemon
                   ` (3 preceding siblings ...)
  2024-09-09 14:31 ` bugzilla-daemon
@ 2024-09-09 18:56 ` bugzilla-daemon
  2024-09-10  5:42 ` bugzilla-daemon
                   ` (10 subsequent siblings)
  15 siblings, 0 replies; 23+ messages in thread
From: bugzilla-daemon @ 2024-09-09 18:56 UTC (permalink / raw)
  To: linux-iio

https://bugzilla.kernel.org/show_bug.cgi?id=219192

--- Comment #3 from Jonathan Cameron (jic23@kernel.org) ---
On Mon, 09 Sep 2024 14:31:02 +0000
bugzilla-daemon@kernel.org wrote:

> https://bugzilla.kernel.org/show_bug.cgi?id=219192
> 
> Andy Shevchenko (andy.shevchenko@gmail.com) changed:
> 
>            What    |Removed                     |Added
> ----------------------------------------------------------------------------
>                  CC|                            |andy.shevchenko@gmail.com
> 
> --- Comment #2 from Andy Shevchenko (andy.shevchenko@gmail.com) ---
> Might be related (read discussion in full):
>
> https://lore.kernel.org/platform-driver-x86/Ztlto06GyFxLXz1y@smile.fi.intel.com/.
> 
Thanks.
https://lore.kernel.org/platform-driver-x86/20240906031601.4yodvhurcyi26qb2@treble/
Looks like the relevant info.  So current view from Josh seems to be that
it's a clang bug.  Interesting to see if that holds up if reported to clang
folk (or if there is undefined behaviour none of us are seeing!)

Jonathan

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug 219192] drivers/iio/imu/adis16400.o: warning: objtool: adis16400_write_raw() falls through to next function adis16400_show_flash_count()
  2024-08-25  9:35 [Bug 219192] New: drivers/iio/imu/adis16400.o: warning: objtool: adis16400_write_raw() falls through to next function adis16400_show_flash_count() bugzilla-daemon
                   ` (4 preceding siblings ...)
  2024-09-09 18:56 ` bugzilla-daemon
@ 2024-09-10  5:42 ` bugzilla-daemon
  2024-09-14 11:37   ` Jonathan Cameron
  2024-09-14 11:37 ` bugzilla-daemon
                   ` (9 subsequent siblings)
  15 siblings, 1 reply; 23+ messages in thread
From: bugzilla-daemon @ 2024-09-10  5:42 UTC (permalink / raw)
  To: linux-iio

https://bugzilla.kernel.org/show_bug.cgi?id=219192

--- Comment #4 from Andy Shevchenko (andy.shevchenko@gmail.com) ---
...with the difference that here it's GCC...

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [Bug 219192] drivers/iio/imu/adis16400.o: warning: objtool: adis16400_write_raw() falls through to next function adis16400_show_flash_count()
  2024-09-10  5:42 ` bugzilla-daemon
@ 2024-09-14 11:37   ` Jonathan Cameron
  0 siblings, 0 replies; 23+ messages in thread
From: Jonathan Cameron @ 2024-09-14 11:37 UTC (permalink / raw)
  To: bugzilla-daemon; +Cc: linux-iio

On Tue, 10 Sep 2024 05:42:56 +0000
bugzilla-daemon@kernel.org wrote:

> https://bugzilla.kernel.org/show_bug.cgi?id=219192
> 
> --- Comment #4 from Andy Shevchenko (andy.shevchenko@gmail.com) ---
> ...with the difference that here it's GCC...

Good point!

So might be something completely different :(

Jonathan

> 


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug 219192] drivers/iio/imu/adis16400.o: warning: objtool: adis16400_write_raw() falls through to next function adis16400_show_flash_count()
  2024-08-25  9:35 [Bug 219192] New: drivers/iio/imu/adis16400.o: warning: objtool: adis16400_write_raw() falls through to next function adis16400_show_flash_count() bugzilla-daemon
                   ` (5 preceding siblings ...)
  2024-09-10  5:42 ` bugzilla-daemon
@ 2024-09-14 11:37 ` bugzilla-daemon
  2024-10-02 21:24 ` bugzilla-daemon
                   ` (8 subsequent siblings)
  15 siblings, 0 replies; 23+ messages in thread
From: bugzilla-daemon @ 2024-09-14 11:37 UTC (permalink / raw)
  To: linux-iio

https://bugzilla.kernel.org/show_bug.cgi?id=219192

--- Comment #5 from Jonathan Cameron (jic23@kernel.org) ---
On Tue, 10 Sep 2024 05:42:56 +0000
bugzilla-daemon@kernel.org wrote:

> https://bugzilla.kernel.org/show_bug.cgi?id=219192
> 
> --- Comment #4 from Andy Shevchenko (andy.shevchenko@gmail.com) ---
> ...with the difference that here it's GCC...

Good point!

So might be something completely different :(

Jonathan

>

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug 219192] drivers/iio/imu/adis16400.o: warning: objtool: adis16400_write_raw() falls through to next function adis16400_show_flash_count()
  2024-08-25  9:35 [Bug 219192] New: drivers/iio/imu/adis16400.o: warning: objtool: adis16400_write_raw() falls through to next function adis16400_show_flash_count() bugzilla-daemon
                   ` (6 preceding siblings ...)
  2024-09-14 11:37 ` bugzilla-daemon
@ 2024-10-02 21:24 ` bugzilla-daemon
  2024-10-06 10:49   ` Jonathan Cameron
  2024-10-06 10:49 ` bugzilla-daemon
                   ` (7 subsequent siblings)
  15 siblings, 1 reply; 23+ messages in thread
From: bugzilla-daemon @ 2024-10-02 21:24 UTC (permalink / raw)
  To: linux-iio

https://bugzilla.kernel.org/show_bug.cgi?id=219192

--- Comment #6 from Tudor Gheorghiu (tudor.reda@gmail.com) ---
I saw this bugreport and I must say I encountered a somewhat similar but
not quite the same warning message from objtool when compiling with
clang.

This is my environment:
Linux version 6.12.0-rc1+ (Ubuntu clang version 18.1.3 (1ubuntu1), Ubuntu LLD
18.1.3)

This is the objtool warning:
> drivers/iio/imu/adis16400.o: warning: objtool: adis16400_write_raw+0x89:
> can't find jump dest instruction at .text+0x8be

I dissasembled the binary and this is what I found at that offset:
>    0x0000000000000781 <+113>: jmp    0x8a4 <adis16400_write_raw+404>
>    0x0000000000000786 <+118>: mov    %rdi,%r12
>    0x0000000000000789 <+121>: lea    0x30(%r14),%rdi
>    0x000000000000078d <+125>: call   0x792 <adis16400_write_raw+130>
>    0x0000000000000792 <+130>: mov    %r14,%rbx
>    0x0000000000000795 <+133>: add    $0x30,%rbx
>    0x0000000000000799 <+137>: je     0x8be

Looking at .text+0x8be:
> (gdb) x/4i 0x00000000000008be+0x8be
>    0x117c <adis16300_channels+1180>:  add    %al,(%rax)
>    0x117e <adis16300_channels+1182>:  add    %al,(%rax)
>    0x1180 <adis16300_channels+1184>:  add    $0x0,%al
>    0x1182 <adis16300_channels+1186>:  add    %al,(%rax)

I cannot tell if this is an actual issue, or just a false positive,
but I decided to post my findings here nevertheless.

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [Bug 219192] drivers/iio/imu/adis16400.o: warning: objtool: adis16400_write_raw() falls through to next function adis16400_show_flash_count()
  2024-10-02 21:24 ` bugzilla-daemon
@ 2024-10-06 10:49   ` Jonathan Cameron
  0 siblings, 0 replies; 23+ messages in thread
From: Jonathan Cameron @ 2024-10-06 10:49 UTC (permalink / raw)
  To: bugzilla-daemon; +Cc: linux-iio

On Wed, 02 Oct 2024 21:24:56 +0000
bugzilla-daemon@kernel.org wrote:

> https://bugzilla.kernel.org/show_bug.cgi?id=219192
> 
> --- Comment #6 from Tudor Gheorghiu (tudor.reda@gmail.com) ---
> I saw this bugreport and I must say I encountered a somewhat similar but
> not quite the same warning message from objtool when compiling with
> clang.
> 
> This is my environment:
> Linux version 6.12.0-rc1+ (Ubuntu clang version 18.1.3 (1ubuntu1), Ubuntu LLD
> 18.1.3)
> 
> This is the objtool warning:
> > drivers/iio/imu/adis16400.o: warning: objtool: adis16400_write_raw+0x89:
> > can't find jump dest instruction at .text+0x8be  
> 
> I dissasembled the binary and this is what I found at that offset:
> >    0x0000000000000781 <+113>: jmp    0x8a4 <adis16400_write_raw+404>
> >    0x0000000000000786 <+118>: mov    %rdi,%r12
> >    0x0000000000000789 <+121>: lea    0x30(%r14),%rdi
> >    0x000000000000078d <+125>: call   0x792 <adis16400_write_raw+130>
> >    0x0000000000000792 <+130>: mov    %r14,%rbx
> >    0x0000000000000795 <+133>: add    $0x30,%rbx
> >    0x0000000000000799 <+137>: je     0x8be  
> 
> Looking at .text+0x8be:
> > (gdb) x/4i 0x00000000000008be+0x8be
> >    0x117c <adis16300_channels+1180>:  add    %al,(%rax)
> >    0x117e <adis16300_channels+1182>:  add    %al,(%rax)
> >    0x1180 <adis16300_channels+1184>:  add    $0x0,%al
> >    0x1182 <adis16300_channels+1186>:  add    %al,(%rax)  
> 
> I cannot tell if this is an actual issue, or just a false positive,
> but I decided to post my findings here nevertheless.
> 

So far no one has been able to identify an actual problem, so I'm 
treating this a false positive that will eventually get fixed from
the compiler side. Or someone will explain what the issue in the
code is.

Jonathan

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug 219192] drivers/iio/imu/adis16400.o: warning: objtool: adis16400_write_raw() falls through to next function adis16400_show_flash_count()
  2024-08-25  9:35 [Bug 219192] New: drivers/iio/imu/adis16400.o: warning: objtool: adis16400_write_raw() falls through to next function adis16400_show_flash_count() bugzilla-daemon
                   ` (7 preceding siblings ...)
  2024-10-02 21:24 ` bugzilla-daemon
@ 2024-10-06 10:49 ` bugzilla-daemon
  2024-10-06 19:51 ` bugzilla-daemon
                   ` (6 subsequent siblings)
  15 siblings, 0 replies; 23+ messages in thread
From: bugzilla-daemon @ 2024-10-06 10:49 UTC (permalink / raw)
  To: linux-iio

https://bugzilla.kernel.org/show_bug.cgi?id=219192

--- Comment #7 from Jonathan Cameron (jic23@kernel.org) ---
On Wed, 02 Oct 2024 21:24:56 +0000
bugzilla-daemon@kernel.org wrote:

> https://bugzilla.kernel.org/show_bug.cgi?id=219192
> 
> --- Comment #6 from Tudor Gheorghiu (tudor.reda@gmail.com) ---
> I saw this bugreport and I must say I encountered a somewhat similar but
> not quite the same warning message from objtool when compiling with
> clang.
> 
> This is my environment:
> Linux version 6.12.0-rc1+ (Ubuntu clang version 18.1.3 (1ubuntu1), Ubuntu LLD
> 18.1.3)
> 
> This is the objtool warning:
> > drivers/iio/imu/adis16400.o: warning: objtool: adis16400_write_raw+0x89:
> > can't find jump dest instruction at .text+0x8be  
> 
> I dissasembled the binary and this is what I found at that offset:
> >    0x0000000000000781 <+113>: jmp    0x8a4 <adis16400_write_raw+404>
> >    0x0000000000000786 <+118>: mov    %rdi,%r12
> >    0x0000000000000789 <+121>: lea    0x30(%r14),%rdi
> >    0x000000000000078d <+125>: call   0x792 <adis16400_write_raw+130>
> >    0x0000000000000792 <+130>: mov    %r14,%rbx
> >    0x0000000000000795 <+133>: add    $0x30,%rbx
> >    0x0000000000000799 <+137>: je     0x8be  
> 
> Looking at .text+0x8be:
> > (gdb) x/4i 0x00000000000008be+0x8be
> >    0x117c <adis16300_channels+1180>:  add    %al,(%rax)
> >    0x117e <adis16300_channels+1182>:  add    %al,(%rax)
> >    0x1180 <adis16300_channels+1184>:  add    $0x0,%al
> >    0x1182 <adis16300_channels+1186>:  add    %al,(%rax)  
> 
> I cannot tell if this is an actual issue, or just a false positive,
> but I decided to post my findings here nevertheless.
> 

So far no one has been able to identify an actual problem, so I'm 
treating this a false positive that will eventually get fixed from
the compiler side. Or someone will explain what the issue in the
code is.

Jonathan

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug 219192] drivers/iio/imu/adis16400.o: warning: objtool: adis16400_write_raw() falls through to next function adis16400_show_flash_count()
  2024-08-25  9:35 [Bug 219192] New: drivers/iio/imu/adis16400.o: warning: objtool: adis16400_write_raw() falls through to next function adis16400_show_flash_count() bugzilla-daemon
                   ` (8 preceding siblings ...)
  2024-10-06 10:49 ` bugzilla-daemon
@ 2024-10-06 19:51 ` bugzilla-daemon
  2024-10-18 11:02 ` bugzilla-daemon
                   ` (5 subsequent siblings)
  15 siblings, 0 replies; 23+ messages in thread
From: bugzilla-daemon @ 2024-10-06 19:51 UTC (permalink / raw)
  To: linux-iio

https://bugzilla.kernel.org/show_bug.cgi?id=219192

--- Comment #8 from Andy Shevchenko (andy.shevchenko@gmail.com) ---
(In reply to Tudor Gheorghiu from comment #6)
> I saw this bugreport and I must say I encountered a somewhat similar but
> not quite the same warning message from objtool when compiling with
> clang.
> 
> This is my environment:
> Linux version 6.12.0-rc1+ (Ubuntu clang version 18.1.3 (1ubuntu1), Ubuntu
> LLD 18.1.3)
> 
> This is the objtool warning:
> > drivers/iio/imu/adis16400.o: warning: objtool: adis16400_write_raw+0x89:
> > can't find jump dest instruction at .text+0x8be
> 
> I dissasembled the binary and this is what I found at that offset:
> >    0x0000000000000781 <+113>: jmp    0x8a4 <adis16400_write_raw+404>
> >    0x0000000000000786 <+118>: mov    %rdi,%r12
> >    0x0000000000000789 <+121>: lea    0x30(%r14),%rdi
> >    0x000000000000078d <+125>: call   0x792 <adis16400_write_raw+130>
> >    0x0000000000000792 <+130>: mov    %r14,%rbx
> >    0x0000000000000795 <+133>: add    $0x30,%rbx
> >    0x0000000000000799 <+137>: je     0x8be
> 
> Looking at .text+0x8be:
> > (gdb) x/4i 0x00000000000008be+0x8be
> >    0x117c <adis16300_channels+1180>:  add    %al,(%rax)

How did you get 0x117c? It can't be correct offset AFAIU all this.

> >    0x117e <adis16300_channels+1182>:  add    %al,(%rax)
> >    0x1180 <adis16300_channels+1184>:  add    $0x0,%al
> >    0x1182 <adis16300_channels+1186>:  add    %al,(%rax)

The above looks to me like a data or so. But I don't remember by heart the
actual binary codes for these assembly to be sure.

> I cannot tell if this is an actual issue, or just a false positive,
> but I decided to post my findings here nevertheless.

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug 219192] drivers/iio/imu/adis16400.o: warning: objtool: adis16400_write_raw() falls through to next function adis16400_show_flash_count()
  2024-08-25  9:35 [Bug 219192] New: drivers/iio/imu/adis16400.o: warning: objtool: adis16400_write_raw() falls through to next function adis16400_show_flash_count() bugzilla-daemon
                   ` (9 preceding siblings ...)
  2024-10-06 19:51 ` bugzilla-daemon
@ 2024-10-18 11:02 ` bugzilla-daemon
  2024-10-18 17:39   ` Jonathan Cameron
  2024-10-18 17:39 ` bugzilla-daemon
                   ` (4 subsequent siblings)
  15 siblings, 1 reply; 23+ messages in thread
From: bugzilla-daemon @ 2024-10-18 11:02 UTC (permalink / raw)
  To: linux-iio

https://bugzilla.kernel.org/show_bug.cgi?id=219192

--- Comment #9 from Andy Shevchenko (andy.shevchenko@gmail.com) ---
This
https://git.kernel.org/pub/scm/linux/kernel/git/hid/hid.git/commit/?h=for-6.13/core&id=b2b8a75e1d88c551a0b30d44d0be552210219eea
one is related and may be used as an example how to fix that.

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [Bug 219192] drivers/iio/imu/adis16400.o: warning: objtool: adis16400_write_raw() falls through to next function adis16400_show_flash_count()
  2024-10-18 11:02 ` bugzilla-daemon
@ 2024-10-18 17:39   ` Jonathan Cameron
  0 siblings, 0 replies; 23+ messages in thread
From: Jonathan Cameron @ 2024-10-18 17:39 UTC (permalink / raw)
  To: bugzilla-daemon; +Cc: linux-iio

On Fri, 18 Oct 2024 11:02:41 +0000
bugzilla-daemon@kernel.org wrote:

> https://bugzilla.kernel.org/show_bug.cgi?id=219192
> 
> --- Comment #9 from Andy Shevchenko (andy.shevchenko@gmail.com) ---
> This
> https://git.kernel.org/pub/scm/linux/kernel/git/hid/hid.git/commit/?h=for-6.13/core&id=b2b8a75e1d88c551a0b30d44d0be552210219eea
> one is related and may be used as an example how to fix that.
> 

Maybe.  Though not quite the same as in this case the code
really is unreachable. The compiler is simply failing to discover it.
We could but BUG() in all these places but that is nasty.

The series:
https://lore.kernel.org/all/20241001-cleanup-if_not_cond_guard-v1-0-7753810b0f7a@baylibre.com/

gives code the compiler should never fail to figure out, so
using that instead is a better approach in my opinion and
Peter Z just applied the infrastructure to his tree today.

Jonathan



^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug 219192] drivers/iio/imu/adis16400.o: warning: objtool: adis16400_write_raw() falls through to next function adis16400_show_flash_count()
  2024-08-25  9:35 [Bug 219192] New: drivers/iio/imu/adis16400.o: warning: objtool: adis16400_write_raw() falls through to next function adis16400_show_flash_count() bugzilla-daemon
                   ` (10 preceding siblings ...)
  2024-10-18 11:02 ` bugzilla-daemon
@ 2024-10-18 17:39 ` bugzilla-daemon
  2025-01-23 17:45 ` bugzilla-daemon
                   ` (3 subsequent siblings)
  15 siblings, 0 replies; 23+ messages in thread
From: bugzilla-daemon @ 2024-10-18 17:39 UTC (permalink / raw)
  To: linux-iio

https://bugzilla.kernel.org/show_bug.cgi?id=219192

--- Comment #10 from Jonathan Cameron (jic23@kernel.org) ---
On Fri, 18 Oct 2024 11:02:41 +0000
bugzilla-daemon@kernel.org wrote:

> https://bugzilla.kernel.org/show_bug.cgi?id=219192
> 
> --- Comment #9 from Andy Shevchenko (andy.shevchenko@gmail.com) ---
> This
>
> https://git.kernel.org/pub/scm/linux/kernel/git/hid/hid.git/commit/?h=for-6.13/core&id=b2b8a75e1d88c551a0b30d44d0be552210219eea
> one is related and may be used as an example how to fix that.
> 

Maybe.  Though not quite the same as in this case the code
really is unreachable. The compiler is simply failing to discover it.
We could but BUG() in all these places but that is nasty.

The series:
https://lore.kernel.org/all/20241001-cleanup-if_not_cond_guard-v1-0-7753810b0f7a@baylibre.com/

gives code the compiler should never fail to figure out, so
using that instead is a better approach in my opinion and
Peter Z just applied the infrastructure to his tree today.

Jonathan

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug 219192] drivers/iio/imu/adis16400.o: warning: objtool: adis16400_write_raw() falls through to next function adis16400_show_flash_count()
  2024-08-25  9:35 [Bug 219192] New: drivers/iio/imu/adis16400.o: warning: objtool: adis16400_write_raw() falls through to next function adis16400_show_flash_count() bugzilla-daemon
                   ` (11 preceding siblings ...)
  2024-10-18 17:39 ` bugzilla-daemon
@ 2025-01-23 17:45 ` bugzilla-daemon
  2025-01-25 11:39   ` Jonathan Cameron
  2025-01-25 11:39 ` bugzilla-daemon
                   ` (2 subsequent siblings)
  15 siblings, 1 reply; 23+ messages in thread
From: bugzilla-daemon @ 2025-01-23 17:45 UTC (permalink / raw)
  To: linux-iio

https://bugzilla.kernel.org/show_bug.cgi?id=219192

--- Comment #11 from Andy Shevchenko (andy.shevchenko@gmail.com) ---
Do we still have this issue in the latest vanilla (v6.13)? Looking again at the
code I'm wondering why we can't simply use guard()() instead of scoped_guard().
It might actually fix this.

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [Bug 219192] drivers/iio/imu/adis16400.o: warning: objtool: adis16400_write_raw() falls through to next function adis16400_show_flash_count()
  2025-01-23 17:45 ` bugzilla-daemon
@ 2025-01-25 11:39   ` Jonathan Cameron
  0 siblings, 0 replies; 23+ messages in thread
From: Jonathan Cameron @ 2025-01-25 11:39 UTC (permalink / raw)
  To: bugzilla-daemon; +Cc: linux-iio

On Thu, 23 Jan 2025 17:45:29 +0000
bugzilla-daemon@kernel.org wrote:

> https://bugzilla.kernel.org/show_bug.cgi?id=219192
> 
> --- Comment #11 from Andy Shevchenko (andy.shevchenko@gmail.com) ---
> Do we still have this issue in the latest vanilla (v6.13)? Looking again at the
> code I'm wondering why we can't simply use guard()() instead of scoped_guard().
> It might actually fix this.
> 

Is this actually a bug rather than a false warning?
My impression was that this is a compiler problem and I'm not that keen to modify
drivers to work around that unless the resulting module is actually broken.

If we have to, just add pointless returns instead of unreachable() markings
with a comment to say they are unreachable but we suppressing a toolchain
issue.

Jonathan


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug 219192] drivers/iio/imu/adis16400.o: warning: objtool: adis16400_write_raw() falls through to next function adis16400_show_flash_count()
  2024-08-25  9:35 [Bug 219192] New: drivers/iio/imu/adis16400.o: warning: objtool: adis16400_write_raw() falls through to next function adis16400_show_flash_count() bugzilla-daemon
                   ` (12 preceding siblings ...)
  2025-01-23 17:45 ` bugzilla-daemon
@ 2025-01-25 11:39 ` bugzilla-daemon
  2025-04-30  6:33 ` bugzilla-daemon
  2025-05-05 12:02 ` bugzilla-daemon
  15 siblings, 0 replies; 23+ messages in thread
From: bugzilla-daemon @ 2025-01-25 11:39 UTC (permalink / raw)
  To: linux-iio

https://bugzilla.kernel.org/show_bug.cgi?id=219192

--- Comment #12 from Jonathan Cameron (jic23@kernel.org) ---
On Thu, 23 Jan 2025 17:45:29 +0000
bugzilla-daemon@kernel.org wrote:

> https://bugzilla.kernel.org/show_bug.cgi?id=219192
> 
> --- Comment #11 from Andy Shevchenko (andy.shevchenko@gmail.com) ---
> Do we still have this issue in the latest vanilla (v6.13)? Looking again at
> the
> code I'm wondering why we can't simply use guard()() instead of
> scoped_guard().
> It might actually fix this.
> 

Is this actually a bug rather than a false warning?
My impression was that this is a compiler problem and I'm not that keen to
modify
drivers to work around that unless the resulting module is actually broken.

If we have to, just add pointless returns instead of unreachable() markings
with a comment to say they are unreachable but we suppressing a toolchain
issue.

Jonathan

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.

^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug 219192] drivers/iio/imu/adis16400.o: warning: objtool: adis16400_write_raw() falls through to next function adis16400_show_flash_count()
  2024-08-25  9:35 [Bug 219192] New: drivers/iio/imu/adis16400.o: warning: objtool: adis16400_write_raw() falls through to next function adis16400_show_flash_count() bugzilla-daemon
                   ` (13 preceding siblings ...)
  2025-01-25 11:39 ` bugzilla-daemon
@ 2025-04-30  6:33 ` bugzilla-daemon
  2025-05-05 12:02   ` Jonathan Cameron
  2025-05-05 12:02 ` bugzilla-daemon
  15 siblings, 1 reply; 23+ messages in thread
From: bugzilla-daemon @ 2025-04-30  6:33 UTC (permalink / raw)
  To: linux-iio

https://bugzilla.kernel.org/show_bug.cgi?id=219192

--- Comment #13 from Andy Shevchenko (andy.shevchenko@gmail.com) ---
Another thread pointed out to the `BUG()` instead of `unreacheable()` which
should solve the issue. Can we go that direction?

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [Bug 219192] drivers/iio/imu/adis16400.o: warning: objtool: adis16400_write_raw() falls through to next function adis16400_show_flash_count()
  2025-04-30  6:33 ` bugzilla-daemon
@ 2025-05-05 12:02   ` Jonathan Cameron
  0 siblings, 0 replies; 23+ messages in thread
From: Jonathan Cameron @ 2025-05-05 12:02 UTC (permalink / raw)
  To: bugzilla-daemon; +Cc: linux-iio

On Wed, 30 Apr 2025 06:33:42 +0000
bugzilla-daemon@kernel.org wrote:

> https://bugzilla.kernel.org/show_bug.cgi?id=219192
> 
> --- Comment #13 from Andy Shevchenko (andy.shevchenko@gmail.com) ---
> Another thread pointed out to the `BUG()` instead of `unreacheable()` which
> should solve the issue. Can we go that direction?
> 

Ok.  Maybe replace them with something that doesn't loose readability such as
BUG(); /* Unreachable */


^ permalink raw reply	[flat|nested] 23+ messages in thread

* [Bug 219192] drivers/iio/imu/adis16400.o: warning: objtool: adis16400_write_raw() falls through to next function adis16400_show_flash_count()
  2024-08-25  9:35 [Bug 219192] New: drivers/iio/imu/adis16400.o: warning: objtool: adis16400_write_raw() falls through to next function adis16400_show_flash_count() bugzilla-daemon
                   ` (14 preceding siblings ...)
  2025-04-30  6:33 ` bugzilla-daemon
@ 2025-05-05 12:02 ` bugzilla-daemon
  15 siblings, 0 replies; 23+ messages in thread
From: bugzilla-daemon @ 2025-05-05 12:02 UTC (permalink / raw)
  To: linux-iio

https://bugzilla.kernel.org/show_bug.cgi?id=219192

--- Comment #14 from Jonathan Cameron (jic23@kernel.org) ---
On Wed, 30 Apr 2025 06:33:42 +0000
bugzilla-daemon@kernel.org wrote:

> https://bugzilla.kernel.org/show_bug.cgi?id=219192
> 
> --- Comment #13 from Andy Shevchenko (andy.shevchenko@gmail.com) ---
> Another thread pointed out to the `BUG()` instead of `unreacheable()` which
> should solve the issue. Can we go that direction?
> 

Ok.  Maybe replace them with something that doesn't loose readability such as
BUG(); /* Unreachable */

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.

^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2025-05-05 12:02 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-25  9:35 [Bug 219192] New: drivers/iio/imu/adis16400.o: warning: objtool: adis16400_write_raw() falls through to next function adis16400_show_flash_count() bugzilla-daemon
2024-08-25  9:35 ` [Bug 219192] " bugzilla-daemon
2024-08-26 10:11 ` [Bug 219192] New: " Jonathan Cameron
2024-08-26 10:11 ` [Bug 219192] " bugzilla-daemon
2024-09-09 14:31 ` bugzilla-daemon
2024-09-09 18:56   ` Jonathan Cameron
2024-09-09 18:56 ` bugzilla-daemon
2024-09-10  5:42 ` bugzilla-daemon
2024-09-14 11:37   ` Jonathan Cameron
2024-09-14 11:37 ` bugzilla-daemon
2024-10-02 21:24 ` bugzilla-daemon
2024-10-06 10:49   ` Jonathan Cameron
2024-10-06 10:49 ` bugzilla-daemon
2024-10-06 19:51 ` bugzilla-daemon
2024-10-18 11:02 ` bugzilla-daemon
2024-10-18 17:39   ` Jonathan Cameron
2024-10-18 17:39 ` bugzilla-daemon
2025-01-23 17:45 ` bugzilla-daemon
2025-01-25 11:39   ` Jonathan Cameron
2025-01-25 11:39 ` bugzilla-daemon
2025-04-30  6:33 ` bugzilla-daemon
2025-05-05 12:02   ` Jonathan Cameron
2025-05-05 12:02 ` bugzilla-daemon

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).