Page 1 of 1

blackmagic-io module doesn't compile on kernel 5.13

PostPosted: Thu Jul 22, 2021 12:24 pm
by goldyfruit
Hi,

I got a kernel update on my desktop, and during the DKMS process, the "blackmagic-io" module didn't compile on kernel 5.13 (which is pretty new I know). I got all the kernel headers, etc...

On kernel 5.12.19 everything works fine.

Here is the trace:
Code: Select all
DKMS make.log for blackmagic-io-12.1a9 for kernel 5.13.4-xanmod1 (x86_64)
Thu Jul 22 08:18:32 AM EDT 2021
touch .blackmagic.o.cmd
make -C /lib/modules/5.13.4-xanmod1/build M=/var/lib/dkms/blackmagic-io/12.1a9/build
make[1]: Entering directory '/usr/src/linux-headers-5.13.4-xanmod1'
  CC [M]  /var/lib/dkms/blackmagic-io/12.1a9/build/bmio_client.o
  CC [M]  /var/lib/dkms/blackmagic-io/12.1a9/build/bmio_dev.o
  CC [M]  /var/lib/dkms/blackmagic-io/12.1a9/build/bmio_device.o
  CC [M]  /var/lib/dkms/blackmagic-io/12.1a9/build/bmio_driver.o
  CC [M]  /var/lib/dkms/blackmagic-io/12.1a9/build/bmio_serial.o
  CC [M]  /var/lib/dkms/blackmagic-io/12.1a9/build/bmio_export.o
  CC [M]  /var/lib/dkms/blackmagic-io/12.1a9/build/bmio_pci_ids.o
  CC [M]  /var/lib/dkms/blackmagic-io/12.1a9/build/bm_locks.o
  CC [M]  /var/lib/dkms/blackmagic-io/12.1a9/build/bm_mm.o
  CC [M]  /var/lib/dkms/blackmagic-io/12.1a9/build/bm_pci.o
  CC [M]  /var/lib/dkms/blackmagic-io/12.1a9/build/bm_util.o
  SHIPPED /var/lib/dkms/blackmagic-io/12.1a9/build/blackmagic.o
  CC [M]  /var/lib/dkms/blackmagic-io/12.1a9/build/bmio_audio.o
/var/lib/dkms/blackmagic-io/12.1a9/build/bm_mm.c: In function ‘bm_dma_get_physical_segment’:
/var/lib/dkms/blackmagic-io/12.1a9/build/bm_mm.c:331:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
  331 |  addr64_t startAddr = dlist->addrs[page_n] + page_offset;
      |  ^~~~~~~~
/var/lib/dkms/blackmagic-io/12.1a9/build/bmio_serial.c: In function ‘bmio_serial_remove’:
/var/lib/dkms/blackmagic-io/12.1a9/build/bmio_serial.c:267:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
  267 |  struct tty_struct *tty = tty_port_tty_get(&serial->port);
      |  ^~~~~~
  LD [M]  /var/lib/dkms/blackmagic-io/12.1a9/build/snd_blackmagic-io.o
  LD [M]  /var/lib/dkms/blackmagic-io/12.1a9/build/blackmagic-io.o
  MODPOST /var/lib/dkms/blackmagic-io/12.1a9/build/Module.symvers
ERROR: modpost: "X86_FEATURE_LA57" [/var/lib/dkms/blackmagic-io/12.1a9/build/blackmagic-io.ko] undefined!
make[2]: *** [scripts/Makefile.modpost:150: /var/lib/dkms/blackmagic-io/12.1a9/build/Module.symvers] Error 1
make[2]: *** Deleting file '/var/lib/dkms/blackmagic-io/12.1a9/build/Module.symvers'
make[1]: *** [Makefile:1768: modules] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.13.4-xanmod1'
make: *** [Makefile:47: all] Error 2

Cheers,

Gaëtan

Re: blackmagic-io module doesn't compile on kernel 5.13

PostPosted: Wed Jul 28, 2021 7:15 am
by pwrzec
I have the same problem with kernel 5.13.2 and 5.13.4. I'm using openSUSE Thumbleed. The driver (12.1a9) compilation works fine in kernel below 5.13, e.g., 5.12.
I'm not particularly good at writing kernel modules, but I found something.
The constant "X86_FEATURE_LA57" is defined in <asm/cpufeatures.h>. You can find it here too: https://elixir.bootlin.com/linux/v5.13. ... res.h#L360
X86_FEATURE_LA57 is only present in object files: bm_util.o and blackmagic-io.o. There is nowhere in the source code.

