Skip to content

Fix SW_TABLET_MODE detection method

Jorge Lopez platform-driver-x86 5 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest4 patches 8 repliesIn review
  2. v43 patches 6 repliesSuperseded
  3. v33 patches 0 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v23 patches3 repliesSuperseded
v11 patch1 replySuperseded

Patches in v5 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4Fix hp_wmi_read_int() reporting error (0x05)drivers/platform/x86/hp-wmi.c+1 -11 reply
2/4Fix SW_TABLET_MODE detection methoddrivers/platform/x86/hp-wmi.c+52 -194 replies
3/4Fix 0x05 error code reported by several WMI callsdrivers/platform/x86/hp-wmi.c+11 -111 reply
4/4Changing bios_args.data to be dynamically allocateddrivers/platform/x86/hp-wmi.c+42 -222 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v5 yet.

Read the v5 thread

Cover letter [PATCH v5 0/4] Fix SW_TABLET_MODE detection method

The intension for this patch was to address SW_TABLET_MODE detection problem. It is during the initial investigation; two other issues were identified and are related to the initial task.

First, several WMI queries were reporting error 0x05 including HPWMI_HARDWARE_QUERY that is responsible for returning dock and table modes values. See patch v5 part 2 and 3 comments for list of WMI queries affected. The driver now reports the appropriate states and values correctly.

Lastly, a limiting data size restriction was discovered. struct bios_args data member size limits all possible WMI commands to those requiring buffer size of 128 bytes or less. Several WMI commands and queries require a buffer size larger than 128 bytes hence limiting current and new feature supported by the driver. hp_wmi_perform_query function changed to handle the memory allocation and release of any required buffer size.

Description of changes between version 4 and version 5
------------------------------------------------------

v5 patch 1: Fix hp_wmi_read_int() reporting error (0x05)
-Moved hp_wmi_read_int() to a separate patch. -Initially part of v4 patch 1

v5 patch 2: Fix SW_TABLET_MODE detection method
-Remaining part are changes included in v4 patch 1 -Replaced return values with -ENODEV errors -Updated how the closing return value is calculated. -Patch 2 is dependent of patch 1 in order for tablet
mode detection to work properly

v5 patch 3: Fix 0x05 error code reported by several WMI calls
-No new changes were introduced.
-Patch is identical to v4 patch 2

v5 patch 4: Changing bios_args.data to be dynamically allocated
-Replace sizeof() with struct_size() and flex_array_size() helpers -Added ret variable value when the output buffer is zero

Jorge Lopez (4):
Fix hp_wmi_read_int() reporting error (0x05) Fix SW_TABLET_MODE detection method
Fix 0x05 error code reported by several WMI calls Changing bios_args.data to be dynamically allocated

 drivers/platform/x86/hp-wmi.c | 159 ++++++++++++++++++++++------------
 1 file changed, 106 insertions(+), 53 deletions(-)
Signature · 1 line
2.25.1