Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp3255521lqp; Tue, 26 Mar 2024 04:24:58 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVH59ZkdKoCjt7roqW3FI8Rcp22zYnRhaUfDco9j1ChndUEUkVLeR46udi1Q/X5zp8Ls/isjxV7EiofKqCvJbVWu7iq3rn2mZEfkOYIYQ== X-Google-Smtp-Source: AGHT+IHrEggJTXzDF9HNxMh6Tox5FgPdwsX1W+DihZEWq6SK70EP6VTEghbkKM6UUwY69Q69ajRQ X-Received: by 2002:a17:906:1318:b0:a46:2100:da56 with SMTP id w24-20020a170906131800b00a462100da56mr7288071ejb.55.1711452298388; Tue, 26 Mar 2024 04:24:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711452298; cv=pass; d=google.com; s=arc-20160816; b=Vft15zlZE9FKhYyGdsIHoHtSBz3dbPL84NRXa4r2ZPm58qgEEkxayu9UWBVAgC+yp6 kz3+l5qMSwqsDCaZF4pZAXHBTiNNPEUDc5KtWvtNXrIZ2I9F/D6jOwIy++eWgQFjsPQa FxmdO42KzEZEuvffGsjd3FgET7Pu2hSmLzoMQ2jABtHbUjb2CwdbDkLTq8CNqMOQjmtE amHrcuaeuIWrfr+zif9mMBx4iIJh7cVcm94TTfX4aZXXehC7TKnVA988+TLAOfLQ2/ih 2ZkYm3GWVx4uhjviykthy/JT030vGYWGgAe9GlNZkbl8fb23JExyU6IUFdyYc0QpyI2C /AzA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date; bh=3WnqV3FttNsG3BedMg9Nal7xzODdQgLlw+sZUw2oDI0=; fh=7bfUUfUwO5OQPjTIs0QBgwxB9bpOSUkguDxzblZWXr4=; b=ow7MSzpfCBTO1rWXJqdUz8dNoYLWbZOySpO3yyn2ITY0LSPC1iqebOhzJ4nNed5JcV hr0HR6Fd6e46mUxr/+pGZAq4neVtg/iAEGkhCoBI1yvPeBz0ee24eQqrmD30fPZXjTaI pPd50xZDHJf5V7pDEbXQilhJhd9UgawLM4cYyzF/v9VT442KhkcbiSDSgI13CE0f56Rm AWuNWN2E7F772twx1Sl/MhKfblXFF9l33wo8QojjBML57TXpRhRlo83KIqxoIKsbRtAx yoGEqrNJMfPd8UIy/gtBBgrLD1aaPC+IymGSBo/w1kKyzB2qxHmqf1uk0dS77c85dMGv 7a5g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-118881-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-118881-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id ch6-20020a170906c2c600b00a46be51e914si3373945ejb.497.2024.03.26.04.24.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Mar 2024 04:24:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-118881-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-118881-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-118881-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 1B3551F619B2 for ; Tue, 26 Mar 2024 11:24:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A1C8C57310; Tue, 26 Mar 2024 11:24:44 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 626E255E58 for ; Tue, 26 Mar 2024 11:24:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711452284; cv=none; b=bQb6t12QzL+sFSG8TVP6fkAF1LveH84l3nrLOIpXh9BlMljeKaFZ6+uJvi2TmOZo8rI5UBzOHcEbfX4BOxY4RL64hW3mr7T0txyqEzmi5lFwVqK28EjGAEufUCAlNRc3f1I3f/fAiKm9eJfry+qlVtZMT9hu4szgroU+N7UTP5w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711452284; c=relaxed/simple; bh=b5PW16lJdCBNP5ifrYSt60o5VKAKdhikWIeLZPiXsJo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=UxLsqWxa9/BNFhq5kKjx3Br0pzJMcisieVt9WHB8IppXYjoh3DDK+avl/40GouSZXZa1e6/WQHZVAru9MHuJ2GEK7VISdbYtijZWRGV/EwwvhDZaB2+mouZgKADeeGhQyECY0a39l4WRpslzDOGeTJtn8v6y/sPRcnPL+VtrCkY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 57A7A2F4; Tue, 26 Mar 2024 04:25:15 -0700 (PDT) Received: from bogus (e103737-lin.cambridge.arm.com [10.1.197.49]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 2209F3F64C; Tue, 26 Mar 2024 04:24:41 -0700 (PDT) Date: Tue, 26 Mar 2024 11:24:38 +0000 From: Sudeep Holla To: Cristian Marussi Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Sudeep Holla Subject: Re: [PATCH v2 3/5] firmware: arm_scmi: Add message dump traces for bad and unexpected replies Message-ID: References: <20240325204620.1437237-1-cristian.marussi@arm.com> <20240325204620.1437237-4-cristian.marussi@arm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240325204620.1437237-4-cristian.marussi@arm.com> On Mon, Mar 25, 2024 at 08:46:18PM +0000, Cristian Marussi wrote: > Trace also late-timed-out, out-of-order and unexpected/spurious messages. > > Signed-off-by: Cristian Marussi > --- > drivers/firmware/arm_scmi/driver.c | 10 ++++++++++ > drivers/firmware/arm_scmi/mailbox.c | 4 +++- > 2 files changed, 13 insertions(+), 1 deletion(-) > > diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers/firmware/arm_scmi/driver.c > index 7fc1c5b1a2a4..207ed1a52d69 100644 > --- a/drivers/firmware/arm_scmi/driver.c > +++ b/drivers/firmware/arm_scmi/driver.c > @@ -861,6 +861,9 @@ scmi_xfer_command_acquire(struct scmi_chan_info *cinfo, u32 msg_hdr) > "Message for %d type %d is not expected!\n", > xfer_id, msg_type); > spin_unlock_irqrestore(&minfo->xfer_lock, flags); > + > + scmi_bad_message_trace(cinfo, msg_hdr, MSG_UNEXPECTED); > + > return xfer; > } > refcount_inc(&xfer->users); > @@ -885,6 +888,9 @@ scmi_xfer_command_acquire(struct scmi_chan_info *cinfo, u32 msg_hdr) > dev_err(cinfo->dev, > "Invalid message type:%d for %d - HDR:0x%X state:%d\n", > msg_type, xfer_id, msg_hdr, xfer->state); > + > + scmi_bad_message_trace(cinfo, msg_hdr, MSG_INVALID); > + > /* On error the refcount incremented above has to be dropped */ > __scmi_xfer_put(minfo, xfer); > xfer = ERR_PTR(-EINVAL); > @@ -921,6 +927,9 @@ static void scmi_handle_notification(struct scmi_chan_info *cinfo, > if (IS_ERR(xfer)) { > dev_err(dev, "failed to get free message slot (%ld)\n", > PTR_ERR(xfer)); > + > + scmi_bad_message_trace(cinfo, msg_hdr, MSG_NOMEM); > + > scmi_clear_channel(info, cinfo); > return; > } > @@ -1040,6 +1049,7 @@ void scmi_rx_callback(struct scmi_chan_info *cinfo, u32 msg_hdr, void *priv) > break; > default: > WARN_ONCE(1, "received unknown msg_type:%d\n", msg_type); > + scmi_bad_message_trace(cinfo, msg_hdr, MSG_UNKNOWN); > break; > } > } > diff --git a/drivers/firmware/arm_scmi/mailbox.c b/drivers/firmware/arm_scmi/mailbox.c > index b8d470417e8f..fb0824af7180 100644 > --- a/drivers/firmware/arm_scmi/mailbox.c > +++ b/drivers/firmware/arm_scmi/mailbox.c > @@ -56,7 +56,9 @@ static void rx_callback(struct mbox_client *cl, void *m) > */ > if (cl->knows_txdone && !shmem_channel_free(smbox->shmem)) { > dev_warn(smbox->cinfo->dev, "Ignoring spurious A2P IRQ !\n"); > - return; > + return scmi_bad_message_trace(smbox->cinfo, > + shmem_read_header(smbox->shmem), > + MSG_MBOX_SPURIOUS); From previous patch, IIUC scmi_bad_message_trace is a void func and doesn't return anything. Did you not get any build error/warning for this ? -- Regards, Sudeep