Skip to contentSkip to conversation

linux-next: build failure after merge of the tty tree

DISCUSSION Mark Brown 4 participants 7 messages Jul 13 – Jul 17 Linux-next tree

lore
Share & tools
lore

Mark Brown

author maintainer
#0 lore raw

Hi all,

After merging the tty tree, today's linux-next build (x86_64 allmodconfig) failed like this:

/tmp/next/build/drivers/tty/serial/qcom_geni_serial.c:1925:4: error:
cannot jump from this goto statement to its label

 1925 |                         goto error;
      |                         ^

/tmp/next/build/drivers/tty/serial/qcom_geni_serial.c:1931:44: note:
jump bypasses initialization of variable with __attribute__((cleanup))
1931 | PM_RUNTIME_ACQUIRE_IF_ENABLED(uport->dev, pm);
| ^
/tmp/next/build/drivers/tty/serial/qcom_geni_serial.c:1916:3: error:
cannot jump from this goto statement to its label

 1916 |                 goto error;
      |                 ^

/tmp/next/build/drivers/tty/serial/qcom_geni_serial.c:1931:44: note:
jump bypasses initialization of variable with __attribute__((cleanup))
1931 | PM_RUNTIME_ACQUIRE_IF_ENABLED(uport->dev, pm);
| ^
/tmp/next/build/drivers/tty/serial/qcom_geni_serial.c:1911:3: error:
cannot jump from this goto statement to its label

 1911 |                 goto error;
      |                 ^

/tmp/next/build/drivers/tty/serial/qcom_geni_serial.c:1931:44: note:
jump bypasses initialization of variable with __attribute__((cleanup))
1931 | PM_RUNTIME_ACQUIRE_IF_ENABLED(uport->dev, pm);
| ^
/tmp/next/build/drivers/tty/serial/qcom_geni_serial.c:1887:3: error:
cannot jump from this goto statement to its label

 1887 |                 goto error;
      |                 ^

/tmp/next/build/drivers/tty/serial/qcom_geni_serial.c:1931:44: note:
jump bypasses initialization of variable with __attribute__((cleanup))
1931 | PM_RUNTIME_ACQUIRE_IF_ENABLED(uport->dev, pm);
| ^
/tmp/next/build/drivers/tty/serial/qcom_geni_serial.c:1881:3: error:
cannot jump from this goto statement to its label

 1881 |                 goto error;
      |                 ^

/tmp/next/build/drivers/tty/serial/qcom_geni_serial.c:1931:44: note:
jump bypasses initialization of variable with __attribute__((cleanup))
1931 | PM_RUNTIME_ACQUIRE_IF_ENABLED(uport->dev, pm);
| ^
/tmp/next/build/drivers/tty/serial/qcom_geni_serial.c:1872:4: error:
cannot jump from this goto statement to its label

 1872 |                         goto error;
      |                         ^

/tmp/next/build/drivers/tty/serial/qcom_geni_serial.c:1931:44: note:
jump bypasses initialization of variable with __attribute__((cleanup))
1931 | PM_RUNTIME_ACQUIRE_IF_ENABLED(uport->dev, pm);
| ^
/tmp/next/build/drivers/tty/serial/qcom_geni_serial.c:1864:4: error:
cannot jump from this goto statement to its label

 1864 |                         goto error;
      |                         ^

/tmp/next/build/drivers/tty/serial/qcom_geni_serial.c:1931:44: note:
jump bypasses initialization of variable with __attribute__((cleanup))
1931 | PM_RUNTIME_ACQUIRE_IF_ENABLED(uport->dev, pm);
| ^
/tmp/next/build/drivers/tty/serial/qcom_geni_serial.c:1848:3: error:
cannot jump from this goto statement to its label

 1848 |                 goto error;
      |                 ^

