kernel: bump 4.14 to 4.14.114

Refreshed all patches.

Altered patches:
- 150-bridge_allow_receiption_on_disabled_port.patch
- 201-extra_optimization.patch

Remove upstreamed:
- 022-0006-crypto-crypto4xx-properly-set-IV-after-de-and-encryp.patch

Compile-tested on: ar71xx, cns3xxx, imx6, x86_64
Runtime-tested on: ar71xx, cns3xxx, imx6

Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
v19.07.3_mercusys_ac12_duma
Koen Vandeputte 5 years ago
parent 456f486b53
commit b765f4be40

@ -4,12 +4,12 @@ LINUX_RELEASE?=1
LINUX_VERSION-3.18 = .136 LINUX_VERSION-3.18 = .136
LINUX_VERSION-4.9 = .171 LINUX_VERSION-4.9 = .171
LINUX_VERSION-4.14 = .113 LINUX_VERSION-4.14 = .114
LINUX_VERSION-4.19 = .36 LINUX_VERSION-4.19 = .36
LINUX_KERNEL_HASH-3.18.136 = 48c8775013d23229462134f911bbb14c7935096fcccfb19ce28ecd5f7154f35c LINUX_KERNEL_HASH-3.18.136 = 48c8775013d23229462134f911bbb14c7935096fcccfb19ce28ecd5f7154f35c
LINUX_KERNEL_HASH-4.9.171 = 431cd992bf74da9851dd5938dbe45ff7577219b84b237ae5e30067d483b57f01 LINUX_KERNEL_HASH-4.9.171 = 431cd992bf74da9851dd5938dbe45ff7577219b84b237ae5e30067d483b57f01
LINUX_KERNEL_HASH-4.14.113 = b24df2e37faaf2290999c507f9e29de98494f52429bcd35513c5b3e52eaddac2 LINUX_KERNEL_HASH-4.14.114 = b75e1dcfabc8d18051a07cbf9b60eaee8ac470a2311fed20447fd0d022c19e15
LINUX_KERNEL_HASH-4.19.36 = b808b508177f9d288d94a3b9df7b01d5eac9fcc1804a794c913b2144de63f2bc LINUX_KERNEL_HASH-4.19.36 = b808b508177f9d288d94a3b9df7b01d5eac9fcc1804a794c913b2144de63f2bc
remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1)))) remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1))))

