All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nx-842: Ignore bit 3 of condition register returned by icswx
@ 2015-10-30 22:43 Ram Pai
  2015-10-31 12:14 ` Dan Streetman
  2015-11-17 14:00 ` Herbert Xu
  0 siblings, 2 replies; 8+ messages in thread
From: Ram Pai @ 2015-10-30 22:43 UTC (permalink / raw)
  To: Herbert Xu, David S. Miller, Linux Crypto Mailing List; +Cc: ddstreet, hbabu

icswx occasionally under heavy load sets bit 3 of condition register 0.
It has no software implication.

Currently that bit is interpreted by the driver as a failure, when
it should have calmly ignored it.

Signed-off-by: Ram Pai <linuxram@us.ibm.com>
---
 arch/powerpc/include/asm/icswx.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/include/asm/icswx.h b/arch/powerpc/include/asm/icswx.h
index 9f8402b..bce20c7 100644
--- a/arch/powerpc/include/asm/icswx.h
+++ b/arch/powerpc/include/asm/icswx.h
@@ -177,7 +177,7 @@ static inline int icswx(__be32 ccw, struct coprocessor_request_block *crb)
 	: "r" (ccw_reg), "r" (crb)
 	: "cr0", "memory");
 
-	return (int)((cr >> 28) & 0xf);
+	return (int)((cr >> 28) & 0xe);
 }

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] nx-842: Ignore bit 3 of condition register returned by icswx
  2015-10-30 22:43 [PATCH] nx-842: Ignore bit 3 of condition register returned by icswx Ram Pai
@ 2015-10-31 12:14 ` Dan Streetman
  2015-11-17 14:00 ` Herbert Xu
  1 sibling, 0 replies; 8+ messages in thread
From: Dan Streetman @ 2015-10-31 12:14 UTC (permalink / raw)
  To: Ram Pai
  Cc: Herbert Xu, David S. Miller, Linux Crypto Mailing List, Haren Myneni

On Fri, Oct 30, 2015 at 6:43 PM, Ram Pai <linuxram@us.ibm.com> wrote:
> icswx occasionally under heavy load sets bit 3 of condition register 0.
> It has no software implication.
>
> Currently that bit is interpreted by the driver as a failure, when
> it should have calmly ignored it.
>
> Signed-off-by: Ram Pai <linuxram@us.ibm.com>

Acked-by: Dan Streetman <ddstreet@ieee.org>

> ---
>  arch/powerpc/include/asm/icswx.h |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/arch/powerpc/include/asm/icswx.h b/arch/powerpc/include/asm/icswx.h
> index 9f8402b..bce20c7 100644
> --- a/arch/powerpc/include/asm/icswx.h
> +++ b/arch/powerpc/include/asm/icswx.h
> @@ -177,7 +177,7 @@ static inline int icswx(__be32 ccw, struct coprocessor_request_block *crb)
>         : "r" (ccw_reg), "r" (crb)
>         : "cr0", "memory");
>
> -       return (int)((cr >> 28) & 0xf);
> +       return (int)((cr >> 28) & 0xe);
>  }
>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] nx-842: Ignore bit 3 of condition register returned by icswx
  2015-10-30 22:43 [PATCH] nx-842: Ignore bit 3 of condition register returned by icswx Ram Pai
  2015-10-31 12:14 ` Dan Streetman
@ 2015-11-17 14:00 ` Herbert Xu
  2015-11-17 19:06   ` Ram Pai
  1 sibling, 1 reply; 8+ messages in thread
From: Herbert Xu @ 2015-11-17 14:00 UTC (permalink / raw)
  To: Ram Pai; +Cc: David S. Miller, Linux Crypto Mailing List, ddstreet, hbabu

On Fri, Oct 30, 2015 at 03:43:01PM -0700, Ram Pai wrote:
> icswx occasionally under heavy load sets bit 3 of condition register 0.
> It has no software implication.
> 
> Currently that bit is interpreted by the driver as a failure, when
> it should have calmly ignored it.
> 
> Signed-off-by: Ram Pai <linuxram@us.ibm.com>

Your patch is corrupted:

$ patch -s -p1 < .git/rebase-apply/patch 
patch: **** malformed patch at line 21: To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
$
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] nx-842: Ignore bit 3 of condition register returned by icswx
  2015-11-17 14:00 ` Herbert Xu
