public inbox for dmaengine@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dmaengine: idxd: add module parameter to force disable of SVA
@ 2021-01-15 22:01 Dave Jiang
  2021-01-17  6:51 ` Vinod Koul
  0 siblings, 1 reply; 6+ messages in thread
From: Dave Jiang @ 2021-01-15 22:01 UTC (permalink / raw)
  To: vkoul; +Cc: dmaengine

Add a module parameter that overrides the SVA feature enabling. This keeps
the driver in legacy mode even when intel_iommu=sm_on is set. In this mode,
the descriptor fields must be programmed with dma_addr_t from the Linux DMA
API for source, destination, and completion descriptors.

Signed-off-by: Dave Jiang <dave.jiang@intel.com>
---
 drivers/dma/idxd/init.c |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/dma/idxd/init.c b/drivers/dma/idxd/init.c
index 25cc947c6179..9687a24ff982 100644
--- a/drivers/dma/idxd/init.c
+++ b/drivers/dma/idxd/init.c
@@ -26,6 +26,10 @@ MODULE_VERSION(IDXD_DRIVER_VERSION);
 MODULE_LICENSE("GPL v2");
 MODULE_AUTHOR("Intel Corporation");
 
+static bool sva = true;
+module_param(sva, bool, 0644);
+MODULE_PARM_DESC(sva, "Toggle SVA support on/off");
+
 #define DRV_NAME "idxd"
 
 bool support_enqcmd;
@@ -338,12 +342,14 @@ static int idxd_probe(struct idxd_device *idxd)
 	idxd_device_init_reset(idxd);
 	dev_dbg(dev, "IDXD reset complete\n");
 
-	if (IS_ENABLED(CONFIG_INTEL_IDXD_SVM)) {
+	if (IS_ENABLED(CONFIG_INTEL_IDXD_SVM) && sva) {
 		rc = idxd_enable_system_pasid(idxd);
 		if (rc < 0)
 			dev_warn(dev, "Failed to enable PASID. No SVA support: %d\n", rc);
 		else
 			set_bit(IDXD_FLAG_PASID_ENABLED, &idxd->flags);
+	} else if (!sva) {
+		dev_warn(dev, "User forced SVA off via module param.\n");
 	}
 
 	idxd_read_caps(idxd);



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] dmaengine: idxd: add module parameter to force disable of SVA
  2021-01-15 22:01 [PATCH] dmaengine: idxd: add module parameter to force disable of SVA Dave Jiang
@ 2021-01-17  6:51 ` Vinod Koul
  2021-01-18 17:06   ` Dave Jiang
  0 siblings, 1 reply; 6+ messages in thread
From: Vinod Koul @ 2021-01-17  6:51 UTC (permalink / raw)
  To: Dave Jiang; +Cc: dmaengine

On 15-01-21, 15:01, Dave Jiang wrote:
> Add a module parameter that overrides the SVA feature enabling. This keeps
> the driver in legacy mode even when intel_iommu=sm_on is set. In this mode,
> the descriptor fields must be programmed with dma_addr_t from the Linux DMA
> API for source, destination, and completion descriptors.
> 
> Signed-off-by: Dave Jiang <dave.jiang@intel.com>
> ---
>  drivers/dma/idxd/init.c |    8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/dma/idxd/init.c b/drivers/dma/idxd/init.c
> index 25cc947c6179..9687a24ff982 100644
> --- a/drivers/dma/idxd/init.c
> +++ b/drivers/dma/idxd/init.c
> @@ -26,6 +26,10 @@ MODULE_VERSION(IDXD_DRIVER_VERSION);
>  MODULE_LICENSE("GPL v2");
>  MODULE_AUTHOR("Intel Corporation");
>  
> +static bool sva = true;
> +module_param(sva, bool, 0644);
> +MODULE_PARM_DESC(sva, "Toggle SVA support on/off");

Documentation for this please..

> +
>  #define DRV_NAME "idxd"
>  
>  bool support_enqcmd;
> @@ -338,12 +342,14 @@ static int idxd_probe(struct idxd_device *idxd)
>  	idxd_device_init_reset(idxd);
>  	dev_dbg(dev, "IDXD reset complete\n");
>  
> -	if (IS_ENABLED(CONFIG_INTEL_IDXD_SVM)) {
> +	if (IS_ENABLED(CONFIG_INTEL_IDXD_SVM) && sva) {
>  		rc = idxd_enable_system_pasid(idxd);
>  		if (rc < 0)
>  			dev_warn(dev, "Failed to enable PASID. No SVA support: %d\n", rc);
>  		else
>  			set_bit(IDXD_FLAG_PASID_ENABLED, &idxd->flags);
> +	} else if (!sva) {
> +		dev_warn(dev, "User forced SVA off via module param.\n");
>  	}
>  
>  	idxd_read_caps(idxd);
> 

-- 
~Vinod

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] dmaengine: idxd: add module parameter to force disable of SVA
  2021-01-17  6:51 ` Vinod Koul