/tmp/next/build/drivers/tty/serial/qcom_geni_serial.c:1931:44: note:
jump bypasses initialization of variable with __attribute__((cleanup))
1931 | PM_RUNTIME_ACQUIRE_IF_ENABLED(uport->dev, pm);
| ^
8 errors generated.

Caused by commit

3d71f8d7eeb37 (serial: qcom-geni: remove .pm callback, use runtime PM in startup/shutdown)

I have used the tree from next-20260710 instead.

#1 lore raw

Hi Mark,

Quoted 63 lines · Mark Brown

Hi all,

After merging the tty tree, today's linux-next build (x86_64 allmodconfig) failed like this:

/tmp/next/build/drivers/tty/serial/qcom_geni_serial.c:1925:4: error:
cannot jump from this goto statement to its label

  1925 |                         goto error;
       |                         ^

/tmp/next/build/drivers/tty/serial/qcom_geni_serial.c:1931:44: note:
jump bypasses initialization of variable with __attribute__((cleanup))
1931 | PM_RUNTIME_ACQUIRE_IF_ENABLED(uport->dev, pm);
| ^
/tmp/next/build/drivers/tty/serial/qcom_geni_serial.c:1916:3: error:
cannot jump from this goto statement to its label

  1916 |                 goto error;
       |                 ^

/tmp/next/build/drivers/tty/serial/qcom_geni_serial.c:1931:44: note:
jump bypasses initialization of variable with __attribute__((cleanup))
1931 | PM_RUNTIME_ACQUIRE_IF_ENABLED(uport->dev, pm);
| ^
/tmp/next/build/drivers/tty/serial/qcom_geni_serial.c:1911:3: error:
cannot jump from this goto statement to its label

  1911 |                 goto error;
       |                 ^

/tmp/next/build/drivers/tty/serial/qcom_geni_serial.c:1931:44: note:
jump bypasses initialization of variable with __attribute__((cleanup))
1931 | PM_RUNTIME_ACQUIRE_IF_ENABLED(uport->dev, pm);
| ^
/tmp/next/build/drivers/tty/serial/qcom_geni_serial.c:1887:3: error:
cannot jump from this goto statement to its label

  1887 |                 goto error;
       |                 ^

/tmp/next/build/drivers/tty/serial/qcom_geni_serial.c:1931:44: note:
jump bypasses initialization of variable with __attribute__((cleanup))
1931 | PM_RUNTIME_ACQUIRE_IF_ENABLED(uport->dev, pm);
| ^
/tmp/next/build/drivers/tty/serial/qcom_geni_serial.c:1881:3: error:
cannot jump from this goto statement to its label

  1881 |                 goto error;
       |                 ^

/tmp/next/build/drivers/tty/serial/qcom_geni_serial.c:1931:44: note:
jump bypasses initialization of variable with __attribute__((cleanup))
1931 | PM_RUNTIME_ACQUIRE_IF_ENABLED(uport->dev, pm);
| ^
/tmp/next/build/drivers/tty/serial/qcom_geni_serial.c:1872:4: error:
cannot jump from this goto statement to its label

  1872 |                         goto error;
       |                         ^

/tmp/next/build/drivers/tty/serial/qcom_geni_serial.c:1931:44: note:
jump bypasses initialization of variable with __attribute__((cleanup))
1931 | PM_RUNTIME_ACQUIRE_IF_ENABLED(uport->dev, pm);
| ^
/tmp/next/build/drivers/tty/serial/qcom_geni_serial.c:1864:4: error:
cannot jump from this goto statement to its label

  1864 |                         goto error;
       |                         ^

/tmp/next/build/drivers/tty/serial/qcom_geni_serial.c:1931:44: note:
jump bypasses initialization of variable with __attribute__((cleanup))
1931 | PM_RUNTIME_ACQUIRE_IF_ENABLED(uport->dev, pm);
| ^
/tmp/next/build/drivers/tty/serial/qcom_geni_serial.c:1848:3: error:
cannot jump from this goto statement to its label