@ 2015-11-17 19:06   ` Ram Pai
  0 siblings, 0 replies; 8+ messages in thread
From: Ram Pai @ 2015-11-17 19:06 UTC (permalink / raw)
  To: Herbert Xu; +Cc: David S. Miller, Linux Crypto Mailing List, ddstreet, hbabu

On Tue, Nov 17, 2015 at 10:00:20PM +0800, Herbert Xu wrote:
> On Fri, Oct 30, 2015 at 03:43:01PM -0700, Ram Pai wrote:
> > icswx occasionally under heavy load sets bit 3 of condition register 0.
> > It has no software implication.
> > 
> > Currently that bit is interpreted by the driver as a failure, when
> > it should have calmly ignored it.
> > 
> > Signed-off-by: Ram Pai <linuxram@us.ibm.com>
> 
> Your patch is corrupted:
> 
> $ patch -s -p1 < .git/rebase-apply/patch 
> patch: **** malformed patch at line 21: To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
> $

Herbert, There were some comments about the patch on the ppc mailing
list.  

There are times this bit could be set and could be used by its
consumers; depending on how the RFC is implemented by the hardware. The
RFC does allow the hardware to assign meaning to that bit; though no
hardware currently exploits that feature. However from a software point
of view, we probably should not ignore the bit entirely. So please
ignore this patch till we come with a better solution.

RP

> -- 
> Email: Herbert Xu <herbert@gondor.apana.org.au>
> Home Page: http://gondor.apana.org.au/~herbert/
> PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

-- 
Ram Pai

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] nx-842: Ignore bit 3 of condition register returned by icswx
  2015-11-02 18:41   ` Ram Pai
@ 2015-11-02 22:24     ` Michael Ellerman
  0 siblings, 0 replies; 8+ messages in thread
From: Michael Ellerman @ 2015-11-02 22:24 UTC (permalink / raw)
  To: Ram Pai; +Cc: linuxppc-dev, hbabu, nacc, Dan Streetman

On Mon, 2015-11-02 at 10:41 -0800, Ram Pai wrote:
> On Mon, Nov 02, 2015 at 12:23:36PM +1100, Michael Ellerman wrote:
> > On Fri, 2015-10-30 at 15:31 -0700, Ram Pai wrote:
> > > icswx occasionally under heavy load sets bit 3 of condition register 0.
> >
> > Why?
>
> The hardware manual says that bit is undefined, though it is set under some
> conditions.

Which hardware manual?

Last I checked none of this was documented anywhere public. But the out of date
RFC I have does define bit zero to mean something.

> > > Currently that bit is interpreted by the driver as a failure, when
> > > it should have calmly ignored it.
> > 
> > Should the fix be in icswx or the driver? Please justify your choice.
> 
> Yes there are two solutions. One is icswx macro should not expose that
> bit to its consumers.  Or the driver/consumers can ignore that bit.  I
> think it makes more sense to contain it in one place, which is icswx
> instruction. Drivers or whoever calls icswx should not know
> more than what they need to know. This patch uses the first approach.

Yep, I'm fine with doing it in icswx if we're 100% sure the bit is always
undefined.

> > This sounds like it's fixing a bug so shouldn't the patch go to stable? And if
> > so which version(s) should it apply to?
> 
> It should go to stable v4.2.  I will tag it to stable, in my next version.

Thanks.

cheers

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] nx-842: Ignore bit 3 of condition register returned by icswx
  2015-11-02  1:23 ` Michael Ellerman
@ 2015-11-02 18:41   ` Ram Pai
  2015-11-02 22:24     ` Michael Ellerman
  0 siblings, 1 reply; 8+ messages in thread
From: Ram Pai @ 2015-11-02 18:41 UTC (permalink / raw)
  To: Michael Ellerman; +Cc: linuxppc-dev, hbabu, nacc, Dan Streetman

