All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Rothwell <sfr@canb.auug.org.au>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Greg KH <gregkh@linuxfoundation.org>,
	James Bottomley <James.Bottomley@hansenpartnership.com>,
	Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Arnd Bergmann <arnd@arndb.de>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [GIT PULL] Char/Misc driver patches for 4.12-rc1
Date: Sat, 6 May 2017 15:09:11 +1000	[thread overview]
Message-ID: <20170506150911.1612bb15@canb.auug.org.au> (raw)
In-Reply-To: <CA+55aFxX6aH8nnVUwyFvNkjg5pKD0LWYA56nhPtUz81sxi7LWg@mail.gmail.com>

Hi Linus,

On Fri, 5 May 2017 13:01:34 -0700 Linus Torvalds <torvalds@linux-foundation.org> wrote:
>
> I actually would have preferred to not get any early merges, but what
> I was unhappy about is that I also didn't really get any heads-up
> about the cdev_device_add() conflict.
> 
> I did get notified about the other conflict (thanks, James), but
> somehow the cdev_device_add() changes didn't cause the same kind of
> notification.
> 
> So my unhappiness is not about me having to resolve things (I'm happy
> to do that) but about how apparently -next failed to notice that part
> of my merge resolution. Or maybe it was noticed in -next, but then the
> information about it got lost.
> 
> I prefer doing merge resolutions myself, but I *also* really really
> prefer the two sides of the conflict having been more aware of the
> clash.

Would that be this?

From: Stephen Rothwell <sfr@canb.auug.org.au>
To: Greg KH <greg@kroah.com>, Arnd Bergmann <arnd@arndb.de>, Jarkko Sakkinen  <jarkko.sakkinen@linux.intel.com>
Cc: linux-next@vger.kernel.org, linux-kernel@vger.kernel.org, Logan  Gunthorpe <logang@deltatee.com>, James Bottomley  <James.Bottomley@HansenPartnership.com>
Subject: linux-next: manual merge of the char-misc tree with the tpmdd tree
Date: Fri, 24 Mar 2017 14:33:02 +1100

Hi all,

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

  drivers/char/tpm/tpm-chip.c

between commits:

  67b67480db8b ("tpm: infrastructure for TPM spaces")
  b8e3586e8536 ("tpm: expose spaces via a device link /dev/tpmrm<n>")

from the tpmdd tree and commit:

  8dbbf5825181 ("tpm-chip: utilize new cdev_device_add helper function")

from the char-misc 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/char/tpm/tpm-chip.c
index aade6995f310,935f0e92ad61..000000000000
--- a/drivers/char/tpm/tpm-chip.c
+++ b/drivers/char/tpm/tpm-chip.c
@@@ -214,22 -186,7 +214,20 @@@ struct tpm_chip *tpm_chip_alloc(struct 
  		chip->flags |= TPM_CHIP_FLAG_VIRTUAL;
  
  	cdev_init(&chip->cdev, &tpm_fops);
 +	cdev_init(&chip->cdevs, &tpmrm_fops);
  	chip->cdev.owner = THIS_MODULE;
 +	chip->cdevs.owner = THIS_MODULE;
- 	chip->cdev.kobj.parent = &chip->dev.kobj;
- 	chip->cdevs.kobj.parent = &chip->devs.kobj;
 +
 +	chip->work_space.context_buf = kzalloc(PAGE_SIZE, GFP_KERNEL);
 +	if (!chip->work_space.context_buf) {
 +		rc = -ENOMEM;
 +		goto out;
 +	}
 +	chip->work_space.session_buf = kzalloc(PAGE_SIZE, GFP_KERNEL);
 +	if (!chip->work_space.session_buf) {
 +		rc = -ENOMEM;
 +		goto out;
 +	}
  
  	return chip;
  
@@@ -273,44 -229,13 +271,22 @@@ static int tpm_add_char_device(struct t
  {
  	int rc;
  
- 	rc = cdev_add(&chip->cdev, chip->dev.devt, 1);
+ 	rc = cdev_device_add(&chip->cdev, &chip->dev);
  	if (rc) {
  		dev_err(&chip->dev,
- 			"unable to cdev_add() %s, major %d, minor %d, err=%d\n",
+ 			"unable to cdev_device_add() %s, major %d, minor %d, err=%d\n",
  			dev_name(&chip->dev), MAJOR(chip->dev.devt),
  			MINOR(chip->dev.devt), rc);
 +		return rc;
 +	}
  
- 	rc = device_add(&chip->dev);
- 	if (rc) {
- 		dev_err(&chip->dev,
- 			"unable to device_register() %s, major %d, minor %d, err=%d\n",
- 			dev_name(&chip->dev), MAJOR(chip->dev.devt),
- 			MINOR(chip->dev.devt), rc);
- 
- 		cdev_del(&chip->cdev);
- 		return rc;
- 	}
- 
- 	if (chip->flags & TPM_CHIP_FLAG_TPM2)
- 		rc = cdev_add(&chip->cdevs, chip->devs.devt, 1);
- 	if (rc) {
- 		dev_err(&chip->dev,
- 			"unable to cdev_add() %s, major %d, minor %d, err=%d\n",
- 			dev_name(&chip->devs), MAJOR(chip->devs.devt),
- 			MINOR(chip->devs.devt), rc);
- 		return rc;
- 	}
- 
 +	if (chip->flags & TPM_CHIP_FLAG_TPM2)
- 		rc = device_add(&chip->devs);
++		rc = cdev_device_add(&chip->cdevs, &chip->devs);
 +	if (rc) {
 +		dev_err(&chip->dev,
- 			"unable to device_register() %s, major %d, minor %d, err=%d\n",
++			"unable to cdev_device_add() %s, major %d, minor %d, err=%d\n",
 +			dev_name(&chip->devs), MAJOR(chip->devs.devt),
 +			MINOR(chip->devs.devt), rc);
- 		cdev_del(&chip->cdevs);
  		return rc;
  	}
  
@@@ -447,10 -371,6 +422,8 @@@ void tpm_chip_unregister(struct tpm_chi
  {
  	tpm_del_legacy_sysfs(chip);
  	tpm_bios_log_teardown(chip);
- 	if (chip->flags & TPM_CHIP_FLAG_TPM2) {
- 		cdev_del(&chip->cdevs);
- 		device_del(&chip->devs);
- 	}
++	if (chip->flags & TPM_CHIP_FLAG_TPM2)
++		cdev_device_del(&chip->cdevs, &chip->devs);
  	tpm_del_char_device(chip);
  }
  EXPORT_SYMBOL_GPL(tpm_chip_unregister);


-- 
Cheers,
Stephen Rothwell

  reply	other threads:[~2017-05-06  5:09 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-05  0:18 [GIT PULL] Char/Misc driver patches for 4.12-rc1 Greg KH
2017-05-05  2:28 ` Linus Torvalds
2017-05-05 16:00   ` James Bottomley
2017-05-05 16:33     ` Linus Torvalds
2017-05-05 16:49       ` James Bottomley
2017-05-05 16:38     ` Greg KH
2017-05-05 19:46       ` James Bottomley
2017-05-05 20:01       ` Linus Torvalds
2017-05-06  5:09         ` Stephen Rothwell [this message]
2017-05-06 18:00           ` Linus Torvalds
2017-05-06 18:12             ` James Bottomley
2017-07-12  4:50               ` Stephen Rothwell

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=20170506150911.1612bb15@canb.auug.org.au \
    --to=sfr@canb.auug.org.au \
    --cc=James.Bottomley@hansenpartnership.com \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=jarkko.sakkinen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.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.