ucsi: ucsi_glink: Move debug log in ucsi_qti_glink_write()

Currently we print a debug log in ucsi_qti_glink_write() only
after it succeeds with an ACK from PPM. To debug some timeout
issues, it is helpful to see the log printed before writing and
waiting for the ACK. So, move it.

Change-Id: I811bc7647030d247f7082092e73d31c90944e43b
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
This commit is contained in:
Subbaraman Narayanamurthy 2021-03-05 10:53:25 -08:00
commit 894a4385f6

View file

@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2019-2020, The Linux Foundation. All rights reserved.
* Copyright (c) 2019-2021, The Linux Foundation. All rights reserved.
*/
#define pr_fmt(fmt) "UCSI: %s: " fmt, __func__
@ -285,6 +285,9 @@ static int ucsi_qti_glink_write(struct ucsi_dev *udev, unsigned int offset,
reinit_completion(&udev->sync_write_ack);
}
ucsi_log(sync ? "sync_write:" : "async_write:", offset,
(u8 *)val, val_len);
rc = pmic_glink_write(udev->client, &ucsi_buf,
sizeof(ucsi_buf));
if (rc < 0) {
@ -314,9 +317,6 @@ static int ucsi_qti_glink_write(struct ucsi_dev *udev, unsigned int offset,
}
}
ucsi_log(sync ? "sync_write:" : "async_write:", offset,
(u8 *)val, val_len);
if (((u8 *)val)[0] == UCSI_GET_CONNECTOR_STATUS) {
mutex_lock(&udev->notify_lock);
set_bit(CONN_STAT_REQD, &udev->cmd_requested_flags);