On Mon, Nov 02, 2015 at 12:23:36PM +1100, Michael Ellerman wrote:
> On Fri, 2015-10-30 at 15:31 -0700, Ram Pai wrote:
> > icswx occasionally under heavy load sets bit 3 of condition register 0.
> 
> Why?

The hardware manual says that bit is undefined, though it is set under some conditions.

> 
> Also you seem to be using IBM bit numbering, so please be explicit about that,
> or use normal bit numbering.

Ok. 


> 
> > It has no software implication.
> 
> What does it mean? You might be right but you don't give me enough info to
> decide.

The software is not supposed to interpret the bit since its meaning is
undefined. 

> 
> > Currently that bit is interpreted by the driver as a failure, when
> > it should have calmly ignored it.
> 
> Should the fix be in icswx or the driver? Please justify your choice.

Yes there are two solutions. One is icswx macro should not expose that
bit to its consumers.  Or the driver/consumers can ignore that bit.  I
think it makes more sense to contain it in one place, which is icswx
instruction. Drivers or whoever calls icswx should not know
more than what they need to know. This patch uses the first approach.

> 
> This sounds like it's fixing a bug so shouldn't the patch go to stable? And if
> so which version(s) should it apply to?

It should go to stable v4.2.  I will tag it to stable, in my next
version.

RP

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] nx-842: Ignore bit 3 of condition register returned by icswx
  2015-10-30 22:31 Ram Pai
@ 2015-11-02  1:23 ` Michael Ellerman
  2015-11-02 18:41   ` Ram Pai
  0 siblings, 1 reply; 8+ messages in thread
From: Michael Ellerman @ 2015-11-02  1:23 UTC (permalink / raw)
  To: Ram Pai, linuxppc-dev; +Cc: hbabu, nacc

On Fri, 2015-10-30 at 15:31 -0700, Ram Pai wrote:
> icswx occasionally under heavy load sets bit 3 of condition register 0.

Why?

Also you seem to be using IBM bit numbering, so please be explicit about that,
or use normal bit numbering.

> It has no software implication.

What does it mean? You might be right but you don't give me enough info to
decide.

> Currently that bit is interpreted by the driver as a failure, when
> it should have calmly ignored it.

Should the fix be in icswx or the driver? Please justify your choice.

This sounds like it's fixing a bug so shouldn't the patch go to stable? And if
so which version(s) should it apply to?

cheers

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH] nx-842: Ignore bit 3 of condition register returned by icswx
@ 2015-10-30 22:31 Ram Pai
  2015-11-02  1:23 ` Michael Ellerman
  0 siblings, 1 reply; 8+ messages in thread
From: Ram Pai @ 2015-10-30 22:31 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: mpe, hbabu, nacc

icswx occasionally under heavy load sets bit 3 of condition register 0.
It has no software implication.

Currently that bit is interpreted by the driver as a failure, when
it should have calmly ignored it.

Signed-off-by: Ram Pai <linuxram@us.ibm.com>
---
 arch/powerpc/include/asm/icswx.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/include/asm/icswx.h b/arch/powerpc/include/asm/icswx.h
index 9f8402b..bce20c7 100644
--- a/arch/powerpc/include/asm/icswx.h
+++ b/arch/powerpc/include/asm/icswx.h
@@ -177,7 +177,7 @@ static inline int icswx(__be32 ccw, struct coprocessor_request_block *crb)
 	: "r" (ccw_reg), "r" (crb)
 	: "cr0", "memory");
 
-	return (int)((cr >> 28) & 0xf);
+	return (int)((cr >> 28) & 0xe);
 }

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-11-17 19:06 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-30 22:43 [PATCH] nx-842: Ignore bit 3 of condition register returned by icswx Ram Pai
2015-10-31 12:14 ` Dan Streetman
2015-11-17 14:00 ` Herbert Xu
2015-11-17 19:06   ` Ram Pai
  -- strict thread matches above, loose matches on Subject: below --
2015-10-30 22:31 Ram Pai
2015-11-02  1:23 ` Michael Ellerman
2015-11-02 18:41   ` Ram Pai
2015-11-02 22:24     ` Michael Ellerman

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.