Quoted 7 lines
  1848 |                 goto error;
       |                 ^

/tmp/next/build/drivers/tty/serial/qcom_geni_serial.c:1931:44: note:
jump bypasses initialization of variable with __attribute__((cleanup))
1931 | PM_RUNTIME_ACQUIRE_IF_ENABLED(uport->dev, pm);
| ^
8 errors generated.

I don't see these errors in my local build. Is there any specific way to build to see these errors?

Thanks,

Praveen Talari

Quoted 6 lines

Caused by commit

3d71f8d7eeb37 (serial: qcom-geni: remove .pm callback, use runtime PM in startup/shutdown)

I have used the tree from next-20260710 instead.

#2 lore raw
Quoted 74 lines · Praveen Talari

Hi Mark,

Quoted 63 lines · Mark Brown

Hi all,

After merging the tty tree, today's linux-next build (x86_64 allmodconfig) failed like this:

/tmp/next/build/drivers/tty/serial/qcom_geni_serial.c:1925:4: error:
cannot jump from this goto statement to its label

  1925 |                         goto error;
       |                         ^

/tmp/next/build/drivers/tty/serial/qcom_geni_serial.c:1931:44: note:
jump bypasses initialization of variable with __attribute__((cleanup))
1931 | PM_RUNTIME_ACQUIRE_IF_ENABLED(uport->dev, pm);
| ^
/tmp/next/build/drivers/tty/serial/qcom_geni_serial.c:1916:3: error:
cannot jump from this goto statement to its label

  1916 |                 goto error;
       |                 ^

/tmp/next/build/drivers/tty/serial/qcom_geni_serial.c:1931:44: note:
jump bypasses initialization of variable with __attribute__((cleanup))
1931 | PM_RUNTIME_ACQUIRE_IF_ENABLED(uport->dev, pm);
| ^
/tmp/next/build/drivers/tty/serial/qcom_geni_serial.c:1911:3: error:
cannot jump from this goto statement to its label

  1911 |                 goto error;
       |                 ^

/tmp/next/build/drivers/tty/serial/qcom_geni_serial.c:1931:44: note:
jump bypasses initialization of variable with __attribute__((cleanup))
1931 | PM_RUNTIME_ACQUIRE_IF_ENABLED(uport->dev, pm);
| ^
/tmp/next/build/drivers/tty/serial/qcom_geni_serial.c:1887:3: error:
cannot jump from this goto statement to its label

  1887 |                 goto error;
       |                 ^

/tmp/next/build/drivers/tty/serial/qcom_geni_serial.c:1931:44: note:
jump bypasses initialization of variable with __attribute__((cleanup))
1931 | PM_RUNTIME_ACQUIRE_IF_ENABLED(uport->dev, pm);
| ^
/tmp/next/build/drivers/tty/serial/qcom_geni_serial.c:1881:3: error:
cannot jump from this goto statement to its label

  1881 |                 goto error;
       |                 ^

/tmp/next/build/drivers/tty/serial/qcom_geni_serial.c:1931:44: note:
jump bypasses initialization of variable with __attribute__((cleanup))
1931 | PM_RUNTIME_ACQUIRE_IF_ENABLED(uport->dev, pm);
| ^
/tmp/next/build/drivers/tty/serial/qcom_geni_serial.c:1872:4: error:
cannot jump from this goto statement to its label

  1872 |                         goto error;
       |                         ^

/tmp/next/build/drivers/tty/serial/qcom_geni_serial.c:1931:44: note:
jump bypasses initialization of variable with __attribute__((cleanup))
1931 | PM_RUNTIME_ACQUIRE_IF_ENABLED(uport->dev, pm);
| ^
/tmp/next/build/drivers/tty/serial/qcom_geni_serial.c:1864:4: error:
cannot jump from this goto statement to its label

  1864 |                         goto error;
       |                         ^

