Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1295580

Re: [PATCH v3 3/7] tpm_tis: Do not fall back to a hardcoded address for TPM2

From Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Newsgroups linux.kernel
Subject Re: [PATCH v3 3/7] tpm_tis: Do not fall back to a hardcoded address for TPM2
Date 2015-12-20 13:40 +0100
Message-ID <qHLrj-Ak-7@gated-at.bofh.it> (permalink)
References <qGLto-32N-7@gated-at.bofh.it> <qGLto-32N-15@gated-at.bofh.it> <qGZG2-3Pt-11@gated-at.bofh.it> <qH6xR-8aD-13@gated-at.bofh.it>
Organization Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo

Show all headers | View raw


On Fri, Dec 18, 2015 at 09:51:27AM -0700, Jason Gunthorpe wrote:
> On Fri, Dec 18, 2015 at 11:34:32AM +0200, Jarkko Sakkinen wrote:
> > > +	st = acpi_get_table(ACPI_SIG_TPM2, 1,
> > > +			    (struct acpi_table_header **) &tbl);
> > > +	if (ACPI_FAILURE(st) || tbl->header.length < sizeof(*tbl)) {
> > > +		dev_err(&acpi_dev->dev,
> > > +			FW_BUG "failed to get TPM2 ACPI table\n");
> > > +		return -EINVAL;
> > > +	}
> > > +
> > > +	if (tbl->start_method != ACPI_TPM2_MEMORY_MAPPED)
> > >  		return -ENODEV;
> > >  
> > >  	INIT_LIST_HEAD(&resources);
> > > @@ -996,6 +978,12 @@ static int tpm_tis_acpi_init(struct acpi_device *acpi_dev)
> > >  
> > >  	acpi_dev_free_resource_list(&resources);
> > >  
> > > +	if (tpm_info.start == 0 && tpm_info.len == 0) {
> > > +		dev_err(&acpi_dev->dev,
> > > +			FW_BUG "TPM2 ACPI table does not define a memory resource\n");
> > > +		return -EINVAL;
> > > +	}
> > > +
> > 
> > I guess this the only relevant change in this patch? You should propose
> > removal of is_fifo() as a separate patch if that makes sense. This patch
> > is now doing orthogonal things.
> 
> No, the return code changes are relevant too, and are why is_fifo was
> best un-inlined.
> 
> The patch is fixing all the ACPI data validatation in one go, not just
> the resource range, the description notes this.

Got you. I think I'm good with this patch.

Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>

> Jason

/Jarkko
--
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 | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH v3 3/7] tpm_tis: Do not fall back to a hardcoded address for TPM2 Jason Gunthorpe <jgunthorpe@obsidianresearch.com> - 2015-12-17 19:30 +0100
  Re: [PATCH v3 3/7] tpm_tis: Do not fall back to a hardcoded address  for TPM2 Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> - 2015-12-18 10:40 +0100
    Re: [PATCH v3 3/7] tpm_tis: Do not fall back to a hardcoded address  for TPM2 Jason Gunthorpe <jgunthorpe@obsidianresearch.com> - 2015-12-18 18:00 +0100
      Re: [PATCH v3 3/7] tpm_tis: Do not fall back to a hardcoded address  for TPM2 Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> - 2015-12-20 13:40 +0100

csiph-web