Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932071AbbLASkK (ORCPT ); Tue, 1 Dec 2015 13:40:10 -0500 Received: from quartz.orcorp.ca ([184.70.90.242]:40672 "EHLO quartz.orcorp.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755546AbbLASkI (ORCPT ); Tue, 1 Dec 2015 13:40:08 -0500 Date: Tue, 1 Dec 2015 11:40:01 -0700 From: Jason Gunthorpe To: Peter Huewe Cc: "Wilck, Martin" , "tpmdd-devel@lists.sourceforge.net" , "linux-kernel@vger.kernel.org" , Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= Subject: Re: [tpmdd-devel] [PATCH] base/platform: fix panic when probe function is NULL Message-ID: <20151201184001.GA7372@obsidianresearch.com> References: <1448564494-23218-1-git-send-email-martin.wilck@ts.fujitsu.com> <20151127101125.GS19888@pengutronix.de> <20151201132436.GC5072@pengutronix.de> <20151201172537.GA541@obsidianresearch.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-Broken-Reverse-DNS: no host name found for IP address 10.0.0.160 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2219 Lines: 57 On Tue, Dec 01, 2015 at 10:26:17AM -0800, Peter Huewe wrote: > > > Am 1. Dezember 2015 09:25:37 PST, schrieb Jason Gunthorpe : > >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.. > > How broken are they and since when? oops the kernel broken, since 4.4-rc1 apparently, so not released yet. > Mark them as obsolete , default them to No and remove them by 4.10 > if there are no objections? Greg KH has been advising just to delete stuff right away. It is easy to undelete something if someone comes around with hardware and is willing to test Jason -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/