linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
To: "Wilck, Martin" <martin.wilck@ts.fujitsu.com>
Cc: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
	"tpmdd-devel@lists.sourceforge.net"
	<tpmdd-devel@lists.sourceforge.net>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [tpmdd-devel] [PATCH] base/platform: fix panic when probe function is NULL
Date: Tue, 1 Dec 2015 10:25:37 -0700	[thread overview]
Message-ID: <20151201172537.GA541@obsidianresearch.com> (raw)
In-Reply-To: <C5A28EF7B98F574C85C70238C8E9ECC04E682BF154@ABGEX74E.FSC.NET>

On Tue, Dec 01, 2015 at 04:19:25PM +0100, Wilck, Martin wrote:
> > > > tpm_tis_init calls tpmm_chip_alloc which barfs when pdev (i.e. the return value
> > > > of platform_device_register_simple above) isn't bound. It is not allowed
> > > > to assume that the device is bound after the above function calls.
> > > 
> > > Can you please explain again why you think that assumption is invalid? 
> > 
> > You can unbind a device from a driver via sysfs, you can also prevent
> > binding somehow I think, probing can fail for different reasons, probing
> > might wait for userspace interaction to load firmware which wasn't
> > scheduled yet. I'm sure there are still more things that break the
> > assumption.
> 
> Thanks. Out of these, "prevent binding somehow" would be the only
> problem that applies to tpm_tis, as probing can't fail (no probe()
> routine), there's no FW to load, and unbinding via sysfs would require
> nearly impossible timing (not sure if it could be done with udev).
> 
> Anyway, the Right Thing to do is to create a probe() routine and that's
> what Jason did.

That fixes tpm_tis, but there are other ancient TPM drivers that use
the old, now broken way.

So, we still need to do something here. Either fixup b8b2c7d845d5 as
you have proposed, remove the now broken obsolete TPM drivers, or try
and fix them..

Jason

  reply	other threads:[~2015-12-01 17:25 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-26 19:01 [PATCH] base/platform: fix panic when probe function is NULL martin.wilck
2015-11-26 20:30 ` [tpmdd-devel] " Jason Gunthorpe
2015-11-27  7:32   ` Wilck, Martin
2015-11-28 16:40   ` Jarkko Sakkinen
2015-11-28 16:49     ` Jarkko Sakkinen
2015-11-28 22:52     ` Jason Gunthorpe
2015-11-30 12:50       ` Jarkko Sakkinen
2015-11-27 10:11 ` Uwe Kleine-König
2015-11-30  7:42   ` Wilck, Martin
2015-11-30 11:50   ` [PATCH v2] base/platform: return success " martin.wilck
2015-12-01 20:30     ` Uwe Kleine-König
2015-12-01 10:41   ` [PATCH] base/platform: fix panic " Wilck, Martin
2015-12-01 13:24     ` Uwe Kleine-König
2015-12-01 15:19       ` Wilck, Martin
2015-12-01 17:25         ` Jason Gunthorpe [this message]
2015-12-01 18:26           ` [tpmdd-devel] " Peter Huewe
2015-12-01 18:40             ` Jason Gunthorpe
2015-12-01 18:54               ` Aw: " Peter Huewe
2015-12-01 19:03                 ` Jason Gunthorpe
2015-11-28 16:34 ` Jarkko Sakkinen
2015-11-29  9:54   ` Uwe Kleine-König
2015-11-30 12:56     ` Jarkko Sakkinen
2015-11-30 13:06       ` Jarkko Sakkinen

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=20151201172537.GA541@obsidianresearch.com \
    --to=jgunthorpe@obsidianresearch.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin.wilck@ts.fujitsu.com \
    --cc=tpmdd-devel@lists.sourceforge.net \
    --cc=u.kleine-koenig@pengutronix.de \
    /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 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).