You are not logged in.

#101 2022-08-31 18:45:51

Mario156090
Member
Registered: 2018-12-04
Posts: 9

Re: [SOLVED] Arch no longer updates battery level/state

Hubbleexplorer wrote:

For those who want a recent kernel without the problems use the linux-g14 from the g14 repo  dont use the one in the aur
https://asus-linux.org/wiki/arch-guide/

Yes, that works perfectly. But I believe is linux kernel alternative but not linux-zen alternative.

Offline

#102 2022-08-31 19:18:18

Hubbleexplorer
Member
Registered: 2021-05-15
Posts: 31

Re: [SOLVED] Arch no longer updates battery level/state

Mario156090 wrote:
Hubbleexplorer wrote:

For those who want a recent kernel without the problems use the linux-g14 from the g14 repo  dont use the one in the aur
https://asus-linux.org/wiki/arch-guide/

Yes, that works perfectly. But I believe is linux kernel alternative but not linux-zen alternative.

The one on the aur is not oficial from the team of asus-linux and is severely out of date

Offline

#103 2022-09-02 09:40:55

Andy3153
Member
Registered: 2018-12-24
Posts: 88

Re: [SOLVED] Arch no longer updates battery level/state

seth wrote:

Ok, so you didn't answer loqs' question, however w/ the recent findings that's now moot.
Try to blacklist asus_ec_module and see whether that "fixes" it. If so, you're in the same boat as everyone else in this thread.

Yep, I'm in the same boat as everyone else. I tested both normal and Zen kernel and they both work. But what's the drawback of disabling that module?

Offline

#104 2022-09-02 12:19:47

seth
Member
Registered: 2012-09-03
Posts: 33,644

Offline

#105 2022-09-02 22:30:30

loqs
Member
Registered: 2014-03-06
Posts: 15,505

Re: [SOLVED] Arch no longer updates battery level/state

asus_wmi_ec_sensors is set to be removed.  That module is not built as Arch already ships asus-ec-sensors and the kernel config does not allow the older module to be built when the newer one is built.
blacklisting the newer asus-ec-sensors fixes the issue because ????? and the battery readings come from ????
Edit:
linux-g14-5.19.4.arch1-1-x86_64.pkg.tar.zst from https://arch.asus-linux.org/ does not ship asus_ec_sensors which would be equivalent to blacklisting the module in a kernel that does.

Last edited by loqs (2022-09-02 22:46:49)

Offline

#106 2022-09-03 09:42:42

Andy3153
Member
Registered: 2018-12-24
Posts: 88

Re: [SOLVED] Arch no longer updates battery level/state

seth wrote:

Nothing, see https://bbs.archlinux.org/viewtopic.php … 3#p2054683

We are all currently using the wmi driver since we all blacklisted the ec driver, right? And, from what I understand from that article, the wmi driver is going to get removed? What will we do in the future then? Maybe I'm understanding something wrong

Offline

#107 2022-09-03 11:08:35

cradlemann
Member
Registered: 2017-07-14
Posts: 14

Re: [SOLVED] Arch no longer updates battery level/state

Maybe we should try the opposite and blacklist wmi driver?

Offline

#108 2022-09-03 12:39:09

seth
Member
Registered: 2012-09-03
Posts: 33,644

Re: [SOLVED] Arch no longer updates battery level/state

Blacklisting asus_wmi_ec_sensors will do nothing.