@ 2021-01-18 17:06   ` Dave Jiang
  2021-01-19 16:38     ` Vinod Koul
  0 siblings, 1 reply; 6+ messages in thread
From: Dave Jiang @ 2021-01-18 17:06 UTC (permalink / raw)
  To: Vinod Koul; +Cc: dmaengine


On 1/16/2021 11:51 PM, Vinod Koul wrote:
> On 15-01-21, 15:01, Dave Jiang wrote:
>> Add a module parameter that overrides the SVA feature enabling. This keeps
>> the driver in legacy mode even when intel_iommu=sm_on is set. In this mode,
>> the descriptor fields must be programmed with dma_addr_t from the Linux DMA
>> API for source, destination, and completion descriptors.
>>
>> Signed-off-by: Dave Jiang <dave.jiang@intel.com>
>> ---
>>   drivers/dma/idxd/init.c |    8 +++++++-
>>   1 file changed, 7 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/dma/idxd/init.c b/drivers/dma/idxd/init.c
>> index 25cc947c6179..9687a24ff982 100644
>> --- a/drivers/dma/idxd/init.c
>> +++ b/drivers/dma/idxd/init.c
>> @@ -26,6 +26,10 @@ MODULE_VERSION(IDXD_DRIVER_VERSION);
>>   MODULE_LICENSE("GPL v2");
>>   MODULE_AUTHOR("Intel Corporation");
>>   
>> +static bool sva = true;
>> +module_param(sva, bool, 0644);
>> +MODULE_PARM_DESC(sva, "Toggle SVA support on/off");
> Documentation for this please..

Just comments or is there somewhere specific for driver module parameter 
documentations?

>
>> +
>>   #define DRV_NAME "idxd"
>>   
>>   bool support_enqcmd;
>> @@ -338,12 +342,14 @@ static int idxd_probe(struct idxd_device *idxd)
>>   	idxd_device_init_reset(idxd);
>>   	dev_dbg(dev, "IDXD reset complete\n");
>>   
>> -	if (IS_ENABLED(CONFIG_INTEL_IDXD_SVM)) {
>> +	if (IS_ENABLED(CONFIG_INTEL_IDXD_SVM) && sva) {
>>   		rc = idxd_enable_system_pasid(idxd);
>>   		if (rc < 0)
>>   			dev_warn(dev, "Failed to enable PASID. No SVA support: %d\n", rc);
>>   		else
>>   			set_bit(IDXD_FLAG_PASID_ENABLED, &idxd->flags);
>> +	} else if (!sva) {
>> +		dev_warn(dev, "User forced SVA off via module param.\n");
>>   	}
>>   
>>   	idxd_read_caps(idxd);
>>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] dmaengine: idxd: add module parameter to force disable of SVA
  2021-01-18 17:06   ` Dave Jiang
@ 2021-01-19 16:38     ` Vinod Koul
  2021-01-19 19:44       ` Dave Jiang
  0 siblings, 1 reply; 6+ messages in thread
From: Vinod Koul @ 2021-01-19 16:38 UTC (permalink / raw)
  To: Dave Jiang; +Cc: dmaengine

On 18-01-21, 10:06, Dave Jiang wrote:
> 
> On 1/16/2021 11:51 PM, Vinod Koul wrote:
> > On 15-01-21, 15:01, Dave Jiang wrote:
> > > Add a module parameter that overrides the SVA feature enabling. This keeps
> > > the driver in legacy mode even when intel_iommu=sm_on is set. In this mode,
> > > the descriptor fields must be programmed with dma_addr_t from the Linux DMA
> > > API for source, destination, and completion descriptors.
> > > 
> > > Signed-off-by: Dave Jiang <dave.jiang@intel.com>
> > > ---
> > >   drivers/dma/idxd/init.c |    8 +++++++-
> > >   1 file changed, 7 insertions(+), 1 deletion(-)
> > > 
> > > diff --git a/drivers/dma/idxd/init.c b/drivers/dma/idxd/init.c
> > > index 25cc947c6179..9687a24ff982 100644
> > > --- a/drivers/dma/idxd/init.c
> > > +++ b/drivers/dma/idxd/init.c
> > > @@ -26,6 +26,10 @@ MODULE_VERSION(IDXD_DRIVER_VERSION);
> > >   MODULE_LICENSE("GPL v2");
> > >   MODULE_AUTHOR("Intel Corporation");
> > > +static bool sva = true;
> > > +module_param(sva, bool, 0644);
> > > +MODULE_PARM_DESC(sva, "Toggle SVA support on/off");
> > Documentation for this please..
> 
> Just comments or is there somewhere specific for driver module parameter
> documentations?

All the parameters are supposed to be documented in Documentation/admin-guide/kernel-parameters.txt

Thanks

-- 
~Vinod

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] dmaengine: idxd: add module parameter to force disable of SVA
  2021-01-19 16:38     ` Vinod Koul
@ 2021-01-19 19:44       ` Dave Jiang
  2021-01-26 17:02         ` Vinod Koul
  0 siblings, 1 reply; 6+ messages in thread
