public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ashley D Lai <adlai@linux.vnet.ibm.com>
To: "Peter Hüwe" <PeterHuewe@gmx.de>
Cc: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>,
	Leonidas Da Silva Barbosa <leosilva@linux.vnet.ibm.com>,
	linux-kernel@vger.kernel.org, Rajiv Andrade <mail@srajiv.net>,
	tpmdd-devel@lists.sourceforge.net, Sirrix AG <tpmdd@sirrix.com>,
	Teddy Reed <teddy@prosauce.org>
Subject: Re: [tpmdd-devel] [PATCH 02/13] tpm atmel: Call request_region with the correct base
Date: Wed, 02 Oct 2013 19:11:14 -0500	[thread overview]
Message-ID: <1380759074.20801.12.camel@buffalo> (raw)
In-Reply-To: <201310020000.13490.PeterHuewe@gmx.de>

On Wed, 2013-10-02 at 00:00 +0200, Peter Hüwe wrote:
> Am Montag, 23. September 2013, 20:14:32 schrieb Jason Gunthorpe:
> 
> > Commit e0dd03caf20d040a0a86b6bd74028ec9bda545f5
> 
> > changed the code path here so that ateml_get_base_addr
> 
> > no longer directly altered the tpm_vendor_specific
> 
> > structure, and instead placed the base address on the stack.
> 
> > 
> 
> > The commit missed updating the request_region call, which
> 
> > would have resulted in request_region being called with 0
> 
> > as the base address.
> 
Good catch!!

> > 
> 
> > I don't know if request_region(0, ..) will fail, if so the
> 
> > driver has been broken since 2006 and we should remove it
> 
> > from the tree as it has no users.
> 
>  
> 
> The Atmel TPM depends on PPC64 || HAS_IOPORT
> 
>  
> 
> So request_region is defined as
> 
> #define request_region(start,n,name)
> __request_region(&ioport_resource, (start), (n), (name), 0)
> 
> http://lxr.free-electrons.com/source/include/linux/ioport.h?a=powerpc#L174
> 
>  
> 
> with the final check in 
> 
> __request_resource(struct resource *root, struct resource *new)
> 
> ...
> 
> 204 if (end < start)
> 
> 205 return root;
> 
> 206 if (start < root->start)
> 
> 207 return root;
> 
> 208 if (end > root->end)
> 
> 209 return root;
> 
>  
> 
>  
> 
> with root being ioport_resource, ioport_resource->start = 0 and
> new->start being 0
> 
> so at least the basic check should work.
> 
>  
> 
> Nevertheless it most probably does request and reserve the wrong
> region and if anything else has or wants to request the region it
> might cause a problem.
> 
Would be interesting to see what problem this may cause. Unfortunately I
don't have a machine to test this.

>  
> 
> Does anyone (Ashley? IBM Fellows? Ted?) have access to one of those
> ancient tpms and maybe a machine to use test them?
> 
See above. I will keep looking and will let you know if I can find one.

>  
> 
>  
> 
>  
> 
> I somewhat have the feeling that we should maybe begin to deprecate
> the vendor specific 1.1 tpms...
> 
I agree. If we have a machine to test and it fails then we know we don't
have a user for this.

