* Re: [PATCH] Fixed tpm_tis bug when some devices report invalid timeout values.
2014-10-29 17:28 ` [PATCH] Fixed tpm_tis bug when some devices report invalid timeout values Emil Condrea
@ 2014-10-29 14:24 ` Ian Campbell
2014-10-30 8:57 ` Emil Condrea
0 siblings, 1 reply; 4+ messages in thread
From: Ian Campbell @ 2014-10-29 14:24 UTC (permalink / raw)
To: Emil Condrea; +Cc: xen-devel
On Wed, 2014-10-29 at 19:28 +0200, Emil Condrea wrote:
Thanks.
Please see http://wiki.xen.org/wiki/Submitting_Xen_Patches which
describes some of the requirements for submitting a patch. In particular
we need a Signed-off-by in order to accept a contribution, but also note
the bit about CCing the relevant maintainer and the bit about what a
good changelog entry might contain.
Thanks,
Ian.
> ---
> extras/mini-os/tpm_tis.c | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
> diff --git a/extras/mini-os/tpm_tis.c b/extras/mini-os/tpm_tis.c
> index b067cb7..81d426a 100644
> --- a/extras/mini-os/tpm_tis.c
> +++ b/extras/mini-os/tpm_tis.c
> @@ -33,6 +33,11 @@
> #ifndef min
> #define min( a, b ) ( ((a) < (b)) ? (a) : (b) )
> #endif
> +#define ADJUST_TIMEOUTS_TO_STANDARD(initial,standard,timeout_no) \
> + if((initial) < (standard)){ \
> + (initial) = (standard); \
> + printk("Timeout %c was adjusted to standard value.\n",timeout_no); \
> + }
>
> #define TPM_HEADER_SIZE 10
>
> @@ -997,15 +1002,22 @@ int tpm_get_timeouts(struct tpm_chip *chip)
> }
> if (timeout)
> chip->timeout_a = MICROSECS(timeout * scale); /*Convert to msec */
> + ADJUST_TIMEOUTS_TO_STANDARD(chip->timeout_a,MILLISECS(TIS_SHORT_TIMEOUT),'a');
> +
> timeout = be32_to_cpu(timeout_cap->b);
> if (timeout)
> chip->timeout_b = MICROSECS(timeout * scale); /*Convert to msec */
> + ADJUST_TIMEOUTS_TO_STANDARD(chip->timeout_b,MILLISECS(TIS_LONG_TIMEOUT),'b');
> +
> timeout = be32_to_cpu(timeout_cap->c);
> if (timeout)
> chip->timeout_c = MICROSECS(timeout * scale); /*Convert to msec */
> + ADJUST_TIMEOUTS_TO_STANDARD(chip->timeout_c,MILLISECS(TIS_SHORT_TIMEOUT),'c');
> +
> timeout = be32_to_cpu(timeout_cap->d);
> if (timeout)
> chip->timeout_d = MICROSECS(timeout * scale); /*Convert to msec */
> + ADJUST_TIMEOUTS_TO_STANDARD(chip->timeout_d,MILLISECS(TIS_SHORT_TIMEOUT),'d');
>
> duration:
> tpm_cmd.header.in = tpm_getcap_header;
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] Fixed tpm_tis bug when some devices report invalid timeout
@ 2014-10-29 17:28 Emil Condrea
2014-10-29 17:28 ` [PATCH] Fixed tpm_tis bug when some devices report invalid timeout values Emil Condrea
0 siblings, 1 reply; 4+ messages in thread
From: Emil Condrea @ 2014-10-29 17:28 UTC (permalink / raw)
To: xen-devel
This patch contains fixes for TPM drivers that report invalid timeouts.
After aplying this patch developers using Atmel chipsets that were facing
problems starting vtmmgr-stubdom, should succeed.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] Fixed tpm_tis bug when some devices report invalid timeout values.
2014-10-29 17:28 [PATCH] Fixed tpm_tis bug when some devices report invalid timeout Emil Condrea
@ 2014-10-29 17:28 ` Emil Condrea
2014-10-29 14:24 ` Ian Campbell
0 siblings, 1 reply; 4+ messages in thread
From: Emil Condrea @ 2014-10-29 17:28 UTC (permalink / raw)
To: xen-devel; +Cc: Emil Condrea
---
| 12 ++++++++++++
1 file changed, 12 insertions(+)
--git a/extras/mini-os/tpm_tis.c b/extras/mini-os/tpm_tis.c
index b067cb7..81d426a 100644
--- a/extras/mini-os/tpm_tis.c
+++ b/extras/mini-os/tpm_tis.c
@@ -33,6 +33,11 @@
#ifndef min
#define min( a, b ) ( ((a) < (b)) ? (a) : (b) )
#endif
+#define ADJUST_TIMEOUTS_TO_STANDARD(initial,standard,timeout_no) \
+ if((initial) < (standard)){ \
+ (initial) = (standard); \
+ printk("Timeout %c was adjusted to standard value.\n",timeout_no); \
+ }
#define TPM_HEADER_SIZE 10
@@ -997,15 +1002,22 @@ int tpm_get_timeouts(struct tpm_chip *chip)
}
if (timeout)
chip->timeout_a = MICROSECS(timeout * scale); /*Convert to msec */
+ ADJUST_TIMEOUTS_TO_STANDARD(chip->timeout_a,MILLISECS(TIS_SHORT_TIMEOUT),'a');
+
timeout = be32_to_cpu(timeout_cap->b);
if (timeout)
chip->timeout_b = MICROSECS(timeout * scale); /*Convert to msec */
+ ADJUST_TIMEOUTS_TO_STANDARD(chip->timeout_b,MILLISECS(TIS_LONG_TIMEOUT),'b');
+
timeout = be32_to_cpu(timeout_cap->c);
if (timeout)
chip->timeout_c = MICROSECS(timeout * scale); /*Convert to msec */
+ ADJUST_TIMEOUTS_TO_STANDARD(chip->timeout_c,MILLISECS(TIS_SHORT_TIMEOUT),'c');
+
timeout = be32_to_cpu(timeout_cap->d);
if (timeout)
chip->timeout_d = MICROSECS(timeout * scale); /*Convert to msec */
+ ADJUST_TIMEOUTS_TO_STANDARD(chip->timeout_d,MILLISECS(TIS_SHORT_TIMEOUT),'d');
duration:
tpm_cmd.header.in = tpm_getcap_header;
--
1.9.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] Fixed tpm_tis bug when some devices report invalid timeout values.
2014-10-29 14:24 ` Ian Campbell
@ 2014-10-30 8:57 ` Emil Condrea
0 siblings, 0 replies; 4+ messages in thread
From: Emil Condrea @ 2014-10-30 8:57 UTC (permalink / raw)
To: Ian Campbell; +Cc: xen-devel
[-- Attachment #1.1: Type: text/plain, Size: 2440 bytes --]
Sure.
I sent the patch using git send-email and it seems that it was not well
configured to include the description and Signed-off. I will send it again.
On Wed, Oct 29, 2014 at 4:24 PM, Ian Campbell <Ian.Campbell@citrix.com>
wrote:
> On Wed, 2014-10-29 at 19:28 +0200, Emil Condrea wrote:
>
> Thanks.
>
> Please see http://wiki.xen.org/wiki/Submitting_Xen_Patches which
> describes some of the requirements for submitting a patch. In particular
> we need a Signed-off-by in order to accept a contribution, but also note
> the bit about CCing the relevant maintainer and the bit about what a
> good changelog entry might contain.
>
> Thanks,
> Ian.
>
> > ---
> > extras/mini-os/tpm_tis.c | 12 ++++++++++++
> > 1 file changed, 12 insertions(+)
> >
> > diff --git a/extras/mini-os/tpm_tis.c b/extras/mini-os/tpm_tis.c
> > index b067cb7..81d426a 100644
> > --- a/extras/mini-os/tpm_tis.c
> > +++ b/extras/mini-os/tpm_tis.c
> > @@ -33,6 +33,11 @@
> > #ifndef min
> > #define min( a, b ) ( ((a) < (b)) ? (a) : (b) )
> > #endif
> > +#define ADJUST_TIMEOUTS_TO_STANDARD(initial,standard,timeout_no)
> \
> > + if((initial) < (standard)){
> \
> > + (initial) = (standard);
> \
> > + printk("Timeout %c was adjusted to standard
> value.\n",timeout_no); \
> > + }
> >
> > #define TPM_HEADER_SIZE 10
> >
> > @@ -997,15 +1002,22 @@ int tpm_get_timeouts(struct tpm_chip *chip)
> > }
> > if (timeout)
> > chip->timeout_a = MICROSECS(timeout * scale); /*Convert to msec */
> > +
> ADJUST_TIMEOUTS_TO_STANDARD(chip->timeout_a,MILLISECS(TIS_SHORT_TIMEOUT),'a');
> > +
> > timeout = be32_to_cpu(timeout_cap->b);
> > if (timeout)
> > chip->timeout_b = MICROSECS(timeout * scale); /*Convert to msec */
> > +
> ADJUST_TIMEOUTS_TO_STANDARD(chip->timeout_b,MILLISECS(TIS_LONG_TIMEOUT),'b');
> > +
> > timeout = be32_to_cpu(timeout_cap->c);
> > if (timeout)
> > chip->timeout_c = MICROSECS(timeout * scale); /*Convert to msec */
> > +
> ADJUST_TIMEOUTS_TO_STANDARD(chip->timeout_c,MILLISECS(TIS_SHORT_TIMEOUT),'c');
> > +
> > timeout = be32_to_cpu(timeout_cap->d);
> > if (timeout)
> > chip->timeout_d = MICROSECS(timeout * scale); /*Convert to msec */
> > +
> ADJUST_TIMEOUTS_TO_STANDARD(chip->timeout_d,MILLISECS(TIS_SHORT_TIMEOUT),'d');
> >
> > duration:
> > tpm_cmd.header.in = tpm_getcap_header;
>
>
>
[-- Attachment #1.2: Type: text/html, Size: 3535 bytes --]
[-- Attachment #2: Type: text/plain, Size: 126 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-10-30 8:57 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-29 17:28 [PATCH] Fixed tpm_tis bug when some devices report invalid timeout Emil Condrea
2014-10-29 17:28 ` [PATCH] Fixed tpm_tis bug when some devices report invalid timeout values Emil Condrea
2014-10-29 14:24 ` Ian Campbell
2014-10-30 8:57 ` Emil Condrea
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.