I think that "postmode error: undefined" is in some way connected to the linking problem.
Is maybe someone who can help to solve this problem?

Cheers,
Piotr Wrzeciono

Re: blackmagic-io module doesn't compile on kernel 5.13

PostPosted: Tue Aug 03, 2021 10:53 pm
by goldyfruit
pwrzec wrote:I have the same problem with kernel 5.13.2 and 5.13.4. I'm using openSUSE Thumbleed. The driver (12.1a9) compilation works fine in kernel below 5.13, e.g., 5.12.
I'm not particularly good at writing kernel modules, but I found something.
The constant "X86_FEATURE_LA57" is defined in <asm/cpufeatures.h>. You can find it here too: https://elixir.bootlin.com/linux/v5.13. ... res.h#L360
X86_FEATURE_LA57 is only present in object files: bm_util.o and blackmagic-io.o. There is nowhere in the source code.

I think that "postmode error: undefined" is in some way connected to the linking problem.
Is maybe someone who can help to solve this problem?

Cheers,
Piotr Wrzeciono

We will have to wait until a new version of Desktop Video will be released. For now I just rolled back to 5.12.

Re: blackmagic-io module doesn't compile on kernel 5.13

PostPosted: Tue Aug 24, 2021 1:19 pm
by dpinson
This has to do with 5-level paging. There is/was a kernel compilation selection (CONFIG_X86_5LEVEL) that has to be selected to get X86_FEATURE_LA57 to show up. Hopefully, this information will help to get the changes needed quickly. Need this now!

Re: blackmagic-io module doesn't compile on kernel 5.13

PostPosted: Mon Sep 06, 2021 5:12 pm
by goldyfruit
dpinson wrote:This has to do with 5-level paging. There is/was a kernel compilation selection (CONFIG_X86_5LEVEL) that has to be selected to get X86_FEATURE_LA57 to show up. Hopefully, this information will help to get the changes needed quickly. Need this now!

Hope it will help.

Re: blackmagic-io module doesn't compile on kernel 5.13

PostPosted: Fri Sep 10, 2021 5:46 am
by Cameron Nichols
Hi Gaëtan,

To build blackmagic-io 12.1 module against kernel 5.13, please download the attached patch file

To apply the patch:
Code: Select all
cd /usr/src/blackmagic-io-12.1a9
sudo patch < ~/Downloads/bm_util.c_5.13.4-200.fc34.x86_64.patch
sudo dkms install -m blackmagic-io -v 12.1a9

This fix will be in a future Desktop Video release. I hope this helps.

Regards
Cameron

Re: blackmagic-io module doesn't compile on kernel 5.13

PostPosted: Fri Sep 10, 2021 6:22 pm
by pwrzec
The patch works fine in kernel 5.13. But the pointer's errors occurred in kernel 5.14, both in "blackmagic" and "blackmagic-io" modules.

blackmagic kernel module:
Code: Select all
DKMS make.log for blackmagic-12.1a9 for kernel 5.14.0-1-default (x86_64)
pią, 10 wrz 2021, 20:10:40 CEST
touch .bmd-support.o.cmd
make -C /lib/modules/5.14.0-1-default/build M=/var/lib/dkms/blackmagic/12.1a9/build
make[1]: Wejście do katalogu '/usr/src/linux-5.14.0-1-obj/x86_64/default'
  CC [M]  /var/lib/dkms/blackmagic/12.1a9/build/blackmagic_serial.o
  CC [M]  /var/lib/dkms/blackmagic/12.1a9/build/blackmagic_lib.o
  CC [M]  /var/lib/dkms/blackmagic/12.1a9/build/blackmagic_core.o
  CC [M]  /var/lib/dkms/blackmagic/12.1a9/build/blackmagic_dma.o
  SHIPPED /var/lib/dkms/blackmagic/12.1a9/build/bmd-support.o
  CC [M]  /var/lib/dkms/blackmagic/12.1a9/build/blackmagic_gate.o
