From: Evgenii Shatokhin <e.shatokhin@yadro.com>
To: Jassi Brar <jassisinghbrar@gmail.com>
Cc: <linux-kernel@vger.kernel.org>, Ilya Kuznetsov <ilya@yadro.com>,
<linux@yadro.com>, Evgenii Shatokhin <e.shatokhin@yadro.com>
Subject: [PATCH 0/2] mailbox: Fix error handling in mbox_send_message()
Date: Thu, 15 Sep 2022 19:47:28 +0300 [thread overview]
Message-ID: <20220915164730.515767-1-e.shatokhin@yadro.com> (raw)
This series fixes a couple issues I found while experimenting with mailbox device drivers:
1. If one tries to send a message via the mailbox using mbox_send_message(), and the controller driver for the mailbox device returns any error, mbox_send_message() returns -ETIME when in blocking mode. This is confusing at least.
2. If the mbox controller driver fails to send a message, mbox_send_message() needlessly waits for the message to be sent. That ends when the waiting timeout has been expired. However, the pointer to the message remains in the queue of the mbox framework (chan->msg_data) and the framework will try to process it over and over again, when one tries to send other messages. If the driver rejects the message each time because it is invalid (some drivers do that), this will prevent anyone from using that mailbox channel.
Evgenii Shatokhin (2):
mailbox: Propagate errors from .send_data() callback to
mbox_send_message()
mailbox: Error out early if the mbox driver has failed to submit the
message
drivers/mailbox/mailbox.c | 30 ++++++++++++++++++++----------
1 file changed, 20 insertions(+), 10 deletions(-)
--
2.34.1
next reply other threads:[~2022-09-15 16:51 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-15 16:47 Evgenii Shatokhin [this message]
2022-09-15 16:47 ` [PATCH 1/2] mailbox: Propagate errors from .send_data() callback to mbox_send_message() Evgenii Shatokhin
2022-09-16 15:57 ` Jassi Brar
2022-09-15 16:47 ` [PATCH 2/2] mailbox: Error out early if the mbox driver has failed to submit the message Evgenii Shatokhin
2022-09-16 17:04 ` Jassi Brar
2022-09-18 16:32 ` Evgeny Shatokhin
2022-10-05 12:11 ` Evgeny Shatokhin
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=20220915164730.515767-1-e.shatokhin@yadro.com \
--to=e.shatokhin@yadro.com \
--cc=ilya@yadro.com \
--cc=jassisinghbrar@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@yadro.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®