On 8/27/25 1:20 AM, Alistair Popple wrote:
...
Hi Alistair,
Not a real review yet, but one thing I noticed on a quick first pass:
> + pub(crate) fn send_cmd_to_gsp(cmd: GspQueueCommand<'_>, bar: &Bar0) ->
> Result {
> + // Find the start of the message. We could also re-read the HW
> pointer.
> + // SAFETY: The command was previously allocated and initialised on
> the
> + // queue and is therefore not-NULL and aligned.
> + let slice_1: &[u8] = unsafe {
> + core::slice::from_raw_parts(
> + ptr::from_ref(cmd.msg_header).cast::<u8>(),
> + size_of::<GspMsgHeader>() + size_of::<GspRpcHeader>() +
> cmd.slice_1.len(),
> + )
> + };
> +
> + dev_info!(
> + &cmd.cmdq.dev,
> + "GSP RPC: send: seq# {}, function=0x{:x} ({}), length=0x{:x}\n",
> + cmd.cmdq.seq - 1,
> + cmd.rpc_header.function,
> + decode_gsp_function(cmd.rpc_header.function),
> + cmd.rpc_header.length,
> + );
Let's please make this (and the corresponding receive) a dev_dbg!().
Otherwise the driver is too chatty at INFO log levels.
I suspect that I'm to blame here, because I recall pretty-ing up the
output of these, and I probably set dev_info!() at the same time. doh!
...
> + // Log RPC receive with message type decoding
> + dev_info!(
> + self.dev,
> + "GSP RPC: receive: seq# {}, function=0x{:x} ({}),
> length=0x{:x}\n",
> + rpc_header.sequence,
> + rpc_header.function,
> + decode_gsp_function(rpc_header.function),
> + rpc_header.length,
> + );
Here also: please use dev_dbg!() for this one.
thanks,
--
John Hubbard