/var/lib/dkms/blackmagic/12.1a9/build/blackmagic_serial.c:520:23: error: initialization of ‘unsigned int (*)(struct tty_struct *)’ from incompatible pointer type ‘int (*)(struct tty_struct *)’ [-Werror=incompatible-pointer-types]
  520 |         .write_room = blackmagic_serial_write_room,
      |                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/var/lib/dkms/blackmagic/12.1a9/build/blackmagic_serial.c:520:23: note: (near initialization for ‘blackmagic_tty_ops.write_room’)
/var/lib/dkms/blackmagic/12.1a9/build/blackmagic_serial.c:521:28: error: initialization of ‘unsigned int (*)(struct tty_struct *)’ from incompatible pointer type ‘int (*)(struct tty_struct *)’ [-Werror=incompatible-pointer-types]
  521 |         .chars_in_buffer = blackmagic_serial_chars_in_buffer,
      |                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/var/lib/dkms/blackmagic/12.1a9/build/blackmagic_serial.c:521:28: note: (near initialization for ‘blackmagic_tty_ops.chars_in_buffer’)
cc1: some warnings being treated as errors
make[3]: *** [/usr/src/linux-5.14.0-1/scripts/Makefile.build:272: /var/lib/dkms/blackmagic/12.1a9/build/blackmagic_serial.o] Błąd 1
make[3]: *** Oczekiwanie na niezakończone zadania....
make[2]: *** [/usr/src/linux-5.14.0-1/Makefile:1865: /var/lib/dkms/blackmagic/12.1a9/build] Błąd 2
make[1]: *** [../../../linux-5.14.0-1/Makefile:220: __sub-make] Błąd 2
make[1]: Opuszczenie katalogu '/usr/src/linux-5.14.0-1-obj/x86_64/default'
make: *** [Makefile:44: all] Błąd 2



blackmagic-io kernel module:
Code: Select all
DKMS make.log for blackmagic-io-12.1a9 for kernel 5.14.0-1-default (x86_64)
pią, 10 wrz 2021, 20:17:43 CEST
touch .blackmagic.o.cmd
make -C /lib/modules/5.14.0-1-default/build M=/var/lib/dkms/blackmagic-io/12.1a9/build
make[1]: Wejście do katalogu '/usr/src/linux-5.14.0-1-obj/x86_64/default'
  CC [M]  /var/lib/dkms/blackmagic-io/12.1a9/build/bmio_client.o
  CC [M]  /var/lib/dkms/blackmagic-io/12.1a9/build/bmio_dev.o
  CC [M]  /var/lib/dkms/blackmagic-io/12.1a9/build/bmio_device.o
  CC [M]  /var/lib/dkms/blackmagic-io/12.1a9/build/bmio_driver.o
  CC [M]  /var/lib/dkms/blackmagic-io/12.1a9/build/bmio_serial.o
  CC [M]  /var/lib/dkms/blackmagic-io/12.1a9/build/bmio_export.o
  CC [M]  /var/lib/dkms/blackmagic-io/12.1a9/build/bmio_pci_ids.o
  CC [M]  /var/lib/dkms/blackmagic-io/12.1a9/build/bm_locks.o
  CC [M]  /var/lib/dkms/blackmagic-io/12.1a9/build/bm_mm.o
  CC [M]  /var/lib/dkms/blackmagic-io/12.1a9/build/bm_pci.o
  CC [M]  /var/lib/dkms/blackmagic-io/12.1a9/build/bm_util.o
  SHIPPED /var/lib/dkms/blackmagic-io/12.1a9/build/blackmagic.o
  CC [M]  /var/lib/dkms/blackmagic-io/12.1a9/build/bmio_audio.o
/var/lib/dkms/blackmagic-io/12.1a9/build/bm_mm.c: In function ‘bm_dma_get_physical_segment’:
/var/lib/dkms/blackmagic-io/12.1a9/build/bm_mm.c:331:9: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
  331 |         addr64_t startAddr = dlist->addrs[page_n] + page_offset;
      |         ^~~~~~~~
/var/lib/dkms/blackmagic-io/12.1a9/build/bmio_serial.c:173:23: error: initialization of ‘unsigned int (*)(struct tty_struct *)’ from incompatible pointer type ‘int (*)(struct tty_struct *)’ [-Werror=incompatible-pointer-types]
  173 |         .write_room = serial_write_room,
      |                       ^~~~~~~~~~~~~~~~~