From: Dave Jiang @ 2021-01-19 19:44 UTC (permalink / raw)
  To: Vinod Koul; +Cc: dmaengine


On 1/19/2021 9:38 AM, Vinod Koul wrote:
> On 18-01-21, 10:06, Dave Jiang wrote:
>> On 1/16/2021 11:51 PM, Vinod Koul wrote:
>>> On 15-01-21, 15:01, Dave Jiang wrote:
>>>> Add a module parameter that overrides the SVA feature enabling. This keeps
>>>> the driver in legacy mode even when intel_iommu=sm_on is set. In this mode,
>>>> the descriptor fields must be programmed with dma_addr_t from the Linux DMA
>>>> API for source, destination, and completion descriptors.
>>>>
>>>> Signed-off-by: Dave Jiang <dave.jiang@intel.com>
>>>> ---
>>>>    drivers/dma/idxd/init.c |    8 +++++++-
>>>>    1 file changed, 7 insertions(+), 1 deletion(-)
>>>>
>>>> diff --git a/drivers/dma/idxd/init.c b/drivers/dma/idxd/init.c
>>>> index 25cc947c6179..9687a24ff982 100644
>>>> --- a/drivers/dma/idxd/init.c
>>>> +++ b/drivers/dma/idxd/init.c
>>>> @@ -26,6 +26,10 @@ MODULE_VERSION(IDXD_DRIVER_VERSION);
>>>>    MODULE_LICENSE("GPL v2");
>>>>    MODULE_AUTHOR("Intel Corporation");
>>>> +static bool sva = true;
>>>> +module_param(sva, bool, 0644);
>>>> +MODULE_PARM_DESC(sva, "Toggle SVA support on/off");
>>> Documentation for this please..
>> Just comments or is there somewhere specific for driver module parameter
>> documentations?
> All the parameters are supposed to be documented in Documentation/admin-guide/kernel-parameters.txt

It seems to be for core kernel components and subsystems, and not 
specific device drivers. I'm not seeing any of the dmaengine driver 
module params being in this doc after grepping in drivers/dma.


>
> Thanks
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] dmaengine: idxd: add module parameter to force disable of SVA
  2021-01-19 19:44       ` Dave Jiang
@ 2021-01-26 17:02         ` Vinod Koul
  0 siblings, 0 replies; 6+ messages in thread
From: Vinod Koul @ 2021-01-26 17:02 UTC (permalink / raw)
  To: Dave Jiang; +Cc: dmaengine

On 19-01-21, 12:44, Dave Jiang wrote:
> 
> On 1/19/2021 9:38 AM, Vinod Koul wrote:
> > On 18-01-21, 10:06, Dave Jiang wrote:
> > > On 1/16/2021 11:51 PM, Vinod Koul wrote:
> > > > On 15-01-21, 15:01, Dave Jiang wrote:
> > > > > Add a module parameter that overrides the SVA feature enabling. This keeps
> > > > > the driver in legacy mode even when intel_iommu=sm_on is set. In this mode,
> > > > > the descriptor fields must be programmed with dma_addr_t from the Linux DMA
> > > > > API for source, destination, and completion descriptors.
> > > > > 
> > > > > Signed-off-by: Dave Jiang <dave.jiang@intel.com>
> > > > > ---
> > > > >    drivers/dma/idxd/init.c |    8 +++++++-
> > > > >    1 file changed, 7 insertions(+), 1 deletion(-)
> > > > > 
> > > > > diff --git a/drivers/dma/idxd/init.c b/drivers/dma/idxd/init.c
> > > > > index 25cc947c6179..9687a24ff982 100644
> > > > > --- a/drivers/dma/idxd/init.c
> > > > > +++ b/drivers/dma/idxd/init.c
> > > > > @@ -26,6 +26,10 @@ MODULE_VERSION(IDXD_DRIVER_VERSION);
> > > > >    MODULE_LICENSE("GPL v2");
> > > > >    MODULE_AUTHOR("Intel Corporation");
> > > > > +static bool sva = true;
> > > > > +module_param(sva, bool, 0644);
> > > > > +MODULE_PARM_DESC(sva, "Toggle SVA support on/off");
> > > > Documentation for this please..
> > > Just comments or is there somewhere specific for driver module parameter
> > > documentations?
> > All the parameters are supposed to be documented in Documentation/admin-guide/kernel-parameters.txt
> 
> It seems to be for core kernel components and subsystems, and not specific
> device drivers. I'm not seeing any of the dmaengine driver module params
> being in this doc after grepping in drivers/dma.

Yeah we should fix that as well :)

-- 
~Vinod

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-01-26 21:51 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-01-15 22:01 [PATCH] dmaengine: idxd: add module parameter to force disable of SVA Dave Jiang
2021-01-17  6:51 ` Vinod Koul
2021-01-18 17:06   ` Dave Jiang
2021-01-19 16:38     ` Vinod Koul
2021-01-19 19:44       ` Dave Jiang
2021-01-26 17:02         ` Vinod Koul

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox