mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-01-11 17:10:13 +00:00
Revert "usb: typec: ucsi: Add support for message out data structure"
This reverts commit db0028637cc832add6d87564fcc2ebb12781b046. The new buffer management code that this feature relies on is broken so revert for now. As for the in buffer, nothing prevents the out message size and buffer from being modified while the message is being processed due to lack of serialisation. Signed-off-by: Johan Hovold <johan@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Link: https://patch.msgid.link/20251222152204.2846-4-johan@kernel.org
This commit is contained in:
parent
174e7d0f47
commit
2e46b4e024
@ -67,20 +67,6 @@ int ucsi_sync_control_common(struct ucsi *ucsi, u64 command, u32 *cci)
|
||||
|
||||
reinit_completion(&ucsi->complete);
|
||||
|
||||
if (ucsi->message_out_size > 0) {
|
||||
if (!ucsi->ops->write_message_out) {
|
||||
ucsi->message_out_size = 0;
|
||||
ret = -EOPNOTSUPP;
|
||||
goto out_clear_bit;
|
||||
}
|
||||
|
||||
ret = ucsi->ops->write_message_out(ucsi, ucsi->message_out,
|
||||
ucsi->message_out_size);
|
||||
ucsi->message_out_size = 0;
|
||||
if (ret)
|
||||
goto out_clear_bit;
|
||||
}
|
||||
|
||||
ret = ucsi->ops->async_control(ucsi, command);
|
||||
if (ret)
|
||||
goto out_clear_bit;
|
||||
|
||||
@ -69,7 +69,6 @@ struct dentry;
|
||||
* @read_cci: Read CCI register
|
||||
* @poll_cci: Read CCI register while polling with notifications disabled
|
||||
* @read_message_in: Read message data from UCSI
|
||||
* @write_message_out: Write message data to UCSI
|
||||
* @sync_control: Blocking control operation
|
||||
* @async_control: Non-blocking control operation
|
||||
* @update_altmodes: Squashes duplicate DP altmodes
|
||||
@ -85,7 +84,6 @@ struct ucsi_operations {
|
||||
int (*read_cci)(struct ucsi *ucsi, u32 *cci);
|
||||
int (*poll_cci)(struct ucsi *ucsi, u32 *cci);
|
||||
int (*read_message_in)(struct ucsi *ucsi, void *val, size_t val_len);
|
||||
int (*write_message_out)(struct ucsi *ucsi, void *data, size_t data_len);
|
||||
int (*sync_control)(struct ucsi *ucsi, u64 command, u32 *cci);
|
||||
int (*async_control)(struct ucsi *ucsi, u64 command);
|
||||
bool (*update_altmodes)(struct ucsi *ucsi, u8 recipient,
|
||||
|
||||
@ -86,21 +86,6 @@ static int ucsi_acpi_read_message_in(struct ucsi *ucsi, void *val, size_t val_le
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int ucsi_acpi_write_message_out(struct ucsi *ucsi, void *data, size_t data_len)
|
||||
{
|
||||
struct ucsi_acpi *ua = ucsi_get_drvdata(ucsi);
|
||||
|
||||
if (!data || !data_len)
|
||||
return -EINVAL;
|
||||
|
||||
if (ucsi->version <= UCSI_VERSION_1_2)
|
||||
memcpy(ua->base + UCSI_MESSAGE_OUT, data, data_len);
|
||||
else
|
||||
memcpy(ua->base + UCSIv2_MESSAGE_OUT, data, data_len);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int ucsi_acpi_async_control(struct ucsi *ucsi, u64 command)
|
||||
{
|
||||
struct ucsi_acpi *ua = ucsi_get_drvdata(ucsi);
|
||||
@ -116,7 +101,6 @@ static const struct ucsi_operations ucsi_acpi_ops = {
|
||||
.read_cci = ucsi_acpi_read_cci,
|
||||
.poll_cci = ucsi_acpi_poll_cci,
|
||||
.read_message_in = ucsi_acpi_read_message_in,
|
||||
.write_message_out = ucsi_acpi_write_message_out,
|
||||
.sync_control = ucsi_sync_control_common,
|
||||
.async_control = ucsi_acpi_async_control
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user