From: Jonathan Cameron <Jonathan.Cameron@Huawei.com>
To: <linux-cxl@vger.kernel.org>, <dan.j.williams@intel.com>
Subject: CXL/region : commit reset of out of order region appears to succeed.
Date: Thu, 16 Mar 2023 17:14:41 +0000 [thread overview]
Message-ID: <20230316171441.0000205b@Huawei.com> (raw)
Ran into this whilst testing fix for QEMU uncommit handling.
To replicate.
1) Setup two regions on a direct connected Type 3 and commit them both.
2) Uncommit the first region once. (it fails with an out of order message)
Note that from here on the sysfs commit attribute reads as 0.
3) Uncommit that first region again. It appears to succeed.
Reason is easy to track down:
https://elixir.bootlin.com/linux/v6.3-rc2/source/drivers/cxl/core/region.c#L257
commit_store() of 0 unconditionally sets the state to CXL_CONFIG_RESET_PENDING
When the decoder reset fails, that is left set.
Hence next call drops straight through.
Whilst it's easy to 'fix' the superficial issue by reseting the state to the previous
value on error, I'm not sure that's sufficient or race free.
Hence report rather than a patch. I can look into this in more depth, but
a few other things come before it in my list.
Thanks,
Jonathan
p.s. I hope to send the qemu fix for uncommit fairly soon.
next reply other threads:[~2023-03-16 17:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-16 17:14 Jonathan Cameron [this message]
2023-06-17 0:26 ` CXL/region : commit reset of out of order region appears to succeed Dan Williams
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=20230316171441.0000205b@Huawei.com \
--to=jonathan.cameron@huawei.com \
--cc=dan.j.williams@intel.com \
--cc=linux-cxl@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.