Skip to content

Commit

Permalink
misc: surface_sam: Update based on module
Browse files Browse the repository at this point in the history
Update Surface System Aggregator Module driver based on module.

Changes:
- Fix a bug preventing the Surface Serial Hub driver from probing
  successfully under certain conditions.

Links:
- SAM: linux-surface/surface-aggregator-module@f973e27
  • Loading branch information
qzed committed Sep 18, 2020
1 parent 6ec5f0e commit a604178
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions drivers/misc/surface_aggregator/clients/surface_acpi_notify.c
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,8 @@ static void gsb_rqsx_response_success(struct gsb_buffer *gsb, u8 *ptr, size_t le
memcpy(&gsb->data.out.pld[0], ptr, len);
}

static acpi_status san_rqst_fixup_suspended(struct ssam_request *rqst,
static acpi_status san_rqst_fixup_suspended(struct san_data *d,
struct ssam_request *rqst,
struct gsb_buffer *gsb)
{
if (rqst->target_category == SSAM_SSH_TC_BAS && rqst->command_id == 0x0D) {
Expand All @@ -543,6 +544,8 @@ static acpi_status san_rqst_fixup_suspended(struct ssam_request *rqst,
* delay.
*/

dev_dbg(d->dev, "rqst: fixup: base-state quirk\n");

gsb_rqsx_response_success(gsb, &base_state, sizeof(base_state));
return AE_OK;
}
Expand Down Expand Up @@ -578,7 +581,7 @@ static acpi_status san_rqst(struct san_data *d, struct gsb_buffer *buffer)
// handle suspended device
if (d->dev->power.is_suspended) {
dev_warn(d->dev, "rqst: device is suspended, not executing\n");
return san_rqst_fixup_suspended(&rqst, buffer);
return san_rqst_fixup_suspended(d, &rqst, buffer);
}

status = ssam_retry(ssam_request_sync_onstack, SAN_REQUEST_NUM_TRIES,
Expand Down
2 changes: 1 addition & 1 deletion drivers/misc/surface_aggregator/controller.c
Original file line number Diff line number Diff line change
Expand Up @@ -1072,7 +1072,7 @@ static int ssam_dsm_load_u32(acpi_handle handle, u64 funcs, u64 func, u32 *ret)
static int ssam_controller_caps_load_from_acpi(
acpi_handle handle, struct ssam_controller_caps *caps)
{
u32 d3_closes_handle;
u32 d3_closes_handle = false;
u64 funcs;
int status;

Expand Down

0 comments on commit a604178

Please sign in to comment.