From: Logan Gunthorpe <logang@deltatee.com>
To: Joey Zhang <joey.zhang@microchip.com>,
jdmason@kudzu.us, dave.jiang@intel.com, allenbh@gmail.com,
linux-ntb@googlegroups.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] NTB: ntb_transport: Free MWs in ntb_transport_link_cleanup()
Date: Mon, 7 Jan 2019 18:16:02 -0700 [thread overview]
Message-ID: <2dccf9e6-d9d7-200e-f689-56c962ea5e7e@deltatee.com> (raw)
In-Reply-To: <1546830776-3138-1-git-send-email-joey.zhang@microchip.com>
On 06/01/19 08:12 PM, Joey Zhang wrote:
> If NTB peer host crashes or reboots, the NTB transport link will be
> down and the MWs of NTB transport will be invalid. But the
> ntb_transport_link_cleanup() does not free these invalid MWs. When
> the NTB peer host is recovered later, NTB transport link will be
> up and the ntb_set_mw() will not reset up MWs. Because the MWs of
> NTB transport are invalid, the NTB transport will not work.
>
> We can fix it by freeing MWs when NTB transport link is down, then
> the ntb_set_mw() will reset up MWs when NTB transport link is up.
>
> Signed-off-by: Joey Zhang <joey.zhang@microchip.com>
Looks ok to me.
Reviewed By: Logan Gunthorpe <logang@deltatee.com>
> ---
> drivers/ntb/ntb_transport.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/ntb/ntb_transport.c b/drivers/ntb/ntb_transport.c
> index 3bfdb45..6e8902d 100644
> --- a/drivers/ntb/ntb_transport.c
> +++ b/drivers/ntb/ntb_transport.c
> @@ -862,6 +862,9 @@ static void ntb_transport_link_cleanup(struct ntb_transport_ctx *nt)
> if (!nt->link_is_up)
> cancel_delayed_work_sync(&nt->link_work);
>
> + for (i = 0; i < nt->mw_count; i++)
> + ntb_free_mw(nt, i);
> +
> /* The scratchpad registers keep the values if the remote side
> * goes down, blast them now to give them a sane value the next
> * time they are accessed
>
next prev parent reply other threads:[~2019-01-08 1:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-07 3:12 Joey Zhang
2019-01-08 1:16 ` Logan Gunthorpe [this message]
2019-02-11 14:34 ` Jon Mason
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=2dccf9e6-d9d7-200e-f689-56c962ea5e7e@deltatee.com \
--to=logang@deltatee.com \
--cc=allenbh@gmail.com \
--cc=dave.jiang@intel.com \
--cc=jdmason@kudzu.us \
--cc=joey.zhang@microchip.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-ntb@googlegroups.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®