linux-next: manual merge of the dmaengine tree with Linus' tree

Stephen Rothwell posted 1 patch 3 years, 11 months ago
There is a newer version of this series
linux-next: manual merge of the dmaengine tree with Linus' tree
Posted by Stephen Rothwell 3 years, 11 months ago
Hi all,

Today's linux-next merge of the dmaengine tree got a conflict in:

  drivers/dma/idxd/device.c

between commit:

  1cd8e751d96c ("dmaengine: idxd: skip clearing device context when device is read-only")

from Linus' tree and commit:

  cf4ac3fef338 ("dmaengine: idxd: fix lockdep warning on device driver removal")

from the dmaengine tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc drivers/dma/idxd/device.c
index f652da6ab47d,1143886f4a80..000000000000
--- a/drivers/dma/idxd/device.c
+++ b/drivers/dma/idxd/device.c
@@@ -699,21 -716,23 +716,26 @@@ static void idxd_device_wqs_clear_state
  		struct idxd_wq *wq = idxd->wqs[i];
  
  		if (wq->state == IDXD_WQ_ENABLED) {
+ 			mutex_lock(&wq->wq_lock);
  			idxd_wq_disable_cleanup(wq);
 -			idxd_wq_device_reset_cleanup(wq);
  			wq->state = IDXD_WQ_DISABLED;
+ 			mutex_unlock(&wq->wq_lock);
  		}
 +		idxd_wq_device_reset_cleanup(wq);
  	}
  }
  
  void idxd_device_clear_state(struct idxd_device *idxd)
  {
 +	if (!test_bit(IDXD_FLAG_CONFIGURABLE, &idxd->flags))
 +		return;
 +
+ 	idxd_device_wqs_clear_state(idxd);
+ 	spin_lock(&idxd->dev_lock);
  	idxd_groups_clear_state(idxd);
  	idxd_engines_clear_state(idxd);
- 	idxd_device_wqs_clear_state(idxd);
+ 	idxd->state = IDXD_DEV_DISABLED;
+ 	spin_unlock(&idxd->dev_lock);
  }
  
  static void idxd_group_config_write(struct idxd_group *group)
Re: linux-next: manual merge of the dmaengine tree with Linus' tree
Posted by Vinod Koul 3 years, 11 months ago
On 17-05-22, 15:34, Stephen Rothwell wrote:
> Hi all,
> 
> Today's linux-next merge of the dmaengine tree got a conflict in:
> 
>   drivers/dma/idxd/device.c
> 
> between commit:
> 
>   1cd8e751d96c ("dmaengine: idxd: skip clearing device context when device is read-only")
> 
> from Linus' tree and commit:
> 
>   cf4ac3fef338 ("dmaengine: idxd: fix lockdep warning on device driver removal")

Thank you Stephen, the merge looks right to me. Dave pls verify and test
-next

> 
> from the dmaengine tree.
> 
> I fixed it up (see below) and can carry the fix as necessary. This
> is now fixed as far as linux-next is concerned, but any non trivial
> conflicts should be mentioned to your upstream maintainer when your tree
> is submitted for merging.  You may also want to consider cooperating
> with the maintainer of the conflicting tree to minimise any particularly
> complex conflicts.
> 
> -- 
> Cheers,
> Stephen Rothwell
> 
> diff --cc drivers/dma/idxd/device.c
> index f652da6ab47d,1143886f4a80..000000000000
> --- a/drivers/dma/idxd/device.c
> +++ b/drivers/dma/idxd/device.c
> @@@ -699,21 -716,23 +716,26 @@@ static void idxd_device_wqs_clear_state
>   		struct idxd_wq *wq = idxd->wqs[i];
>   
>   		if (wq->state == IDXD_WQ_ENABLED) {
> + 			mutex_lock(&wq->wq_lock);
>   			idxd_wq_disable_cleanup(wq);
>  -			idxd_wq_device_reset_cleanup(wq);
>   			wq->state = IDXD_WQ_DISABLED;
> + 			mutex_unlock(&wq->wq_lock);
>   		}
>  +		idxd_wq_device_reset_cleanup(wq);
>   	}
>   }
>   
>   void idxd_device_clear_state(struct idxd_device *idxd)
>   {
>  +	if (!test_bit(IDXD_FLAG_CONFIGURABLE, &idxd->flags))
>  +		return;
>  +
> + 	idxd_device_wqs_clear_state(idxd);
> + 	spin_lock(&idxd->dev_lock);
>   	idxd_groups_clear_state(idxd);
>   	idxd_engines_clear_state(idxd);
> - 	idxd_device_wqs_clear_state(idxd);
> + 	idxd->state = IDXD_DEV_DISABLED;
> + 	spin_unlock(&idxd->dev_lock);
>   }
>   
>   static void idxd_group_config_write(struct idxd_group *group)



