Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752192AbbLAPT3 (ORCPT ); Tue, 1 Dec 2015 10:19:29 -0500 Received: from dgate10.ts.fujitsu.com ([80.70.172.49]:43627 "EHLO dgate10.ts.fujitsu.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751183AbbLAPT2 (ORCPT ); Tue, 1 Dec 2015 10:19:28 -0500 DomainKey-Signature: s=s1536a; d=ts.fujitsu.com; c=nofws; q=dns; h=X-SBRSScore:Received:Received:From:To:CC:Date:Subject: Thread-Topic:Thread-Index:Message-ID:References: In-Reply-To:Accept-Language:Content-Language: X-MS-Has-Attach:X-MS-TNEF-Correlator:acceptlanguage: Content-Type:Content-Transfer-Encoding:MIME-Version; b=E8G/2uD27m/TeARqOpqUzZp9Nn9JX2KoD3FL2iLa2coNGhDRdHUtu3Np eB+sLbAdOr4meMRIQjnUwVSo7wF90nmaEjRYsIcZFVh9xxti5LMICBQye s2L2ZBo0c+ROuwQuhKoV50Uwdo6JQdRxcZRBaQIyb9sK2FOWm8kIDq6fC bc6rE81bBy9cIpvJjX/TlX0kamYlP+blPD+aT6LHevAg0fe5NGkWK0ADf e3aasbqWp8qjYZfY9o839l5xwmy/D; X-SBRSScore: None From: "Wilck, Martin" To: =?utf-8?B?VXdlIEtsZWluZS1Lw7ZuaWc=?= CC: "linux-kernel@vger.kernel.org" , "tpmdd-devel@lists.sourceforge.net" Date: Tue, 1 Dec 2015 16:19:25 +0100 Subject: Re: [PATCH] base/platform: fix panic when probe function is NULL Thread-Topic: [PATCH] base/platform: fix panic when probe function is NULL Thread-Index: AdEsS6pMzdWVKV6kRH+rvIXh/jMsng== Message-ID: References: <1448564494-23218-1-git-send-email-martin.wilck@ts.fujitsu.com> <20151127101125.GS19888@pengutronix.de> <20151201132436.GC5072@pengutronix.de> In-Reply-To: <20151201132436.GC5072@pengutronix.de> Accept-Language: de-DE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: de-DE, en-US Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id tB1FJXw8028873 Content-Length: 1165 Lines: 24 > > > 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. Thanks again, Martin ????{.n?+???????+%?????ݶ??w??{.n?+????{??G?????{ay?ʇڙ?,j??f???h?????????z_??(?階?ݢj"???m??????G????????????&???~???iO???z??v?^?m???? ????????I?