/tmp/next/build/drivers/tty/serial/qcom_geni_serial.c:1931:44: note:
jump bypasses initialization of variable with __attribute__((cleanup))
1931 | PM_RUNTIME_ACQUIRE_IF_ENABLED(uport->dev, pm);
| ^
/tmp/next/build/drivers/tty/serial/qcom_geni_serial.c:1848:3: error:
cannot jump from this goto statement to its label

Quoted 7 lines
  1848 |                 goto error;
       |                 ^

/tmp/next/build/drivers/tty/serial/qcom_geni_serial.c:1931:44: note:
jump bypasses initialization of variable with __attribute__((cleanup))
1931 | PM_RUNTIME_ACQUIRE_IF_ENABLED(uport->dev, pm);
| ^
8 errors generated.

Quoted 2 lines

I don't see these errors in my local build. Is there any specific way to build to see these errors?

Have you tried 'allmodconfig'? I'll go do that now too...

thanks,

greg k-h

#3 lore raw
In reply to Praveen Talari
Quoted 74 lines · Praveen Talari

Hi Mark,

Quoted 63 lines · Mark Brown

Hi all,

After merging the tty tree, today's linux-next build (x86_64 allmodconfig) failed like this:

/tmp/next/build/drivers/tty/serial/qcom_geni_serial.c:1925:4: error:
cannot jump from this goto statement to its label

  1925 |                         goto error;
       |                         ^

/tmp/next/build/drivers/tty/serial/qcom_geni_serial.c:1931:44: note:
jump bypasses initialization of variable with __attribute__((cleanup))
1931 | PM_RUNTIME_ACQUIRE_IF_ENABLED(uport->dev, pm);
| ^
/tmp/next/build/drivers/tty/serial/qcom_geni_serial.c:1916:3: error:
cannot jump from this goto statement to its label

  1916 |                 goto error;
       |                 ^

/tmp/next/build/drivers/tty/serial/qcom_geni_serial.c:1931:44: note:
jump bypasses initialization of variable with __attribute__((cleanup))
1931 | PM_RUNTIME_ACQUIRE_IF_ENABLED(uport->dev, pm);
| ^
/tmp/next/build/drivers/tty/serial/qcom_geni_serial.c:1911:3: error:
cannot jump from this goto statement to its label

  1911 |                 goto error;
       |                 ^

/tmp/next/build/drivers/tty/serial/qcom_geni_serial.c:1931:44: note:
jump bypasses initialization of variable with __attribute__((cleanup))
1931 | PM_RUNTIME_ACQUIRE_IF_ENABLED(uport->dev, pm);
| ^
/tmp/next/build/drivers/tty/serial/qcom_geni_serial.c:1887:3: error:
cannot jump from this goto statement to its label

  1887 |                 goto error;
       |                 ^

/tmp/next/build/drivers/tty/serial/qcom_geni_serial.c:1931:44: note:
jump bypasses initialization of variable with __attribute__((cleanup))
1931 | PM_RUNTIME_ACQUIRE_IF_ENABLED(uport->dev, pm);
| ^
/tmp/next/build/drivers/tty/serial/qcom_geni_serial.c:1881:3: error:
cannot jump from this goto statement to its label

  1881 |                 goto error;
       |                 ^

/tmp/next/build/drivers/tty/serial/qcom_geni_serial.c:1931:44: note:
jump bypasses initialization of variable with __attribute__((cleanup))
1931 | PM_RUNTIME_ACQUIRE_IF_ENABLED(uport->dev, pm);
| ^
/tmp/next/build/drivers/tty/serial/qcom_geni_serial.c:1872:4: error:
cannot jump from this goto statement to its label

  1872 |                         goto error;
       |                         ^

