Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1281082
| Path | csiph.com!eternal-september.org!feeder.eternal-september.org!aioe.org!bofh.it!news.nic.it!robomod |
|---|---|
| From | Jason Gunthorpe <jgunthorpe@obsidianresearch.com> |
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 2/2] tpm_tis: Clean up the force=1 module parameter |
| Date | Tue, 01 Dec 2015 18:40:02 +0100 |
| Message-ID | <qAX4e-4do-11@gated-at.bofh.it> (permalink) |
| References | <qACj8-7Iu-9@gated-at.bofh.it> <qACj8-7Iu-11@gated-at.bofh.it> <qANxT-6yD-5@gated-at.bofh.it> |
| X-Original-To | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> |
| Dkim-Signature | v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=obsidianresearch.com; s=rsa1; h=In-Reply-To:Content-Transfer-Encoding:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date; bh=rCn1rFK+LwgUWQntB1Ea89tBJK9MFwDhROyvCftOQoA=; b=tubLRIZCQfNM+TZYrVmx45SX8+NjEKOcrs07Yda26pY1+r/m44bgsOkMyoSgYYU9jC492xK6xweUG1EkM+LsXxyCpuimyj2Chfw1RjJRB9Kp4WJpYi4Ve0nPDCfLlqEKXP6dzVCBEKkGwwieyveC13c3cdCCWX4p4wY4trPn/IM=; |
| MIME-Version | 1.0 |
| Content-Type | text/plain; charset=iso-8859-1 |
| Content-Disposition | inline |
| Content-Transfer-Encoding | 8bit |
| 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 | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 76 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>, tpmdd-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, Martin Wilck <Martin.Wilck@ts.fujitsu.com>, Peter Huewe <peterhuewe@gmx.de> |
| X-Original-Date | Tue, 1 Dec 2015 10:35:49 -0700 |
| X-Original-Message-ID | <20151201173549.GB691@obsidianresearch.com> |
| X-Original-References | <1448911632-20070-1-git-send-email-jgunthorpe@obsidianresearch.com> <1448911632-20070-3-git-send-email-jgunthorpe@obsidianresearch.com> <20151201072835.GQ10431@pengutronix.de> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1281082 |
Show key headers only | View raw
On Tue, Dec 01, 2015 at 08:28:35AM +0100, Uwe Kleine-König wrote:
> On Mon, Nov 30, 2015 at 12:27:12PM -0700, Jason Gunthorpe wrote:
> > The TPM core has long assumed that every device has a driver attached,
> > however b8b2c7d845d5 ("base/platform: assert that dev_pm_domain callbacks are
> > called unconditionally") breaks that assumption.
>
> Maybe it's worth to point out that b8b2c7d845d5 didn't break it on
> purpose and is fixed accordingly. Still the assumption isn't valid, but
> works in practise.
Purposeful or not, it is the source of the bug this patch is
fixing.. I'm happy with any language, proposal?
> > + res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> > + if (res == NULL) {
>
> indention problems here.
Woops, forgot to run check patch..
> > + if (res)
> > + tpm_info.irq = res->start;
> > + else {
>
> If one branch of an if/else has braces, all of them should.
Is that a thing now? Surprised checkpatch doesn't complain.
> > static bool force;
> > +#ifdef CONFIG_X86
> > module_param(force, bool, 0444);
> > MODULE_PARM_DESC(force, "Force device probe rather than using ACPI entry");
> > +#endif
>
> Is this added ifdef intended to be in this commit?
Yes, upon auditing all this it is clear the values we have are
hard-wired to x86, so this will never work on another platform.
I'm happy to put that in another patch.
> > -err_init:
> > - platform_device_unregister(pdev);
> > -err_dev:
> > - platform_driver_unregister(&tis_drv);
> > +out4:
> > +#ifdef CONFIG_ACPI
> > + acpi_bus_unregister_driver(&tis_acpi_driver);
> > +out3:
> > +#endif
> > + pnp_unregister_driver(&tis_pnp_driver);
> > +out2:
> > + platform_device_unregister(force_pdev);
> > +out1:
>
> Might be a matter of taste, but having nicer names for the error labels
> makes review easier. For example I would have called "out3"
> "err_register_acpi" instead. Then you can easily verify that it's placed
> right in the error path being directly after
> acpi_bus_unregister_driver.
The downside is it is harder to review the goto sites because there is
no longer much logic to their ordering, but sure, names seem a bit
more common in tpm.
> Also all kind of strange things happen if you later need to add a label
> between out2 and out3. drivers/scsi/hpsa.c for example used "clean2_5"
> in a similar situation.
Yes, it isn't so bad to do that.
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/
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 2/2] tpm_tis: Clean up the force=1 module parameter Jason Gunthorpe <jgunthorpe@obsidianresearch.com> - 2015-11-30 20:30 +0100
Re: [PATCH 2/2] tpm_tis: Clean up the force=1 module parameter Uwe Kleine-König <u.kleine-koenig@pengutronix.de> - 2015-12-01 08:30 +0100
Re: [PATCH 2/2] tpm_tis: Clean up the force=1 module parameter Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> - 2015-12-01 09:40 +0100
Re: [PATCH 2/2] tpm_tis: Clean up the force=1 module parameter Jason Gunthorpe <jgunthorpe@obsidianresearch.com> - 2015-12-01 18:50 +0100
Re: [PATCH 2/2] tpm_tis: Clean up the force=1 module parameter Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> - 2015-12-01 22:00 +0100
Re: [PATCH 2/2] tpm_tis: Clean up the force=1 module parameter Jason Gunthorpe <jgunthorpe@obsidianresearch.com> - 2015-12-01 18:40 +0100
Re: [tpmdd-devel] [PATCH 2/2] tpm_tis: Clean up the force=1 module parameter "Wilck, Martin" <martin.wilck@ts.fujitsu.com> - 2015-12-01 13:00 +0100
Re: [tpmdd-devel] [PATCH 2/2] tpm_tis: Clean up the force=1 module parameter Jason Gunthorpe <jgunthorpe@obsidianresearch.com> - 2015-12-01 18:40 +0100
csiph-web