Skip to content

xmm7360: Drop put_tty_driver - #152

Merged
tgxn merged 1 commit into
xmm7360:masterfrom
zear:put_tty_driver_fix
Feb 6, 2022
Merged

tgxn merged 1 commit into
xmm7360:masterfrom
zear:put_tty_driver_fix

Conversation

@zear

@zear zear commented Nov 20, 2021

Copy link
Copy Markdown
Contributor

As of v5.15, the put_tty_driver alias has been dropped in favor of
directly calling tty_driver_kref_put (9f90a4ddef4e). Apply this change
in the xmm7360 driver in order to allow building on recent kernels.

Signed-off-by: Artur Rojek contact@artur-rojek.eu

As of v5.15, the `put_tty_driver` alias has been dropped in favor of
directly calling `tty_driver_kref_put` (9f90a4ddef4e). Apply this change
in the xmm7360 driver in order to allow building on recent kernels.

Signed-off-by: Artur Rojek <contact@artur-rojek.eu>
@zear

zear commented Nov 20, 2021

Copy link
Copy Markdown
Contributor Author

This fixes #150

flokli added a commit to flokli/nixpkgs that referenced this pull request Nov 28, 2021
As of v5.15, the `put_tty_driver` alias has been dropped in favor of
directly calling `tty_driver_kref_put` (9f90a4ddef4e). Apply this change
in the xmm7360 driver in order to allow building on recent kernels.

See xmm7360/xmm7360-pci#152
@flokli

flokli commented Nov 28, 2021

Copy link
Copy Markdown

This seems to be broken both on 5.14 and 5.15:

make -C /nix/store/q8bsakfb9cg8mhdg2d5a10wiag4dbysi-linux-5.14.21-dev/lib/modules/5.14.21/build M=/build/source modules
make[1]: Entering directory '/nix/store/q8bsakfb9cg8mhdg2d5a10wiag4dbysi-linux-5.14.21-dev/lib/modules/5.14.21/build'
  CC [M]  /build/source/xmm7360.o
/build/source/xmm7360.c:1322:16: error: initialization of 'unsigned int (*)(struct tty_struct *)' from incompatible pointer type 'int (*)(struct tty_struct *)' [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wincompatible-pointer-types-Werror=incompatible-pointer-types8;;]
 1322 |  .write_room = xmm7360_tty_write_room,
      |                ^~~~~~~~~~~~~~~~~~~~~~
/build/source/xmm7360.c:1322:16: note: (near initialization for 'xmm7360_tty_ops.write_room')
cc1: some warnings being treated as errors
make[3]: *** [/nix/store/q8bsakfb9cg8mhdg2d5a10wiag4dbysi-linux-5.14.21-dev/lib/modules/5.14.21/source/scripts/Makefile.build:271: /build/source/xmm7360.o] Error 1
make[2]: *** [/nix/store/q8bsakfb9cg8mhdg2d5a10wiag4dbysi-linux-5.14.21-dev/lib/modules/5.14.21/source/Makefile:1858: /build/source] Error 2
make[1]: *** [/nix/store/q8bsakfb9cg8mhdg2d5a10wiag4dbysi-linux-5.14.21-dev/lib/modules/5.14.21/source/Makefile:220: __sub-make] Error 2
make[1]: Leaving directory '/nix/store/q8bsakfb9cg8mhdg2d5a10wiag4dbysi-linux-5.14.21-dev/lib/modules/5.14.21/build'
make: *** [Makefile:9: default] Error 2
error: builder for '/nix/store/fsxn9hy9jjgc70qz7vr0468wcwps3pb2-xmm7360-pci-unstable-2021-07-19.drv' failed with exit code 2;
       last 10 log lines:
       > /build/source/xmm7360.c:1322:16: error: initialization of 'unsigned int (*)(struct tty_struct *)' from incompatible pointer type 'int (*)(struct tty_struct *)' [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wincompatible-pointer-types-Werror=incompatible-pointer-types8;;]
       >  1322 |  .write_room = xmm7360_tty_write_room,
       >       |                ^~~~~~~~~~~~~~~~~~~~~~
       > /build/source/xmm7360.c:1322:16: note: (near initialization for 'xmm7360_tty_ops.write_room')
       > cc1: some warnings being treated as errors
       > make[3]: *** [/nix/store/q8bsakfb9cg8mhdg2d5a10wiag4dbysi-linux-5.14.21-dev/lib/modules/5.14.21/source/scripts/Makefile.build:271: /build/source/xmm7360.o] Error 1
       > make[2]: *** [/nix/store/q8bsakfb9cg8mhdg2d5a10wiag4dbysi-linux-5.14.21-dev/lib/modules/5.14.21/source/Makefile:1858: /build/source] Error 2
       > make[1]: *** [/nix/store/q8bsakfb9cg8mhdg2d5a10wiag4dbysi-linux-5.14.21-dev/lib/modules/5.14.21/source/Makefile:220: __sub-make] Error 2
       > make[1]: Leaving directory '/nix/store/q8bsakfb9cg8mhdg2d5a10wiag4dbysi-linux-5.14.21-dev/lib/modules/5.14.21/build'
       > make: *** [Makefile:9: default] Error 2
       For full logs, run 'nix log /nix/store/fsxn9hy9jjgc70qz7vr0468wcwps3pb2-xmm7360-pci-unstable-2021-07-19.drv'.