/tmp/next/build/drivers/tty/serial/qcom_geni_serial.c:1931:44: note:
jump bypasses initialization of variable with __attribute__((cleanup))
1931 | PM_RUNTIME_ACQUIRE_IF_ENABLED(uport->dev, pm);
| ^
/tmp/next/build/drivers/tty/serial/qcom_geni_serial.c:1864:4: error:
cannot jump from this goto statement to its label

  1864 |                         goto error;
       |                         ^

/tmp/next/build/drivers/tty/serial/qcom_geni_serial.c:1931:44: note:
jump bypasses initialization of variable with __attribute__((cleanup))
1931 | PM_RUNTIME_ACQUIRE_IF_ENABLED(uport->dev, pm);
| ^
/tmp/next/build/drivers/tty/serial/qcom_geni_serial.c:1848:3: error:
cannot jump from this goto statement to its label

Quoted 7 lines
  1848 |                 goto error;
       |                 ^

/tmp/next/build/drivers/tty/serial/qcom_geni_serial.c:1931:44: note:
jump bypasses initialization of variable with __attribute__((cleanup))
1931 | PM_RUNTIME_ACQUIRE_IF_ENABLED(uport->dev, pm);
| ^
8 errors generated.

Quoted 2 lines

I don't see these errors in my local build. Is there any specific way to build to see these errors?

Nope, I can't duplicate this either on my side just by building this branch. Is this coming from a change somewhere else that modifies PM_RUNTIME_ACQUIRE_IF_ENABLED()?

thanks,

greg k-h

author maintainer
#4 lore raw
Quoted 8 lines · Greg KH
Quoted 2 lines · Praveen Talari

I don't see these errors in my local build. Is there any specific way to build to see these errors?

Nope, I can't duplicate this either on my side just by building this branch. Is this coming from a change somewhere else that modifies PM_RUNTIME_ACQUIRE_IF_ENABLED()?

It's something clang reports.

#5 lore raw
Quoted 11 lines · Mark Brown
Quoted 8 lines · Greg KH
Quoted 2 lines · Praveen Talari

I don't see these errors in my local build. Is there any specific way to build to see these errors?

Nope, I can't duplicate this either on my side just by building this branch. Is this coming from a change somewhere else that modifies PM_RUNTIME_ACQUIRE_IF_ENABLED()?

It's something clang reports.

Right, this change is broken, as the cleanup function will be called with an uninitialized pointer on any of the 'goto error' paths before the PM_RUNTIME_ACQUIRE_IF_ENABLED(). This goes against the documentation in include/linux/cleanup.h:

Lastly, given that the benefit of cleanup helpers is removal of “goto”, and that the “goto” statement can jump between scopes, the expectation is that usage of “goto” and cleanup helpers is never mixed in the same function. I.e. for a given routine, convert all resources that need a “goto” cleanup to scope-based cleanup, or convert none of them.

Signature · 2 lines
Cheers,
Nathan
#6 lore raw
Quoted 18 lines · Nathan Chancellor
Quoted 11 lines · Mark Brown
Quoted 8 lines · Greg KH
Quoted 2 lines · Praveen Talari

I don't see these errors in my local build. Is there any specific way to build to see these errors?

Nope, I can't duplicate this either on my side just by building this branch. Is this coming from a change somewhere else that modifies PM_RUNTIME_ACQUIRE_IF_ENABLED()?

It's something clang reports.

Right, this change is broken, as the cleanup function will be called with an uninitialized pointer on any of the 'goto error' paths before the PM_RUNTIME_ACQUIRE_IF_ENABLED(). This goes against the documentation in include/linux/cleanup.h:

Quoted 6 lines

Lastly, given that the benefit of cleanup helpers is removal of “goto”, and that the “goto” statement can jump between scopes, the expectation is that usage of “goto” and cleanup helpers is never mixed in the same function. I.e. for a given routine, convert all resources that need a “goto” cleanup to scope-based cleanup, or convert none of them.

Ok, thanks, I'll go revert the offending commit now, sorry for the delay.

greg k-h