From: Dan Williams <dan.j.williams@intel.com>
To: Vishal Verma <vishal.l.verma@intel.com>, <linux-cxl@vger.kernel.org>
Cc: Dan Williams <dan.j.williams@intel.com>,
Vishal Verma <vishal.l.verma@intel.com>
Subject: RE: [PATCH] cxl/region: reset the cxl endpoint decoder HPA range on teardown
Date: Fri, 5 Aug 2022 01:07:35 -0700 [thread overview]
Message-ID: <62eccfc72e340_151ced294d9@dwillia2-xfh.jf.intel.com.notmuch> (raw)
In-Reply-To: <20220805064918.925115-1-vishal.l.verma@intel.com>
Vishal Verma wrote:
> The endpoint decoder HPA range gets set up during cxl_region_attach, but
> cxl_region_detach() neglects to reset it back to a 'free' state. As a
> result, a create-destroy-create cycle with the same region parameters
> results in the second create-region failing with an EBUSY when trying to
> reserver DPA.
>
> # cxl create-region -d decoder3.2 -m mem4 -g 1024
> cxl region: create_region: decoder11.1: set_dpa_size failed: Device or resource busy
> cxl region: cmd_create_region: created 0 regions
>
> Set the endpoint decoder's hpa_range to [0, -1] to mark it as free in
> cxl_region_detach().
>
> Fixes: 292bdc6af8f2 ("cxl/region: Move HPA setup to cxl_region_attach()")
> Cc: Dan Williams <dan.j.williams@intel.com>
> Signed-off-by: Vishal Verma <vishal.l.verma@intel.com>
> ---
> drivers/cxl/core/region.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> Hi Dan,
>
> This is a fixup-to-a-fixup, and the commit in Fixes: is only in
> 'preview'. Feel free to squash this into the original fix if you so
> prefer.
Will do, I think this also needs to kill the cxld_clear_hpa() helper and
call in cxl_decoder_reset().
> Another question - should we be resetting the endpoint decoder's mode to
> CXL_DECODER_DEAD while in here? I notice that a freed decoder still
> lists mode:pmem in cxl-list.
The DEAD state is a internal-only hack while the decoder is being torn
down, it's not visible to userspace. Perhaps just hide the none state
and default the mode to 'ram' when no DPA is allocated?
next prev parent reply other threads:[~2022-08-05 8:07 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-05 6:49 [PATCH] cxl/region: reset the cxl endpoint decoder HPA range on teardown Vishal Verma
2022-08-05 8:07 ` Dan Williams [this message]
2022-08-05 18:53 ` Verma, Vishal L
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=62eccfc72e340_151ced294d9@dwillia2-xfh.jf.intel.com.notmuch \
--to=dan.j.williams@intel.com \
--cc=linux-cxl@vger.kernel.org \
--cc=vishal.l.verma@intel.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