build flags: SHELL=/nix/store/l0wlqpbsvh1pgvhcdhw7qkka3d31si7k-bash-5.1-p8/bin/bash KDIR=/nix/store/qsw0596gm8zvlv25w9ckz3wrgk59zmbr-linux-5.15.4-dev/lib/modules/5.15.4/build
make -C /nix/store/qsw0596gm8zvlv25w9ckz3wrgk59zmbr-linux-5.15.4-dev/lib/modules/5.15.4/build M=/build/source modules
make[1]: Entering directory '/nix/store/qsw0596gm8zvlv25w9ckz3wrgk59zmbr-linux-5.15.4-dev/lib/modules/5.15.4/build'
  CC [M]  /build/source/xmm7360.o
/build/source/xmm7360.c:1322:16: error: initialization of 'unsigned int (*)(struct tty_struct *)' from incompatible pointer type 'int (*)(struct tty_struct *)' [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wincompatible-pointer-types-Werror=incompatible-pointer-types8;;]
 1322 |  .write_room = xmm7360_tty_write_room,
      |                ^~~~~~~~~~~~~~~~~~~~~~
/build/source/xmm7360.c:1322:16: note: (near initialization for 'xmm7360_tty_ops.write_room')
cc1: some warnings being treated as errors
make[2]: *** [/nix/store/qsw0596gm8zvlv25w9ckz3wrgk59zmbr-linux-5.15.4-dev/lib/modules/5.15.4/source/scripts/Makefile.build:277: /build/source/xmm7360.o] Error 1
make[1]: *** [/nix/store/qsw0596gm8zvlv25w9ckz3wrgk59zmbr-linux-5.15.4-dev/lib/modules/5.15.4/source/Makefile:1868: /build/source] Error 2
make[1]: Leaving directory '/nix/store/qsw0596gm8zvlv25w9ckz3wrgk59zmbr-linux-5.15.4-dev/lib/modules/5.15.4/build'
make: *** [Makefile:9: default] Error 2
error: builder for '/nix/store/44aswya8v8f9a3g1nabk4n0w4gln8xln-xmm7360-pci-unstable-2021-07-19.drv' failed with exit code 2;
       last 10 log lines:
       >   CC [M]  /build/source/xmm7360.o
       > /build/source/xmm7360.c:1322:16: error: initialization of 'unsigned int (*)(struct tty_struct *)' from incompatible pointer type 'int (*)(struct tty_struct *)' [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wincompatible-pointer-types-Werror=incompatible-pointer-types8;;]
       >  1322 |  .write_room = xmm7360_tty_write_room,
       >       |                ^~~~~~~~~~~~~~~~~~~~~~
       > /build/source/xmm7360.c:1322:16: note: (near initialization for 'xmm7360_tty_ops.write_room')
       > cc1: some warnings being treated as errors
       > make[2]: *** [/nix/store/qsw0596gm8zvlv25w9ckz3wrgk59zmbr-linux-5.15.4-dev/lib/modules/5.15.4/source/scripts/Makefile.build:277: /build/source/xmm7360.o] Error 1
       > make[1]: *** [/nix/store/qsw0596gm8zvlv25w9ckz3wrgk59zmbr-linux-5.15.4-dev/lib/modules/5.15.4/source/Makefile:1868: /build/source] Error 2
       > make[1]: Leaving directory '/nix/store/qsw0596gm8zvlv25w9ckz3wrgk59zmbr-linux-5.15.4-dev/lib/modules/5.15.4/build'
       > make: *** [Makefile:9: default] Error 2
       For full logs, run 'nix log /nix/store/44aswya8v8f9a3g1nabk4n0w4gln8xln-xmm7360-pci-unstable-2021-07-19.drv'.