/var/lib/dkms/blackmagic-io/12.1a9/build/bmio_serial.c:173:23: note: (near initialization for ‘serial_ops.write_room’)
/var/lib/dkms/blackmagic-io/12.1a9/build/bmio_serial.c:174:28: error: initialization of ‘unsigned int (*)(struct tty_struct *)’ from incompatible pointer type ‘int (*)(struct tty_struct *)’ [-Werror=incompatible-pointer-types]
  174 |         .chars_in_buffer = serial_chars_in_buffer,
      |                            ^~~~~~~~~~~~~~~~~~~~~~
/var/lib/dkms/blackmagic-io/12.1a9/build/bmio_serial.c:174:28: note: (near initialization for ‘serial_ops.chars_in_buffer’)
/var/lib/dkms/blackmagic-io/12.1a9/build/bmio_serial.c: In function ‘bmio_serial_remove’:
/var/lib/dkms/blackmagic-io/12.1a9/build/bmio_serial.c:267:9: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
  267 |         struct tty_struct *tty = tty_port_tty_get(&serial->port);
      |         ^~~~~~
cc1: some warnings being treated as errors
make[3]: *** [/usr/src/linux-5.14.0-1/scripts/Makefile.build:272: /var/lib/dkms/blackmagic-io/12.1a9/build/bmio_serial.o] Błąd 1
make[3]: *** Oczekiwanie na niezakończone zadania....
make[2]: *** [/usr/src/linux-5.14.0-1/Makefile:1865: /var/lib/dkms/blackmagic-io/12.1a9/build] Błąd 2
make[1]: *** [../../../linux-5.14.0-1/Makefile:220: __sub-make] Błąd 2
make[1]: Opuszczenie katalogu '/usr/src/linux-5.14.0-1-obj/x86_64/default'
make: *** [Makefile:47: all] Błąd 2



I hope those errors can be removed soon.

Piotr Wrzeciono

Re: blackmagic-io module doesn't compile on kernel 5.13

PostPosted: Fri Sep 10, 2021 6:57 pm
by goldyfruit
Cameron Nichols wrote:Hi Gaëtan,

To build blackmagic-io 12.1 module against kernel 5.13, please download the attached patch file

To apply the patch:
Code: Select all
cd /usr/src/blackmagic-io-12.1a9
sudo patch < ~/Downloads/bm_util.c_5.13.4-200.fc34.x86_64.patch
sudo dkms install -m blackmagic-io -v 12.1a9

This fix will be in a future Desktop Video release. I hope this helps.

Regards
Cameron

Thanks, the patched worked like a charm, I just had to uninstall the module before

Code: Select all
╰─λ uname -r
5.13.15-xanmod1
╰─λ lsmod | grep blackm
blackmagic_io        1916928  2

Re: blackmagic-io module doesn't compile on kernel 5.13

PostPosted: Thu Sep 16, 2021 12:22 pm
by NVieville
Hello,

Maybe the patch provided will be helpful in order to build blackmagic-io 12.1 module against kernel 5.13.x (at least on Fedora 34 here) without issues and warnings.

Cordially,

--
NVieville

Re: blackmagic-io module doesn't compile on kernel 5.13

PostPosted: Fri Sep 17, 2021 3:43 pm
by goldyfruit
NVieville wrote:Hello,

Maybe the patch provided will be helpful in order to build blackmagic-io 12.1 module against kernel 5.13.x (at least on Fedora 34 here) without issues and warnings.

Cordially,

--
NVieville

A patch has been already provided by Blackmagic: viewtopic.php?f=12&t=144876#p788448
This is the patch content:
Code: Select all
--- bm_util.old.c   2021-05-17 15:44:36.000000000 +1000
+++ bm_util.c   2021-07-26 14:46:37.088542000 +1000
@@ -24,7 +24,6 @@
 ** DEALINGS IN THE SOFTWARE.
 ** -LICENSE-END-
 */
-#include <asm/io.h>
 #include <linux/delay.h>
 #include <linux/hash.h>
 #include <linux/interrupt.h>
@@ -41,6 +40,7 @@
 #include <linux/uaccess.h>
 #include <linux/vmalloc.h>
 #include <linux/wait.h>
+#include <asm/io.h>
 #include "bm_version.h"
 #if KERNEL_VERSION_OR_LATER(2, 6, 20)
    #include <linux/freezer.h>

Re: blackmagic-io module doesn't compile on kernel 5.13

PostPosted: Mon Sep 20, 2021 5:14 pm
by NVieville
goldyfruit wrote:A patch has been already provided by Blackmagic: viewtopic.php?f=12&t=144876#p788448


Hello goldyfruit,

Thank you very much for pointing this. Maybe I didn't explained so much that the proposed patch was a little bit different and was also addressing warnings at compile time, sorry.

Here below, two more patches that are supposed to address compilation errors against 5.14.x kernel. They are supposed to be used once the previous patch applied (against kernel 5.13.x). As kernel 5.14.x hasn't landed yet on my production machine, I can' tell if these patches work. Tests are probably needed. Feedback would be really appreciated.

First patch file name could be blackmagic-12.1a9-001-fix_5.14.x.patch:
Code: Select all
diff -Naur ./blackmagic-12.1a9.orig/blackmagic_serial.c ./blackmagic-12.1a9/blackmagic_serial.c
--- ./blackmagic-12.1a9-001-fix_5.13.14_build/blackmagic_serial.c   2021-05-17 07:44:36.000000000 +0200
+++ ./blackmagic-12.1a9/blackmagic_serial.c   2021-09-20 13:56:08.195573871 +0200
@@ -471,7 +471,11 @@
    return blackmagic_serial_enqueue_data(get_driver_from_serial(sdev), data, count);
 }
 
+#if KERNEL_VERSION_OR_LATER(5, 14, 0)
+static unsigned int blackmagic_serial_write_room(struct tty_struct *tty)
+#else
 static int blackmagic_serial_write_room(struct tty_struct *tty)
+#endif
 {
    unsigned long iflags;
    struct blackmagic_serial *sdev = find_serial_by_tty(tty);
@@ -493,7 +497,11 @@
    return room;
 }
 
+#if KERNEL_VERSION_OR_LATER(5, 14, 0)
+static unsigned int blackmagic_serial_chars_in_buffer(struct tty_struct *tty)
+#else
 static int blackmagic_serial_chars_in_buffer(struct tty_struct *tty)
+#endif
 {
    unsigned long iflags;
    struct blackmagic_serial *sdev = find_serial_by_tty(tty);


Second patch file name could be blackmagic-io-12.1a9-002-fix_5.14.x.patch:
Code: Select all
diff -Naur ./blackmagic-io-12.1a9.orig/bmio_serial.c ./blackmagic-io-12.1a9/bmio_serial.c
--- ./blackmagic-io-12.1a9-001-fix_5.13.14_build/bmio_serial.c   2021-09-16 13:59:00.408994906 +0200
+++ ./blackmagic-io-12.1a9/bmio_serial.c   2021-09-20 13:56:08.223573870 +0200
@@ -142,7 +142,11 @@
    return bmio_serial_write(serial, data, count);
 }
 
+#if KERNEL_VERSION_OR_LATER(5, 14, 0)
+static unsigned int serial_write_room(struct tty_struct *tty)
+#else
 static int serial_write_room(struct tty_struct *tty)
+#endif
 {
    bmio_serial_t *serial = get_driver_by_index(tty->index);
    if (IS_ERR(serial))
@@ -151,7 +155,11 @@
    return bmio_serial_write_room(serial);
 }
 
+#if KERNEL_VERSION_OR_LATER(5, 14, 0)
+static unsigned int serial_chars_in_buffer(struct tty_struct *tty)
+#else
 static int serial_chars_in_buffer(struct tty_struct *tty)
+#endif
 {
    bmio_serial_t *serial = get_driver_by_index(tty->index);
    if (IS_ERR(serial))


Hope this will help.

Cordially,


--
NVieville

Re: blackmagic-io module doesn't compile on kernel 5.13

PostPosted: Tue Oct 12, 2021 2:27 pm
by goldyfruit
In complement of NVieville previous message about kernel 5.14:
Code: Select all
DKMS make.log for blackmagic-12.1a9 for kernel 5.14.11-xanmod1 (x86_64)
Mon Oct 11 06:39:33 PM EDT 2021
touch .bmd-support.o.cmd
make -C /lib/modules/5.14.11-xanmod1/build M=/var/lib/dkms/blackmagic/12.1a9/build
make[1]: Entering directory '/usr/src/linux-headers-5.14.11-xanmod1'
  CC [M]  /var/lib/dkms/blackmagic/12.1a9/build/blackmagic_serial.o
  CC [M]  /var/lib/dkms/blackmagic/12.1a9/build/blackmagic_core.o
  CC [M]  /var/lib/dkms/blackmagic/12.1a9/build/blackmagic_lib.o
  CC [M]  /var/lib/dkms/blackmagic/12.1a9/build/blackmagic_dma.o
  CC [M]  /var/lib/dkms/blackmagic/12.1a9/build/blackmagic_gate.o
  SHIPPED /var/lib/dkms/blackmagic/12.1a9/build/bmd-support.o
/var/lib/dkms/blackmagic/12.1a9/build/blackmagic_serial.c:520:16: error: initialization of ‘unsigned int (*)(struct tty_struct *)’ from incompatible pointer type ‘int (*)(struct tty_struct *)’ [-Werror=incompatible-pointer-types]
  520 |  .write_room = blackmagic_serial_write_room,
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/var/lib/dkms/blackmagic/12.1a9/build/blackmagic_serial.c:520:16: note: (near initialization for ‘blackmagic_tty_ops.write_room’)
/var/lib/dkms/blackmagic/12.1a9/build/blackmagic_serial.c:521:21: error: initialization of ‘unsigned int (*)(struct tty_struct *)’ from incompatible pointer type ‘int (*)(struct tty_struct *)’ [-Werror=incompatible-pointer-types]
  521 |  .chars_in_buffer = blackmagic_serial_chars_in_buffer,
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/var/lib/dkms/blackmagic/12.1a9/build/blackmagic_serial.c:521:21: note: (near initialization for ‘blackmagic_tty_ops.chars_in_buffer’)
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:271: /var/lib/dkms/blackmagic/12.1a9/build/blackmagic_serial.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [Makefile:1859: /var/lib/dkms/blackmagic/12.1a9/build] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.14.11-xanmod1'
make: *** [Makefile:44: all] Error 2

Re: blackmagic-io module doesn't compile on kernel 5.13

PostPosted: Tue Oct 12, 2021 2:51 pm
by goldyfruit
NVieville wrote:As kernel 5.14.x hasn't landed yet on my production machine, I can' tell if these patches work. Tests are probably needed. Feedback would be really appreciated.
Your patches are working on kernel 5.14, thanks. ;)
Code: Select all
╰─λ lsmod | grep blackm
blackmagic            565248  0
blackmagic_io        1912832  3
╰─λ uname -r
5.14.10-xanmod1

Re: blackmagic-io module doesn't compile on kernel 5.13

PostPosted: Thu Oct 28, 2021 1:28 pm
by goldyfruit
Desktop Video 12.2 has been released Tuesday and everything works fine (on Pop!OS 21.10).

Code: Select all
$ lsmod | grep black                                                                                                                                                                                                 
blackmagic            565248  0
blackmagic_io        1921024  2

Code: Select all
$ modinfo blackmagic_io                                                                                                                                                                                             
filename:       /lib/modules/5.14.15-xanmod1/kernel/drivers/blackmagic-io/blackmagic-io.ko
license:        Proprietary
version:        12.2a12
description:    Blackmagic Design BlackmagicIO driver
author:         Blackmagic Design Inc. <developer@blackmagicdesign.com>
srcversion:     EA324DD096B6D1E037C3436
alias:          pci:v0000BDBDd0000A155sv*sd*bc*sc*i*
alias:          pci:v0000BDBDd0000A154sv*sd*bc*sc*i*
alias:          pci:v0000BDBDd0000A150sv*sd*bc*sc*i*
alias:          pci:v0000BDBDd0000A14Fsv*sd*bc*sc*i*
alias:          pci:v0000BDBDd0000A14Esv*sd*bc*sc*i*
alias:          pci:v0000BDBDd0000A14Bsv*sd*bc*sc*i*
alias:          pci:v0000BDBDd0000A148sv*sd*bc*sc*i*
alias:          pci:v0000BDBDd0000A147sv*sd*bc*sc*i*
alias:          pci:v0000BDBDd0000A144sv*sd*bc*sc*i*
alias:          pci:v0000BDBDd0000A143sv*sd*bc*sc*i*
alias:          pci:v0000BDBDd0000A142sv*sd*bc*sc*i*
alias:          pci:v0000BDBDd0000A141sv*sd*bc*sc*i*
alias:          pci:v0000BDBDd0000A140sv*sd*bc*sc*i*
alias:          pci:v0000BDBDd0000A13Fsv*sd*bc*sc*i*
alias:          pci:v0000BDBDd0000A13Esv*sd*bc*sc*i*
alias:          pci:v0000BDBDd0000A13Dsv*sd*bc*sc*i*
alias:          pci:v0000BDBDd0000A13Csv*sd*bc*sc*i*
alias:          pci:v0000BDBDd0000A13Bsv*sd*bc*sc*i*
alias:          pci:v0000BDBDd0000A13Asv*sd*bc*sc*i*
alias:          pci:v0000BDBDd0000A139sv*sd*bc*sc*i*
alias:          pci:v0000BDBDd0000A138sv*sd*bc*sc*i*
alias:          pci:v0000BDBDd0000A137sv*sd*bc*sc*i*
alias:          pci:v0000BDBDd0000A136sv*sd*bc*sc*i*
alias:          pci:v0000BDBDd0000A132sv*sd*bc*sc*i*
alias:          pci:v0000BDBDd0000A130sv*sd*bc*sc*i*
alias:          pci:v0000BDBDd0000A12Esv*sd*bc*sc*i*
alias:          pci:v0000BDBDd0000A12Dsv*sd*bc*sc*i*
depends:       
retpoline:      Y
name:           blackmagic_io
vermagic:       5.14.15-xanmod1 SMP mod_unload modversions
parm:           irq:The default irq type: msi, legacy (charp)
parm:           tty:Serial TTY driver is enabled (bool)

Re: blackmagic-io module doesn't compile on kernel 5.13

PostPosted: Fri Nov 05, 2021 5:50 pm
by goldyfruit
Just tried with kernel 5.15 and it does not compile as well.
Code: Select all
# cat /var/lib/dkms/blackmagic-io/12.2a12/build/make.log
DKMS make.log for blackmagic-io-12.2a12 for kernel 5.15.0-76051500-generic (x86_64)
Fri Nov  5 01:46:43 PM EDT 2021
touch .blackmagic.o.cmd

make -C /lib/modules/5.15.0-76051500-generic/build M=/var/lib/dkms/blackmagic-io/12.2a12/build
make[1]: Entering directory '/usr/src/linux-headers-5.15.0-76051500-generic'
  CC [M]  /var/lib/dkms/blackmagic-io/12.2a12/build/bmio_client.o
  CC [M]  /var/lib/dkms/blackmagic-io/12.2a12/build/bmio_dev.o
  CC [M]  /var/lib/dkms/blackmagic-io/12.2a12/build/bmio_device.o
  CC [M]  /var/lib/dkms/blackmagic-io/12.2a12/build/bmio_driver.o
  CC [M]  /var/lib/dkms/blackmagic-io/12.2a12/build/bmio_serial.o
  CC [M]  /var/lib/dkms/blackmagic-io/12.2a12/build/bmio_export.o
  CC [M]  /var/lib/dkms/blackmagic-io/12.2a12/build/bmio_pci_ids.o
  CC [M]  /var/lib/dkms/blackmagic-io/12.2a12/build/bm_locks.o
  CC [M]  /var/lib/dkms/blackmagic-io/12.2a12/build/bm_mm.o
  CC [M]  /var/lib/dkms/blackmagic-io/12.2a12/build/bm_pci.o
  CC [M]  /var/lib/dkms/blackmagic-io/12.2a12/build/bm_util.o
  SHIPPED /var/lib/dkms/blackmagic-io/12.2a12/build/blackmagic.o
  CC [M]  /var/lib/dkms/blackmagic-io/12.2a12/build/bmio_audio.o
/var/lib/dkms/blackmagic-io/12.2a12/build/bm_mm.c: In function ‘bm_dma_get_physical_segment’:
/var/lib/dkms/blackmagic-io/12.2a12/build/bm_mm.c:331:9: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
  331 |         addr64_t startAddr = dlist->addrs[page_n] + page_offset;
      |         ^~~~~~~~
/var/lib/dkms/blackmagic-io/12.2a12/build/bmio_serial.c: In function ‘bmio_serial_driver_init’:
/var/lib/dkms/blackmagic-io/12.2a12/build/bmio_serial.c:307:37: error: implicit declaration of function ‘alloc_tty_driver’ [-Werror=implicit-function-declaration]
  307 |         struct tty_driver* serial = alloc_tty_driver(MAX_SERIAL_LINES);
      |                                     ^~~~~~~~~~~~~~~~
/var/lib/dkms/blackmagic-io/12.2a12/build/bmio_serial.c:307:37: warning: initialization of ‘struct tty_driver *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
/var/lib/dkms/blackmagic-io/12.2a12/build/bmio_serial.c:327:17: error: implicit declaration of function ‘put_tty_driver’ [-Werror=implicit-function-declaration]
  327 |                 put_tty_driver(serial);
      |                 ^~~~~~~~~~~~~~
  LD [M]  /var/lib/dkms/blackmagic-io/12.2a12/build/snd_blackmagic-io.o
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:277: /var/lib/dkms/blackmagic-io/12.2a12/build/bmio_serial.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [Makefile:1874: /var/lib/dkms/blackmagic-io/12.2a12/build] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.15.0-76051500-generic'
make: *** [Makefile:47: all] Error 2
Code: Select all
# cat /var/lib/dkms/blackmagic/12.2a12/build/make.log
DKMS make.log for blackmagic-12.2a12 for kernel 5.15.0-76051500-generic (x86_64)
Fri Nov  5 01:47:36 PM EDT 2021
touch .bmd-support.o.cmd
make -C /lib/modules/5.15.0-76051500-generic/build M=/var/lib/dkms/blackmagic/12.2a12/build
make[1]: Entering directory '/usr/src/linux-headers-5.15.0-76051500-generic'
  CC [M]  /var/lib/dkms/blackmagic/12.2a12/build/blackmagic_serial.o
  CC [M]  /var/lib/dkms/blackmagic/12.2a12/build/blackmagic_core.o
  CC [M]  /var/lib/dkms/blackmagic/12.2a12/build/blackmagic_lib.o
  CC [M]  /var/lib/dkms/blackmagic/12.2a12/build/blackmagic_dma.o
  CC [M]  /var/lib/dkms/blackmagic/12.2a12/build/blackmagic_gate.o
  SHIPPED /var/lib/dkms/blackmagic/12.2a12/build/bmd-support.o
/var/lib/dkms/blackmagic/12.2a12/build/blackmagic_serial.c: In function ‘blackmagic_serial_init’:
/var/lib/dkms/blackmagic/12.2a12/build/blackmagic_serial.c:616:18: error: implicit declaration of function ‘alloc_tty_driver’ [-Werror=implicit-function-declaration]
  616 |         driver = alloc_tty_driver(BLACKMAGIC_SERIAL_MINORS);
      |                  ^~~~~~~~~~~~~~~~
/var/lib/dkms/blackmagic/12.2a12/build/blackmagic_serial.c:616:16: warning: assignment to ‘struct tty_driver *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
  616 |         driver = alloc_tty_driver(BLACKMAGIC_SERIAL_MINORS);
      |                ^
/var/lib/dkms/blackmagic/12.2a12/build/blackmagic_serial.c:642:9: error: implicit declaration of function ‘put_tty_driver’ [-Werror=implicit-function-declaration]
  642 |         put_tty_driver(driver);
      |         ^~~~~~~~~~~~~~
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:277: /var/lib/dkms/blackmagic/12.2a12/build/blackmagic_serial.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [Makefile:1874: /var/lib/dkms/blackmagic/12.2a12/build] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.15.0-76051500-generic'
make: *** [Makefile:44: all] Error 2

Re: blackmagic-io module doesn't compile on kernel 5.13

PostPosted: Sat Dec 04, 2021 6:54 pm
by Hoggins!
On kernel 5.15, it seems that alloc_tty_driver and put_tty_driver are not available anymore.

Didn't take the time to write a small patch file, but in bmio_serial.c, all you have to do is replace occurrences of
Code: Select all
alloc_tty_driver(<arg>)
with
Code: Select all
tty_alloc_driver(<arg>, 0)
and
Code: Select all
put_tty_driver(<arg>)
with
Code: Select all
tty_driver_kref_put(<arg>)
.

I got it to compile on my Fedora 34 workstation with kernel 5.15.5.

Re: blackmagic-io module doesn't compile on kernel 5.13

PostPosted: Sun Mar 06, 2022 11:11 pm
by mianosm
Is there an announcement mailing list, or distribution users can subscribe to?

I'm currently on Fedora 35 with 5.16.5.200, and modifying the source (for the bmio_serial.c modifications) and recompiling the RPMs are resulting in:

Code: Select all
ERROR   0010: file '/usr/lib64/blackmagic/DesktopVideo/libgcc_s.so.1' contains an empty  in []


Thanks much!