I flubbered the module names in my head and made up a story where a new module was introduced and immediately retracted for being inferior (what kinda happened, just wasn't the relevant one)

asus-ec-sensors was introduced w/ 5.18.0, replacing asus_wmi_ec_sensors - if you blacklist asus-ec-sensors on 5.19 you're neither using it nor asus_wmi_ec_sensors, the battery is likely read via ACPI
So if there's no functional regression between the linux-lts and linux kernels w/ blacklisted asus-ec-sensors, the latter module simply gets "in the way" and causes a stale acpi mutex.

Because of https://bbs.archlinux.org/viewtopic.php … 2#p2054462 you could also try to pass

asus-ec-sensors.mutex_path=":GLOBAL_LOCK"

to the kernel, https://wiki.archlinux.org/title/Kernel_parameters to see whether it's because the mutex path changes midway through and the wrong mutex gets unlocked.

Offline

#109 2022-09-03 12:54:04

cradlemann
Member
Registered: 2017-07-14
Posts: 14

Re: [SOLVED] Arch no longer updates battery level/state

seth wrote:

asus-ec-sensors.mutex_path=":GLOBAL_LOCK"

Not working for me. Too bad. If I understand from the article `asus-ec-sensors` is much better and faster

Offline

#110 2022-09-03 15:46:50

loqs
Member
Registered: 2014-03-06
Posts: 15,505

Re: [SOLVED] Arch no longer updates battery level/state

cradlemann wrote:
seth wrote:

asus-ec-sensors.mutex_path=":GLOBAL_LOCK"

Not working for me. Too bad. If I understand from the article `asus-ec-sensors` is much better and faster

Please try the two kernels from https://bbs.archlinux.org/viewtopic.php … 7#p2054467 The first introduced using the ACPI global lock which is suspected of being the cause of the issue and the second is the previous commit which should not have the issue.

Offline

#111 2022-09-03 19:43:22

cradlemann
Member
Registered: 2017-07-14
Posts: 14

Re: [SOLVED] Arch no longer updates battery level/state

loqs wrote:

Please try the two kernels from https://bbs.archlinux.org/viewtopic.php … 7#p2054467 The first introduced using the ACPI global lock which is suspected of being the cause of the issue and the second is the previous commit which should not have the issue.

I need proper nvidia drivers too

Offline

#112 2022-09-03 19:47:41

loqs
Member
Registered: 2014-03-06
Posts: 15,505

Re: [SOLVED] Arch no longer updates battery level/state

cradlemann wrote:
loqs wrote:

Please try the two kernels from https://bbs.archlinux.org/viewtopic.php … 7#p2054467 The first introduced using the ACPI global lock which is suspected of being the cause of the issue and the second is the previous commit which should not have the issue.

I need proper nvidia drivers too

I included matching header packages.  nvidia-dkms will use those to build nvidia modules for the kernel.

Offline

#113 2022-09-09 01:21:33

Mario156090
Member
Registered: 2018-12-04
Posts: 9

Re: [SOLVED] Arch no longer updates battery level/state

So, is the new kernels works without the module ban option?

Offline

#114 2022-09-09 02:01:53

loqs
Member
Registered: 2014-03-06
Posts: 15,505

Re: [SOLVED] Arch no longer updates battery level/state

Mario156090 wrote:

So, is the new kernels works without the module ban option?

https://lore.kernel.org/all/166ca420-27 … mail.de/T/
Also https://bugzilla.kernel.org/show_bug.cgi?id=216412#c19

Thanks a lot! Now I  understand I have to redo module loading completely.

Edit:
Please see if this fixes the issue
https://git.kernel.org/pub/scm/linux/ke … c1c2f53f3d
Edit2:
Commit cherry-picked and conflicts resolved as it does not apply cleanly which stop it being queued for stable https://lore.kernel.org/stable/16628746 … kroah.com/

commit 8d0a75b676c9f9fdb1873666e43f1b74de14a915
Author: Eugene Shalygin <eugene.shalygin@gmail.com>
Date:   Fri Sep 9 17:56:53 2022 +0200

    hwmon: (asus-ec-sensors) autoload module via DMI data
    
    Replace autoloading data based on the ACPI EC device with the DMI
    records for motherboards models. The ACPI method created a bug that when
    this driver returns error from the probe function because of the
    unsupported motherboard model, the ACPI subsystem concludes
    that the EC device does not work properly.
    
    Fixes: 5cd29012028d ("hwmon: (asus-ec-sensors) introduce ec_board_info struct for board data")
    Bug: https://bugzilla.kernel.org/show_bug.cgi?id=216412
    Bug: https://bugzilla.redhat.com/show_bug.cgi?id=2121844
    Signed-off-by: Eugene Shalygin <eugene.shalygin@gmail.com>
    Link: https://lore.kernel.org/r/20220909155654.123398-2-eugene.shalygin@gmail.com
    Cc: stable@vger.kernel.org
    Signed-off-by: Guenter Roeck <linux@roeck-us.net>
    (cherry picked from commit 88700d1396bae72d9a4c23a48bbd98c1c2f53f3d)
    
     Conflicts:
            drivers/hwmon/asus-ec-sensors.c

diff --git a/drivers/hwmon/asus-ec-sensors.c b/drivers/hwmon/asus-ec-sensors.c
index 3633ab691662..abaade3e6e81 100644
--- a/drivers/hwmon/asus-ec-sensors.c
+++ b/drivers/hwmon/asus-ec-sensors.c
@@ -203,7 +203,6 @@ static const struct ec_sensor_info sensors_family_amd_500[] = {
 #define SENSOR_SET_TEMP_WATER (SENSOR_TEMP_WATER_IN | SENSOR_TEMP_WATER_OUT)
 
 struct ec_board_info {
-	const char *board_names[MAX_IDENTICAL_BOARD_VARIATIONS];
 	unsigned long sensors;
 	/*
 	 * Defines which mutex to use for guarding access to the state and the
@@ -216,121 +215,159 @@ struct ec_board_info {
 	enum board_family family;
 };
 
-static const struct ec_board_info board_info[] = {
-	{
-		.board_names = {"PRIME X470-PRO"},
-		.sensors = SENSOR_SET_TEMP_CHIPSET_CPU_MB |
-			SENSOR_TEMP_T_SENSOR | SENSOR_TEMP_VRM |
-			SENSOR_FAN_CPU_OPT |
-			SENSOR_CURR_CPU | SENSOR_IN_CPU_CORE,
-		.mutex_path = ACPI_GLOBAL_LOCK_PSEUDO_PATH,
-		.family = family_amd_400_series,
-	},
-	{
-		.board_names = {"PRIME X570-PRO"},
-		.sensors = SENSOR_SET_TEMP_CHIPSET_CPU_MB | SENSOR_TEMP_VRM |
-			SENSOR_TEMP_T_SENSOR | SENSOR_FAN_CHIPSET,
-		.mutex_path = ASUS_HW_ACCESS_MUTEX_ASMX,
-		.family = family_amd_500_series,
-	},
-	{
-		.board_names = {"ProArt X570-CREATOR WIFI"},
-		.sensors = SENSOR_SET_TEMP_CHIPSET_CPU_MB | SENSOR_TEMP_VRM |
-			SENSOR_TEMP_T_SENSOR | SENSOR_FAN_CPU_OPT |
-			SENSOR_CURR_CPU | SENSOR_IN_CPU_CORE,
-	},
-	{
-		.board_names = {"Pro WS X570-ACE"},
-		.sensors = SENSOR_SET_TEMP_CHIPSET_CPU_MB | SENSOR_TEMP_VRM |
-			SENSOR_TEMP_T_SENSOR | SENSOR_FAN_CHIPSET |
-			SENSOR_CURR_CPU | SENSOR_IN_CPU_CORE,
-		.mutex_path = ASUS_HW_ACCESS_MUTEX_ASMX,
-		.family = family_amd_500_series,
-	},
-	{
-		.board_names = {"ROG CROSSHAIR VIII DARK HERO"},
-		.sensors = SENSOR_SET_TEMP_CHIPSET_CPU_MB |
-			SENSOR_TEMP_T_SENSOR |
-			SENSOR_TEMP_VRM | SENSOR_SET_TEMP_WATER |
-			SENSOR_FAN_CPU_OPT | SENSOR_FAN_WATER_FLOW |
-			SENSOR_CURR_CPU | SENSOR_IN_CPU_CORE,
-		.mutex_path = ASUS_HW_ACCESS_MUTEX_ASMX,
-		.family = family_amd_500_series,
-	},
-	{
-		.board_names = {
-			"ROG CROSSHAIR VIII FORMULA",
-			"ROG CROSSHAIR VIII HERO",
-			"ROG CROSSHAIR VIII HERO (WI-FI)",
-		},
-		.sensors = SENSOR_SET_TEMP_CHIPSET_CPU_MB |
-			SENSOR_TEMP_T_SENSOR |
-			SENSOR_TEMP_VRM | SENSOR_SET_TEMP_WATER |
-			SENSOR_FAN_CPU_OPT | SENSOR_FAN_CHIPSET |
-			SENSOR_FAN_WATER_FLOW | SENSOR_CURR_CPU |
-			SENSOR_IN_CPU_CORE,
-		.mutex_path = ASUS_HW_ACCESS_MUTEX_ASMX,
-		.family = family_amd_500_series,
-	},
-	{
-		.board_names = {"ROG CROSSHAIR VIII IMPACT"},
-		.sensors = SENSOR_SET_TEMP_CHIPSET_CPU_MB |
-			SENSOR_TEMP_T_SENSOR | SENSOR_TEMP_VRM |
-			SENSOR_FAN_CHIPSET | SENSOR_CURR_CPU |
-			SENSOR_IN_CPU_CORE,
-		.mutex_path = ASUS_HW_ACCESS_MUTEX_ASMX,
-		.family = family_amd_500_series,
-	},
-	{
-		.board_names = {"ROG STRIX B550-E GAMING"},
-		.sensors = SENSOR_SET_TEMP_CHIPSET_CPU_MB |
-			SENSOR_TEMP_T_SENSOR | SENSOR_TEMP_VRM |
-			SENSOR_FAN_CPU_OPT,
-		.mutex_path = ASUS_HW_ACCESS_MUTEX_ASMX,
-		.family = family_amd_500_series,
-	},
-	{
-		.board_names = {"ROG STRIX B550-I GAMING"},
-		.sensors = SENSOR_SET_TEMP_CHIPSET_CPU_MB |
-			SENSOR_TEMP_T_SENSOR | SENSOR_TEMP_VRM |
-			SENSOR_FAN_VRM_HS | SENSOR_CURR_CPU |
-			SENSOR_IN_CPU_CORE,
-		.mutex_path = ASUS_HW_ACCESS_MUTEX_ASMX,
-		.family = family_amd_500_series,
-	},
-	{
-		.board_names = {"ROG STRIX X570-E GAMING"},
-		.sensors = SENSOR_SET_TEMP_CHIPSET_CPU_MB |
-			SENSOR_TEMP_T_SENSOR | SENSOR_TEMP_VRM |
-			SENSOR_FAN_CHIPSET | SENSOR_CURR_CPU |
-			SENSOR_IN_CPU_CORE,
-		.mutex_path = ASUS_HW_ACCESS_MUTEX_ASMX,
-		.family = family_amd_500_series,
-	},
-	{
-		.board_names = {"ROG STRIX X570-E GAMING WIFI II"},
-		.sensors = SENSOR_SET_TEMP_CHIPSET_CPU_MB |
-			SENSOR_TEMP_T_SENSOR | SENSOR_CURR_CPU |
-			SENSOR_IN_CPU_CORE,
-		.mutex_path = ASUS_HW_ACCESS_MUTEX_ASMX,
-		.family = family_amd_500_series,
-	},
-	{
-		.board_names = {"ROG STRIX X570-F GAMING"},
-		.sensors = SENSOR_SET_TEMP_CHIPSET_CPU_MB |
-			SENSOR_TEMP_T_SENSOR | SENSOR_FAN_CHIPSET,
-		.mutex_path = ASUS_HW_ACCESS_MUTEX_ASMX,
-		.family = family_amd_500_series,
-	},
-	{
-		.board_names = {"ROG STRIX X570-I GAMING"},
-		.sensors = SENSOR_TEMP_T_SENSOR | SENSOR_FAN_VRM_HS |
-			SENSOR_FAN_CHIPSET | SENSOR_CURR_CPU |
-			SENSOR_IN_CPU_CORE,
-		.mutex_path = ASUS_HW_ACCESS_MUTEX_ASMX,
-		.family = family_amd_500_series,
-	},
-	{}
+static const struct ec_board_info board_info_prime_x470_pro = {
+	.sensors = SENSOR_SET_TEMP_CHIPSET_CPU_MB |
+		SENSOR_TEMP_T_SENSOR | SENSOR_TEMP_VRM |
+		SENSOR_FAN_CPU_OPT |
+		SENSOR_CURR_CPU | SENSOR_IN_CPU_CORE,
+	.mutex_path = ACPI_GLOBAL_LOCK_PSEUDO_PATH,
+	.family = family_amd_400_series,
+};
+
+static const struct ec_board_info board_info_prime_x570_pro = {
+	.sensors = SENSOR_SET_TEMP_CHIPSET_CPU_MB | SENSOR_TEMP_VRM |
+		SENSOR_TEMP_T_SENSOR | SENSOR_FAN_CHIPSET,
+	.mutex_path = ASUS_HW_ACCESS_MUTEX_ASMX,
+	.family = family_amd_500_series,
+};
+
+static const struct ec_board_info board_info_pro_art_x570_creator_wifi = {
+	.sensors = SENSOR_SET_TEMP_CHIPSET_CPU_MB | SENSOR_TEMP_VRM |
+		SENSOR_TEMP_T_SENSOR | SENSOR_FAN_CPU_OPT |
+		SENSOR_CURR_CPU | SENSOR_IN_CPU_CORE,
+	.family = family_amd_500_series,
+};
+
+static const struct ec_board_info board_info_pro_ws_x570_ace = {
+	.sensors = SENSOR_SET_TEMP_CHIPSET_CPU_MB | SENSOR_TEMP_VRM |
+		SENSOR_TEMP_T_SENSOR | SENSOR_FAN_CHIPSET |
+		SENSOR_CURR_CPU | SENSOR_IN_CPU_CORE,
+	.mutex_path = ASUS_HW_ACCESS_MUTEX_ASMX,
+	.family = family_amd_500_series,
+};
+
+static const struct ec_board_info board_info_crosshair_viii_dark_hero = {
+	.sensors = SENSOR_SET_TEMP_CHIPSET_CPU_MB |
+		SENSOR_TEMP_T_SENSOR |
+		SENSOR_TEMP_VRM | SENSOR_SET_TEMP_WATER |
+		SENSOR_FAN_CPU_OPT | SENSOR_FAN_WATER_FLOW |
+		SENSOR_CURR_CPU | SENSOR_IN_CPU_CORE,
+	.mutex_path = ASUS_HW_ACCESS_MUTEX_ASMX,
+	.family = family_amd_500_series,
+};
+
+static const struct ec_board_info board_info_crosshair_viii_hero = {
+	.sensors = SENSOR_SET_TEMP_CHIPSET_CPU_MB |
+		SENSOR_TEMP_T_SENSOR |
+		SENSOR_TEMP_VRM | SENSOR_SET_TEMP_WATER |
+		SENSOR_FAN_CPU_OPT | SENSOR_FAN_CHIPSET |
+		SENSOR_FAN_WATER_FLOW | SENSOR_CURR_CPU |
+		SENSOR_IN_CPU_CORE,
+	.mutex_path = ASUS_HW_ACCESS_MUTEX_ASMX,
+	.family = family_amd_500_series,
+};
+
+static const struct ec_board_info board_info_crosshair_viii_impact = {
+	.sensors = SENSOR_SET_TEMP_CHIPSET_CPU_MB |
+		SENSOR_TEMP_T_SENSOR | SENSOR_TEMP_VRM |
+		SENSOR_FAN_CHIPSET | SENSOR_CURR_CPU |
+		SENSOR_IN_CPU_CORE,
+	.mutex_path = ASUS_HW_ACCESS_MUTEX_ASMX,
+	.family = family_amd_500_series,
+};
+
+static const struct ec_board_info board_info_strix_b550_e_gaming = {
+	.sensors = SENSOR_SET_TEMP_CHIPSET_CPU_MB |
+		SENSOR_TEMP_T_SENSOR | SENSOR_TEMP_VRM |
+		SENSOR_FAN_CPU_OPT,
+	.mutex_path = ASUS_HW_ACCESS_MUTEX_ASMX,
+	.family = family_amd_500_series,
+};
+
+static const struct ec_board_info board_info_strix_b550_i_gaming = {
+	.sensors = SENSOR_SET_TEMP_CHIPSET_CPU_MB |
+		SENSOR_TEMP_T_SENSOR | SENSOR_TEMP_VRM |
+		SENSOR_FAN_VRM_HS | SENSOR_CURR_CPU |
+		SENSOR_IN_CPU_CORE,
+	.mutex_path = ASUS_HW_ACCESS_MUTEX_ASMX,
+	.family = family_amd_500_series,
+};
+
+static const struct ec_board_info board_info_strix_x570_e_gaming = {
+	.sensors = SENSOR_SET_TEMP_CHIPSET_CPU_MB |
+		SENSOR_TEMP_T_SENSOR | SENSOR_TEMP_VRM |
+		SENSOR_FAN_CHIPSET | SENSOR_CURR_CPU |
+		SENSOR_IN_CPU_CORE,
+	.mutex_path = ASUS_HW_ACCESS_MUTEX_ASMX,
+	.family = family_amd_500_series,
+};
+
+static const struct ec_board_info board_info_strix_x570_e_gaming_wifi_ii = {
+	.sensors = SENSOR_SET_TEMP_CHIPSET_CPU_MB |
+		SENSOR_TEMP_T_SENSOR | SENSOR_CURR_CPU |
+		SENSOR_IN_CPU_CORE,
+	.mutex_path = ASUS_HW_ACCESS_MUTEX_ASMX,
+	.family = family_amd_500_series,
+};
+
+static const struct ec_board_info board_info_strix_x570_f_gaming = {
+	.sensors = SENSOR_SET_TEMP_CHIPSET_CPU_MB |
+		SENSOR_TEMP_T_SENSOR | SENSOR_FAN_CHIPSET,
+	.mutex_path = ASUS_HW_ACCESS_MUTEX_ASMX,
+	.family = family_amd_500_series,
+};
+
+static const struct ec_board_info board_info_strix_x570_i_gaming = {
+	.sensors = SENSOR_TEMP_CHIPSET | SENSOR_TEMP_VRM |
+		SENSOR_TEMP_T_SENSOR |
+		SENSOR_FAN_VRM_HS | SENSOR_FAN_CHIPSET |
+		SENSOR_CURR_CPU | SENSOR_IN_CPU_CORE,
+	.mutex_path = ASUS_HW_ACCESS_MUTEX_ASMX,
+	.family = family_amd_500_series,
+};
+
+#define DMI_EXACT_MATCH_ASUS_BOARD_NAME(name, board_info)                      \
+	{                                                                      \
+		.matches = {                                                   \
+			DMI_EXACT_MATCH(DMI_BOARD_VENDOR,                      \
+					"ASUSTeK COMPUTER INC."),              \
+			DMI_EXACT_MATCH(DMI_BOARD_NAME, name),                 \
+		},                                                             \
+		.driver_data = (void *)board_info,                              \
+	}
+
+static const struct dmi_system_id dmi_table[] = {
+	DMI_EXACT_MATCH_ASUS_BOARD_NAME("PRIME X470-PRO",
+					&board_info_prime_x470_pro),
+	DMI_EXACT_MATCH_ASUS_BOARD_NAME("PRIME X570-PRO",
+					&board_info_prime_x570_pro),
+	DMI_EXACT_MATCH_ASUS_BOARD_NAME("ProArt X570-CREATOR WIFI",
+					&board_info_pro_art_x570_creator_wifi),
+	DMI_EXACT_MATCH_ASUS_BOARD_NAME("Pro WS X570-ACE",
+					&board_info_pro_ws_x570_ace),
+	DMI_EXACT_MATCH_ASUS_BOARD_NAME("ROG CROSSHAIR VIII DARK HERO",
+					&board_info_crosshair_viii_dark_hero),
+	DMI_EXACT_MATCH_ASUS_BOARD_NAME("ROG CROSSHAIR VIII FORMULA",
+					&board_info_crosshair_viii_hero),
+	DMI_EXACT_MATCH_ASUS_BOARD_NAME("ROG CROSSHAIR VIII HERO",
+					&board_info_crosshair_viii_hero),
+	DMI_EXACT_MATCH_ASUS_BOARD_NAME("ROG CROSSHAIR VIII HERO (WI-FI)",
+					&board_info_crosshair_viii_hero),
+	DMI_EXACT_MATCH_ASUS_BOARD_NAME("ROG CROSSHAIR VIII IMPACT",
+					&board_info_crosshair_viii_impact),
+	DMI_EXACT_MATCH_ASUS_BOARD_NAME("ROG STRIX B550-E GAMING",
+					&board_info_strix_b550_e_gaming),
+	DMI_EXACT_MATCH_ASUS_BOARD_NAME("ROG STRIX B550-I GAMING",
+					&board_info_strix_b550_i_gaming),
+	DMI_EXACT_MATCH_ASUS_BOARD_NAME("ROG STRIX X570-E GAMING",
+					&board_info_strix_x570_e_gaming),
+	DMI_EXACT_MATCH_ASUS_BOARD_NAME("ROG STRIX X570-E GAMING WIFI II",
+					&board_info_strix_x570_e_gaming_wifi_ii),
+	DMI_EXACT_MATCH_ASUS_BOARD_NAME("ROG STRIX X570-F GAMING",
+					&board_info_strix_x570_f_gaming),
+	DMI_EXACT_MATCH_ASUS_BOARD_NAME("ROG STRIX X570-I GAMING",
+					&board_info_strix_x570_i_gaming),
+	{},
 };
 
 struct ec_sensor {
@@ -441,12 +478,12 @@ static int find_ec_sensor_index(const struct ec_sensors_data *ec,
 	return -ENOENT;
 }
 
-static int __init bank_compare(const void *a, const void *b)
+static int bank_compare(const void *a, const void *b)
 {
 	return *((const s8 *)a) - *((const s8 *)b);
 }
 
-static void __init setup_sensor_data(struct ec_sensors_data *ec)
+static void setup_sensor_data(struct ec_sensors_data *ec)
 {
 	struct ec_sensor *s = ec->sensors;
 	bool bank_found;
@@ -478,7 +515,7 @@ static void __init setup_sensor_data(struct ec_sensors_data *ec)
 	sort(ec->banks, ec->nr_banks, 1, bank_compare, NULL);
 }
 
-static void __init fill_ec_registers(struct ec_sensors_data *ec)
+static void fill_ec_registers(struct ec_sensors_data *ec)
 {
 	const struct ec_sensor_info *si;
 	unsigned int i, j, register_idx = 0;
@@ -493,7 +530,7 @@ static void __init fill_ec_registers(struct ec_sensors_data *ec)
 	}
 }
 
-static int __init setup_lock_data(struct device *dev)
+static int setup_lock_data(struct device *dev)
 {
 	const char *mutex_path;
 	int status;
@@ -716,7 +753,7 @@ static umode_t asus_ec_hwmon_is_visible(const void *drvdata,
 	return find_ec_sensor_index(state, type, channel) >= 0 ? S_IRUGO : 0;
 }
 
-static int __init
+static int
 asus_ec_hwmon_add_chan_info(struct hwmon_channel_info *asus_ec_hwmon_chan,
 			     struct device *dev, int num,
 			     enum hwmon_sensor_types type, u32 config)
@@ -745,27 +782,15 @@ static struct hwmon_chip_info asus_ec_chip_info = {
 	.ops = &asus_ec_hwmon_ops,
 };
 
-static const struct ec_board_info * __init get_board_info(void)
+static const struct ec_board_info *get_board_info(void)
 {
-	const char *dmi_board_vendor = dmi_get_system_info(DMI_BOARD_VENDOR);
-	const char *dmi_board_name = dmi_get_system_info(DMI_BOARD_NAME);
-	const struct ec_board_info *board;
-
-	if (!dmi_board_vendor || !dmi_board_name ||
-	    strcasecmp(dmi_board_vendor, "ASUSTeK COMPUTER INC."))
-		return NULL;
-
-	for (board = board_info; board->sensors; board++) {
-		if (match_string(board->board_names,
-				 MAX_IDENTICAL_BOARD_VARIATIONS,
-				 dmi_board_name) >= 0)
-			return board;
-	}
+	const struct dmi_system_id *dmi_entry;
 
-	return NULL;
+	dmi_entry = dmi_first_match(dmi_table);
+	return dmi_entry ? dmi_entry->driver_data : NULL;
 }
 
-static int __init asus_ec_probe(struct platform_device *pdev)
+static int asus_ec_probe(struct platform_device *pdev)
 {
 	const struct hwmon_channel_info **ptr_asus_ec_ci;
 	int nr_count[hwmon_max] = { 0 }, nr_types = 0;
@@ -868,29 +893,37 @@ static int __init asus_ec_probe(struct platform_device *pdev)
 	return PTR_ERR_OR_ZERO(hwdev);
 }
 
-
-static const struct acpi_device_id acpi_ec_ids[] = {
-	/* Embedded Controller Device */
-	{ "PNP0C09", 0 },
-	{}
-};
+MODULE_DEVICE_TABLE(dmi, dmi_table);
 
 static struct platform_driver asus_ec_sensors_platform_driver = {
 	.driver = {
 		.name	= "asus-ec-sensors",
-		.acpi_match_table = acpi_ec_ids,
 	},
+	.probe = asus_ec_probe,
 };
 
-MODULE_DEVICE_TABLE(acpi, acpi_ec_ids);
-/*
- * we use module_platform_driver_probe() rather than module_platform_driver()
- * because the probe function (and its dependants) are marked with __init, which
- * means we can't put it into the .probe member of the platform_driver struct
- * above, and we can't mark the asus_ec_sensors_platform_driver object as __init
- * because the object is referenced from the module exit code.
- */
-module_platform_driver_probe(asus_ec_sensors_platform_driver, asus_ec_probe);
+static struct platform_device *asus_ec_sensors_platform_device;
+
+static int __init asus_ec_init(void)
+{
+	asus_ec_sensors_platform_device =
+		platform_create_bundle(&asus_ec_sensors_platform_driver,
+				       asus_ec_probe, NULL, 0, NULL, 0);
+
+	if (IS_ERR(asus_ec_sensors_platform_device))
+		return PTR_ERR(asus_ec_sensors_platform_device);
+
+	return 0;
+}
+
+static void __exit asus_ec_exit(void)
+{
+	platform_device_unregister(asus_ec_sensors_platform_device);
+	platform_driver_unregister(&asus_ec_sensors_platform_driver);
+}
+
+module_init(asus_ec_init);
+module_exit(asus_ec_exit);
 
 module_param_named(mutex_path, mutex_path_override, charp, 0);
 MODULE_PARM_DESC(mutex_path,

Built kernel
https://drive.google.com/file/d/1Qj3V9a … sp=sharing linux-5.19.8.arch1-1.1-x86_64.pkg.tar.zst
https://drive.google.com/file/d/1yWgPF4 … sp=sharing linux-headers-5.19.8.arch1-1.1-x86_64.pkg.tar.zst

Boards the asus-ec-sensors module supports and should be loaded for:
PRIME X470-PRO
PRIME X570-PRO
ProArt X570-CREATOR WIFI
Pro WS X570-ACE
ROG CROSSHAIR VIII DARK HERO
ROG CROSSHAIR VIII FORMULA
ROG CROSSHAIR VIII HERO
ROG CROSSHAIR VIII HERO (WI-FI)
ROG CROSSHAIR VIII IMPACT
ROG STRIX B550-E GAMING
ROG STRIX B550-I GAMING
ROG STRIX X570-E GAMING
ROG STRIX X570-E GAMING WIFI II
ROG STRIX X570-F GAMING
ROG STRIX X570-I GAMING
Edit:
Fixed in 5.19.9 support for the following additional boards was added to allow the commit to apply:
ROG ZENITH II EXTREME
ROG MAXIMUS XI HERO
ROG MAXIMUS XI HERO (WI-FI)

Last edited by loqs (2022-09-15 11:50:55)

Offline

#115 2022-09-16 07:05:13

SAK
Member
From: ubl
Registered: 2016-10-31
Posts: 10

Re: [SOLVED] Arch no longer updates battery level/state

linux 5.19.9.arch1-1 solves this issue.
https://archlinux.org/packages/testing/x86_64/linux/

Offline

#116 2022-09-18 01:12:28

LoreleiPenn
Member
From: México
Registered: 2020-07-31
Posts: 1

Re: [SOLVED] Arch no longer updates battery level/state

SAK wrote:

linux 5.19.9.arch1-1 solves this issue.
https://archlinux.org/packages/testing/x86_64/linux/

It is also solved for linux-zen 5.19.9.zen1-1.

Last edited by LoreleiPenn (2022-09-18 01:12:48)

Offline

#117 2022-09-20 21:41:04

Rijndael1998
Member
Registered: 2022-08-20
Posts: 4

Re: [SOLVED] Arch no longer updates battery level/state

Works on 5.19.9-arch1-1.

Offline

#118 2022-09-20 21:48:30

loqs
Member
Registered: 2014-03-06
Posts: 15,505

Re: [SOLVED] Arch no longer updates battery level/state

@Andy3153 please remember to mark the thread as solved by editing the first post in the thread and prepending [SOLVED].

Offline

#119 2022-09-24 03:00:46

ambition_echo
Member
Registered: 2022-09-24
Posts: 10
Website

Re: [SOLVED] Arch no longer updates battery level/state

I've been using the lts kernel after having this problem and it was working fine, when I saw this problem solved I switched to the 5.19.9 kernel to use, but that night my computer ran into it twice Automatic restart, I didn't find what caused this problem, now I continue to switch to lts kernel to use, no problem with automatic restart, does anyone have the same problem as me? My laptop model is ASUS TUF Gaming A15 FA507RM

Offline

Board footer

Powered by FluxBB