diff mbox series

[v5,9/9] cxl/pmem: Remove CXL SET_PARTITION_INFO from exclusive_cmds list

Message ID accc6abc878f0662093b81490a1a052f2ff6f06e.1648687552.git.alison.schofield@intel.com
State Accepted
Commit 6aa657f416b65f23d7a3c9d04f144b1c4aa2ebc1
Headers show
Series Do not allow set-partition immediate mode | expand

Commit Message

Alison Schofield March 31, 2022, 1:27 a.m. UTC
From: Alison Schofield <alison.schofield@intel.com>

With SET_PARTITION_INFO on the exclusive_cmds list for the CXL_PMEM
driver, userspace cannot execute a set-partition command without
first unbinding the pmem driver from the device.

When userspace requests a partition change to take effect on the
next reboot this unbind requirement is unnecessarily restrictive.
The driver does not need to enforce an unbind because partitions
will not change until the next reboot. Of course, userspace still
needs to be aware that changing the size of persistent capacity
on the next reboot will result in the loss of data stored. That
can happen regardless of whether it is presently bound at the time
of issuing the set-partition command.

When userspace requests a partition change to take effect immediately,
restrictions are needed. The CXL_MEM driver currently blocks the usage
of immediate mode, making the presence of SET_PARTITION_INFO, in this
exclusive commands list, redundant.

In the future, when the CXL_MEM driver adds support for immediate
changes to device partitions it will ensure that the partition change
will not affect any active decode. That means the work will not fall
right back here, onto the CXL_PMEM driver.

Signed-off-by: Alison Schofield <alison.schofield@intel.com>
---
 drivers/cxl/pmem.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Dan Williams March 31, 2022, 10:13 p.m. UTC | #1
On Wed, Mar 30, 2022 at 6:25 PM <alison.schofield@intel.com> wrote:
>
> From: Alison Schofield <alison.schofield@intel.com>
>
> With SET_PARTITION_INFO on the exclusive_cmds list for the CXL_PMEM
> driver, userspace cannot execute a set-partition command without
> first unbinding the pmem driver from the device.
>
> When userspace requests a partition change to take effect on the
> next reboot this unbind requirement is unnecessarily restrictive.
> The driver does not need to enforce an unbind because partitions
> will not change until the next reboot. Of course, userspace still
> needs to be aware that changing the size of persistent capacity
> on the next reboot will result in the loss of data stored. That
> can happen regardless of whether it is presently bound at the time
> of issuing the set-partition command.
>
> When userspace requests a partition change to take effect immediately,
> restrictions are needed. The CXL_MEM driver currently blocks the usage
> of immediate mode, making the presence of SET_PARTITION_INFO, in this
> exclusive commands list, redundant.
>
> In the future, when the CXL_MEM driver adds support for immediate
> changes to device partitions it will ensure that the partition change
> will not affect any active decode. That means the work will not fall
> right back here, onto the CXL_PMEM driver.
>
> Signed-off-by: Alison Schofield <alison.schofield@intel.com>

Looks good.

Reviewed-by: Dan Williams <dan.j.williams@intel.com>
Jonathan Cameron April 1, 2022, 2:56 p.m. UTC | #2
On Wed, 30 Mar 2022 18:27:19 -0700
alison.schofield@intel.com wrote:

> From: Alison Schofield <alison.schofield@intel.com>
> 
> With SET_PARTITION_INFO on the exclusive_cmds list for the CXL_PMEM
> driver, userspace cannot execute a set-partition command without
> first unbinding the pmem driver from the device.
> 
> When userspace requests a partition change to take effect on the
> next reboot this unbind requirement is unnecessarily restrictive.
> The driver does not need to enforce an unbind because partitions
> will not change until the next reboot. Of course, userspace still
> needs to be aware that changing the size of persistent capacity
> on the next reboot will result in the loss of data stored. That
> can happen regardless of whether it is presently bound at the time
> of issuing the set-partition command.
> 
> When userspace requests a partition change to take effect immediately,
> restrictions are needed. The CXL_MEM driver currently blocks the usage
> of immediate mode, making the presence of SET_PARTITION_INFO, in this
> exclusive commands list, redundant.
> 
> In the future, when the CXL_MEM driver adds support for immediate
> changes to device partitions it will ensure that the partition change
> will not affect any active decode. That means the work will not fall
> right back here, onto the CXL_PMEM driver.
> 
> Signed-off-by: Alison Schofield <alison.schofield@intel.com>
I gave a an RB on v3...  To make it easy for whoever
picks this up.

Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>

> ---
>  drivers/cxl/pmem.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/cxl/pmem.c b/drivers/cxl/pmem.c
> index 564d125d25ef..35c6f3af18f2 100644
> --- a/drivers/cxl/pmem.c
> +++ b/drivers/cxl/pmem.c
> @@ -344,7 +344,6 @@ static __init int cxl_pmem_init(void)
>  {
>  	int rc;
>  
> -	set_bit(CXL_MEM_COMMAND_ID_SET_PARTITION_INFO, exclusive_cmds);
>  	set_bit(CXL_MEM_COMMAND_ID_SET_SHUTDOWN_STATE, exclusive_cmds);
>  	set_bit(CXL_MEM_COMMAND_ID_SET_LSA, exclusive_cmds);
>
diff mbox series

Patch

diff --git a/drivers/cxl/pmem.c b/drivers/cxl/pmem.c
index 564d125d25ef..35c6f3af18f2 100644
--- a/drivers/cxl/pmem.c
+++ b/drivers/cxl/pmem.c
@@ -344,7 +344,6 @@  static __init int cxl_pmem_init(void)
 {
 	int rc;
 
-	set_bit(CXL_MEM_COMMAND_ID_SET_PARTITION_INFO, exclusive_cmds);
 	set_bit(CXL_MEM_COMMAND_ID_SET_SHUTDOWN_STATE, exclusive_cmds);
 	set_bit(CXL_MEM_COMMAND_ID_SET_LSA, exclusive_cmds);