>  
> 
>  
> 
>  
> 
> Reviewed-by: Peter Huewe <peterhuewe@gmx.de>
> 
> Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
> 
>  
> 
> Staged here 
> https://github.com/PeterHuewe/linux-tpmdd for-james
> 
> 
>  
> 
> Peter
> 
>  
> 
> ------------------------------------------------------------------------------
> October Webinars: Code for Performance
> Free Intel webinars can help you accelerate application performance.
> Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
> the latest Intel processors and coprocessors. See abstracts and register >
> http://pubads.g.doubleclick.net/gampad/clk?id=60134791&iu=/4140/ostg.clktrk
> _______________________________________________ tpmdd-devel mailing list tpmdd-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tpmdd-devel



  parent reply	other threads:[~2013-10-03  0:10 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-23 18:14 [PATCH 00/13] TPM cleanup Jason Gunthorpe
2013-09-23 18:14 ` [PATCH 01/13] tpm: ibmvtpm: Use %zd formatting for size_t format arguments Jason Gunthorpe
2013-10-01 21:58   ` Peter Hüwe
2013-10-02 19:37   ` [tpmdd-devel] " Ashley D Lai
2013-09-23 18:14 ` [PATCH 02/13] tpm atmel: Call request_region with the correct base Jason Gunthorpe
     [not found]   ` <201310020000.13490.PeterHuewe@gmx.de>
2013-10-03  0:11     ` Ashley D Lai [this message]
2013-10-03  4:36       ` [tpmdd-devel] " Jason Gunthorpe
2013-10-04 17:21         ` Joel Schopp
2013-09-23 18:14 ` [PATCH 03/13] tpm: xen-tpmfront: Fix default durations Jason Gunthorpe
2013-09-23 18:51   ` Konrad Rzeszutek Wilk
2013-09-23 18:57     ` Daniel De Graaf
2013-09-23 18:14 ` [PATCH 04/13] tpm: Store devname in the tpm_chip Jason Gunthorpe
2013-10-04 15:57   ` [tpmdd-devel] " Ashley Lai
2013-09-23 18:14 ` [PATCH 05/13] tpm: Use container_of to locate the tpm_chip in tpm_open Jason Gunthorpe
2013-10-05  1:47   ` [tpmdd-devel] " Ashley Lai
2013-09-23 18:14 ` [PATCH 06/13] tpm: Remove redundant dev_set_drvdata Jason Gunthorpe
2013-10-05  2:14   ` [tpmdd-devel] " Ashley Lai
2013-09-23 18:14 ` [PATCH 07/13] tpm: Remove tpm_show_caps_1_2 Jason Gunthorpe
     [not found]   ` <201310020009.22952.PeterHuewe@gmx.de>
2013-10-01 22:21     ` Jason Gunthorpe
2013-10-01 22:38       ` [tpmdd-devel] " Peter Hüwe
2013-09-23 18:14 ` [PATCH 08/13] tpm: Pull everything related to /dev/tpmX into tpm-dev.c Jason Gunthorpe
2013-10-01 22:52   ` Peter Hüwe
2013-10-01 22:57     ` Jason Gunthorpe
2013-10-01 23:14       ` Peter Hüwe
2013-10-01 23:23         ` Jason Gunthorpe
2013-10-03  5:05         ` Jason Gunthorpe
2013-10-04 15:50           ` TPM.ko module rename (was tpm: Pull everything related to /dev/tpmX into tpm-dev.c) Peter Hüwe
2013-10-04 16:28             ` Jason Gunthorpe
2013-10-04 16:45               ` Ashley Lai
2013-09-23 18:14 ` [PATCH 09/13] tpm: Pull everything related to sysfs into tpm-sysfs.c Jason Gunthorpe
2013-09-23 18:54   ` [tpmdd-devel] " Daniel De Graaf
2013-09-23 19:36     ` Jason Gunthorpe
2013-09-23 20:20       ` Daniel De Graaf
2013-09-23 20:42         ` Jason Gunthorpe
2013-09-23 22:00           ` Daniel De Graaf
2013-09-23 22:23             ` Jason Gunthorpe
2013-09-24 14:28               ` Daniel De Graaf
2013-09-30 18:10                 ` Jason Gunthorpe
2013-09-30 20:36                   ` Daniel De Graaf
2013-09-30 21:20                     ` Jason Gunthorpe
2013-09-30 22:09                     ` Joel Schopp
2013-10-04 17:08                       ` Jason Gunthorpe
2013-10-04 19:17                         ` Stefan Berger
2013-10-04 22:02                           ` Peter Hüwe
2013-10-07 15:06                           ` Daniel De Graaf
2013-10-08  9:15                         ` AW: [TrouSerS-tech] " Fuchs, Andreas
2013-10-09 17:38                           ` Jason Gunthorpe
2013-10-10  7:42                             ` AW: " Fuchs, Andreas
2013-10-10 16:50                               ` Jason Gunthorpe
2013-09-23 18:14 ` [PATCH 10/13] tpm: Create a tpm_class_ops structure and use it in the drivers Jason Gunthorpe
2013-09-23 18:14 ` [PATCH 11/13] tpm: Use the ops structure instead of a copy in tpm_vendor_specific Jason Gunthorpe
2013-09-23 18:14 ` [PATCH 12/13] tpm: st33: Remove chip->data_buffer access from this driver Jason Gunthorpe
2013-09-23 18:14 ` [PATCH 13/13] tpm: Make tpm-dev allocate a per-file structure Jason Gunthorpe
2013-09-23 21:27 ` [tpmdd-devel] [PATCH 00/13] TPM cleanup Joel Schopp

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=1380759074.20801.12.camel@buffalo \
    --to=adlai@linux.vnet.ibm.com \
    --cc=PeterHuewe@gmx.de \
    --cc=jgunthorpe@obsidianresearch.com \
    --cc=leosilva@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mail@srajiv.net \
    --cc=teddy@prosauce.org \
    --cc=tpmdd-devel@lists.sourceforge.net \
    --cc=tpmdd@sirrix.com \
    /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