All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V4 1/2] ACPI / EC: Fix broken 64bit big-endian users of 'global_lock'
@ 2015-09-25 16:41 ` Viresh Kumar
  0 siblings, 0 replies; 135+ messages in thread
From: Viresh Kumar @ 2015-09-25 16:41 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: linaro-kernel, QCA ath9k Development, Intel Linux Wireless,
	Viresh Kumar, linux-doc, linux-kernel, linux-arm-kernel,
	linux-acpi, linux-bluetooth, iommu, netdev, linux-wireless,
	linux-scsi, linux-usb, linux-edac, linux-mm, alsa-devel

global_lock is defined as an unsigned long and accessing only its lower
32 bits from sysfs is incorrect, as we need to consider other 32 bits
for big endian 64 bit systems. There are no such platforms yet, but the
code needs to be robust for such a case.

Fix that by passing a local variable to debugfs_create_bool() and
assigning its value to global_lock later.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
V3->V4:
- Create a local variable instead of changing type of global_lock
  (Rafael)
- Drop the stable tag
- BCC'd a lot of people (rather than cc'ing them) to make sure
  - the series reaches them
  - mailing lists do not block the patchset due to long cc list
  - and we don't spam the BCC'd people for every reply
---
 drivers/acpi/ec_sys.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/acpi/ec_sys.c b/drivers/acpi/ec_sys.c
index b4c216bab22b..b44b91331a56 100644
--- a/drivers/acpi/ec_sys.c
+++ b/drivers/acpi/ec_sys.c
@@ -110,6 +110,7 @@ static int acpi_ec_add_debugfs(struct acpi_ec *ec, unsigned int ec_device_count)
 	struct dentry *dev_dir;
 	char name[64];
 	umode_t mode = 0400;
+	u32 val;
 
 	if (ec_device_count == 0) {
 		acpi_ec_debugfs_dir = debugfs_create_dir("ec", NULL);
@@ -127,10 +128,11 @@ static int acpi_ec_add_debugfs(struct acpi_ec *ec, unsigned int ec_device_count)
 
 	if (!debugfs_create_x32("gpe", 0444, dev_dir, (u32 *)&first_ec->gpe))
 		goto error;
-	if (!debugfs_create_bool("use_global_lock", 0444, dev_dir,
-				 (u32 *)&first_ec->global_lock))
+	if (!debugfs_create_bool("use_global_lock", 0444, dev_dir, &val))
 		goto error;
 
+	first_ec->global_lock = val;
+
 	if (write_support)
 		mode = 0600;
 	if (!debugfs_create_file("io", mode, dev_dir, ec, &acpi_ec_io_ops))
-- 
2.4.0


^ permalink raw reply related	[flat|nested] 135+ messages in thread

end of thread, other threads:[~2015-09-28 15:32 UTC | newest]

Thread overview: 135+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-25 16:41 [PATCH V4 1/2] ACPI / EC: Fix broken 64bit big-endian users of 'global_lock' Viresh Kumar
2015-09-25 16:41 ` Viresh Kumar
2015-09-25 16:41 ` Viresh Kumar
2015-09-25 16:41 ` Viresh Kumar
2015-09-25 16:41 ` [PATCH V4 2/2] debugfs: Pass bool pointer to debugfs_create_bool() Viresh Kumar
2015-09-25 16:41   ` Viresh Kumar
2015-09-25 16:41   ` Viresh Kumar
2015-09-25 17:42 ` [PATCH V4 1/2] ACPI / EC: Fix broken 64bit big-endian users of 'global_lock' Johannes Berg
2015-09-25 17:42   ` Johannes Berg
2015-09-25 17:42   ` Johannes Berg
2015-09-25 17:42   ` Johannes Berg
2015-09-25 18:47   ` Viresh Kumar
2015-09-25 18:47     ` Viresh Kumar
2015-09-25 18:47     ` Viresh Kumar
2015-09-25 18:47     ` Viresh Kumar
2015-09-25 18:49     ` Johannes Berg
2015-09-25 18:49       ` Johannes Berg
2015-09-25 18:49       ` Johannes Berg
2015-09-25 18:52       ` Viresh Kumar
2015-09-25 18:52         ` Viresh Kumar
2015-09-25 18:52         ` Viresh Kumar
2015-09-25 18:52         ` Viresh Kumar
2015-09-25 20:26         ` Rafael J. Wysocki
2015-09-25 20:26           ` Rafael J. Wysocki
2015-09-25 20:26           ` Rafael J. Wysocki
2015-09-25 20:33           ` Rafael J. Wysocki
2015-09-25 20:33             ` Rafael J. Wysocki
2015-09-25 20:33             ` Rafael J. Wysocki
2015-09-25 20:33             ` Rafael J. Wysocki
2015-09-25 20:25             ` Viresh Kumar
2015-09-25 20:25               ` Viresh Kumar
2015-09-25 20:25               ` Viresh Kumar
2015-09-25 20:25               ` Viresh Kumar
2015-09-25 20:25               ` Viresh Kumar
2015-09-25 20:25               ` Viresh Kumar
2015-09-25 20:58               ` Rafael J. Wysocki
2015-09-25 20:58                 ` Rafael J. Wysocki
2015-09-25 20:58                 ` Rafael J. Wysocki
2015-09-25 20:58                 ` Rafael J. Wysocki
2015-09-25 20:58                 ` Rafael J. Wysocki
2015-09-25 20:58                 ` Rafael J. Wysocki
2015-09-25 21:44                 ` Viresh Kumar
2015-09-25 21:44                   ` Viresh Kumar
2015-09-25 21:44                   ` Viresh Kumar
2015-09-25 21:44                   ` Viresh Kumar
2015-09-25 21:44                   ` Viresh Kumar
2015-09-25 21:44                   ` Viresh Kumar
2015-09-25 22:19                   ` Rafael J. Wysocki
2015-09-25 22:19                     ` Rafael J. Wysocki
2015-09-25 22:19                     ` Rafael J. Wysocki
2015-09-25 22:19                     ` Rafael J. Wysocki
2015-09-25 22:19                     ` Rafael J. Wysocki
2015-09-26 18:40                     ` Viresh Kumar
2015-09-26 18:40                       ` Viresh Kumar
2015-09-26 18:40                       ` Viresh Kumar
2015-09-26 18:40                       ` Viresh Kumar
2015-09-26 18:40                       ` Viresh Kumar
2015-09-26 18:40                       ` Viresh Kumar
2015-09-26 19:33                       ` Arnd Bergmann
2015-09-26 19:33                         ` Arnd Bergmann
2015-09-26 19:33                         ` Arnd Bergmann
2015-09-26 19:33                         ` Arnd Bergmann
2015-09-26 19:33                         ` Arnd Bergmann
2015-09-27 14:10                         ` Rafael J. Wysocki
2015-09-27 14:10                           ` Rafael J. Wysocki
2015-09-27 14:10                           ` Rafael J. Wysocki
2015-09-27 14:10                           ` Rafael J. Wysocki
2015-09-27 14:10                           ` Rafael J. Wysocki
2015-09-27 14:10                           ` Rafael J. Wysocki
2015-09-28  8:24                           ` Arnd Bergmann
2015-09-28  8:24                             ` Arnd Bergmann
2015-09-28  8:24                             ` Arnd Bergmann
2015-09-28  8:24                             ` Arnd Bergmann
2015-09-28  8:24                             ` Arnd Bergmann
2015-09-28  8:24                             ` Arnd Bergmann
2015-09-28 13:07                             ` Rafael J. Wysocki
2015-09-28 13:07                               ` Rafael J. Wysocki
2015-09-28 13:07                               ` Rafael J. Wysocki
2015-09-28 13:07                               ` Rafael J. Wysocki
2015-09-28 13:07                               ` Rafael J. Wysocki
2015-09-28 13:07                               ` Rafael J. Wysocki
2015-09-26 19:52                 ` James Bottomley
2015-09-26 19:52                   ` James Bottomley
2015-09-26 19:52                   ` James Bottomley
2015-09-26 19:52                   ` James Bottomley
2015-09-26 19:52                   ` James Bottomley
2015-09-26 19:52                   ` James Bottomley
2015-09-27 14:09                   ` Rafael J. Wysocki
2015-09-27 14:09                     ` Rafael J. Wysocki
2015-09-27 14:09                     ` Rafael J. Wysocki
2015-09-27 14:09                     ` Rafael J. Wysocki
2015-09-27 14:09                     ` Rafael J. Wysocki
2015-09-28  8:58                     ` David Laight
2015-09-28  8:58                       ` David Laight
2015-09-28  8:58                       ` David Laight
2015-09-28  8:58                       ` David Laight
2015-09-28  8:58                       ` David Laight
2015-09-28  8:58                       ` David Laight
2015-09-28 14:26                       ` James Bottomley
2015-09-28 14:26                         ` James Bottomley
2015-09-28 14:26                         ` James Bottomley
2015-09-28 14:26                         ` James Bottomley
2015-09-28 14:26                         ` James Bottomley
2015-09-28 14:26                         ` James Bottomley
2015-09-28 14:50                         ` David Laight
2015-09-28 14:50                           ` David Laight
2015-09-28 14:50                           ` David Laight
2015-09-28 14:50                           ` David Laight
2015-09-28 14:50                           ` David Laight
2015-09-28 14:50                           ` David Laight
2015-09-28 15:11                           ` James Bottomley
2015-09-28 15:11                             ` James Bottomley
2015-09-28 15:11                             ` James Bottomley
2015-09-28 15:11                             ` James Bottomley
2015-09-28 15:11                             ` James Bottomley
2015-09-28 15:11                             ` James Bottomley
2015-09-28 15:31                             ` David Laight
2015-09-28 15:31                               ` David Laight
2015-09-28 15:31                               ` David Laight
2015-09-28 15:31                               ` David Laight
2015-09-28 15:31                               ` David Laight
2015-09-28 15:31                               ` David Laight
2015-09-25 20:18 ` Rafael J. Wysocki
2015-09-25 20:18   ` Rafael J. Wysocki
2015-09-25 20:18   ` Rafael J. Wysocki
2015-09-25 20:22   ` Rafael J. Wysocki
2015-09-25 20:22     ` Rafael J. Wysocki
2015-09-25 20:22     ` Rafael J. Wysocki
2015-09-27  5:31 ` Jiri Slaby
2015-09-27 14:35   ` Viresh Kumar
2015-09-27 14:35     ` Viresh Kumar
2015-09-27 14:35     ` Viresh Kumar
2015-09-27 14:35     ` Viresh Kumar
2015-09-27 14:35     ` Viresh Kumar
2015-09-27 14:35     ` Viresh Kumar

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.