Skip to content

Commit

Permalink
[hack] add more traces to stream.c
Browse files Browse the repository at this point in the history
Signed-off-by: Pierre-Louis Bossart <[email protected]>
  • Loading branch information
plbossart committed Nov 3, 2023
1 parent 07fbb48 commit db68142
Showing 1 changed file with 33 additions and 8 deletions.
41 changes: 33 additions & 8 deletions drivers/soundwire/stream.c
Original file line number Diff line number Diff line change
Expand Up @@ -1390,18 +1390,27 @@ static int _sdw_prepare_stream(struct sdw_stream_runtime *stream,
struct sdw_bus_params params;
int ret;

if (stream->type == SDW_STREAM_BPT) {
ret = sdw_bpt_program_ports(bus);
if (ret < 0) {
dev_err(bus->dev, "BPT program params failed: %d\n", ret);
return ret;
}
goto skip_params;
}
pr_info("%s: start\n", __func__);

/* Prepare Master(s) and Slave(s) port(s) associated with stream */
list_for_each_entry(m_rt, &stream->master_list, stream_node) {

pr_info("%s: 1\n", __func__);
bus = m_rt->bus;
if (stream->type == SDW_STREAM_BPT) {
pr_info("%s: 2\n", __func__);
ret = sdw_bpt_program_ports(bus);
pr_info("%s: 3\n", __func__);
if (ret < 0) {
dev_err(bus->dev, "BPT program params failed: %d\n", ret);
return ret;
}
pr_info("%s: 4\n", __func__);
goto skip_params;
}

pr_info("%s: 5\n", __func__);

prop = &bus->prop;
memcpy(&params, &bus->params, sizeof(params));

Expand Down Expand Up @@ -1438,13 +1447,18 @@ static int _sdw_prepare_stream(struct sdw_stream_runtime *stream,
}

skip_params:
dev_info(bus->dev, "%s: before do_bank_switch\n", __func__);
ret = do_bank_switch(stream);
dev_info(bus->dev, "%s: after do_bank_switch\n", __func__);
if (ret < 0) {
pr_err("%s: do_bank_switch failed: %d\n", __func__, ret);
goto restore_params;
}

list_for_each_entry(m_rt, &stream->master_list, stream_node) {

dev_info(bus->dev, "%s: list_start\n", __func__);

bus = m_rt->bus;

/* Prepare port(s) on the new clock configuration */
Expand All @@ -1454,6 +1468,7 @@ static int _sdw_prepare_stream(struct sdw_stream_runtime *stream,
ret);
return ret;
}
dev_info(bus->dev, "%s: adter sdw_prep_deprep_ports\n", __func__);
}

stream->state = SDW_STREAM_PREPARED;
Expand Down Expand Up @@ -1482,13 +1497,16 @@ int sdw_prepare_stream(struct sdw_stream_runtime *stream)
return -EINVAL;
}

pr_info("%s: start\n", __func__);
sdw_acquire_bus_lock(stream);

pr_info("%s: 1\n", __func__);
if (stream->state == SDW_STREAM_PREPARED) {
ret = 0;
goto state_err;
}

pr_info("%s: 2\n", __func__);
if (stream->state != SDW_STREAM_CONFIGURED &&
stream->state != SDW_STREAM_DEPREPARED &&
stream->state != SDW_STREAM_DISABLED) {
Expand All @@ -1498,6 +1516,8 @@ int sdw_prepare_stream(struct sdw_stream_runtime *stream)
goto state_err;
}

pr_info("%s: 3\n", __func__);

/*
* when the stream is DISABLED, this means sdw_prepare_stream()
* is called as a result of an underflow or a resume operation.
Expand All @@ -1507,10 +1527,15 @@ int sdw_prepare_stream(struct sdw_stream_runtime *stream)
if (stream->state == SDW_STREAM_DISABLED)
update_params = false;

pr_info("%s: 4\n", __func__);

ret = _sdw_prepare_stream(stream, update_params);

pr_info("%s: 5\n", __func__);
state_err:
sdw_release_bus_lock(stream);

pr_info("%s: done\n", __func__);
return ret;
}
EXPORT_SYMBOL(sdw_prepare_stream);
Expand Down

0 comments on commit db68142

Please sign in to comment.