@zear

zear commented Nov 28, 2021 via email

Copy link
Copy Markdown
Contributor Author

@flokli

flokli commented Nov 28, 2021 •

Copy link
Copy Markdown

@zear you're right. With #139 applied too, this successfully compiles on 5.14 and 5.15.

flokli added a commit to flokli/nixpkgs that referenced this pull request Dec 2, 2021
As of v5.15, the `put_tty_driver` alias has been dropped in favor of
directly calling `tty_driver_kref_put` (9f90a4ddef4e). Apply this change
in the xmm7360 driver in order to allow building on recent kernels:
xmm7360/xmm7360-pci#152

Also, apply some [incompatible pointer type fixes](xmm7360/xmm7360-pci#139)
and [stability fixes](xmm7360/xmm7360-pci#149)
which are queued in that repository.

I successfully built this for 5.14 and 5.15, so let's remove the
isBroken for these versions.
@tgxn

tgxn commented Feb 6, 2022

Copy link
Copy Markdown
Contributor

Similar changes to #159

@zear

zear commented Feb 6, 2022

Copy link
Copy Markdown
Contributor Author

No, his change is similar to mine, as my patch was first.

@tgxn

tgxn commented Feb 6, 2022

Copy link
Copy Markdown
Contributor

No, his change is similar to mine, as my patch was first.

OK, Their change also includes a check for #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0). It seems there's a bit of discussion about tty_driver_kref_put and I'm just catching up.

!139 gives me the same compile issue so I can't apply that without the kernel version check

@tgxn

tgxn commented Feb 6, 2022

Copy link
Copy Markdown
Contributor

That said, this change works with no issues for me.

@zear

zear commented Feb 6, 2022

Copy link
Copy Markdown
Contributor Author

OK, Their change also includes a check for #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 15, 0).

Which is unnecessary, because tty_driver_kref_put exists on prior versions of the kernel.
All that changed is that since 5.15 you have to call this symbol directly. In other words, my patch doesn't impact older kernels and no ugly checks need to be performed.

@tgxn

tgxn commented Feb 6, 2022

Copy link
Copy Markdown
Contributor

Yeah, I see; I agree, your patch for the put_tty_driver change is cleaner, and it works for me (on an older kernel).

My issue was that if we need #139 for this change to work on 5.15, based on the comment above; and that pull isn't working right for me.

@zear

zear commented Feb 6, 2022

Copy link
Copy Markdown
Contributor Author

We don't need #139 for this change to work on 5.15. Those are two separate fixes that can be applied in any order. The driver will simply not compile with -Werror on 5.14 and above without #139, whether this (#152) change is applied or not.

@tgxn
tgxn merged commit 11f5c2f into xmm7360:master Feb 6, 2022
@tgxn

tgxn commented Feb 6, 2022

Copy link
Copy Markdown
Contributor

@zear I see what you mean. The issue above related to the patch in #139. Thanks 👍

@zear

zear commented Feb 6, 2022

Copy link
Copy Markdown
Contributor Author

You're welcome. Glad that my changes are merged now, so there will be no further confusion in the pull requests :)

PS. Is there any faster way of communication with you and other maintainers of this driver, perhaps via e-mail or IRC? I'd like to help with the cleanup and upstream process of this driver, as I'm forced to use LTE on a compatible device on a daily basis.

@tgxn tgxn added this to the kernel 5.15 support milestone Feb 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants