From 772f50fd23e575e69b8d0d912fb6dfcc903b3470 Mon Sep 17 00:00:00 2001 From: John Klug Date: Fri, 10 Sep 2021 04:02:59 -0500 Subject: Fix kernel regression, put radio reset monitor on all products --- configure.ac | 2 +- io-module/machine/mt100eocg.c | 3 +++ io-module/machine/mtcap.c | 3 +++ io-module/machine/mtcap3.c | 3 +++ io-module/machine/mtcdt.c | 7 +++++++ io-module/machine/mtcpm.c | 5 ++++- io-module/machine/mths.c | 3 +++ io-module/machine/mtre.c | 3 +++ io-module/mts_io_module.h | 2 +- io-module/radio_udev_discovery.c | 10 +++++++--- 10 files changed, 35 insertions(+), 6 deletions(-) diff --git a/configure.ac b/configure.ac index 857cf12..7c25e08 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -AC_INIT([mts-io], [4.7.1]) +AC_INIT([mts-io], [4.7.2]) AC_CONFIG_SRCDIR([util/mts_util_lora2_reset.c]) AM_INIT_AUTOMAKE AM_CONFIG_HEADER([config.h]) diff --git a/io-module/machine/mt100eocg.c b/io-module/machine/mt100eocg.c index ac00143..5bb8007 100644 --- a/io-module/machine/mt100eocg.c +++ b/io-module/machine/mt100eocg.c @@ -243,6 +243,9 @@ static struct attribute *mt100eocg_platform_attributes[] = { &dev_attr_adc2.attr, &dev_attr_adc3.attr, + // UDEV notification of radio discovery + &dev_attr_radio_udev_discovery.attr, + &dev_attr_radio_reset_monitor.attr, NULL, }; diff --git a/io-module/machine/mtcap.c b/io-module/machine/mtcap.c index e013f14..9db1218 100644 --- a/io-module/machine/mtcap.c +++ b/io-module/machine/mtcap.c @@ -586,6 +586,9 @@ static struct attribute *mtcap_0_0_platform_attributes[] = { &dev_attr_radio_reset_backoff_index.attr, &dev_attr_radio_reset_backoff_seconds.attr, + // UDEV notification of radio discovery + &dev_attr_radio_udev_discovery.attr, + &dev_attr_radio_reset_monitor.attr, NULL, }; diff --git a/io-module/machine/mtcap3.c b/io-module/machine/mtcap3.c index 8d2f3c4..587a024 100644 --- a/io-module/machine/mtcap3.c +++ b/io-module/machine/mtcap3.c @@ -489,6 +489,9 @@ static struct attribute *mtcap3_0_0_platform_attributes[] = { &dev_attr_radio_enable_mtcap3.attr, + // UDEV notification of radio discovery + &dev_attr_radio_udev_discovery.attr, + &dev_attr_radio_reset_monitor.attr, NULL, }; diff --git a/io-module/machine/mtcdt.c b/io-module/machine/mtcdt.c index aabbc2d..b753a9e 100644 --- a/io-module/machine/mtcdt.c +++ b/io-module/machine/mtcdt.c @@ -405,6 +405,10 @@ static struct attribute *mtcdt_platform_attributes[] = { &dev_attr_radio_reset_backoffs.attr, &dev_attr_radio_reset_backoff_index.attr, &dev_attr_radio_reset_backoff_seconds.attr, + + // UDEV notification of radio discovery + &dev_attr_radio_udev_discovery.attr, + &dev_attr_radio_reset_monitor.attr, NULL, }; @@ -446,6 +450,9 @@ static struct attribute *mtcdt_0_1_platform_attributes[] = { &dev_attr_radio_reset_backoff_index.attr, &dev_attr_radio_reset_backoff_seconds.attr, + // UDEV notification of radio discovery + &dev_attr_radio_udev_discovery.attr, + &dev_attr_radio_reset_monitor.attr, NULL, }; diff --git a/io-module/machine/mtcpm.c b/io-module/machine/mtcpm.c index 964b766..6ed4c6c 100644 --- a/io-module/machine/mtcpm.c +++ b/io-module/machine/mtcpm.c @@ -207,7 +207,10 @@ static struct attribute *mtcpm_platform_attributes[] = { &dev_attr_radio_reset_backoffs.attr, &dev_attr_radio_reset_backoff_index.attr, &dev_attr_radio_reset_backoff_seconds.attr, - + + // UDEV notification of radio discovery + &dev_attr_radio_udev_discovery.attr, + &dev_attr_radio_reset_monitor.attr, NULL, }; diff --git a/io-module/machine/mths.c b/io-module/machine/mths.c index b74e69f..565f6c6 100644 --- a/io-module/machine/mths.c +++ b/io-module/machine/mths.c @@ -872,6 +872,9 @@ static struct attribute *mths_0_0_platform_attributes[] = { &dev_attr_led_e_gpio.attr, &dev_attr_led_f_gpio_mths.attr, + // UDEV notification of radio discovery + &dev_attr_radio_udev_discovery.attr, + &dev_attr_radio_reset_monitor.attr, NULL, }; diff --git a/io-module/machine/mtre.c b/io-module/machine/mtre.c index e3df31c..6a59ebe 100644 --- a/io-module/machine/mtre.c +++ b/io-module/machine/mtre.c @@ -273,6 +273,9 @@ static struct attribute *mtre_0_0_platform_attributes[] = { &dev_attr_oem_string2.attr, #endif + // UDEV notification of radio discovery + &dev_attr_radio_udev_discovery.attr, + &dev_attr_radio_reset_monitor.attr, NULL, }; diff --git a/io-module/mts_io_module.h b/io-module/mts_io_module.h index 15e4b9a..eca15a3 100644 --- a/io-module/mts_io_module.h +++ b/io-module/mts_io_module.h @@ -5,7 +5,7 @@ * MTAC cards. */ -#define DRIVER_VERSION "v4.7.1" +#define DRIVER_VERSION "v4.7.2" #define DRIVER_AUTHOR "Multitech Systems" #define DRIVER_DESC "MTS-IO Controller" #define DRIVER_NAME "mts-io" diff --git a/io-module/radio_udev_discovery.c b/io-module/radio_udev_discovery.c index c6cc98a..88f5d0d 100644 --- a/io-module/radio_udev_discovery.c +++ b/io-module/radio_udev_discovery.c @@ -52,9 +52,13 @@ verify_vpid(struct sig_pid_radio_reset_monitor_s *p) mutex_unlock(&mts_io_mutex); rcu_read_lock(); vpid1 = find_vpid((pid_t)pid0); - if(vpid1 != NULL) - vcount = refcount_read(&vpid1->count); - else + if(vpid1 != NULL) { + #if LINUX_VERSION_CODE >= KERNEL_VERSION(4,15,0) + vcount = refcount_read(&vpid1->count); + #else + vcount = atomic_read(&vpid1->count); + #fi + } else vcount = 0; rcu_read_unlock(); mutex_lock(&mts_io_mutex); -- cgit v1.2.3