Skip to content

Commit

Permalink
crypto: nx - fix nx-842 pSeries driver minimum buffer size
Browse files Browse the repository at this point in the history
Reduce the nx-842 pSeries driver minimum buffer size from 128 to 8.
Also replace the single use of IO_BUFFER_ALIGN macro with the standard
and correct DDE_BUFFER_ALIGN.

The hw sometimes rejects buffers that contain padding past the end of the
8-byte aligned section where it sees the "end" marker.  With the minimum
buffer size set too high, some highly compressed buffers were being padded
and the hw was incorrectly rejecting them; this sets the minimum correctly
so there will be no incorrect padding.

Signed-off-by: Dan Streetman <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
  • Loading branch information
ddstreet authored and herbertx committed Jun 4, 2015
1 parent b08b6b7 commit 3154de7
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions drivers/crypto/nx/nx-842-pseries.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,10 @@ MODULE_LICENSE("GPL");
MODULE_AUTHOR("Robert Jennings <[email protected]>");
MODULE_DESCRIPTION("842 H/W Compression driver for IBM Power processors");

/* IO buffer must be 128 byte aligned */
#define IO_BUFFER_ALIGN 128

static struct nx842_constraints nx842_pseries_constraints = {
.alignment = IO_BUFFER_ALIGN,
.alignment = DDE_BUFFER_ALIGN,
.multiple = DDE_BUFFER_LAST_MULT,
.minimum = IO_BUFFER_ALIGN,
.minimum = DDE_BUFFER_LAST_MULT,
.maximum = PAGE_SIZE, /* dynamic, max_sync_size */
};

Expand Down

0 comments on commit 3154de7

Please sign in to comment.