-- 
~Vinod
Re: linux-next: manual merge of the dmaengine tree with Linus' tree
Posted by Dave Jiang 3 years, 11 months ago
On 5/18/2022 4:46 AM, Vinod Koul wrote:
> On 17-05-22, 15:34, Stephen Rothwell wrote:
>> Hi all,
>>
>> Today's linux-next merge of the dmaengine tree got a conflict in:
>>
>>    drivers/dma/idxd/device.c
>>
>> between commit:
>>
>>    1cd8e751d96c ("dmaengine: idxd: skip clearing device context when device is read-only")
>>
>> from Linus' tree and commit:
>>
>>    cf4ac3fef338 ("dmaengine: idxd: fix lockdep warning on device driver removal")
> Thank you Stephen, the merge looks right to me. Dave pls verify and test
> -next
>
>> from the dmaengine tree.
>>
>> I fixed it up (see below) and can carry the fix as necessary. This
>> is now fixed as far as linux-next is concerned, but any non trivial
>> conflicts should be mentioned to your upstream maintainer when your tree
>> is submitted for merging.  You may also want to consider cooperating
>> with the maintainer of the conflicting tree to minimise any particularly
>> complex conflicts.
>>
>> -- 
>> Cheers,
>> Stephen Rothwell
>>
>> diff --cc drivers/dma/idxd/device.c
>> index f652da6ab47d,1143886f4a80..000000000000
>> --- a/drivers/dma/idxd/device.c
>> +++ b/drivers/dma/idxd/device.c
>> @@@ -699,21 -716,23 +716,26 @@@ static void idxd_device_wqs_clear_state
>>    		struct idxd_wq *wq = idxd->wqs[i];
>>    
>>    		if (wq->state == IDXD_WQ_ENABLED) {
>> + 			mutex_lock(&wq->wq_lock);
>>    			idxd_wq_disable_cleanup(wq);
>>   -			idxd_wq_device_reset_cleanup(wq);
>>    			wq->state = IDXD_WQ_DISABLED;
>> + 			mutex_unlock(&wq->wq_lock);
>>    		}
>>   +		idxd_wq_device_reset_cleanup(wq);


The lock needs to go around both functions, we can move it outside the 
if().

  + 		mutex_lock(&wq->wq_lock);
   		if (wq->state == IDXD_WQ_ENABLED) {
   			idxd_wq_disable_cleanup(wq);
  -			idxd_wq_device_reset_cleanup(wq);
   			wq->state = IDXD_WQ_DISABLED;
   		}
  +		idxd_wq_device_reset_cleanup(wq);
  + 		mutex_unlock(&wq->wq_lock);


>>    	}
>>    }
>>    
>>    void idxd_device_clear_state(struct idxd_device *idxd)
>>    {
>>   +	if (!test_bit(IDXD_FLAG_CONFIGURABLE, &idxd->flags))
>>   +		return;
>>   +
>> + 	idxd_device_wqs_clear_state(idxd);
>> + 	spin_lock(&idxd->dev_lock);
>>    	idxd_groups_clear_state(idxd);
>>    	idxd_engines_clear_state(idxd);
>> - 	idxd_device_wqs_clear_state(idxd);
>> + 	idxd->state = IDXD_DEV_DISABLED;
>> + 	spin_unlock(&idxd->dev_lock);
>>    }
>>    
>>    static void idxd_group_config_write(struct idxd_group *group)
>
>
Re: linux-next: manual merge of the dmaengine tree with Linus' tree
Posted by Stephen Rothwell 3 years, 11 months ago
Hi Dave,

On Wed, 18 May 2022 10:20:59 -0700 Dave Jiang <dave.jiang@intel.com> wrote:
>
> The lock needs to go around both functions, we can move it outside the if().
> 
>   + 		mutex_lock(&wq->wq_lock);
>    		if (wq->state == IDXD_WQ_ENABLED) {
>    			idxd_wq_disable_cleanup(wq);
>   -			idxd_wq_device_reset_cleanup(wq);
>    			wq->state = IDXD_WQ_DISABLED;
>    		}
>   +		idxd_wq_device_reset_cleanup(wq);
>   + 		mutex_unlock(&wq->wq_lock);

Thanks for checking.  I have made that change to my merge resolution.
-- 
Cheers,
Stephen Rothwell
Re: linux-next: manual merge of the dmaengine tree with Linus' tree
Posted by Dave Jiang 3 years, 11 months ago
On 5/18/2022 3:40 PM, Stephen Rothwell wrote:
> Hi Dave,
>
> On Wed, 18 May 2022 10:20:59 -0700 Dave Jiang <dave.jiang@intel.com> wrote:
>> The lock needs to go around both functions, we can move it outside the if().
>>
>>    + 		mutex_lock(&wq->wq_lock);
>>     		if (wq->state == IDXD_WQ_ENABLED) {
>>     			idxd_wq_disable_cleanup(wq);
>>    -			idxd_wq_device_reset_cleanup(wq);
>>     			wq->state = IDXD_WQ_DISABLED;
>>     		}
>>    +		idxd_wq_device_reset_cleanup(wq);
>>    + 		mutex_unlock(&wq->wq_lock);
> Thanks for checking.  I have made that change to my merge resolution.
Thank you!