mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Luke Parkin <luke.parkin@arm.com>
To: Cristian Marussi <cristian.marussi@arm.com>
Cc: linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, arm-scmi@vger.kernel.org,
	sudeep.holla@arm.com
Subject: Re: [PATCH v3 3/5] firmware: arm_scmi: Track basic SCMI statistics
Date: Wed, 24 Jul 2024 15:39:59 +0100	[thread overview]
Message-ID: <9b823928-2910-4253-821c-6082fc9f48ae@arm.com> (raw)
In-Reply-To: <ZqEN6w49zFSDMUIe@pluto>

>> @@ -994,6 +1008,7 @@ scmi_xfer_command_acquire(struct scmi_chan_info *cinfo, u32 msg_hdr)
>>  		spin_unlock_irqrestore(&minfo->xfer_lock, flags);
>>  
>>  		scmi_bad_message_trace(cinfo, msg_hdr, MSG_UNEXPECTED);
>> +		scmi_log_stats(info->dbg_stats, ERR_MSG_UNEXPECTED);
> 
> I'd be tempted to say why dont you wrap these scmi_log_stats() inside the
> scmi_bad_message_trace() ... BUT in order to avoid an additional
> conditional inside the scmi_bad_message_trace() you will need to somehow
> remap the MSG_UNEXPECTED to ERR_MSG_UNEXPECTED inside scmi_bad_message_trace (lets say
> with a local onstack array indexed by -err)...AND that would mean committing to keep
> such mapping in-sync with the the above enum, so as to avoid that adding
> a new definition into scmi_bad_msg BUT not to debug_stat_counters will
> end up in a buffer overflow....so at the end probably better/safer to keep it
> this way...

Yeah, I had the same thoughts and came to the same conclusion. As far as I could
determine there weren't enough scmi_bad_message_trace()'s to warrant the extra
complexity (both code and processing) of centralising it.

Thanks,
Luke

  reply	other threads:[~2024-07-24 14:40 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-15 13:37 [PATCH v3 0/5] Add Per-transport SCMI debug statistics Luke Parkin
2024-07-15 13:37 ` [PATCH v3 1/5] firmware: arm_scmi: Remove superfluous handle_to_scmi_info Luke Parkin
2024-07-24 13:07   ` Cristian Marussi
2024-07-15 13:37 ` [PATCH v3 2/5] firmware: arm_scmi: Add support for tracking statistics Luke Parkin
2024-07-24 13:40   ` Cristian Marussi
2024-07-15 13:37 ` [PATCH v3 3/5] firmware: arm_scmi: Track basic SCMI statistics Luke Parkin
2024-07-16 12:29   ` Peng Fan
2024-07-22 12:21     ` Luke Parkin
2024-07-24 14:24       ` Cristian Marussi
2024-07-24 14:21   ` Cristian Marussi
2024-07-24 14:39     ` Luke Parkin [this message]
2024-07-15 13:37 ` [PATCH v3 4/5] firmware: arm_scmi: Create debugfs files for statistics Luke Parkin
2024-07-24 14:26   ` Cristian Marussi
2024-07-15 13:37 ` [PATCH v3 5/5] firmware: arm_scmi: Reset statistics Luke Parkin
2024-07-24 14:41   ` Cristian Marussi
2024-07-24 14:46 ` [PATCH v3 0/5] Add Per-transport SCMI debug statistics Cristian Marussi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9b823928-2910-4253-821c-6082fc9f48ae@arm.com \
    --to=luke.parkin@arm.com \
    --cc=arm-scmi@vger.kernel.org \
    --cc=cristian.marussi@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sudeep.holla@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®