@ -39,9 +39,9 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
sa = (struct dynamic_sa_ctl *) ctx->sa_in; sa = (struct dynamic_sa_ctl *) ctx->sa_in;
- ctx->hash_final = 0; - ctx->hash_final = 0;
set_dynamic_sa_command_0(sa, SA_NOT_SAVE_HASH, SA_NOT_SAVE_IV, set_dynamic_sa_command_0(sa, SA_NOT_SAVE_HASH, (cm == CRYPTO_MODE_CBC ?
SA_LOAD_HASH_FROM_SA, SA_LOAD_IV_FROM_STATE, SA_SAVE_IV : SA_NOT_SAVE_IV),
@@ -191,7 +188,6 @@ static int crypto4xx_hash_alg_init(struc @@ -192,7 +189,6 @@ static int crypto4xx_hash_alg_init(struc
ctx->dev = my_alg->dev; ctx->dev = my_alg->dev;
ctx->is_hash = 1; ctx->is_hash = 1;
@ -49,7 +49,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
/* Create SA */ /* Create SA */
if (ctx->sa_in_dma_addr || ctx->sa_out_dma_addr) if (ctx->sa_in_dma_addr || ctx->sa_out_dma_addr)
@@ -256,7 +252,6 @@ int crypto4xx_hash_update(struct ahash_r @@ -257,7 +253,6 @@ int crypto4xx_hash_update(struct ahash_r
struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm); struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm);
ctx->is_hash = 1; ctx->is_hash = 1;
@ -57,7 +57,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
ctx->pd_ctl = 0x11; ctx->pd_ctl = 0x11;
ctx->direction = DIR_INBOUND; ctx->direction = DIR_INBOUND;
@@ -274,7 +269,6 @@ int crypto4xx_hash_digest(struct ahash_r @@ -275,7 +270,6 @@ int crypto4xx_hash_digest(struct ahash_r
{ {
struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm); struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm);
@ -67,7 +67,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
--- a/drivers/crypto/amcc/crypto4xx_core.c --- a/drivers/crypto/amcc/crypto4xx_core.c
+++ b/drivers/crypto/amcc/crypto4xx_core.c +++ b/drivers/crypto/amcc/crypto4xx_core.c
@@ -964,7 +964,7 @@ u32 crypto4xx_build_pd(struct crypto_asy @@ -973,7 +973,7 @@ u32 crypto4xx_build_pd(struct crypto_asy
sa->sa_command_1.bf.hash_crypto_offset = 0; sa->sa_command_1.bf.hash_crypto_offset = 0;
pd->pd_ctl.w = ctx->pd_ctl; pd->pd_ctl.w = ctx->pd_ctl;

@ -18,7 +18,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
--- a/drivers/crypto/amcc/crypto4xx_core.c --- a/drivers/crypto/amcc/crypto4xx_core.c
+++ b/drivers/crypto/amcc/crypto4xx_core.c +++ b/drivers/crypto/amcc/crypto4xx_core.c
@@ -1116,7 +1116,9 @@ struct crypto4xx_alg_common crypto4xx_al @@ -1125,7 +1125,9 @@ struct crypto4xx_alg_common crypto4xx_al
.cra_name = "cbc(aes)", .cra_name = "cbc(aes)",
.cra_driver_name = "cbc-aes-ppc4xx", .cra_driver_name = "cbc-aes-ppc4xx",
.cra_priority = CRYPTO4XX_CRYPTO_PRIORITY, .cra_priority = CRYPTO4XX_CRYPTO_PRIORITY,

@ -14,7 +14,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
--- a/drivers/crypto/amcc/crypto4xx_core.c --- a/drivers/crypto/amcc/crypto4xx_core.c
+++ b/drivers/crypto/amcc/crypto4xx_core.c +++ b/drivers/crypto/amcc/crypto4xx_core.c
@@ -1081,7 +1081,6 @@ static void crypto4xx_bh_tasklet_cb(unsi @@ -1090,7 +1090,6 @@ static void crypto4xx_bh_tasklet_cb(unsi
pd->pd_ctl.bf.pe_done = 0; pd->pd_ctl.bf.pe_done = 0;
crypto4xx_pd_done(core_dev->dev, tail); crypto4xx_pd_done(core_dev->dev, tail);
crypto4xx_put_pd_to_pdr(core_dev->dev, tail); crypto4xx_put_pd_to_pdr(core_dev->dev, tail);

@ -18,7 +18,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
--- a/drivers/crypto/amcc/crypto4xx_alg.c --- a/drivers/crypto/amcc/crypto4xx_alg.c
+++ b/drivers/crypto/amcc/crypto4xx_alg.c +++ b/drivers/crypto/amcc/crypto4xx_alg.c
@@ -149,7 +149,7 @@ static int crypto4xx_setkey_aes(struct c @@ -150,7 +150,7 @@ static int crypto4xx_setkey_aes(struct c
SA_NOT_COPY_HDR); SA_NOT_COPY_HDR);
crypto4xx_memcpy_le(ctx->sa_in + get_dynamic_sa_offset_key_field(ctx), crypto4xx_memcpy_le(ctx->sa_in + get_dynamic_sa_offset_key_field(ctx),
key, keylen); key, keylen);
@ -27,7 +27,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
sa->sa_command_1.bf.key_len = keylen >> 3; sa->sa_command_1.bf.key_len = keylen >> 3;
ctx->is_hash = 0; ctx->is_hash = 0;
ctx->direction = DIR_INBOUND; ctx->direction = DIR_INBOUND;
@@ -219,7 +219,7 @@ static int crypto4xx_hash_alg_init(struc @@ -220,7 +220,7 @@ static int crypto4xx_hash_alg_init(struc
SA_NOT_COPY_PAD, SA_NOT_COPY_PAYLOAD, SA_NOT_COPY_PAD, SA_NOT_COPY_PAYLOAD,
SA_NOT_COPY_HDR); SA_NOT_COPY_HDR);
ctx->direction = DIR_INBOUND; ctx->direction = DIR_INBOUND;

@ -68,7 +68,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
} }
/** /**
@@ -147,15 +147,15 @@ static int crypto4xx_setkey_aes(struct c @@ -148,15 +148,15 @@ static int crypto4xx_setkey_aes(struct c
SA_SEQ_MASK_OFF, SA_MC_ENABLE, SA_SEQ_MASK_OFF, SA_MC_ENABLE,
SA_NOT_COPY_PAD, SA_NOT_COPY_PAYLOAD, SA_NOT_COPY_PAD, SA_NOT_COPY_PAYLOAD,
SA_NOT_COPY_HDR); SA_NOT_COPY_HDR);
@ -88,7 +88,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
memcpy(ctx->sa_out, ctx->sa_in, ctx->sa_len * 4); memcpy(ctx->sa_out, ctx->sa_in, ctx->sa_len * 4);
sa = (struct dynamic_sa_ctl *) ctx->sa_out; sa = (struct dynamic_sa_ctl *) ctx->sa_out;
@@ -225,7 +225,7 @@ static int crypto4xx_hash_alg_init(struc @@ -226,7 +226,7 @@ static int crypto4xx_hash_alg_init(struc
memset(sa_in->inner_digest, 0, sizeof(sa_in->inner_digest)); memset(sa_in->inner_digest, 0, sizeof(sa_in->inner_digest));
memset(sa_in->outer_digest, 0, sizeof(sa_in->outer_digest)); memset(sa_in->outer_digest, 0, sizeof(sa_in->outer_digest));
sa_in->state_ptr = ctx->state_record_dma_addr; sa_in->state_ptr = ctx->state_record_dma_addr;

@ -27,7 +27,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
#include "crypto4xx_reg_def.h" #include "crypto4xx_reg_def.h"
#include "crypto4xx_core.h" #include "crypto4xx_core.h"
#include "crypto4xx_sa.h" #include "crypto4xx_sa.h"
@@ -171,6 +172,71 @@ int crypto4xx_setkey_aes_cbc(struct cryp @@ -172,6 +173,71 @@ int crypto4xx_setkey_aes_cbc(struct cryp
CRYPTO_FEEDBACK_MODE_NO_FB); CRYPTO_FEEDBACK_MODE_NO_FB);
} }
@ -109,7 +109,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
#include <crypto/sha.h> #include <crypto/sha.h>
#include "crypto4xx_reg_def.h" #include "crypto4xx_reg_def.h"
#include "crypto4xx_core.h" #include "crypto4xx_core.h"
@@ -1135,6 +1136,103 @@ struct crypto4xx_alg_common crypto4xx_al @@ -1144,6 +1145,103 @@ struct crypto4xx_alg_common crypto4xx_al
} }
} }
}}, }},

@ -25,9 +25,9 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
- sa = (struct dynamic_sa_ctl *) ctx->sa_in; - sa = (struct dynamic_sa_ctl *) ctx->sa_in;
+ sa = ctx->sa_in; + sa = ctx->sa_in;
set_dynamic_sa_command_0(sa, SA_NOT_SAVE_HASH, SA_NOT_SAVE_IV, set_dynamic_sa_command_0(sa, SA_NOT_SAVE_HASH, (cm == CRYPTO_MODE_CBC ?
SA_LOAD_HASH_FROM_SA, SA_LOAD_IV_FROM_STATE, SA_SAVE_IV : SA_NOT_SAVE_IV),
@@ -159,7 +159,7 @@ static int crypto4xx_setkey_aes(struct c @@ -160,7 +160,7 @@ static int crypto4xx_setkey_aes(struct c
ctx->offset_to_sr_ptr = get_dynamic_sa_offset_state_ptr_field(sa); ctx->offset_to_sr_ptr = get_dynamic_sa_offset_state_ptr_field(sa);
memcpy(ctx->sa_out, ctx->sa_in, ctx->sa_len * 4); memcpy(ctx->sa_out, ctx->sa_in, ctx->sa_len * 4);
@ -36,7 +36,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
sa->sa_command_0.bf.dir = DIR_OUTBOUND; sa->sa_command_0.bf.dir = DIR_OUTBOUND;
return 0; return 0;
@@ -248,8 +248,7 @@ static int crypto4xx_hash_alg_init(struc @@ -249,8 +249,7 @@ static int crypto4xx_hash_alg_init(struc
struct crypto_alg *alg = tfm->__crt_alg; struct crypto_alg *alg = tfm->__crt_alg;
struct crypto4xx_alg *my_alg = crypto_alg_to_crypto4xx_alg(alg); struct crypto4xx_alg *my_alg = crypto_alg_to_crypto4xx_alg(alg);
struct crypto4xx_ctx *ctx = crypto_tfm_ctx(tfm); struct crypto4xx_ctx *ctx = crypto_tfm_ctx(tfm);
@ -46,7 +46,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
int rc; int rc;
ctx->dev = my_alg->dev; ctx->dev = my_alg->dev;
@@ -273,25 +272,24 @@ static int crypto4xx_hash_alg_init(struc @@ -274,25 +273,24 @@ static int crypto4xx_hash_alg_init(struc
crypto_ahash_set_reqsize(__crypto_ahash_cast(tfm), crypto_ahash_set_reqsize(__crypto_ahash_cast(tfm),
sizeof(struct crypto4xx_ctx)); sizeof(struct crypto4xx_ctx));
@ -80,7 +80,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
return 0; return 0;
} }
@@ -302,7 +300,7 @@ int crypto4xx_hash_init(struct ahash_req @@ -303,7 +301,7 @@ int crypto4xx_hash_init(struct ahash_req
int ds; int ds;
struct dynamic_sa_ctl *sa; struct dynamic_sa_ctl *sa;
@ -206,7 +206,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
SA_HASH_ALG_SHA1_DIGEST_SIZE); SA_HASH_ALG_SHA1_DIGEST_SIZE);
} }
@@ -607,11 +600,9 @@ static u32 crypto4xx_ahash_done(struct c @@ -616,11 +609,9 @@ static u32 crypto4xx_ahash_done(struct c
static u32 crypto4xx_pd_done(struct crypto4xx_device *dev, u32 idx) static u32 crypto4xx_pd_done(struct crypto4xx_device *dev, u32 idx)
{ {
@ -220,7 +220,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
if (crypto_tfm_alg_type(pd_uinfo->async_req->tfm) == if (crypto_tfm_alg_type(pd_uinfo->async_req->tfm) ==
CRYPTO_ALG_TYPE_ABLKCIPHER) CRYPTO_ALG_TYPE_ABLKCIPHER)
return crypto4xx_ablkcipher_done(dev, pd_uinfo, pd); return crypto4xx_ablkcipher_done(dev, pd_uinfo, pd);
@@ -712,7 +703,6 @@ u32 crypto4xx_build_pd(struct crypto_asy @@ -721,7 +712,6 @@ u32 crypto4xx_build_pd(struct crypto_asy
unsigned long flags; unsigned long flags;
struct pd_uinfo *pd_uinfo = NULL; struct pd_uinfo *pd_uinfo = NULL;
unsigned int nbytes = datalen, idx; unsigned int nbytes = datalen, idx;
@ -228,7 +228,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
u32 gd_idx = 0; u32 gd_idx = 0;
/* figure how many gd is needed */ /* figure how many gd is needed */
@@ -771,17 +761,15 @@ u32 crypto4xx_build_pd(struct crypto_asy @@ -780,17 +770,15 @@ u32 crypto4xx_build_pd(struct crypto_asy
} }
spin_unlock_irqrestore(&dev->core_dev->lock, flags); spin_unlock_irqrestore(&dev->core_dev->lock, flags);
@ -248,7 +248,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
if (ctx->direction == DIR_INBOUND) if (ctx->direction == DIR_INBOUND)
memcpy(sa, ctx->sa_in, ctx->sa_len * 4); memcpy(sa, ctx->sa_in, ctx->sa_len * 4);
else else
@@ -791,14 +779,15 @@ u32 crypto4xx_build_pd(struct crypto_asy @@ -800,14 +788,15 @@ u32 crypto4xx_build_pd(struct crypto_asy
&pd_uinfo->sr_pa, 4); &pd_uinfo->sr_pa, 4);
if (iv_len) if (iv_len)
@ -267,7 +267,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
} }
} }
pd->sa_len = ctx->sa_len; pd->sa_len = ctx->sa_len;
@@ -1006,9 +995,8 @@ static void crypto4xx_bh_tasklet_cb(unsi @@ -1015,9 +1004,8 @@ static void crypto4xx_bh_tasklet_cb(unsi
while (core_dev->dev->pdr_head != core_dev->dev->pdr_tail) { while (core_dev->dev->pdr_head != core_dev->dev->pdr_tail) {
tail = core_dev->dev->pdr_tail; tail = core_dev->dev->pdr_tail;

@ -38,7 +38,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
--- a/drivers/crypto/amcc/crypto4xx_core.c --- a/drivers/crypto/amcc/crypto4xx_core.c
+++ b/drivers/crypto/amcc/crypto4xx_core.c +++ b/drivers/crypto/amcc/crypto4xx_core.c
@@ -1148,7 +1148,7 @@ struct crypto4xx_alg_common crypto4xx_al @@ -1157,7 +1157,7 @@ struct crypto4xx_alg_common crypto4xx_al
.min_keysize = AES_MIN_KEY_SIZE, .min_keysize = AES_MIN_KEY_SIZE,
.max_keysize = AES_MAX_KEY_SIZE, .max_keysize = AES_MAX_KEY_SIZE,
.ivsize = AES_IV_SIZE, .ivsize = AES_IV_SIZE,

@ -56,9 +56,9 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
#include "crypto4xx_reg_def.h" #include "crypto4xx_reg_def.h"
#include "crypto4xx_core.h" #include "crypto4xx_core.h"
#include "crypto4xx_sa.h" #include "crypto4xx_sa.h"
@@ -573,8 +574,10 @@ static u32 crypto4xx_ablkcipher_done(str @@ -582,8 +583,10 @@ static u32 crypto4xx_ablkcipher_done(str
dst->offset, dst->length, DMA_FROM_DEVICE);
} }
crypto4xx_ret_sg_desc(dev, pd_uinfo); crypto4xx_ret_sg_desc(dev, pd_uinfo);
- if (ablk_req->base.complete != NULL) - if (ablk_req->base.complete != NULL)
- ablk_req->base.complete(&ablk_req->base, 0); - ablk_req->base.complete(&ablk_req->base, 0);
@ -69,7 +69,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
return 0; return 0;
} }
@@ -591,9 +594,10 @@ static u32 crypto4xx_ahash_done(struct c @@ -600,9 +603,10 @@ static u32 crypto4xx_ahash_done(struct c
crypto4xx_copy_digest_to_dst(pd_uinfo, crypto4xx_copy_digest_to_dst(pd_uinfo,
crypto_tfm_ctx(ahash_req->base.tfm)); crypto_tfm_ctx(ahash_req->base.tfm));
crypto4xx_ret_sg_desc(dev, pd_uinfo); crypto4xx_ret_sg_desc(dev, pd_uinfo);
@ -83,7 +83,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
return 0; return 0;
} }
@@ -704,6 +708,7 @@ u32 crypto4xx_build_pd(struct crypto_asy @@ -713,6 +717,7 @@ u32 crypto4xx_build_pd(struct crypto_asy
struct pd_uinfo *pd_uinfo = NULL; struct pd_uinfo *pd_uinfo = NULL;
unsigned int nbytes = datalen, idx; unsigned int nbytes = datalen, idx;
u32 gd_idx = 0; u32 gd_idx = 0;
@ -91,7 +91,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
/* figure how many gd is needed */ /* figure how many gd is needed */
num_gd = sg_nents_for_len(src, datalen); num_gd = sg_nents_for_len(src, datalen);
@@ -734,6 +739,31 @@ u32 crypto4xx_build_pd(struct crypto_asy @@ -743,6 +748,31 @@ u32 crypto4xx_build_pd(struct crypto_asy
* already got must be return the original place. * already got must be return the original place.
*/ */
spin_lock_irqsave(&dev->core_dev->lock, flags); spin_lock_irqsave(&dev->core_dev->lock, flags);
@ -123,7 +123,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
if (num_gd) { if (num_gd) {
fst_gd = crypto4xx_get_n_gd(dev, num_gd); fst_gd = crypto4xx_get_n_gd(dev, num_gd);
if (fst_gd == ERING_WAS_FULL) { if (fst_gd == ERING_WAS_FULL) {
@@ -888,11 +918,12 @@ u32 crypto4xx_build_pd(struct crypto_asy @@ -897,11 +927,12 @@ u32 crypto4xx_build_pd(struct crypto_asy
sa->sa_command_1.bf.hash_crypto_offset = 0; sa->sa_command_1.bf.hash_crypto_offset = 0;
pd->pd_ctl.w = ctx->pd_ctl; pd->pd_ctl.w = ctx->pd_ctl;
pd->pd_ctl_len.w = 0x00400000 | datalen; pd->pd_ctl_len.w = 0x00400000 | datalen;
@ -138,7 +138,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
} }
/** /**
@@ -997,7 +1028,7 @@ static void crypto4xx_bh_tasklet_cb(unsi @@ -1006,7 +1037,7 @@ static void crypto4xx_bh_tasklet_cb(unsi
tail = core_dev->dev->pdr_tail; tail = core_dev->dev->pdr_tail;
pd_uinfo = &core_dev->dev->pdr_uinfo[tail]; pd_uinfo = &core_dev->dev->pdr_uinfo[tail];
pd = &core_dev->dev->pdr[tail]; pd = &core_dev->dev->pdr[tail];

@ -32,7 +32,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
--- a/drivers/crypto/amcc/crypto4xx_alg.c --- a/drivers/crypto/amcc/crypto4xx_alg.c
+++ b/drivers/crypto/amcc/crypto4xx_alg.c +++ b/drivers/crypto/amcc/crypto4xx_alg.c
@@ -149,8 +149,8 @@ static int crypto4xx_setkey_aes(struct c @@ -150,8 +150,8 @@ static int crypto4xx_setkey_aes(struct c
SA_SEQ_MASK_OFF, SA_MC_ENABLE, SA_SEQ_MASK_OFF, SA_MC_ENABLE,
SA_NOT_COPY_PAD, SA_NOT_COPY_PAYLOAD, SA_NOT_COPY_PAD, SA_NOT_COPY_PAYLOAD,
SA_NOT_COPY_HDR); SA_NOT_COPY_HDR);
@ -45,7 +45,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
ctx->is_hash = 0; ctx->is_hash = 0;
--- a/drivers/crypto/amcc/crypto4xx_core.c --- a/drivers/crypto/amcc/crypto4xx_core.c
+++ b/drivers/crypto/amcc/crypto4xx_core.c +++ b/drivers/crypto/amcc/crypto4xx_core.c
@@ -614,42 +614,6 @@ static u32 crypto4xx_pd_done(struct cryp @@ -623,42 +623,6 @@ static u32 crypto4xx_pd_done(struct cryp
return crypto4xx_ahash_done(dev, pd_uinfo); return crypto4xx_ahash_done(dev, pd_uinfo);
} }
@ -88,7 +88,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
static void crypto4xx_stop_all(struct crypto4xx_core_device *core_dev) static void crypto4xx_stop_all(struct crypto4xx_core_device *core_dev)
{ {
crypto4xx_destroy_pdr(core_dev->dev); crypto4xx_destroy_pdr(core_dev->dev);
@@ -809,8 +773,8 @@ u32 crypto4xx_build_pd(struct crypto_asy @@ -818,8 +782,8 @@ u32 crypto4xx_build_pd(struct crypto_asy
&pd_uinfo->sr_pa, 4); &pd_uinfo->sr_pa, 4);
if (iv_len) if (iv_len)

@ -82,7 +82,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
} }
/** /**
@@ -153,11 +155,6 @@ static int crypto4xx_setkey_aes(struct c @@ -154,11 +156,6 @@ static int crypto4xx_setkey_aes(struct c
key, keylen); key, keylen);
sa->sa_contents.w = SA_AES_CONTENTS | (keylen << 2); sa->sa_contents.w = SA_AES_CONTENTS | (keylen << 2);
sa->sa_command_1.bf.key_len = keylen >> 3; sa->sa_command_1.bf.key_len = keylen >> 3;
@ -94,7 +94,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
memcpy(ctx->sa_out, ctx->sa_in, ctx->sa_len * 4); memcpy(ctx->sa_out, ctx->sa_in, ctx->sa_len * 4);
sa = ctx->sa_out; sa = ctx->sa_out;
@@ -206,7 +203,7 @@ int crypto4xx_setkey_rfc3686(struct cryp @@ -207,7 +204,7 @@ int crypto4xx_setkey_rfc3686(struct cryp
if (rc) if (rc)
return rc; return rc;
@ -103,7 +103,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
key + keylen - CTR_RFC3686_NONCE_SIZE, CTR_RFC3686_NONCE_SIZE); key + keylen - CTR_RFC3686_NONCE_SIZE, CTR_RFC3686_NONCE_SIZE);
return 0; return 0;
@@ -215,27 +212,29 @@ int crypto4xx_setkey_rfc3686(struct cryp @@ -216,27 +213,29 @@ int crypto4xx_setkey_rfc3686(struct cryp
int crypto4xx_rfc3686_encrypt(struct ablkcipher_request *req) int crypto4xx_rfc3686_encrypt(struct ablkcipher_request *req)
{ {
struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm); struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm);
@ -145,7 +145,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
} }
/** /**
@@ -253,7 +252,6 @@ static int crypto4xx_hash_alg_init(struc @@ -254,7 +253,6 @@ static int crypto4xx_hash_alg_init(struc
int rc; int rc;
ctx->dev = my_alg->dev; ctx->dev = my_alg->dev;
@ -153,7 +153,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
/* Create SA */ /* Create SA */
if (ctx->sa_in_dma_addr || ctx->sa_out_dma_addr) if (ctx->sa_in_dma_addr || ctx->sa_out_dma_addr)
@@ -284,13 +282,9 @@ static int crypto4xx_hash_alg_init(struc @@ -285,13 +283,9 @@ static int crypto4xx_hash_alg_init(struc
SA_SEQ_MASK_OFF, SA_MC_ENABLE, SA_SEQ_MASK_OFF, SA_MC_ENABLE,
SA_NOT_COPY_PAD, SA_NOT_COPY_PAYLOAD, SA_NOT_COPY_PAD, SA_NOT_COPY_PAYLOAD,
SA_NOT_COPY_HDR); SA_NOT_COPY_HDR);
@ -167,7 +167,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
return 0; return 0;
} }
@@ -306,23 +300,22 @@ int crypto4xx_hash_init(struct ahash_req @@ -307,23 +301,22 @@ int crypto4xx_hash_init(struct ahash_req
__crypto_ahash_cast(req->base.tfm)); __crypto_ahash_cast(req->base.tfm));
sa->sa_command_0.bf.digest_len = ds >> 2; sa->sa_command_0.bf.digest_len = ds >> 2;
sa->sa_command_0.bf.load_hash_state = SA_LOAD_HASH_FROM_SA; sa->sa_command_0.bf.load_hash_state = SA_LOAD_HASH_FROM_SA;
@ -199,7 +199,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
} }
int crypto4xx_hash_final(struct ahash_request *req) int crypto4xx_hash_final(struct ahash_request *req)
@@ -332,14 +325,16 @@ int crypto4xx_hash_final(struct ahash_re @@ -333,14 +326,16 @@ int crypto4xx_hash_final(struct ahash_re
int crypto4xx_hash_digest(struct ahash_request *req) int crypto4xx_hash_digest(struct ahash_request *req)
{ {
@ -285,7 +285,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
} }
static void crypto4xx_ret_sg_desc(struct crypto4xx_device *dev, static void crypto4xx_ret_sg_desc(struct crypto4xx_device *dev,
@@ -591,7 +583,7 @@ static u32 crypto4xx_ahash_done(struct c @@ -600,7 +592,7 @@ static u32 crypto4xx_ahash_done(struct c
ahash_req = ahash_request_cast(pd_uinfo->async_req); ahash_req = ahash_request_cast(pd_uinfo->async_req);
ctx = crypto_tfm_ctx(ahash_req->base.tfm); ctx = crypto_tfm_ctx(ahash_req->base.tfm);
@ -294,7 +294,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto_tfm_ctx(ahash_req->base.tfm)); crypto_tfm_ctx(ahash_req->base.tfm));
crypto4xx_ret_sg_desc(dev, pd_uinfo); crypto4xx_ret_sg_desc(dev, pd_uinfo);
@@ -651,17 +643,17 @@ static u32 get_next_sd(u32 current) @@ -660,17 +652,17 @@ static u32 get_next_sd(u32 current)
return 0; return 0;
} }
@ -317,7 +317,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
struct ce_gd *gd; struct ce_gd *gd;
struct ce_pd *pd; struct ce_pd *pd;
u32 num_gd, num_sd; u32 num_gd, num_sd;
@@ -669,8 +661,9 @@ u32 crypto4xx_build_pd(struct crypto_asy @@ -678,8 +670,9 @@ u32 crypto4xx_build_pd(struct crypto_asy
u32 fst_sd = 0xffffffff; u32 fst_sd = 0xffffffff;
u32 pd_entry; u32 pd_entry;
unsigned long flags; unsigned long flags;
@ -329,7 +329,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
u32 gd_idx = 0; u32 gd_idx = 0;
bool is_busy; bool is_busy;
@@ -684,7 +677,7 @@ u32 crypto4xx_build_pd(struct crypto_asy @@ -693,7 +686,7 @@ u32 crypto4xx_build_pd(struct crypto_asy
num_gd = 0; num_gd = 0;
/* figure how many sd is needed */ /* figure how many sd is needed */
@ -338,7 +338,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
num_sd = 0; num_sd = 0;
} else { } else {
if (datalen > PPC4XX_SD_BUFFER_SIZE) { if (datalen > PPC4XX_SD_BUFFER_SIZE) {
@@ -755,37 +748,27 @@ u32 crypto4xx_build_pd(struct crypto_asy @@ -764,37 +757,27 @@ u32 crypto4xx_build_pd(struct crypto_asy
} }
spin_unlock_irqrestore(&dev->core_dev->lock, flags); spin_unlock_irqrestore(&dev->core_dev->lock, flags);
@ -389,7 +389,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
/* get first gd we are going to use */ /* get first gd we are going to use */
gd_idx = fst_gd; gd_idx = fst_gd;
pd_uinfo->first_gd = fst_gd; pd_uinfo->first_gd = fst_gd;
@@ -794,27 +777,30 @@ u32 crypto4xx_build_pd(struct crypto_asy @@ -803,27 +786,30 @@ u32 crypto4xx_build_pd(struct crypto_asy
pd->src = gd_dma; pd->src = gd_dma;
/* enable gather */ /* enable gather */
sa->sa_command_0.bf.gather = 1; sa->sa_command_0.bf.gather = 1;
@ -430,7 +430,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
/* /*
* Disable gather in sa command * Disable gather in sa command
*/ */
@@ -825,25 +811,24 @@ u32 crypto4xx_build_pd(struct crypto_asy @@ -834,25 +820,24 @@ u32 crypto4xx_build_pd(struct crypto_asy
pd_uinfo->first_gd = 0xffffffff; pd_uinfo->first_gd = 0xffffffff;
pd_uinfo->num_gd = 0; pd_uinfo->num_gd = 0;
} }
@ -463,7 +463,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
u32 sd_idx = fst_sd; u32 sd_idx = fst_sd;
nbytes = datalen; nbytes = datalen;
sa->sa_command_0.bf.scatter = 1; sa->sa_command_0.bf.scatter = 1;
@@ -857,7 +842,6 @@ u32 crypto4xx_build_pd(struct crypto_asy @@ -866,7 +851,6 @@ u32 crypto4xx_build_pd(struct crypto_asy
sd->ctl.done = 0; sd->ctl.done = 0;
sd->ctl.rdy = 1; sd->ctl.rdy = 1;
/* sd->ptr should be setup by sd_init routine*/ /* sd->ptr should be setup by sd_init routine*/
@ -471,7 +471,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
if (nbytes >= PPC4XX_SD_BUFFER_SIZE) if (nbytes >= PPC4XX_SD_BUFFER_SIZE)
nbytes -= PPC4XX_SD_BUFFER_SIZE; nbytes -= PPC4XX_SD_BUFFER_SIZE;
else else
@@ -868,19 +852,23 @@ u32 crypto4xx_build_pd(struct crypto_asy @@ -877,19 +861,23 @@ u32 crypto4xx_build_pd(struct crypto_asy
/* setup scatter descriptor */ /* setup scatter descriptor */
sd->ctl.done = 0; sd->ctl.done = 0;
sd->ctl.rdy = 1; sd->ctl.rdy = 1;

@ -42,7 +42,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
if (n >= PPC4XX_NUM_GD) if (n >= PPC4XX_NUM_GD)
return ERING_WAS_FULL; return ERING_WAS_FULL;
@@ -616,17 +617,6 @@ static void crypto4xx_stop_all(struct cr @@ -625,17 +626,6 @@ static void crypto4xx_stop_all(struct cr
kfree(core_dev); kfree(core_dev);
} }

@ -44,7 +44,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
} }
/** /**
@@ -854,16 +857,16 @@ int crypto4xx_build_pd(struct crypto_asy @@ -863,16 +866,16 @@ int crypto4xx_build_pd(struct crypto_asy
} }
} }
@ -66,7 +66,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
writel(1, dev->ce_base + CRYPTO4XX_INT_DESCR_RD); writel(1, dev->ce_base + CRYPTO4XX_INT_DESCR_RD);
return is_busy ? -EBUSY : -EINPROGRESS; return is_busy ? -EBUSY : -EINPROGRESS;
} }
@@ -964,23 +967,23 @@ static void crypto4xx_bh_tasklet_cb(unsi @@ -973,23 +976,23 @@ static void crypto4xx_bh_tasklet_cb(unsi
struct crypto4xx_core_device *core_dev = dev_get_drvdata(dev); struct crypto4xx_core_device *core_dev = dev_get_drvdata(dev);
struct pd_uinfo *pd_uinfo; struct pd_uinfo *pd_uinfo;
struct ce_pd *pd; struct ce_pd *pd;

@ -42,7 +42,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
/* Setup SA */ /* Setup SA */
sa = ctx->sa_in; sa = ctx->sa_in;
@@ -203,8 +196,8 @@ int crypto4xx_setkey_rfc3686(struct cryp @@ -204,8 +197,8 @@ int crypto4xx_setkey_rfc3686(struct cryp
if (rc) if (rc)
return rc; return rc;
@ -53,7 +53,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
return 0; return 0;
} }
@@ -213,7 +206,7 @@ int crypto4xx_rfc3686_encrypt(struct abl @@ -214,7 +207,7 @@ int crypto4xx_rfc3686_encrypt(struct abl
{ {
struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm); struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm);
__le32 iv[AES_IV_SIZE / 4] = { __le32 iv[AES_IV_SIZE / 4] = {
@ -62,7 +62,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
cpu_to_le32p((u32 *) req->info), cpu_to_le32p((u32 *) req->info),
cpu_to_le32p((u32 *) (req->info + 4)), cpu_to_le32p((u32 *) (req->info + 4)),
cpu_to_le32(1) }; cpu_to_le32(1) };
@@ -227,7 +220,7 @@ int crypto4xx_rfc3686_decrypt(struct abl @@ -228,7 +221,7 @@ int crypto4xx_rfc3686_decrypt(struct abl
{ {
struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm); struct crypto4xx_ctx *ctx = crypto_tfm_ctx(req->base.tfm);
__le32 iv[AES_IV_SIZE / 4] = { __le32 iv[AES_IV_SIZE / 4] = {
@ -71,7 +71,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
cpu_to_le32p((u32 *) req->info), cpu_to_le32p((u32 *) req->info),
cpu_to_le32p((u32 *) (req->info + 4)), cpu_to_le32p((u32 *) (req->info + 4)),
cpu_to_le32(1) }; cpu_to_le32(1) };
@@ -254,21 +247,13 @@ static int crypto4xx_hash_alg_init(struc @@ -255,21 +248,13 @@ static int crypto4xx_hash_alg_init(struc
ctx->dev = my_alg->dev; ctx->dev = my_alg->dev;
/* Create SA */ /* Create SA */
@ -167,7 +167,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
/** /**
* alloc memory for the gather ring * alloc memory for the gather ring
* no need to alloc buf for the ring * no need to alloc buf for the ring
@@ -883,8 +852,6 @@ static int crypto4xx_alg_init(struct cry @@ -892,8 +861,6 @@ static int crypto4xx_alg_init(struct cry
ctx->dev = amcc_alg->dev; ctx->dev = amcc_alg->dev;
ctx->sa_in = NULL; ctx->sa_in = NULL;
ctx->sa_out = NULL; ctx->sa_out = NULL;
@ -176,7 +176,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
ctx->sa_len = 0; ctx->sa_len = 0;
switch (alg->cra_flags & CRYPTO_ALG_TYPE_MASK) { switch (alg->cra_flags & CRYPTO_ALG_TYPE_MASK) {
@@ -905,7 +872,6 @@ static void crypto4xx_alg_exit(struct cr @@ -914,7 +881,6 @@ static void crypto4xx_alg_exit(struct cr
struct crypto4xx_ctx *ctx = crypto_tfm_ctx(tfm); struct crypto4xx_ctx *ctx = crypto_tfm_ctx(tfm);
crypto4xx_free_sa(ctx); crypto4xx_free_sa(ctx);

@ -44,7 +44,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
} }
/** /**
@@ -213,7 +214,7 @@ int crypto4xx_rfc3686_encrypt(struct abl @@ -214,7 +215,7 @@ int crypto4xx_rfc3686_encrypt(struct abl
return crypto4xx_build_pd(&req->base, ctx, req->src, req->dst, return crypto4xx_build_pd(&req->base, ctx, req->src, req->dst,
req->nbytes, iv, AES_IV_SIZE, req->nbytes, iv, AES_IV_SIZE,
@ -53,7 +53,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
} }
int crypto4xx_rfc3686_decrypt(struct ablkcipher_request *req) int crypto4xx_rfc3686_decrypt(struct ablkcipher_request *req)
@@ -227,7 +228,7 @@ int crypto4xx_rfc3686_decrypt(struct abl @@ -228,7 +229,7 @@ int crypto4xx_rfc3686_decrypt(struct abl
return crypto4xx_build_pd(&req->base, ctx, req->src, req->dst, return crypto4xx_build_pd(&req->base, ctx, req->src, req->dst,
req->nbytes, iv, AES_IV_SIZE, req->nbytes, iv, AES_IV_SIZE,
@ -62,7 +62,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
} }
/** /**
@@ -239,11 +240,13 @@ static int crypto4xx_hash_alg_init(struc @@ -240,11 +241,13 @@ static int crypto4xx_hash_alg_init(struc
unsigned char hm) unsigned char hm)
{ {
struct crypto_alg *alg = tfm->__crt_alg; struct crypto_alg *alg = tfm->__crt_alg;
@ -77,7 +77,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
ctx->dev = my_alg->dev; ctx->dev = my_alg->dev;
/* Create SA */ /* Create SA */
@@ -300,7 +303,7 @@ int crypto4xx_hash_update(struct ahash_r @@ -301,7 +304,7 @@ int crypto4xx_hash_update(struct ahash_r
return crypto4xx_build_pd(&req->base, ctx, req->src, &dst, return crypto4xx_build_pd(&req->base, ctx, req->src, &dst,
req->nbytes, NULL, 0, ctx->sa_in, req->nbytes, NULL, 0, ctx->sa_in,
@ -86,7 +86,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
} }
int crypto4xx_hash_final(struct ahash_request *req) int crypto4xx_hash_final(struct ahash_request *req)
@@ -319,7 +322,7 @@ int crypto4xx_hash_digest(struct ahash_r @@ -320,7 +323,7 @@ int crypto4xx_hash_digest(struct ahash_r
return crypto4xx_build_pd(&req->base, ctx, req->src, &dst, return crypto4xx_build_pd(&req->base, ctx, req->src, &dst,
req->nbytes, NULL, 0, ctx->sa_in, req->nbytes, NULL, 0, ctx->sa_in,
@ -95,7 +95,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
} }
/** /**
@@ -330,5 +333,3 @@ int crypto4xx_sha1_alg_init(struct crypt @@ -331,5 +334,3 @@ int crypto4xx_sha1_alg_init(struct crypt
return crypto4xx_hash_alg_init(tfm, SA_HASH160_LEN, SA_HASH_ALG_SHA1, return crypto4xx_hash_alg_init(tfm, SA_HASH160_LEN, SA_HASH_ALG_SHA1,
SA_HASH_MODE_HASH); SA_HASH_MODE_HASH);
} }
@ -125,7 +125,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
struct pd_uinfo *pd_uinfo, struct pd_uinfo *pd_uinfo,
struct ce_pd *pd) struct ce_pd *pd)
{ {
@@ -543,11 +545,9 @@ static u32 crypto4xx_ablkcipher_done(str @@ -552,11 +554,9 @@ static u32 crypto4xx_ablkcipher_done(str
if (pd_uinfo->state & PD_ENTRY_BUSY) if (pd_uinfo->state & PD_ENTRY_BUSY)
ablkcipher_request_complete(ablk_req, -EINPROGRESS); ablkcipher_request_complete(ablk_req, -EINPROGRESS);
ablkcipher_request_complete(ablk_req, 0); ablkcipher_request_complete(ablk_req, 0);
@ -138,7 +138,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
struct pd_uinfo *pd_uinfo) struct pd_uinfo *pd_uinfo)
{ {
struct crypto4xx_ctx *ctx; struct crypto4xx_ctx *ctx;
@@ -563,20 +563,88 @@ static u32 crypto4xx_ahash_done(struct c @@ -572,20 +572,88 @@ static u32 crypto4xx_ahash_done(struct c
if (pd_uinfo->state & PD_ENTRY_BUSY) if (pd_uinfo->state & PD_ENTRY_BUSY)
ahash_request_complete(ahash_req, -EINPROGRESS); ahash_request_complete(ahash_req, -EINPROGRESS);
ahash_request_complete(ahash_req, 0); ahash_request_complete(ahash_req, 0);
@ -234,7 +234,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
} }
static void crypto4xx_stop_all(struct crypto4xx_core_device *core_dev) static void crypto4xx_stop_all(struct crypto4xx_core_device *core_dev)
@@ -612,8 +680,10 @@ int crypto4xx_build_pd(struct crypto_asy @@ -621,8 +689,10 @@ int crypto4xx_build_pd(struct crypto_asy
const unsigned int datalen, const unsigned int datalen,
const __le32 *iv, const u32 iv_len, const __le32 *iv, const u32 iv_len,
const struct dynamic_sa_ctl *req_sa, const struct dynamic_sa_ctl *req_sa,
@ -246,7 +246,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
struct crypto4xx_device *dev = ctx->dev; struct crypto4xx_device *dev = ctx->dev;
struct dynamic_sa_ctl *sa; struct dynamic_sa_ctl *sa;
struct ce_gd *gd; struct ce_gd *gd;
@@ -627,18 +697,25 @@ int crypto4xx_build_pd(struct crypto_asy @@ -636,18 +706,25 @@ int crypto4xx_build_pd(struct crypto_asy
unsigned int nbytes = datalen; unsigned int nbytes = datalen;
size_t offset_to_sr_ptr; size_t offset_to_sr_ptr;
u32 gd_idx = 0; u32 gd_idx = 0;
@ -279,7 +279,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
if (sg_is_last(dst)) { if (sg_is_last(dst)) {
num_sd = 0; num_sd = 0;
} else { } else {
@@ -724,6 +801,7 @@ int crypto4xx_build_pd(struct crypto_asy @@ -733,6 +810,7 @@ int crypto4xx_build_pd(struct crypto_asy
sa = pd_uinfo->sa_va; sa = pd_uinfo->sa_va;
memcpy(sa, req_sa, sa_len * 4); memcpy(sa, req_sa, sa_len * 4);
@ -287,7 +287,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
offset_to_sr_ptr = get_dynamic_sa_offset_state_ptr_field(sa); offset_to_sr_ptr = get_dynamic_sa_offset_state_ptr_field(sa);
*(u32 *)((unsigned long)sa + offset_to_sr_ptr) = pd_uinfo->sr_pa; *(u32 *)((unsigned long)sa + offset_to_sr_ptr) = pd_uinfo->sr_pa;
@@ -830,7 +908,7 @@ int crypto4xx_build_pd(struct crypto_asy @@ -839,7 +917,7 @@ int crypto4xx_build_pd(struct crypto_asy
((crypto_tfm_alg_type(req->tfm) == CRYPTO_ALG_TYPE_AHASH) | ((crypto_tfm_alg_type(req->tfm) == CRYPTO_ALG_TYPE_AHASH) |
(crypto_tfm_alg_type(req->tfm) == CRYPTO_ALG_TYPE_AEAD) ? (crypto_tfm_alg_type(req->tfm) == CRYPTO_ALG_TYPE_AEAD) ?
PD_CTL_HASH_FINAL : 0); PD_CTL_HASH_FINAL : 0);
@ -296,7 +296,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
pd_uinfo->state = PD_ENTRY_INUSE | (is_busy ? PD_ENTRY_BUSY : 0); pd_uinfo->state = PD_ENTRY_INUSE | (is_busy ? PD_ENTRY_BUSY : 0);
wmb(); wmb();
@@ -843,40 +921,68 @@ int crypto4xx_build_pd(struct crypto_asy @@ -852,40 +930,68 @@ int crypto4xx_build_pd(struct crypto_asy
/** /**
* Algorithm Registration Functions * Algorithm Registration Functions
*/ */
@ -385,7 +385,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
{ {
struct crypto4xx_alg *alg; struct crypto4xx_alg *alg;
int i; int i;
@@ -891,6 +997,10 @@ int crypto4xx_register_alg(struct crypto @@ -900,6 +1006,10 @@ int crypto4xx_register_alg(struct crypto
alg->dev = sec_dev; alg->dev = sec_dev;
switch (alg->alg.type) { switch (alg->alg.type) {
@ -396,7 +396,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
case CRYPTO_ALG_TYPE_AHASH: case CRYPTO_ALG_TYPE_AHASH:
rc = crypto_register_ahash(&alg->alg.u.hash); rc = crypto_register_ahash(&alg->alg.u.hash);
break; break;
@@ -920,6 +1030,10 @@ static void crypto4xx_unregister_alg(str @@ -929,6 +1039,10 @@ static void crypto4xx_unregister_alg(str
crypto_unregister_ahash(&alg->alg.u.hash); crypto_unregister_ahash(&alg->alg.u.hash);
break; break;
@ -407,7 +407,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
default: default:
crypto_unregister_alg(&alg->alg.u.cipher); crypto_unregister_alg(&alg->alg.u.cipher);
} }
@@ -973,7 +1087,7 @@ static irqreturn_t crypto4xx_ce_interrup @@ -982,7 +1096,7 @@ static irqreturn_t crypto4xx_ce_interrup
/** /**
* Supported Crypto Algorithms * Supported Crypto Algorithms
*/ */
@ -416,7 +416,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
/* Crypto AES modes */ /* Crypto AES modes */
{ .type = CRYPTO_ALG_TYPE_ABLKCIPHER, .u.cipher = { { .type = CRYPTO_ALG_TYPE_ABLKCIPHER, .u.cipher = {
.cra_name = "cbc(aes)", .cra_name = "cbc(aes)",
@@ -985,8 +1099,8 @@ struct crypto4xx_alg_common crypto4xx_al @@ -994,8 +1108,8 @@ struct crypto4xx_alg_common crypto4xx_al
.cra_blocksize = AES_BLOCK_SIZE, .cra_blocksize = AES_BLOCK_SIZE,
.cra_ctxsize = sizeof(struct crypto4xx_ctx), .cra_ctxsize = sizeof(struct crypto4xx_ctx),
.cra_type = &crypto_ablkcipher_type, .cra_type = &crypto_ablkcipher_type,
@ -427,7 +427,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
.cra_module = THIS_MODULE, .cra_module = THIS_MODULE,
.cra_u = { .cra_u = {
.ablkcipher = { .ablkcipher = {
@@ -1009,8 +1123,8 @@ struct crypto4xx_alg_common crypto4xx_al @@ -1018,8 +1132,8 @@ struct crypto4xx_alg_common crypto4xx_al
.cra_blocksize = AES_BLOCK_SIZE, .cra_blocksize = AES_BLOCK_SIZE,
.cra_ctxsize = sizeof(struct crypto4xx_ctx), .cra_ctxsize = sizeof(struct crypto4xx_ctx),
.cra_type = &crypto_ablkcipher_type, .cra_type = &crypto_ablkcipher_type,
@ -438,7 +438,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
.cra_module = THIS_MODULE, .cra_module = THIS_MODULE,
.cra_u = { .cra_u = {
.ablkcipher = { .ablkcipher = {
@@ -1033,8 +1147,8 @@ struct crypto4xx_alg_common crypto4xx_al @@ -1042,8 +1156,8 @@ struct crypto4xx_alg_common crypto4xx_al
.cra_blocksize = AES_BLOCK_SIZE, .cra_blocksize = AES_BLOCK_SIZE,
.cra_ctxsize = sizeof(struct crypto4xx_ctx), .cra_ctxsize = sizeof(struct crypto4xx_ctx),
.cra_type = &crypto_ablkcipher_type, .cra_type = &crypto_ablkcipher_type,
@ -449,7 +449,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
.cra_module = THIS_MODULE, .cra_module = THIS_MODULE,
.cra_u = { .cra_u = {
.ablkcipher = { .ablkcipher = {
@@ -1059,8 +1173,8 @@ struct crypto4xx_alg_common crypto4xx_al @@ -1068,8 +1182,8 @@ struct crypto4xx_alg_common crypto4xx_al
.cra_blocksize = AES_BLOCK_SIZE, .cra_blocksize = AES_BLOCK_SIZE,
.cra_ctxsize = sizeof(struct crypto4xx_ctx), .cra_ctxsize = sizeof(struct crypto4xx_ctx),
.cra_type = &crypto_ablkcipher_type, .cra_type = &crypto_ablkcipher_type,
@ -460,7 +460,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
.cra_module = THIS_MODULE, .cra_module = THIS_MODULE,
.cra_u = { .cra_u = {
.ablkcipher = { .ablkcipher = {
@@ -1082,8 +1196,8 @@ struct crypto4xx_alg_common crypto4xx_al @@ -1091,8 +1205,8 @@ struct crypto4xx_alg_common crypto4xx_al
.cra_blocksize = AES_BLOCK_SIZE, .cra_blocksize = AES_BLOCK_SIZE,
.cra_ctxsize = sizeof(struct crypto4xx_ctx), .cra_ctxsize = sizeof(struct crypto4xx_ctx),
.cra_type = &crypto_ablkcipher_type, .cra_type = &crypto_ablkcipher_type,
@ -471,7 +471,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
.cra_module = THIS_MODULE, .cra_module = THIS_MODULE,
.cra_u = { .cra_u = {
.ablkcipher = { .ablkcipher = {
@@ -1149,6 +1263,7 @@ static int crypto4xx_probe(struct platfo @@ -1158,6 +1272,7 @@ static int crypto4xx_probe(struct platfo
core_dev->device = dev; core_dev->device = dev;
spin_lock_init(&core_dev->lock); spin_lock_init(&core_dev->lock);
INIT_LIST_HEAD(&core_dev->dev->alg_list); INIT_LIST_HEAD(&core_dev->dev->alg_list);

@ -15,7 +15,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
--- a/drivers/crypto/amcc/crypto4xx_alg.c --- a/drivers/crypto/amcc/crypto4xx_alg.c
+++ b/drivers/crypto/amcc/crypto4xx_alg.c +++ b/drivers/crypto/amcc/crypto4xx_alg.c
@@ -231,6 +231,191 @@ int crypto4xx_rfc3686_decrypt(struct abl @@ -232,6 +232,191 @@ int crypto4xx_rfc3686_decrypt(struct abl
ctx->sa_out, ctx->sa_len, 0); ctx->sa_out, ctx->sa_len, 0);
} }
@ -209,7 +209,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
*/ */
--- a/drivers/crypto/amcc/crypto4xx_core.c --- a/drivers/crypto/amcc/crypto4xx_core.c
+++ b/drivers/crypto/amcc/crypto4xx_core.c +++ b/drivers/crypto/amcc/crypto4xx_core.c
@@ -1210,6 +1210,29 @@ static struct crypto4xx_alg_common crypt @@ -1219,6 +1219,29 @@ static struct crypto4xx_alg_common crypt
} }
} }
} }, } },

@ -23,7 +23,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
#include <crypto/sha.h> #include <crypto/sha.h>
#include <crypto/ctr.h> #include <crypto/ctr.h>
#include "crypto4xx_reg_def.h" #include "crypto4xx_reg_def.h"
@@ -417,6 +418,144 @@ int crypto4xx_setauthsize_aead(struct cr @@ -418,6 +419,144 @@ int crypto4xx_setauthsize_aead(struct cr
} }
/** /**
@ -178,7 +178,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
#include <crypto/sha.h> #include <crypto/sha.h>
#include <crypto/scatterwalk.h> #include <crypto/scatterwalk.h>
#include <crypto/internal/aead.h> #include <crypto/internal/aead.h>
@@ -1227,6 +1228,27 @@ static struct crypto4xx_alg_common crypt @@ -1236,6 +1237,27 @@ static struct crypto4xx_alg_common crypt
.cra_priority = CRYPTO4XX_CRYPTO_PRIORITY, .cra_priority = CRYPTO4XX_CRYPTO_PRIORITY,
.cra_flags = CRYPTO_ALG_ASYNC | .cra_flags = CRYPTO_ALG_ASYNC |
CRYPTO_ALG_NEED_FALLBACK | CRYPTO_ALG_NEED_FALLBACK |

@ -17,7 +17,7 @@ Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
--- a/drivers/crypto/amcc/crypto4xx_core.c --- a/drivers/crypto/amcc/crypto4xx_core.c
+++ b/drivers/crypto/amcc/crypto4xx_core.c +++ b/drivers/crypto/amcc/crypto4xx_core.c
@@ -1075,9 +1075,6 @@ static irqreturn_t crypto4xx_ce_interrup @@ -1084,9 +1084,6 @@ static irqreturn_t crypto4xx_ce_interrup
struct device *dev = (struct device *)data; struct device *dev = (struct device *)data;
struct crypto4xx_core_device *core_dev = dev_get_drvdata(dev); struct crypto4xx_core_device *core_dev = dev_get_drvdata(dev);
@ -27,7 +27,7 @@ Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
writel(PPC4XX_INTERRUPT_CLR, writel(PPC4XX_INTERRUPT_CLR,
core_dev->dev->ce_base + CRYPTO4XX_INT_CLR); core_dev->dev->ce_base + CRYPTO4XX_INT_CLR);
tasklet_schedule(&core_dev->tasklet); tasklet_schedule(&core_dev->tasklet);
@@ -1325,13 +1322,6 @@ static int crypto4xx_probe(struct platfo @@ -1334,13 +1331,6 @@ static int crypto4xx_probe(struct platfo
tasklet_init(&core_dev->tasklet, crypto4xx_bh_tasklet_cb, tasklet_init(&core_dev->tasklet, crypto4xx_bh_tasklet_cb,
(unsigned long) dev); (unsigned long) dev);
@ -41,7 +41,7 @@ Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
core_dev->dev->ce_base = of_iomap(ofdev->dev.of_node, 0); core_dev->dev->ce_base = of_iomap(ofdev->dev.of_node, 0);
if (!core_dev->dev->ce_base) { if (!core_dev->dev->ce_base) {
dev_err(dev, "failed to of_iomap\n"); dev_err(dev, "failed to of_iomap\n");
@@ -1339,6 +1329,13 @@ static int crypto4xx_probe(struct platfo @@ -1348,6 +1338,13 @@ static int crypto4xx_probe(struct platfo
goto err_iomap; goto err_iomap;
} }
@ -55,7 +55,7 @@ Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
/* need to setup pdr, rdr, gdr and sdr before this */ /* need to setup pdr, rdr, gdr and sdr before this */
crypto4xx_hw_init(core_dev->dev); crypto4xx_hw_init(core_dev->dev);
@@ -1352,11 +1349,11 @@ static int crypto4xx_probe(struct platfo @@ -1361,11 +1358,11 @@ static int crypto4xx_probe(struct platfo
return 0; return 0;
err_start_dev: err_start_dev:

@ -35,7 +35,7 @@ Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
} }
int crypto4xx_alloc_sa(struct crypto4xx_ctx *ctx, u32 size) int crypto4xx_alloc_sa(struct crypto4xx_ctx *ctx, u32 size)
@@ -1070,18 +1077,29 @@ static void crypto4xx_bh_tasklet_cb(unsi @@ -1079,18 +1086,29 @@ static void crypto4xx_bh_tasklet_cb(unsi
/** /**
* Top Half of isr. * Top Half of isr.
*/ */
@ -68,7 +68,7 @@ Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
/** /**
* Supported Crypto Algorithms * Supported Crypto Algorithms
*/ */
@@ -1263,6 +1281,8 @@ static int crypto4xx_probe(struct platfo @@ -1272,6 +1290,8 @@ static int crypto4xx_probe(struct platfo
struct resource res; struct resource res;
struct device *dev = &ofdev->dev; struct device *dev = &ofdev->dev;
struct crypto4xx_core_device *core_dev; struct crypto4xx_core_device *core_dev;
@ -77,7 +77,7 @@ Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
rc = of_address_to_resource(ofdev->dev.of_node, 0, &res); rc = of_address_to_resource(ofdev->dev.of_node, 0, &res);
if (rc) if (rc)
@@ -1279,6 +1299,7 @@ static int crypto4xx_probe(struct platfo @@ -1288,6 +1308,7 @@ static int crypto4xx_probe(struct platfo
mfdcri(SDR0, PPC405EX_SDR0_SRST) | PPC405EX_CE_RESET); mfdcri(SDR0, PPC405EX_SDR0_SRST) | PPC405EX_CE_RESET);
mtdcri(SDR0, PPC405EX_SDR0_SRST, mtdcri(SDR0, PPC405EX_SDR0_SRST,
mfdcri(SDR0, PPC405EX_SDR0_SRST) & ~PPC405EX_CE_RESET); mfdcri(SDR0, PPC405EX_SDR0_SRST) & ~PPC405EX_CE_RESET);
@ -85,7 +85,7 @@ Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
} else if (of_find_compatible_node(NULL, NULL, } else if (of_find_compatible_node(NULL, NULL,
"amcc,ppc460sx-crypto")) { "amcc,ppc460sx-crypto")) {
mtdcri(SDR0, PPC460SX_SDR0_SRST, mtdcri(SDR0, PPC460SX_SDR0_SRST,
@@ -1301,7 +1322,22 @@ static int crypto4xx_probe(struct platfo @@ -1310,7 +1331,22 @@ static int crypto4xx_probe(struct platfo
if (!core_dev->dev) if (!core_dev->dev)
goto err_alloc_dev; goto err_alloc_dev;
@ -108,7 +108,7 @@ Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
core_dev->device = dev; core_dev->device = dev;
spin_lock_init(&core_dev->lock); spin_lock_init(&core_dev->lock);
INIT_LIST_HEAD(&core_dev->dev->alg_list); INIT_LIST_HEAD(&core_dev->dev->alg_list);
@@ -1331,7 +1367,9 @@ static int crypto4xx_probe(struct platfo @@ -1340,7 +1376,9 @@ static int crypto4xx_probe(struct platfo
/* Register for Crypto isr, Crypto Engine IRQ */ /* Register for Crypto isr, Crypto Engine IRQ */
core_dev->irq = irq_of_parse_and_map(ofdev->dev.of_node, 0); core_dev->irq = irq_of_parse_and_map(ofdev->dev.of_node, 0);

@ -16,7 +16,7 @@ Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
--- a/drivers/crypto/amcc/crypto4xx_core.c --- a/drivers/crypto/amcc/crypto4xx_core.c
+++ b/drivers/crypto/amcc/crypto4xx_core.c +++ b/drivers/crypto/amcc/crypto4xx_core.c
@@ -1370,7 +1370,7 @@ static int crypto4xx_probe(struct platfo @@ -1379,7 +1379,7 @@ static int crypto4xx_probe(struct platfo
rc = request_irq(core_dev->irq, is_revb ? rc = request_irq(core_dev->irq, is_revb ?
crypto4xx_ce_interrupt_handler_revb : crypto4xx_ce_interrupt_handler_revb :
crypto4xx_ce_interrupt_handler, 0, crypto4xx_ce_interrupt_handler, 0,

@ -14,7 +14,7 @@ Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
--- a/drivers/crypto/amcc/crypto4xx_core.c --- a/drivers/crypto/amcc/crypto4xx_core.c
+++ b/drivers/crypto/amcc/crypto4xx_core.c +++ b/drivers/crypto/amcc/crypto4xx_core.c
@@ -1432,7 +1432,7 @@ MODULE_DEVICE_TABLE(of, crypto4xx_match) @@ -1441,7 +1441,7 @@ MODULE_DEVICE_TABLE(of, crypto4xx_match)
static struct platform_driver crypto4xx_driver = { static struct platform_driver crypto4xx_driver = {
.driver = { .driver = {

@ -40,7 +40,7 @@ Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
--- a/drivers/crypto/amcc/crypto4xx_alg.c --- a/drivers/crypto/amcc/crypto4xx_alg.c
+++ b/drivers/crypto/amcc/crypto4xx_alg.c +++ b/drivers/crypto/amcc/crypto4xx_alg.c
@@ -256,10 +256,6 @@ static inline bool crypto4xx_aead_need_f @@ -257,10 +257,6 @@ static inline bool crypto4xx_aead_need_f
if (is_ccm && !(req->iv[0] == 1 || req->iv[0] == 3)) if (is_ccm && !(req->iv[0] == 1 || req->iv[0] == 3))
return true; return true;
@ -51,7 +51,7 @@ Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
return false; return false;
} }
@@ -330,7 +326,7 @@ int crypto4xx_setkey_aes_ccm(struct cryp @@ -331,7 +327,7 @@ int crypto4xx_setkey_aes_ccm(struct cryp
sa = (struct dynamic_sa_ctl *) ctx->sa_in; sa = (struct dynamic_sa_ctl *) ctx->sa_in;
sa->sa_contents.w = SA_AES_CCM_CONTENTS | (keylen << 2); sa->sa_contents.w = SA_AES_CCM_CONTENTS | (keylen << 2);
@ -62,7 +62,7 @@ Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
SA_CIPHER_ALG_AES, SA_CIPHER_ALG_AES,
--- a/drivers/crypto/amcc/crypto4xx_core.c --- a/drivers/crypto/amcc/crypto4xx_core.c
+++ b/drivers/crypto/amcc/crypto4xx_core.c +++ b/drivers/crypto/amcc/crypto4xx_core.c
@@ -577,15 +577,14 @@ static void crypto4xx_aead_done(struct c @@ -586,15 +586,14 @@ static void crypto4xx_aead_done(struct c
struct pd_uinfo *pd_uinfo, struct pd_uinfo *pd_uinfo,
struct ce_pd *pd) struct ce_pd *pd)
{ {
@ -83,7 +83,7 @@ Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
if (pd_uinfo->using_sd) { if (pd_uinfo->using_sd) {
crypto4xx_copy_pkt_to_dst(dev, pd, pd_uinfo, crypto4xx_copy_pkt_to_dst(dev, pd, pd_uinfo,
pd->pd_ctl_len.bf.pkt_len, pd->pd_ctl_len.bf.pkt_len,
@@ -597,38 +596,39 @@ static void crypto4xx_aead_done(struct c @@ -606,38 +605,39 @@ static void crypto4xx_aead_done(struct c
if (pd_uinfo->sa_va->sa_command_0.bf.dir == DIR_OUTBOUND) { if (pd_uinfo->sa_va->sa_command_0.bf.dir == DIR_OUTBOUND) {
/* append icv at the end */ /* append icv at the end */

@ -71,7 +71,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
/** /**
--- a/drivers/crypto/amcc/crypto4xx_core.c --- a/drivers/crypto/amcc/crypto4xx_core.c
+++ b/drivers/crypto/amcc/crypto4xx_core.c +++ b/drivers/crypto/amcc/crypto4xx_core.c
@@ -580,7 +580,7 @@ static void crypto4xx_aead_done(struct c @@ -589,7 +589,7 @@ static void crypto4xx_aead_done(struct c
struct scatterlist *dst = pd_uinfo->dest_va; struct scatterlist *dst = pd_uinfo->dest_va;
size_t cp_len = crypto_aead_authsize( size_t cp_len = crypto_aead_authsize(
crypto_aead_reqtfm(aead_req)); crypto_aead_reqtfm(aead_req));
@ -80,7 +80,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
int err = 0; int err = 0;
if (pd_uinfo->using_sd) { if (pd_uinfo->using_sd) {
@@ -595,7 +595,7 @@ static void crypto4xx_aead_done(struct c @@ -604,7 +604,7 @@ static void crypto4xx_aead_done(struct c
if (pd_uinfo->sa_va->sa_command_0.bf.dir == DIR_OUTBOUND) { if (pd_uinfo->sa_va->sa_command_0.bf.dir == DIR_OUTBOUND) {
/* append icv at the end */ /* append icv at the end */
crypto4xx_memcpy_from_le32(icv, pd_uinfo->sr_va->save_digest, crypto4xx_memcpy_from_le32(icv, pd_uinfo->sr_va->save_digest,
@ -89,7 +89,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
scatterwalk_map_and_copy(icv, dst, aead_req->cryptlen, scatterwalk_map_and_copy(icv, dst, aead_req->cryptlen,
cp_len, 1); cp_len, 1);
@@ -605,7 +605,7 @@ static void crypto4xx_aead_done(struct c @@ -614,7 +614,7 @@ static void crypto4xx_aead_done(struct c
aead_req->assoclen + aead_req->cryptlen - aead_req->assoclen + aead_req->cryptlen -
cp_len, cp_len, 0); cp_len, cp_len, 0);
@ -98,7 +98,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
if (crypto_memneq(icv, pd_uinfo->sr_va->save_digest, cp_len)) if (crypto_memneq(icv, pd_uinfo->sr_va->save_digest, cp_len))
err = -EBADMSG; err = -EBADMSG;
@@ -1122,8 +1122,8 @@ static struct crypto4xx_alg_common crypt @@ -1131,8 +1131,8 @@ static struct crypto4xx_alg_common crypt
.max_keysize = AES_MAX_KEY_SIZE, .max_keysize = AES_MAX_KEY_SIZE,
.ivsize = AES_IV_SIZE, .ivsize = AES_IV_SIZE,
.setkey = crypto4xx_setkey_aes_cbc, .setkey = crypto4xx_setkey_aes_cbc,
@ -109,7 +109,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
} }
} }
}}, }},
@@ -1146,8 +1146,8 @@ static struct crypto4xx_alg_common crypt @@ -1155,8 +1155,8 @@ static struct crypto4xx_alg_common crypt
.max_keysize = AES_MAX_KEY_SIZE, .max_keysize = AES_MAX_KEY_SIZE,
.ivsize = AES_IV_SIZE, .ivsize = AES_IV_SIZE,
.setkey = crypto4xx_setkey_aes_cfb, .setkey = crypto4xx_setkey_aes_cfb,
@ -120,7 +120,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
} }
} }
} }, } },
@@ -1195,8 +1195,8 @@ static struct crypto4xx_alg_common crypt @@ -1204,8 +1204,8 @@ static struct crypto4xx_alg_common crypt
.min_keysize = AES_MIN_KEY_SIZE, .min_keysize = AES_MIN_KEY_SIZE,
.max_keysize = AES_MAX_KEY_SIZE, .max_keysize = AES_MAX_KEY_SIZE,
.setkey = crypto4xx_setkey_aes_ecb, .setkey = crypto4xx_setkey_aes_ecb,
@ -131,7 +131,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
} }
} }
} }, } },
@@ -1219,8 +1219,8 @@ static struct crypto4xx_alg_common crypt @@ -1228,8 +1228,8 @@ static struct crypto4xx_alg_common crypt
.max_keysize = AES_MAX_KEY_SIZE, .max_keysize = AES_MAX_KEY_SIZE,
.ivsize = AES_IV_SIZE, .ivsize = AES_IV_SIZE,
.setkey = crypto4xx_setkey_aes_ofb, .setkey = crypto4xx_setkey_aes_ofb,

@ -96,7 +96,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
CRYPTO_TFM_RES_BAD_KEY_LEN); CRYPTO_TFM_RES_BAD_KEY_LEN);
return -EINVAL; return -EINVAL;
} }
@@ -164,39 +165,38 @@ static int crypto4xx_setkey_aes(struct c @@ -165,39 +166,38 @@ static int crypto4xx_setkey_aes(struct c
return 0; return 0;
} }
@ -142,7 +142,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
int rc; int rc;
rc = crypto4xx_setkey_aes(cipher, key, keylen - CTR_RFC3686_NONCE_SIZE, rc = crypto4xx_setkey_aes(cipher, key, keylen - CTR_RFC3686_NONCE_SIZE,
@@ -210,31 +210,33 @@ int crypto4xx_setkey_rfc3686(struct cryp @@ -211,31 +211,33 @@ int crypto4xx_setkey_rfc3686(struct cryp
return 0; return 0;
} }
@ -223,7 +223,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
} else { } else {
dst = pd_uinfo->dest_va; dst = pd_uinfo->dest_va;
addr = dma_map_page(dev->core_dev->device, sg_page(dst), addr = dma_map_page(dev->core_dev->device, sg_page(dst),
@@ -549,8 +548,8 @@ static void crypto4xx_ablkcipher_done(st @@ -558,8 +557,8 @@ static void crypto4xx_ablkcipher_done(st
crypto4xx_ret_sg_desc(dev, pd_uinfo); crypto4xx_ret_sg_desc(dev, pd_uinfo);
if (pd_uinfo->state & PD_ENTRY_BUSY) if (pd_uinfo->state & PD_ENTRY_BUSY)
@ -234,7 +234,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
} }
static void crypto4xx_ahash_done(struct crypto4xx_device *dev, static void crypto4xx_ahash_done(struct crypto4xx_device *dev,
@@ -641,8 +640,8 @@ static void crypto4xx_pd_done(struct cry @@ -650,8 +649,8 @@ static void crypto4xx_pd_done(struct cry
struct pd_uinfo *pd_uinfo = &dev->pdr_uinfo[idx]; struct pd_uinfo *pd_uinfo = &dev->pdr_uinfo[idx];
switch (crypto_tfm_alg_type(pd_uinfo->async_req->tfm)) { switch (crypto_tfm_alg_type(pd_uinfo->async_req->tfm)) {
@ -245,7 +245,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
break; break;
case CRYPTO_ALG_TYPE_AEAD: case CRYPTO_ALG_TYPE_AEAD:
crypto4xx_aead_done(dev, pd_uinfo, pd); crypto4xx_aead_done(dev, pd_uinfo, pd);
@@ -936,15 +935,14 @@ static void crypto4xx_ctx_init(struct cr @@ -945,15 +944,14 @@ static void crypto4xx_ctx_init(struct cr
ctx->sa_len = 0; ctx->sa_len = 0;
} }
@ -264,7 +264,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
return 0; return 0;
} }
@@ -953,9 +951,11 @@ static void crypto4xx_common_exit(struct @@ -962,9 +960,11 @@ static void crypto4xx_common_exit(struct
crypto4xx_free_sa(ctx); crypto4xx_free_sa(ctx);
} }
@ -278,7 +278,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
} }
static int crypto4xx_aead_init(struct crypto_aead *tfm) static int crypto4xx_aead_init(struct crypto_aead *tfm)
@@ -1012,7 +1012,7 @@ static int crypto4xx_register_alg(struct @@ -1021,7 +1021,7 @@ static int crypto4xx_register_alg(struct
break; break;
default: default:
@ -287,7 +287,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
break; break;
} }
@@ -1041,7 +1041,7 @@ static void crypto4xx_unregister_alg(str @@ -1050,7 +1050,7 @@ static void crypto4xx_unregister_alg(str
break; break;
default: default:
@ -296,7 +296,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
} }
kfree(alg); kfree(alg);
} }
@@ -1103,126 +1103,109 @@ static irqreturn_t crypto4xx_ce_interrup @@ -1112,126 +1112,109 @@ static irqreturn_t crypto4xx_ce_interrup
*/ */
static struct crypto4xx_alg_common crypto4xx_alg[] = { static struct crypto4xx_alg_common crypto4xx_alg[] = {
/* Crypto AES modes */ /* Crypto AES modes */

@ -26,7 +26,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
if (ivlen) if (ivlen)
crypto4xx_memcpy_to_le32(iv, req->iv, ivlen); crypto4xx_memcpy_to_le32(iv, req->iv, ivlen);
@@ -270,13 +270,7 @@ static inline bool crypto4xx_aead_need_f @@ -271,13 +271,7 @@ static inline bool crypto4xx_aead_need_f
static int crypto4xx_aead_fallback(struct aead_request *req, static int crypto4xx_aead_fallback(struct aead_request *req,
struct crypto4xx_ctx *ctx, bool do_decrypt) struct crypto4xx_ctx *ctx, bool do_decrypt)
{ {
@ -41,7 +41,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
aead_request_set_tfm(subreq, ctx->sw_cipher.aead); aead_request_set_tfm(subreq, ctx->sw_cipher.aead);
aead_request_set_callback(subreq, req->base.flags, aead_request_set_callback(subreq, req->base.flags,
@@ -377,7 +371,7 @@ static int crypto4xx_crypt_aes_ccm(struc @@ -378,7 +372,7 @@ static int crypto4xx_crypt_aes_ccm(struc
struct crypto_aead *aead = crypto_aead_reqtfm(req); struct crypto_aead *aead = crypto_aead_reqtfm(req);
unsigned int len = req->cryptlen; unsigned int len = req->cryptlen;
__le32 iv[16]; __le32 iv[16];
@ -50,7 +50,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
struct dynamic_sa_ctl *sa = (struct dynamic_sa_ctl *)tmp_sa; struct dynamic_sa_ctl *sa = (struct dynamic_sa_ctl *)tmp_sa;
if (crypto4xx_aead_need_fallback(req, true, decrypt)) if (crypto4xx_aead_need_fallback(req, true, decrypt))
@@ -386,7 +380,7 @@ static int crypto4xx_crypt_aes_ccm(struc @@ -387,7 +381,7 @@ static int crypto4xx_crypt_aes_ccm(struc
if (decrypt) if (decrypt)
len -= crypto_aead_authsize(aead); len -= crypto_aead_authsize(aead);

@ -39,7 +39,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
--- a/drivers/crypto/amcc/crypto4xx_alg.c --- a/drivers/crypto/amcc/crypto4xx_alg.c
+++ b/drivers/crypto/amcc/crypto4xx_alg.c +++ b/drivers/crypto/amcc/crypto4xx_alg.c
@@ -240,6 +240,85 @@ int crypto4xx_rfc3686_decrypt(struct skc @@ -241,6 +241,85 @@ int crypto4xx_rfc3686_decrypt(struct skc
ctx->sa_out, ctx->sa_len, 0); ctx->sa_out, ctx->sa_len, 0);
} }
@ -125,7 +125,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
static inline bool crypto4xx_aead_need_fallback(struct aead_request *req, static inline bool crypto4xx_aead_need_fallback(struct aead_request *req,
bool is_ccm, bool decrypt) bool is_ccm, bool decrypt)
{ {
@@ -282,10 +361,10 @@ static int crypto4xx_aead_fallback(struc @@ -283,10 +362,10 @@ static int crypto4xx_aead_fallback(struc
crypto_aead_encrypt(subreq); crypto_aead_encrypt(subreq);
} }
@ -140,7 +140,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
{ {
int rc; int rc;
@@ -313,7 +392,7 @@ int crypto4xx_setkey_aes_ccm(struct cryp @@ -314,7 +393,7 @@ int crypto4xx_setkey_aes_ccm(struct cryp
struct dynamic_sa_ctl *sa; struct dynamic_sa_ctl *sa;
int rc = 0; int rc = 0;
@ -149,7 +149,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
if (rc) if (rc)
return rc; return rc;
@@ -472,7 +551,7 @@ int crypto4xx_setkey_aes_gcm(struct cryp @@ -473,7 +552,7 @@ int crypto4xx_setkey_aes_gcm(struct cryp
return -EINVAL; return -EINVAL;
} }
@ -160,7 +160,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
--- a/drivers/crypto/amcc/crypto4xx_core.c --- a/drivers/crypto/amcc/crypto4xx_core.c
+++ b/drivers/crypto/amcc/crypto4xx_core.c +++ b/drivers/crypto/amcc/crypto4xx_core.c
@@ -941,6 +941,19 @@ static int crypto4xx_sk_init(struct cryp @@ -950,6 +950,19 @@ static int crypto4xx_sk_init(struct cryp
struct crypto4xx_alg *amcc_alg; struct crypto4xx_alg *amcc_alg;
struct crypto4xx_ctx *ctx = crypto_skcipher_ctx(sk); struct crypto4xx_ctx *ctx = crypto_skcipher_ctx(sk);
@ -180,7 +180,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
amcc_alg = container_of(alg, struct crypto4xx_alg, alg.u.cipher); amcc_alg = container_of(alg, struct crypto4xx_alg, alg.u.cipher);
crypto4xx_ctx_init(amcc_alg, ctx); crypto4xx_ctx_init(amcc_alg, ctx);
return 0; return 0;
@@ -956,6 +969,8 @@ static void crypto4xx_sk_exit(struct cry @@ -965,6 +978,8 @@ static void crypto4xx_sk_exit(struct cry
struct crypto4xx_ctx *ctx = crypto_skcipher_ctx(sk); struct crypto4xx_ctx *ctx = crypto_skcipher_ctx(sk);
crypto4xx_common_exit(ctx); crypto4xx_common_exit(ctx);
@ -189,7 +189,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
} }
static int crypto4xx_aead_init(struct crypto_aead *tfm) static int crypto4xx_aead_init(struct crypto_aead *tfm)
@@ -1145,6 +1160,28 @@ static struct crypto4xx_alg_common crypt @@ -1154,6 +1169,28 @@ static struct crypto4xx_alg_common crypt
.init = crypto4xx_sk_init, .init = crypto4xx_sk_init,
.exit = crypto4xx_sk_exit, .exit = crypto4xx_sk_exit,
} }, } },

@ -1,71 +0,0 @@
From fc340115ffb8235c1bbd200c28855e6373d0dd1a Mon Sep 17 00:00:00 2001
From: Christian Lamparter <chunkeey@gmail.com>
Date: Thu, 19 Apr 2018 18:41:55 +0200
Subject: [PATCH 6/8] crypto: crypto4xx - properly set IV after de- and encrypt
This patch fixes cts(cbc(aes)) test when cbc-aes-ppc4xx is used.
alg: skcipher: Test 1 failed (invalid result) on encryption for cts(cbc-aes-ppc4xx)
00000000: 4b 10 75 fc 2f 14 1b 6a 27 35 37 33 d1 b7 70 05
00000010: 97
alg: skcipher: Failed to load transform for cts(cbc(aes)): -2
The CTS cipher mode expect the IV (req->iv) of skcipher_request
to contain the last ciphertext block after the {en,de}crypt
operation is complete.
Fix this issue for the AMCC Crypto4xx hardware engine.
The tcrypt test case for cts(cbc(aes)) is now correctly passed.
name : cts(cbc(aes))
driver : cts(cbc-aes-ppc4xx)
module : cts
priority : 300
refcnt : 1
selftest : passed
internal : no
type : skcipher
async : yes
blocksize : 16
min keysize : 16
max keysize : 32
ivsize : 16
chunksize : 16
walksize : 16
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
---
drivers/crypto/amcc/crypto4xx_alg.c | 3 ++-
drivers/crypto/amcc/crypto4xx_core.c | 9 +++++++++
2 files changed, 11 insertions(+), 1 deletion(-)
--- a/drivers/crypto/amcc/crypto4xx_alg.c
+++ b/drivers/crypto/amcc/crypto4xx_alg.c
@@ -141,7 +141,8 @@ static int crypto4xx_setkey_aes(struct c
/* Setup SA */
sa = ctx->sa_in;
- set_dynamic_sa_command_0(sa, SA_NOT_SAVE_HASH, SA_NOT_SAVE_IV,
+ set_dynamic_sa_command_0(sa, SA_NOT_SAVE_HASH, (cm == CRYPTO_MODE_CBC ?
+ SA_SAVE_IV : SA_NOT_SAVE_IV),
SA_LOAD_HASH_FROM_SA, SA_LOAD_IV_FROM_STATE,
SA_NO_HEADER_PROC, SA_HASH_ALG_NULL,
SA_CIPHER_ALG_AES, SA_PAD_TYPE_ZERO,
--- a/drivers/crypto/amcc/crypto4xx_core.c
+++ b/drivers/crypto/amcc/crypto4xx_core.c
@@ -545,6 +545,15 @@ static void crypto4xx_cipher_done(struct
addr = dma_map_page(dev->core_dev->device, sg_page(dst),
dst->offset, dst->length, DMA_FROM_DEVICE);
}
+
+ if (pd_uinfo->sa_va->sa_command_0.bf.save_iv == SA_SAVE_IV) {
+ struct crypto_skcipher *skcipher = crypto_skcipher_reqtfm(req);
+
+ crypto4xx_memcpy_from_le32((u32 *)req->iv,
+ pd_uinfo->sr_va->save_iv,
+ crypto_skcipher_ivsize(skcipher));
+ }
+
crypto4xx_ret_sg_desc(dev, pd_uinfo);
if (pd_uinfo->state & PD_ENTRY_BUSY)

@ -661,7 +661,7 @@
return false; return false;
return true; return true;
@@ -634,13 +638,13 @@ static inline void ipv6_addr_set_v4mappe @@ -605,13 +609,13 @@ static inline void ipv6_addr_set_v4mappe
*/ */
static inline int __ipv6_addr_diff32(const void *token1, const void *token2, int addrlen) static inline int __ipv6_addr_diff32(const void *token1, const void *token2, int addrlen)
{ {
@ -677,7 +677,7 @@
if (xb) if (xb)
return i * 32 + 31 - __fls(ntohl(xb)); return i * 32 + 31 - __fls(ntohl(xb));
} }
@@ -809,17 +813,18 @@ static inline int ip6_default_np_autolab @@ -780,17 +784,18 @@ static inline int ip6_default_np_autolab
static inline void ip6_flow_hdr(struct ipv6hdr *hdr, unsigned int tclass, static inline void ip6_flow_hdr(struct ipv6hdr *hdr, unsigned int tclass,
__be32 flowlabel) __be32 flowlabel)
{ {

@ -641,7 +641,7 @@
return false; return false;
return true; return true;
@@ -634,13 +638,13 @@ static inline void ipv6_addr_set_v4mappe @@ -605,13 +609,13 @@ static inline void ipv6_addr_set_v4mappe
*/ */
static inline int __ipv6_addr_diff32(const void *token1, const void *token2, int addrlen) static inline int __ipv6_addr_diff32(const void *token1, const void *token2, int addrlen)
{ {
@ -657,7 +657,7 @@
if (xb) if (xb)
return i * 32 + 31 - __fls(ntohl(xb)); return i * 32 + 31 - __fls(ntohl(xb));
} }
@@ -809,17 +813,18 @@ static inline int ip6_default_np_autolab @@ -780,17 +784,18 @@ static inline int ip6_default_np_autolab
static inline void ip6_flow_hdr(struct ipv6hdr *hdr, unsigned int tclass, static inline void ip6_flow_hdr(struct ipv6hdr *hdr, unsigned int tclass,
__be32 flowlabel) __be32 flowlabel)
{ {

@ -15,7 +15,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
--- a/include/net/ipv6.h --- a/include/net/ipv6.h
+++ b/include/net/ipv6.h +++ b/include/net/ipv6.h
@@ -889,6 +889,8 @@ static inline struct sk_buff *ip6_finish @@ -860,6 +860,8 @@ static inline struct sk_buff *ip6_finish
&inet6_sk(sk)->cork); &inet6_sk(sk)->cork);
} }

@ -38,7 +38,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
#endif #endif
--- a/include/net/ipv6.h --- a/include/net/ipv6.h
+++ b/include/net/ipv6.h +++ b/include/net/ipv6.h
@@ -889,8 +889,6 @@ static inline struct sk_buff *ip6_finish @@ -860,8 +860,6 @@ static inline struct sk_buff *ip6_finish
&inet6_sk(sk)->cork); &inet6_sk(sk)->cork);
} }

@ -15,7 +15,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/Makefile --- a/Makefile
+++ b/Makefile +++ b/Makefile
@@ -1240,7 +1240,6 @@ all: modules @@ -1239,7 +1239,6 @@ all: modules
PHONY += modules PHONY += modules
modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux) modules.builtin modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux) modules.builtin
@ -23,7 +23,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
@$(kecho) ' Building modules, stage 2.'; @$(kecho) ' Building modules, stage 2.';
$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
@@ -1269,7 +1268,6 @@ _modinst_: @@ -1268,7 +1267,6 @@ _modinst_:
rm -f $(MODLIB)/build ; \ rm -f $(MODLIB)/build ; \
ln -s $(CURDIR) $(MODLIB)/build ; \ ln -s $(CURDIR) $(MODLIB)/build ; \
fi fi

@ -33,7 +33,7 @@ Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
# Read KERNELRELEASE from include/config/kernel.release (if it exists) # Read KERNELRELEASE from include/config/kernel.release (if it exists)
KERNELRELEASE = $(shell cat include/config/kernel.release 2> /dev/null) KERNELRELEASE = $(shell cat include/config/kernel.release 2> /dev/null)
KERNELVERSION = $(VERSION)$(if $(PATCHLEVEL),.$(PATCHLEVEL)$(if $(SUBLEVEL),.$(SUBLEVEL)))$(EXTRAVERSION) KERNELVERSION = $(VERSION)$(if $(PATCHLEVEL),.$(PATCHLEVEL)$(if $(SUBLEVEL),.$(SUBLEVEL)))$(EXTRAVERSION)
@@ -788,11 +793,6 @@ ifdef CONFIG_DEBUG_SECTION_MISMATCH @@ -787,11 +792,6 @@ ifdef CONFIG_DEBUG_SECTION_MISMATCH
KBUILD_CFLAGS += $(call cc-option, -fno-inline-functions-called-once) KBUILD_CFLAGS += $(call cc-option, -fno-inline-functions-called-once)
endif endif

@ -243,7 +243,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
} }
--- a/mm/vmstat.c --- a/mm/vmstat.c
+++ b/mm/vmstat.c +++ b/mm/vmstat.c
@@ -1955,10 +1955,12 @@ void __init init_mm_internals(void) @@ -1950,10 +1950,12 @@ void __init init_mm_internals(void)
start_shepherd_timer(); start_shepherd_timer();
#endif #endif
#ifdef CONFIG_PROC_FS #ifdef CONFIG_PROC_FS

@ -15,17 +15,19 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/net/bridge/br_input.c --- a/net/bridge/br_input.c
+++ b/net/bridge/br_input.c +++ b/net/bridge/br_input.c
@@ -239,7 +239,8 @@ static int br_handle_local_finish(struct @@ -237,7 +237,10 @@ static void __br_handle_local_finish(str
/* note: already called with rcu_read_lock */
static int br_handle_local_finish(struct net *net, struct sock *sk, struct sk_buff *skb)
{ {
struct net_bridge_port *p = br_port_get_rcu(skb->dev);
- __br_handle_local_finish(skb); - __br_handle_local_finish(skb);
+ struct net_bridge_port *p = br_port_get_rcu(skb->dev);
+
+ if (p->state != BR_STATE_DISABLED) + if (p->state != BR_STATE_DISABLED)
+ __br_handle_local_finish(skb); + __br_handle_local_finish(skb);
BR_INPUT_SKB_CB(skb)->brdev = p->br->dev; /* return 1 to signal the okfn() was called so it's ok to use the skb */
br_pass_frame_up(skb); return 1;
@@ -327,6 +328,15 @@ rx_handler_result_t br_handle_frame(stru @@ -332,6 +335,15 @@ rx_handler_result_t br_handle_frame(stru
forward: forward:
switch (p->state) { switch (p->state) {

@ -14,12 +14,12 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/Makefile --- a/Makefile
+++ b/Makefile +++ b/Makefile
@@ -654,12 +654,12 @@ KBUILD_CFLAGS += $(call cc-disable-warni @@ -653,12 +653,12 @@ KBUILD_CFLAGS += $(call cc-disable-warni
KBUILD_CFLAGS += $(call cc-disable-warning, attribute-alias)
ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE ifdef CONFIG_CC_OPTIMIZE_FOR_SIZE
KBUILD_CFLAGS += $(call cc-option,-Oz,-Os) -KBUILD_CFLAGS += -Os $(call cc-disable-warning,maybe-uninitialized,)
-KBUILD_CFLAGS += $(call cc-disable-warning,maybe-uninitialized,) +KBUILD_CFLAGS += -Os $(call cc-disable-warning,maybe-uninitialized,) $(EXTRA_OPTIMIZATION)
+KBUILD_CFLAGS += $(call cc-disable-warning,maybe-uninitialized,) $(EXTRA_OPTIMIZATION)
else else
ifdef CONFIG_PROFILE_ALL_BRANCHES ifdef CONFIG_PROFILE_ALL_BRANCHES
-KBUILD_CFLAGS += -O2 $(call cc-disable-warning,maybe-uninitialized,) -KBUILD_CFLAGS += -O2 $(call cc-disable-warning,maybe-uninitialized,)

@ -84,7 +84,7 @@ Signed-off-by: Biwen Li <biwen.li@nxp.com>
{ {
struct bonding *bond = netdev_priv(bond_dev); struct bonding *bond = netdev_priv(bond_dev);
const struct net_device_ops *slave_ops = slave_dev->netdev_ops; const struct net_device_ops *slave_ops = slave_dev->netdev_ops;
@@ -3502,7 +3503,7 @@ static int bond_do_ioctl(struct net_devi @@ -3506,7 +3507,7 @@ static int bond_do_ioctl(struct net_devi
switch (cmd) { switch (cmd) {
case BOND_ENSLAVE_OLD: case BOND_ENSLAVE_OLD:
case SIOCBONDENSLAVE: case SIOCBONDENSLAVE:
@ -106,7 +106,7 @@ Signed-off-by: Biwen Li <biwen.li@nxp.com>
case '-': case '-':
--- a/drivers/net/team/team.c --- a/drivers/net/team/team.c
+++ b/drivers/net/team/team.c +++ b/drivers/net/team/team.c
@@ -1921,7 +1921,8 @@ static int team_netpoll_setup(struct net @@ -1947,7 +1947,8 @@ static int team_netpoll_setup(struct net
} }
#endif #endif

Loading…
Cancel
Save