linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* linux-next: manual merge of the block tree with the mmc-fixes tree
@ 2021-07-09  0:32 Stephen Rothwell
  2021-07-09  8:34 ` Ulf Hansson
  2021-07-11 23:02 ` Stephen Rothwell
  0 siblings, 2 replies; 4+ messages in thread
From: Stephen Rothwell @ 2021-07-09  0:32 UTC (permalink / raw)
  To: Jens Axboe, Ulf Hansson
  Cc: Christoph Hellwig, Linux Kernel Mailing List,
	Linux Next Mailing List, Stephen Boyd

[-- Attachment #1: Type: text/plain, Size: 2785 bytes --]

Hi all,

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

  drivers/mmc/core/block.c

between commit:

  5c0777665b3e ("mmc: core: Use kref in place of struct mmc_blk_data::usage")

from the mmc-fixes tree and commits:

  249cda3325e0 ("mmc: remove an extra blk_{get,put}_queue pair")
  607d968a5769 ("mmc: switch to blk_mq_alloc_disk")

from the block 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/mmc/core/block.c
index d7b5c5ab75fa,9890a1532cb0..000000000000
--- a/drivers/mmc/core/block.c
+++ b/drivers/mmc/core/block.c
@@@ -195,26 -196,18 +195,25 @@@ static inline int mmc_get_devidx(struc
  	return devidx;
  }
  
 -static void mmc_blk_put(struct mmc_blk_data *md)
 +static void mmc_blk_kref_release(struct kref *ref)
  {
 -	mutex_lock(&open_lock);
 -	md->usage--;
 -	if (md->usage == 0) {
 -		int devidx = mmc_get_devidx(md->disk);
 +	struct mmc_blk_data *md = container_of(ref, struct mmc_blk_data, kref);
 +	int devidx;
  
 -		ida_simple_remove(&mmc_blk_ida, devidx);
 -		put_disk(md->disk);
 -		kfree(md);
 -	}
 +	devidx = mmc_get_devidx(md->disk);
- 	blk_put_queue(md->queue.queue);
 +	ida_simple_remove(&mmc_blk_ida, devidx);
 +
 +	mutex_lock(&open_lock);
 +	md->disk->private_data = NULL;
  	mutex_unlock(&open_lock);
 +
 +	put_disk(md->disk);
 +	kfree(md);
 +}
 +
 +static void mmc_blk_put(struct mmc_blk_data *md)
 +{
 +	kref_put(&md->kref, mmc_blk_kref_release);
  }
  
  static ssize_t power_ro_lock_show(struct device *dev,
@@@ -2334,27 -2327,11 +2333,11 @@@ static struct mmc_blk_data *mmc_blk_all
  
  	INIT_LIST_HEAD(&md->part);
  	INIT_LIST_HEAD(&md->rpmbs);
 -	md->usage = 1;
 +	kref_init(&md->kref);
- 
- 	ret = mmc_init_queue(&md->queue, card);
- 	if (ret)
- 		goto err_putdisk;
- 
  	md->queue.blkdata = md;
  
- 	/*
- 	 * Keep an extra reference to the queue so that we can shutdown the
- 	 * queue (i.e. call blk_cleanup_queue()) while there are still
- 	 * references to the 'md'. The corresponding blk_put_queue() is in
- 	 * mmc_blk_put().
- 	 */
- 	if (!blk_get_queue(md->queue.queue)) {
- 		mmc_cleanup_queue(&md->queue);
- 		ret = -ENODEV;
- 		goto err_putdisk;
- 	}
- 
  	md->disk->major	= MMC_BLOCK_MAJOR;
+ 	md->disk->minors = perdev_minors;
  	md->disk->first_minor = devidx * perdev_minors;
  	md->disk->fops = &mmc_bdops;
  	md->disk->private_data = md;

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: linux-next: manual merge of the block tree with the mmc-fixes tree
  2021-07-09  0:32 linux-next: manual merge of the block tree with the mmc-fixes tree Stephen Rothwell
@ 2021-07-09  8:34 ` Ulf Hansson
  2021-07-09 14:27   ` Jens Axboe
  2021-07-11 23:02 ` Stephen Rothwell
  1 sibling, 1 reply; 4+ messages in thread
From: Ulf Hansson @ 2021-07-09  8:34 UTC (permalink / raw)
  To: Jens Axboe, Stephen Rothwell
  Cc: Christoph Hellwig, Linux Kernel Mailing List,
	Linux Next Mailing List, Stephen Boyd

On Fri, 9 Jul 2021 at 02:32, Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> Hi all,
>
> Today's linux-next merge of the block tree got a conflict in:
>
>   drivers/mmc/core/block.c
>
> between commit:
>
>   5c0777665b3e ("mmc: core: Use kref in place of struct mmc_blk_data::usage")
>
> from the mmc-fixes tree and commits:
>
>   249cda3325e0 ("mmc: remove an extra blk_{get,put}_queue pair")
>   607d968a5769 ("mmc: switch to blk_mq_alloc_disk")
>
> from the block 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

Stephen, thanks for the heads up!

Jens, I noticed that you sent the PR with the mmc commits as of
yesterday. Assuming Linus will pull it before rc1, I will rebase and
fix up the conflict from my fixes branch on top. No action needed from
your side.

Kind regards
Uffe

>
> diff --cc drivers/mmc/core/block.c
> index d7b5c5ab75fa,9890a1532cb0..000000000000
> --- a/drivers/mmc/core/block.c
> +++ b/drivers/mmc/core/block.c
> @@@ -195,26 -196,18 +195,25 @@@ static inline int mmc_get_devidx(struc
>         return devidx;
>   }
>
>  -static void mmc_blk_put(struct mmc_blk_data *md)
>  +static void mmc_blk_kref_release(struct kref *ref)
>   {
>  -      mutex_lock(&open_lock);
>  -      md->usage--;
>  -      if (md->usage == 0) {
>  -              int devidx = mmc_get_devidx(md->disk);
>  +      struct mmc_blk_data *md = container_of(ref, struct mmc_blk_data, kref);
>  +      int devidx;
>
>  -              ida_simple_remove(&mmc_blk_ida, devidx);
>  -              put_disk(md->disk);
>  -              kfree(md);
>  -      }
>  +      devidx = mmc_get_devidx(md->disk);
> -       blk_put_queue(md->queue.queue);
>  +      ida_simple_remove(&mmc_blk_ida, devidx);
>  +
>  +      mutex_lock(&open_lock);
>  +      md->disk->private_data = NULL;
>         mutex_unlock(&open_lock);
>  +
>  +      put_disk(md->disk);
>  +      kfree(md);
>  +}
>  +
>  +static void mmc_blk_put(struct mmc_blk_data *md)
>  +{
>  +      kref_put(&md->kref, mmc_blk_kref_release);
>   }
>
>   static ssize_t power_ro_lock_show(struct device *dev,
> @@@ -2334,27 -2327,11 +2333,11 @@@ static struct mmc_blk_data *mmc_blk_all
>
>         INIT_LIST_HEAD(&md->part);
>         INIT_LIST_HEAD(&md->rpmbs);
>  -      md->usage = 1;
>  +      kref_init(&md->kref);
> -
> -       ret = mmc_init_queue(&md->queue, card);
> -       if (ret)
> -               goto err_putdisk;
> -
>         md->queue.blkdata = md;
>
> -       /*
> -        * Keep an extra reference to the queue so that we can shutdown the
> -        * queue (i.e. call blk_cleanup_queue()) while there are still
> -        * references to the 'md'. The corresponding blk_put_queue() is in
> -        * mmc_blk_put().
> -        */
> -       if (!blk_get_queue(md->queue.queue)) {
> -               mmc_cleanup_queue(&md->queue);
> -               ret = -ENODEV;
> -               goto err_putdisk;
> -       }
> -
>         md->disk->major = MMC_BLOCK_MAJOR;
> +       md->disk->minors = perdev_minors;
>         md->disk->first_minor = devidx * perdev_minors;
>         md->disk->fops = &mmc_bdops;
>         md->disk->private_data = md;

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

* Re: linux-next: manual merge of the block tree with the mmc-fixes tree
  2021-07-09  8:34 ` Ulf Hansson
@ 2021-07-09 14:27   ` Jens Axboe
  0 siblings, 0 replies; 4+ messages in thread
From: Jens Axboe @ 2021-07-09 14:27 UTC (permalink / raw)
  To: Ulf Hansson, Stephen Rothwell
  Cc: Christoph Hellwig, Linux Kernel Mailing List,
	Linux Next Mailing List, Stephen Boyd

On 7/9/21 2:34 AM, Ulf Hansson wrote:
> On Fri, 9 Jul 2021 at 02:32, Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>>
>> Hi all,
>>
>> Today's linux-next merge of the block tree got a conflict in:
>>
>>   drivers/mmc/core/block.c
>>
>> between commit:
>>
>>   5c0777665b3e ("mmc: core: Use kref in place of struct mmc_blk_data::usage")
>>
>> from the mmc-fixes tree and commits:
>>
>>   249cda3325e0 ("mmc: remove an extra blk_{get,put}_queue pair")
>>   607d968a5769 ("mmc: switch to blk_mq_alloc_disk")
>>
>> from the block 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
> 
> Stephen, thanks for the heads up!
> 
> Jens, I noticed that you sent the PR with the mmc commits as of
> yesterday. Assuming Linus will pull it before rc1, I will rebase and
> fix up the conflict from my fixes branch on top. No action needed from
> your side.

I don't have any 5.15 code in for-next until after the merge window, so
it's all fixes that are going into this release until then. These commits
have been queued up for a few weeks, they are just part of a later push
to Linus (that was sent out yesterday).

-- 
Jens Axboe


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

* Re: linux-next: manual merge of the block tree with the mmc-fixes tree
  2021-07-09  0:32 linux-next: manual merge of the block tree with the mmc-fixes tree Stephen Rothwell
  2021-07-09  8:34 ` Ulf Hansson
@ 2021-07-11 23:02 ` Stephen Rothwell
  1 sibling, 0 replies; 4+ messages in thread
From: Stephen Rothwell @ 2021-07-11 23:02 UTC (permalink / raw)
  To: Ulf Hansson
  Cc: Jens Axboe, Christoph Hellwig, Linux Kernel Mailing List,
	Linux Next Mailing List, Stephen Boyd

[-- Attachment #1: Type: text/plain, Size: 3124 bytes --]

Hi all,

On Fri, 9 Jul 2021 10:32:44 +1000 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> Today's linux-next merge of the block tree got a conflict in:
> 
>   drivers/mmc/core/block.c
> 
> between commit:
> 
>   5c0777665b3e ("mmc: core: Use kref in place of struct mmc_blk_data::usage")
> 
> from the mmc-fixes tree and commits:
> 
>   249cda3325e0 ("mmc: remove an extra blk_{get,put}_queue pair")
>   607d968a5769 ("mmc: switch to blk_mq_alloc_disk")
> 
> from the block 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.
> 
> diff --cc drivers/mmc/core/block.c
> index d7b5c5ab75fa,9890a1532cb0..000000000000
> --- a/drivers/mmc/core/block.c
> +++ b/drivers/mmc/core/block.c
> @@@ -195,26 -196,18 +195,25 @@@ static inline int mmc_get_devidx(struc
>   	return devidx;
>   }
>   
>  -static void mmc_blk_put(struct mmc_blk_data *md)
>  +static void mmc_blk_kref_release(struct kref *ref)
>   {
>  -	mutex_lock(&open_lock);
>  -	md->usage--;
>  -	if (md->usage == 0) {
>  -		int devidx = mmc_get_devidx(md->disk);
>  +	struct mmc_blk_data *md = container_of(ref, struct mmc_blk_data, kref);
>  +	int devidx;
>   
>  -		ida_simple_remove(&mmc_blk_ida, devidx);
>  -		put_disk(md->disk);
>  -		kfree(md);
>  -	}
>  +	devidx = mmc_get_devidx(md->disk);
> - 	blk_put_queue(md->queue.queue);
>  +	ida_simple_remove(&mmc_blk_ida, devidx);
>  +
>  +	mutex_lock(&open_lock);
>  +	md->disk->private_data = NULL;
>   	mutex_unlock(&open_lock);
>  +
>  +	put_disk(md->disk);
>  +	kfree(md);
>  +}
>  +
>  +static void mmc_blk_put(struct mmc_blk_data *md)
>  +{
>  +	kref_put(&md->kref, mmc_blk_kref_release);
>   }
>   
>   static ssize_t power_ro_lock_show(struct device *dev,
> @@@ -2334,27 -2327,11 +2333,11 @@@ static struct mmc_blk_data *mmc_blk_all
>   
>   	INIT_LIST_HEAD(&md->part);
>   	INIT_LIST_HEAD(&md->rpmbs);
>  -	md->usage = 1;
>  +	kref_init(&md->kref);
> - 
> - 	ret = mmc_init_queue(&md->queue, card);
> - 	if (ret)
> - 		goto err_putdisk;
> - 
>   	md->queue.blkdata = md;
>   
> - 	/*
> - 	 * Keep an extra reference to the queue so that we can shutdown the
> - 	 * queue (i.e. call blk_cleanup_queue()) while there are still
> - 	 * references to the 'md'. The corresponding blk_put_queue() is in
> - 	 * mmc_blk_put().
> - 	 */
> - 	if (!blk_get_queue(md->queue.queue)) {
> - 		mmc_cleanup_queue(&md->queue);
> - 		ret = -ENODEV;
> - 		goto err_putdisk;
> - 	}
> - 
>   	md->disk->major	= MMC_BLOCK_MAJOR;
> + 	md->disk->minors = perdev_minors;
>   	md->disk->first_minor = devidx * perdev_minors;
>   	md->disk->fops = &mmc_bdops;
>   	md->disk->private_data = md;

This is now a conflict between the mmc-fixes tree and Linus' tree.

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

end of thread, other threads:[~2021-07-11 23:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-09  0:32 linux-next: manual merge of the block tree with the mmc-fixes tree Stephen Rothwell
2021-07-09  8:34 ` Ulf Hansson
2021-07-09 14:27   ` Jens Axboe
2021-07-11 23:02 ` Stephen Rothwell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).