kernel: bump 4.19 to 4.19.62
Refreshed all patches. Remove upstreamed: - 023-0013-crypto-crypto4xx-fix-AES-CTR-blocksize-value.patch - 023-0014-crypto-crypto4xx-fix-blocksize-for-cfb-and-ofb.patch - 023-0015-crypto-crypto4xx-block-ciphers-should-only-accept-co.patch - 950-0252-staging-bcm2835_camera-Ensure-all-buffers-are-return.patch - 950-0253-staging-bcm2835-camera-Remove-check-of-the-number-of.patch - 950-0254-staging-bcm2835-camera-Handle-empty-EOS-buffers-whil.patch - 950-0489-staging-mmal-vchiq-Replace-spinlock-protecting-conte.patch - 0021-ARM-dts-gemini-Fix-up-DNS-313-compatible-string.patch - 049-v4.20-mips-remove-superfluous-check-for-linux.patch - 100-MIPS-fix-build-on-non-linux-hosts.patch - 303-MIPS-Fix-bounds-check-virt_addr_valid.patch - 0002-usb-dwc2-use-a-longer-AHB-idle-timeout-in-dwc2_core_.patch Altered patches: - 950-0267-staging-vc04_services-Split-vchiq-mmal-into-a-module.patch - 700-net-add-qualcomm-mdio-and-phy.patch Fixes: - CVE-2019-3846 New symbol: - AX88796B_PHY Compile-tested on: cns3xxx, imx6 Runtime-tested on: cns3xxx, imx6 Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>master
parent
1d45ed1477
commit
c7634180fc
@ -1,60 +0,0 @@
|
||||
From bfa2ba7d9e6b20aca82b99e6842fe18842ae3a0f Mon Sep 17 00:00:00 2001
|
||||
From: Christian Lamparter <chunkeey@gmail.com>
|
||||
Date: Fri, 17 May 2019 23:15:57 +0200
|
||||
Subject: [PATCH 13/15] crypto: crypto4xx - fix AES CTR blocksize value
|
||||
|
||||
This patch fixes a issue with crypto4xx's ctr(aes) that was
|
||||
discovered by libcapi's kcapi-enc-test.sh test.
|
||||
|
||||
The some of the ctr(aes) encryptions test were failing on the
|
||||
non-power-of-two test:
|
||||
|
||||
kcapi-enc - Error: encryption failed with error 0
|
||||
kcapi-enc - Error: decryption failed with error 0
|
||||
[FAILED: 32-bit - 5.1.0-rc1+] 15 bytes: STDIN / STDOUT enc test (128 bits):
|
||||
original file (1d100e..cc96184c) and generated file (e3b0c442..1b7852b855)
|
||||
[FAILED: 32-bit - 5.1.0-rc1+] 15 bytes: STDIN / STDOUT enc test (128 bits)
|
||||
(openssl generated CT): original file (e3b0..5) and generated file (3..8e)
|
||||
[PASSED: 32-bit - 5.1.0-rc1+] 15 bytes: STDIN / STDOUT enc test (128 bits)
|
||||
(openssl generated PT)
|
||||
[FAILED: 32-bit - 5.1.0-rc1+] 15 bytes: STDIN / STDOUT enc test (password):
|
||||
original file (1d1..84c) and generated file (e3b..852b855)
|
||||
|
||||
But the 16, 32, 512, 65536 tests always worked.
|
||||
|
||||
Thankfully, this isn't a hidden hardware problem like previously,
|
||||
instead this turned out to be a copy and paste issue.
|
||||
|
||||
With this patch, all the tests are passing with and
|
||||
kcapi-enc-test.sh gives crypto4xx's a clean bill of health:
|
||||
"Number of failures: 0" :).
|
||||
|
||||
Cc: stable@vger.kernel.org
|
||||
Fixes: 98e87e3d933b ("crypto: crypto4xx - add aes-ctr support")
|
||||
Fixes: f2a13e7cba9e ("crypto: crypto4xx - enable AES RFC3686, ECB, CFB and OFB offloads")
|
||||
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
|
||||
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
|
||||
---
|
||||
drivers/crypto/amcc/crypto4xx_core.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
--- a/drivers/crypto/amcc/crypto4xx_core.c
|
||||
+++ b/drivers/crypto/amcc/crypto4xx_core.c
|
||||
@@ -1257,7 +1257,7 @@ static struct crypto4xx_alg_common crypt
|
||||
.cra_flags = CRYPTO_ALG_NEED_FALLBACK |
|
||||
CRYPTO_ALG_ASYNC |
|
||||
CRYPTO_ALG_KERN_DRIVER_ONLY,
|
||||
- .cra_blocksize = AES_BLOCK_SIZE,
|
||||
+ .cra_blocksize = 1,
|
||||
.cra_ctxsize = sizeof(struct crypto4xx_ctx),
|
||||
.cra_module = THIS_MODULE,
|
||||
},
|
||||
@@ -1277,7 +1277,7 @@ static struct crypto4xx_alg_common crypt
|
||||
.cra_priority = CRYPTO4XX_CRYPTO_PRIORITY,
|
||||
.cra_flags = CRYPTO_ALG_ASYNC |
|
||||
CRYPTO_ALG_KERN_DRIVER_ONLY,
|
||||
- .cra_blocksize = AES_BLOCK_SIZE,
|
||||
+ .cra_blocksize = 1,
|
||||
.cra_ctxsize = sizeof(struct crypto4xx_ctx),
|
||||
.cra_module = THIS_MODULE,
|
||||
},
|
@ -1,44 +0,0 @@
|
||||
From 70c4997f34b6c6888b3ac157adec49e01d0df2d5 Mon Sep 17 00:00:00 2001
|
||||
From: Christian Lamparter <chunkeey@gmail.com>
|
||||
Date: Sat, 18 May 2019 23:28:11 +0200
|
||||
Subject: [PATCH 14/15] crypto: crypto4xx - fix blocksize for cfb and ofb
|
||||
|
||||
While the hardware consider them to be blockciphers, the
|
||||
reference implementation defines them as streamciphers.
|
||||
|
||||
Do the right thing and set the blocksize to 1. This
|
||||
was found by CONFIG_CRYPTO_MANAGER_EXTRA_TESTS.
|
||||
|
||||
This fixes the following issues:
|
||||
skcipher: blocksize for ofb-aes-ppc4xx (16) doesn't match generic impl (1)
|
||||
skcipher: blocksize for cfb-aes-ppc4xx (16) doesn't match generic impl (1)
|
||||
|
||||
Cc: Eric Biggers <ebiggers@kernel.org>
|
||||
Cc: stable@vger.kernel.org
|
||||
Fixes: f2a13e7cba9e ("crypto: crypto4xx - enable AES RFC3686, ECB, CFB and OFB offloads")
|
||||
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
|
||||
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
|
||||
---
|
||||
drivers/crypto/amcc/crypto4xx_core.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
--- a/drivers/crypto/amcc/crypto4xx_core.c
|
||||
+++ b/drivers/crypto/amcc/crypto4xx_core.c
|
||||
@@ -1236,7 +1236,7 @@ static struct crypto4xx_alg_common crypt
|
||||
.cra_priority = CRYPTO4XX_CRYPTO_PRIORITY,
|
||||
.cra_flags = CRYPTO_ALG_ASYNC |
|
||||
CRYPTO_ALG_KERN_DRIVER_ONLY,
|
||||
- .cra_blocksize = AES_BLOCK_SIZE,
|
||||
+ .cra_blocksize = 1,
|
||||
.cra_ctxsize = sizeof(struct crypto4xx_ctx),
|
||||
.cra_module = THIS_MODULE,
|
||||
},
|
||||
@@ -1316,7 +1316,7 @@ static struct crypto4xx_alg_common crypt
|
||||
.cra_priority = CRYPTO4XX_CRYPTO_PRIORITY,
|
||||
.cra_flags = CRYPTO_ALG_ASYNC |
|
||||
CRYPTO_ALG_KERN_DRIVER_ONLY,
|
||||
- .cra_blocksize = AES_BLOCK_SIZE,
|
||||
+ .cra_blocksize = 1,
|
||||
.cra_ctxsize = sizeof(struct crypto4xx_ctx),
|
||||
.cra_module = THIS_MODULE,
|
||||
},
|
@ -1,172 +0,0 @@
|
||||
From 0f7a81374060828280fcfdfbaa162cb559017f9f Mon Sep 17 00:00:00 2001
|
||||
From: Christian Lamparter <chunkeey@gmail.com>
|
||||
Date: Sat, 18 May 2019 23:28:12 +0200
|
||||
Subject: [PATCH 15/15] crypto: crypto4xx - block ciphers should only accept
|
||||
complete blocks
|
||||
|
||||
The hardware automatically zero pads incomplete block ciphers
|
||||
blocks without raising any errors. This is a screw-up. This
|
||||
was noticed by CONFIG_CRYPTO_MANAGER_EXTRA_TESTS tests that
|
||||
sent a incomplete blocks and expect them to fail.
|
||||
|
||||
This fixes:
|
||||
cbc-aes-ppc4xx encryption unexpectedly succeeded on test vector
|
||||
"random: len=2409 klen=32"; expected_error=-22, cfg="random:
|
||||
may_sleep use_digest src_divs=[96.90%@+2295, 2.34%@+4066,
|
||||
0.32%@alignmask+12, 0.34%@+4087, 0.9%@alignmask+1787, 0.1%@+3767]
|
||||
iv_offset=6"
|
||||
|
||||
ecb-aes-ppc4xx encryption unexpectedly succeeded on test vector
|
||||
"random: len=1011 klen=32"; expected_error=-22, cfg="random:
|
||||
may_sleep use_digest src_divs=[100.0%@alignmask+20]
|
||||
dst_divs=[3.12%@+3001, 96.88%@+4070]"
|
||||
|
||||
Cc: Eric Biggers <ebiggers@kernel.org>
|
||||
Cc: stable@vger.kernel.org [4.19, 5.0 and 5.1]
|
||||
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
|
||||
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
|
||||
---
|
||||
drivers/crypto/amcc/crypto4xx_alg.c | 36 +++++++++++++++++++---------
|
||||
drivers/crypto/amcc/crypto4xx_core.c | 16 ++++++-------
|
||||
drivers/crypto/amcc/crypto4xx_core.h | 10 ++++----
|
||||
3 files changed, 39 insertions(+), 23 deletions(-)
|
||||
|
||||
--- a/drivers/crypto/amcc/crypto4xx_alg.c
|
||||
+++ b/drivers/crypto/amcc/crypto4xx_alg.c
|
||||
@@ -76,12 +76,16 @@ static void set_dynamic_sa_command_1(str
|
||||
}
|
||||
|
||||
static inline int crypto4xx_crypt(struct skcipher_request *req,
|
||||
- const unsigned int ivlen, bool decrypt)
|
||||
+ const unsigned int ivlen, bool decrypt,
|
||||
+ bool check_blocksize)
|
||||
{
|
||||
struct crypto_skcipher *cipher = crypto_skcipher_reqtfm(req);
|
||||
struct crypto4xx_ctx *ctx = crypto_skcipher_ctx(cipher);
|
||||
__le32 iv[AES_IV_SIZE];
|
||||
|
||||
+ if (check_blocksize && !IS_ALIGNED(req->cryptlen, AES_BLOCK_SIZE))
|
||||
+ return -EINVAL;
|
||||
+
|
||||
if (ivlen)
|
||||
crypto4xx_memcpy_to_le32(iv, req->iv, ivlen);
|
||||
|
||||
@@ -90,24 +94,34 @@ static inline int crypto4xx_crypt(struct
|
||||
ctx->sa_len, 0, NULL);
|
||||
}
|
||||
|
||||
-int crypto4xx_encrypt_noiv(struct skcipher_request *req)
|
||||
+int crypto4xx_encrypt_noiv_block(struct skcipher_request *req)
|
||||
+{
|
||||
+ return crypto4xx_crypt(req, 0, false, true);
|
||||
+}
|
||||
+
|
||||
+int crypto4xx_encrypt_iv_stream(struct skcipher_request *req)
|
||||
+{
|
||||
+ return crypto4xx_crypt(req, AES_IV_SIZE, false, false);
|
||||
+}
|
||||
+
|
||||
+int crypto4xx_decrypt_noiv_block(struct skcipher_request *req)
|
||||
{
|
||||
- return crypto4xx_crypt(req, 0, false);
|
||||
+ return crypto4xx_crypt(req, 0, true, true);
|
||||
}
|
||||
|
||||
-int crypto4xx_encrypt_iv(struct skcipher_request *req)
|
||||
+int crypto4xx_decrypt_iv_stream(struct skcipher_request *req)
|
||||
{
|
||||
- return crypto4xx_crypt(req, AES_IV_SIZE, false);
|
||||
+ return crypto4xx_crypt(req, AES_IV_SIZE, true, false);
|
||||
}
|
||||
|
||||
-int crypto4xx_decrypt_noiv(struct skcipher_request *req)
|
||||
+int crypto4xx_encrypt_iv_block(struct skcipher_request *req)
|
||||
{
|
||||
- return crypto4xx_crypt(req, 0, true);
|
||||
+ return crypto4xx_crypt(req, AES_IV_SIZE, false, true);
|
||||
}
|
||||
|
||||
-int crypto4xx_decrypt_iv(struct skcipher_request *req)
|
||||
+int crypto4xx_decrypt_iv_block(struct skcipher_request *req)
|
||||
{
|
||||
- return crypto4xx_crypt(req, AES_IV_SIZE, true);
|
||||
+ return crypto4xx_crypt(req, AES_IV_SIZE, true, true);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -278,8 +292,8 @@ crypto4xx_ctr_crypt(struct skcipher_requ
|
||||
return ret;
|
||||
}
|
||||
|
||||
- return encrypt ? crypto4xx_encrypt_iv(req)
|
||||
- : crypto4xx_decrypt_iv(req);
|
||||
+ return encrypt ? crypto4xx_encrypt_iv_stream(req)
|
||||
+ : crypto4xx_decrypt_iv_stream(req);
|
||||
}
|
||||
|
||||
static int crypto4xx_sk_setup_fallback(struct crypto4xx_ctx *ctx,
|
||||
--- a/drivers/crypto/amcc/crypto4xx_core.c
|
||||
+++ b/drivers/crypto/amcc/crypto4xx_core.c
|
||||
@@ -1224,8 +1224,8 @@ static struct crypto4xx_alg_common crypt
|
||||
.max_keysize = AES_MAX_KEY_SIZE,
|
||||
.ivsize = AES_IV_SIZE,
|
||||
.setkey = crypto4xx_setkey_aes_cbc,
|
||||
- .encrypt = crypto4xx_encrypt_iv,
|
||||
- .decrypt = crypto4xx_decrypt_iv,
|
||||
+ .encrypt = crypto4xx_encrypt_iv_block,
|
||||
+ .decrypt = crypto4xx_decrypt_iv_block,
|
||||
.init = crypto4xx_sk_init,
|
||||
.exit = crypto4xx_sk_exit,
|
||||
} },
|
||||
@@ -1244,8 +1244,8 @@ static struct crypto4xx_alg_common crypt
|
||||
.max_keysize = AES_MAX_KEY_SIZE,
|
||||
.ivsize = AES_IV_SIZE,
|
||||
.setkey = crypto4xx_setkey_aes_cfb,
|
||||
- .encrypt = crypto4xx_encrypt_iv,
|
||||
- .decrypt = crypto4xx_decrypt_iv,
|
||||
+ .encrypt = crypto4xx_encrypt_iv_stream,
|
||||
+ .decrypt = crypto4xx_decrypt_iv_stream,
|
||||
.init = crypto4xx_sk_init,
|
||||
.exit = crypto4xx_sk_exit,
|
||||
} },
|
||||
@@ -1304,8 +1304,8 @@ static struct crypto4xx_alg_common crypt
|
||||
.min_keysize = AES_MIN_KEY_SIZE,
|
||||
.max_keysize = AES_MAX_KEY_SIZE,
|
||||
.setkey = crypto4xx_setkey_aes_ecb,
|
||||
- .encrypt = crypto4xx_encrypt_noiv,
|
||||
- .decrypt = crypto4xx_decrypt_noiv,
|
||||
+ .encrypt = crypto4xx_encrypt_noiv_block,
|
||||
+ .decrypt = crypto4xx_decrypt_noiv_block,
|
||||
.init = crypto4xx_sk_init,
|
||||
.exit = crypto4xx_sk_exit,
|
||||
} },
|
||||
@@ -1324,8 +1324,8 @@ static struct crypto4xx_alg_common crypt
|
||||
.max_keysize = AES_MAX_KEY_SIZE,
|
||||
.ivsize = AES_IV_SIZE,
|
||||
.setkey = crypto4xx_setkey_aes_ofb,
|
||||
- .encrypt = crypto4xx_encrypt_iv,
|
||||
- .decrypt = crypto4xx_decrypt_iv,
|
||||
+ .encrypt = crypto4xx_encrypt_iv_stream,
|
||||
+ .decrypt = crypto4xx_decrypt_iv_stream,
|
||||
.init = crypto4xx_sk_init,
|
||||
.exit = crypto4xx_sk_exit,
|
||||
} },
|
||||
--- a/drivers/crypto/amcc/crypto4xx_core.h
|
||||
+++ b/drivers/crypto/amcc/crypto4xx_core.h
|
||||
@@ -182,10 +182,12 @@ int crypto4xx_setkey_rfc3686(struct cryp
|
||||
const u8 *key, unsigned int keylen);
|
||||
int crypto4xx_encrypt_ctr(struct skcipher_request *req);
|
||||
int crypto4xx_decrypt_ctr(struct skcipher_request *req);
|
||||
-int crypto4xx_encrypt_iv(struct skcipher_request *req);
|
||||
-int crypto4xx_decrypt_iv(struct skcipher_request *req);
|
||||
-int crypto4xx_encrypt_noiv(struct skcipher_request *req);
|
||||
-int crypto4xx_decrypt_noiv(struct skcipher_request *req);
|
||||
+int crypto4xx_encrypt_iv_stream(struct skcipher_request *req);
|
||||
+int crypto4xx_decrypt_iv_stream(struct skcipher_request *req);
|
||||
+int crypto4xx_encrypt_iv_block(struct skcipher_request *req);
|
||||
+int crypto4xx_decrypt_iv_block(struct skcipher_request *req);
|
||||
+int crypto4xx_encrypt_noiv_block(struct skcipher_request *req);
|
||||
+int crypto4xx_decrypt_noiv_block(struct skcipher_request *req);
|
||||
int crypto4xx_rfc3686_encrypt(struct skcipher_request *req);
|
||||
int crypto4xx_rfc3686_decrypt(struct skcipher_request *req);
|
||||
int crypto4xx_sha1_alg_init(struct crypto_tfm *tfm);
|
@ -1,95 +0,0 @@
|
||||
From 754a5ed1aa42ce9d5be5f84a5a0888f850b15e00 Mon Sep 17 00:00:00 2001
|
||||
From: Dave Stevenson <dave.stevenson@raspberrypi.org>
|
||||
Date: Thu, 28 Jun 2018 15:57:25 +0100
|
||||
Subject: [PATCH 252/703] staging: bcm2835_camera: Ensure all buffers are
|
||||
returned on disable
|
||||
|
||||
With the recent change to match MMAL and V4L2 buffers there
|
||||
is a need to wait for all MMAL buffers to be returned during
|
||||
stop_streaming.
|
||||
|
||||
Fixes: 9384167 "staging: bcm2835-camera: Remove V4L2/MMAL buffer remapping"
|
||||
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
|
||||
---
|
||||
.../bcm2835-camera/bcm2835-camera.c | 22 ++++++++++++++-----
|
||||
.../vc04_services/bcm2835-camera/mmal-vchiq.c | 4 ++++
|
||||
.../vc04_services/bcm2835-camera/mmal-vchiq.h | 3 +++
|
||||
3 files changed, 23 insertions(+), 6 deletions(-)
|
||||
|
||||
--- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
|
||||
+++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
|
||||
@@ -607,6 +607,7 @@ static void stop_streaming(struct vb2_qu
|
||||
int ret;
|
||||
unsigned long timeout;
|
||||
struct bm2835_mmal_dev *dev = vb2_get_drv_priv(vq);
|
||||
+ struct vchiq_mmal_port *port = dev->capture.port;
|
||||
|
||||
v4l2_dbg(1, bcm2835_v4l2_debug, &dev->v4l2_dev, "%s: dev:%p\n",
|
||||
__func__, dev);
|
||||
@@ -630,12 +631,6 @@ static void stop_streaming(struct vb2_qu
|
||||
&dev->capture.frame_count,
|
||||
sizeof(dev->capture.frame_count));
|
||||
|
||||
- /* wait for last frame to complete */
|
||||
- timeout = wait_for_completion_timeout(&dev->capture.frame_cmplt, HZ);
|
||||
- if (timeout == 0)
|
||||
- v4l2_err(&dev->v4l2_dev,
|
||||
- "timed out waiting for frame completion\n");
|
||||
-
|
||||
v4l2_dbg(1, bcm2835_v4l2_debug, &dev->v4l2_dev,
|
||||
"disabling connection\n");
|
||||
|
||||
@@ -650,6 +645,21 @@ static void stop_streaming(struct vb2_qu
|
||||
ret);
|
||||
}
|
||||
|
||||
+ /* wait for all buffers to be returned */
|
||||
+ while (atomic_read(&port->buffers_with_vpu)) {
|
||||
+ v4l2_dbg(1, bcm2835_v4l2_debug, &dev->v4l2_dev,
|
||||
+ "%s: Waiting for buffers to be returned - %d outstanding\n",
|
||||
+ __func__, atomic_read(&port->buffers_with_vpu));
|
||||
+ timeout = wait_for_completion_timeout(&dev->capture.frame_cmplt,
|
||||
+ HZ);
|
||||
+ if (timeout == 0) {
|
||||
+ v4l2_err(&dev->v4l2_dev, "%s: Timeout waiting for buffers to be returned - %d outstanding\n",
|
||||
+ __func__,
|
||||
+ atomic_read(&port->buffers_with_vpu));
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
if (disable_camera(dev) < 0)
|
||||
v4l2_err(&dev->v4l2_dev, "Failed to disable camera\n");
|
||||
}
|
||||
--- a/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c
|
||||
+++ b/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c
|
||||
@@ -246,6 +246,8 @@ static void buffer_work_cb(struct work_s
|
||||
struct mmal_msg_context *msg_context =
|
||||
container_of(work, struct mmal_msg_context, u.bulk.work);
|
||||
|
||||
+ atomic_dec(&msg_context->u.bulk.port->buffers_with_vpu);
|
||||
+
|
||||
msg_context->u.bulk.port->buffer_cb(msg_context->u.bulk.instance,
|
||||
msg_context->u.bulk.port,
|
||||
msg_context->u.bulk.status,
|
||||
@@ -389,6 +391,8 @@ buffer_from_host(struct vchiq_mmal_insta
|
||||
INIT_WORK(&msg_context->u.bulk.buffer_to_host_work,
|
||||
buffer_to_host_work_cb);
|
||||
|
||||
+ atomic_inc(&port->buffers_with_vpu);
|
||||
+
|
||||
/* prep the buffer from host message */
|
||||
memset(&m, 0xbc, sizeof(m)); /* just to make debug clearer */
|
||||
|
||||
--- a/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.h
|
||||
+++ b/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.h
|
||||
@@ -72,6 +72,9 @@ struct vchiq_mmal_port {
|
||||
struct list_head buffers;
|
||||
/* lock to serialise adding and removing buffers from list */
|
||||
spinlock_t slock;
|
||||
+
|
||||
+ /* Count of buffers the VPU has yet to return */
|
||||
+ atomic_t buffers_with_vpu;
|
||||
/* callback on buffer completion */
|
||||
vchiq_mmal_buffer_cb buffer_cb;
|
||||
/* callback context */
|
@ -1,39 +0,0 @@
|
||||
From 98457a5263c83026cf1d451d44d8b028b8423b87 Mon Sep 17 00:00:00 2001
|
||||
From: Dave Stevenson <dave.stevenson@raspberrypi.org>
|
||||
Date: Wed, 4 Jul 2018 17:01:15 +0100
|
||||
Subject: [PATCH 253/703] staging: bcm2835-camera: Remove check of the number
|
||||
of buffers supplied
|
||||
|
||||
Before 9384167 there was a need to ensure that there were sufficient
|
||||
buffers supplied from the user to cover those being sent to the VPU
|
||||
(always 1).
|
||||
With 9384167 the buffers are linked 1:1 between MMAL and V4L2,
|
||||
therefore there is no need for that check, and indeed it is wrong
|
||||
as there is no need to submit all the buffers before starting streaming.
|
||||
|
||||
Fixes: 9384167 "staging: bcm2835-camera: Remove V4L2/MMAL buffer remapping"
|
||||
|
||||
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
|
||||
---
|
||||
.../staging/vc04_services/bcm2835-camera/mmal-vchiq.c | 10 ----------
|
||||
1 file changed, 10 deletions(-)
|
||||
|
||||
--- a/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c
|
||||
+++ b/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c
|
||||
@@ -1338,16 +1338,6 @@ static int port_enable(struct vchiq_mmal
|
||||
if (port->enabled)
|
||||
return 0;
|
||||
|
||||
- /* ensure there are enough buffers queued to cover the buffer headers */
|
||||
- if (port->buffer_cb) {
|
||||
- hdr_count = 0;
|
||||
- list_for_each(buf_head, &port->buffers) {
|
||||
- hdr_count++;
|
||||
- }
|
||||
- if (hdr_count < port->current_buffer.num)
|
||||
- return -ENOSPC;
|
||||
- }
|
||||
-
|
||||
ret = port_action_port(instance, port,
|
||||
MMAL_MSG_PORT_ACTION_TYPE_ENABLE);
|
||||
if (ret)
|
@ -1,84 +0,0 @@
|
||||
From 1da35962d95cdb8648cb85c4b6f3d3367be88601 Mon Sep 17 00:00:00 2001
|
||||
From: Dave Stevenson <dave.stevenson@raspberrypi.org>
|
||||
Date: Thu, 5 Jul 2018 16:17:03 +0100
|
||||
Subject: [PATCH 254/703] staging: bcm2835-camera: Handle empty EOS buffers
|
||||
whilst streaming
|
||||
|
||||
The change to mapping V4L2 to MMAL buffers 1:1 didn't handle
|
||||
the condition we get with raw pixel buffers (eg YUV and RGB)
|
||||
direct from the camera's stills port. That sends the pixel buffer
|
||||
and then an empty buffer with the EOS flag set. The EOS buffer
|
||||
wasn't handled and returned an error up the stack.
|
||||
|
||||
Handle the condition correctly by returning it to the component
|
||||
if streaming, or returning with an error if stopping streaming.
|
||||
|
||||
Fixes: 9384167 "staging: bcm2835-camera: Remove V4L2/MMAL buffer remapping"
|
||||
|
||||
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
|
||||
---
|
||||
.../bcm2835-camera/bcm2835-camera.c | 21 +++++++++++--------
|
||||
.../vc04_services/bcm2835-camera/mmal-vchiq.c | 5 +++--
|
||||
2 files changed, 15 insertions(+), 11 deletions(-)
|
||||
|
||||
--- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
|
||||
+++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
|
||||
@@ -339,16 +339,13 @@ static void buffer_cb(struct vchiq_mmal_
|
||||
|
||||
if (length == 0) {
|
||||
/* stream ended */
|
||||
- if (buf) {
|
||||
- /* this should only ever happen if the port is
|
||||
- * disabled and there are buffers still queued
|
||||
+ if (dev->capture.frame_count) {
|
||||
+ /* empty buffer whilst capturing - expected to be an
|
||||
+ * EOS, so grab another frame
|
||||
*/
|
||||
- vb2_buffer_done(&buf->vb.vb2_buf, VB2_BUF_STATE_ERROR);
|
||||
- pr_debug("Empty buffer");
|
||||
- } else if (dev->capture.frame_count) {
|
||||
- /* grab another frame */
|
||||
if (is_capturing(dev)) {
|
||||
- pr_debug("Grab another frame");
|
||||
+ v4l2_dbg(1, bcm2835_v4l2_debug, &dev->v4l2_dev,
|
||||
+ "Grab another frame");
|
||||
vchiq_mmal_port_parameter_set(
|
||||
instance,
|
||||
dev->capture.camera_port,
|
||||
@@ -356,8 +353,14 @@ static void buffer_cb(struct vchiq_mmal_
|
||||
&dev->capture.frame_count,
|
||||
sizeof(dev->capture.frame_count));
|
||||
}
|
||||
+ if (vchiq_mmal_submit_buffer(instance, port, buf))
|
||||
+ v4l2_dbg(1, bcm2835_v4l2_debug, &dev->v4l2_dev,
|
||||
+ "Failed to return EOS buffer");
|
||||
} else {
|
||||
- /* signal frame completion */
|
||||
+ /* stopping streaming.
|
||||
+ * return buffer, and signal frame completion
|
||||
+ */
|
||||
+ vb2_buffer_done(&buf->vb.vb2_buf, VB2_BUF_STATE_ERROR);
|
||||
complete(&dev->capture.frame_cmplt);
|
||||
}
|
||||
return;
|
||||
--- a/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c
|
||||
+++ b/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c
|
||||
@@ -332,8 +332,6 @@ static int bulk_receive(struct vchiq_mma
|
||||
|
||||
/* store length */
|
||||
msg_context->u.bulk.buffer_used = rd_len;
|
||||
- msg_context->u.bulk.mmal_flags =
|
||||
- msg->u.buffer_from_host.buffer_header.flags;
|
||||
msg_context->u.bulk.dts = msg->u.buffer_from_host.buffer_header.dts;
|
||||
msg_context->u.bulk.pts = msg->u.buffer_from_host.buffer_header.pts;
|
||||
|
||||
@@ -461,6 +459,9 @@ static void buffer_to_host_cb(struct vch
|
||||
return;
|
||||
}
|
||||
|
||||
+ msg_context->u.bulk.mmal_flags =
|
||||
+ msg->u.buffer_from_host.buffer_header.flags;
|
||||
+
|
||||
if (msg->h.status != MMAL_MSG_STATUS_SUCCESS) {
|
||||
/* message reception had an error */
|
||||
pr_warn("error %d in reply\n", msg->h.status);
|
File diff suppressed because it is too large
Load Diff
@ -1,67 +0,0 @@
|
||||
From 39464cbb618af3ddf6427d77b0c0be0042bcaaf9 Mon Sep 17 00:00:00 2001
|
||||
From: Dave Stevenson <dave.stevenson@raspberrypi.org>
|
||||
Date: Wed, 1 May 2019 15:17:00 +0100
|
||||
Subject: [PATCH 489/703] staging: mmal-vchiq: Replace spinlock protecting
|
||||
context_map with mutex
|
||||
|
||||
950fd86 staging: bcm2835-camera: Replace open-coded idr with a struct idr.
|
||||
replaced an internal implementation of an idr with the standard functions
|
||||
and a spinlock.
|
||||
idr_alloc(GFP_KERNEL) can sleep whilst calling kmem_cache_alloc to allocate
|
||||
the new node, but this is not valid whilst in an atomic context due to the
|
||||
spinlock.
|
||||
|
||||
There is no need for this to be a spinlock as a standard mutex is
|
||||
sufficient.
|
||||
|
||||
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
|
||||
---
|
||||
.../staging/vc04_services/vchiq-mmal/mmal-vchiq.c | 13 +++++++------
|
||||
1 file changed, 7 insertions(+), 6 deletions(-)
|
||||
|
||||
--- a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
|
||||
+++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
|
||||
@@ -185,7 +185,8 @@ struct vchiq_mmal_instance {
|
||||
void *bulk_scratch;
|
||||
|
||||
struct idr context_map;
|
||||
- spinlock_t context_map_lock;
|
||||
+ /* protect accesses to context_map */
|
||||
+ struct mutex context_map_lock;
|
||||
|
||||
struct vchiq_mmal_component component[VCHIQ_MMAL_MAX_COMPONENTS];
|
||||
|
||||
@@ -209,10 +210,10 @@ get_msg_context(struct vchiq_mmal_instan
|
||||
* that when we service the VCHI reply, we can look up what
|
||||
* message is being replied to.
|
||||
*/
|
||||
- spin_lock(&instance->context_map_lock);
|
||||
+ mutex_lock(&instance->context_map_lock);
|
||||
handle = idr_alloc(&instance->context_map, msg_context,
|
||||
0, 0, GFP_KERNEL);
|
||||
- spin_unlock(&instance->context_map_lock);
|
||||
+ mutex_unlock(&instance->context_map_lock);
|
||||
|
||||
if (handle < 0) {
|
||||
kfree(msg_context);
|
||||
@@ -236,9 +237,9 @@ release_msg_context(struct mmal_msg_cont
|
||||
{
|
||||
struct vchiq_mmal_instance *instance = msg_context->instance;
|
||||
|
||||
- spin_lock(&instance->context_map_lock);
|
||||
+ mutex_lock(&instance->context_map_lock);
|
||||
idr_remove(&instance->context_map, msg_context->handle);
|
||||
- spin_unlock(&instance->context_map_lock);
|
||||
+ mutex_unlock(&instance->context_map_lock);
|
||||
kfree(msg_context);
|
||||
}
|
||||
|
||||
@@ -2143,7 +2144,7 @@ int vchiq_mmal_init(struct vchiq_mmal_in
|
||||
|
||||
instance->bulk_scratch = vmalloc(PAGE_SIZE);
|
||||
|
||||
- spin_lock_init(&instance->context_map_lock);
|
||||
+ mutex_init(&instance->context_map_lock);
|
||||
idr_init_base(&instance->context_map, 1);
|
||||
|
||||
params.callback_param = instance;
|
@ -1,21 +0,0 @@
|
||||
From: Linus Walleij <linus.walleij@linaro.org>
|
||||
Date: Sun, 16 Jun 2019 23:41:20 +0200
|
||||
Subject: [PATCH] ARM: dts: gemini Fix up DNS-313 compatible
|
||||
|
||||
It's a simple typo in the DNS file, which was pretty serious.
|
||||
No scripts were working properly. Fix it up.
|
||||
|
||||
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
|
||||
---
|
||||
|
||||
--- a/arch/arm/boot/dts/gemini-dlink-dns-313.dts
|
||||
+++ b/arch/arm/boot/dts/gemini-dlink-dns-313.dts
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
/ {
|
||||
model = "D-Link DNS-313 1-Bay Network Storage Enclosure";
|
||||
- compatible = "dlink,dir-313", "cortina,gemini";
|
||||
+ compatible = "dlink,dns-313", "cortina,gemini";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
@ -1,47 +0,0 @@
|
||||
From 1287533d3d95d5ad8b02773733044500b1be06bc Mon Sep 17 00:00:00 2001
|
||||
From: Sean Young <sean@mess.org>
|
||||
Date: Fri, 16 Nov 2018 16:09:39 +0000
|
||||
Subject: MIPS: Remove superfluous check for __linux__
|
||||
|
||||
When building BPF code using "clang -target bpf -c", clang does not
|
||||
define __linux__.
|
||||
|
||||
To build BPF IR decoders the include linux/lirc.h is needed which
|
||||
includes linux/types.h. Currently this workaround is needed:
|
||||
|
||||
https://git.linuxtv.org/v4l-utils.git/commit/?id=dd3ff81f58c4e1e6f33765dc61ad33c48ae6bb07
|
||||
|
||||
This check might otherwise be useful to stop users from using a non-linux
|
||||
compiler, but if you're doing that you are going to have a lot more
|
||||
trouble anyway.
|
||||
|
||||
Signed-off-by: Sean Young <sean@mess.org>
|
||||
Signed-off-by: Paul Burton <paul.burton@mips.com>
|
||||
Patchwork: https://patchwork.linux-mips.org/patch/21149/
|
||||
Cc: Ralf Baechle <ralf@linux-mips.org>
|
||||
Cc: James Hogan <jhogan@kernel.org>
|
||||
Cc: linux-mips@linux-mips.org
|
||||
Cc: linux-kernel@vger.kernel.org
|
||||
---
|
||||
arch/mips/include/uapi/asm/sgidefs.h | 8 --------
|
||||
1 file changed, 8 deletions(-)
|
||||
|
||||
(limited to 'arch/mips/include/uapi/asm/sgidefs.h')
|
||||
|
||||
--- a/arch/mips/include/uapi/asm/sgidefs.h
|
||||
+++ b/arch/mips/include/uapi/asm/sgidefs.h
|
||||
@@ -12,14 +12,6 @@
|
||||
#define __ASM_SGIDEFS_H
|
||||
|
||||
/*
|
||||
- * Using a Linux compiler for building Linux seems logic but not to
|
||||
- * everybody.
|
||||
- */
|
||||
-#ifndef __linux__
|
||||
-#error Use a Linux compiler or give up.
|
||||
-#endif
|
||||
-
|
||||
-/*
|
||||
* Definitions for the ISA levels
|
||||
*
|
||||
* With the introduction of MIPS32 / MIPS64 instruction sets definitions
|
@ -1,55 +0,0 @@
|
||||
From 4ee213d8c2afeab9a68f8530317260298b4b6b82 Mon Sep 17 00:00:00 2001
|
||||
From: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
|
||||
Date: Wed, 19 Jun 2019 08:16:33 +0100
|
||||
Subject: [PATCH] MIPS: fix build on non-linux hosts
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
calc_vmlinuz_load_addr.c requires SZ_64K to be defined for alignment
|
||||
purposes. It included "../../../../include/linux/sizes.h" to define
|
||||
that size, however "sizes.h" tries to include <linux/const.h> which
|
||||
assumes linux system headers. These may not exist eg. the following
|
||||
error was encountered when building Linux for OpenWrt under macOS:
|
||||
|
||||
In file included from arch/mips/boot/compressed/calc_vmlinuz_load_addr.c:16:
|
||||
arch/mips/boot/compressed/../../../../include/linux/sizes.h:11:10: fatal error: 'linux/const.h' file not found
|
||||
^~~~~~~~~~
|
||||
|
||||
Change makefile to force building on local linux headers instead of
|
||||
system headers. Also change eye-watering relative reference in include
|
||||
file spec.
|
||||
|
||||
Thanks to Jo-Philip Wich & Petr Štetiar for assistance in tracking this
|
||||
down & fixing.
|
||||
|
||||
Suggested-by: Jo-Philipp Wich <jo@mein.io>
|
||||
Signed-off-by: Petr Štetiar <ynezz@true.cz>
|
||||
Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
|
||||
---
|
||||
arch/mips/boot/compressed/Makefile | 2 ++
|
||||
arch/mips/boot/compressed/calc_vmlinuz_load_addr.c | 2 +-
|
||||
2 files changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/arch/mips/boot/compressed/Makefile
|
||||
+++ b/arch/mips/boot/compressed/Makefile
|
||||
@@ -78,6 +78,8 @@ OBJCOPYFLAGS_piggy.o := --add-section=.i
|
||||
$(obj)/piggy.o: $(obj)/dummy.o $(obj)/vmlinux.bin.z FORCE
|
||||
$(call if_changed,objcopy)
|
||||
|
||||
+HOSTCFLAGS_calc_vmlinuz_load_addr.o += $(LINUXINCLUDE)
|
||||
+
|
||||
# Calculate the load address of the compressed kernel image
|
||||
hostprogs-y := calc_vmlinuz_load_addr
|
||||
|
||||
--- a/arch/mips/boot/compressed/calc_vmlinuz_load_addr.c
|
||||
+++ b/arch/mips/boot/compressed/calc_vmlinuz_load_addr.c
|
||||
@@ -13,7 +13,7 @@
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
-#include "../../../../include/linux/sizes.h"
|
||||
+#include <linux/sizes.h>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
@ -1,33 +0,0 @@
|
||||
From 415e0feec4f927af0059f72a6831f6c5a104f0fc Mon Sep 17 00:00:00 2001
|
||||
From: Hauke Mehrtens <hauke@hauke-m.de>
|
||||
Date: Mon, 17 Jun 2019 00:13:08 +0200
|
||||
Subject: [PATCH] MIPS: Fix bounds check virt_addr_valid
|
||||
|
||||
The bounds check used the uninitialized variable vaddr, it should use
|
||||
the given parameter kaddr instead. When using the uninitialized value
|
||||
the compiler assumed it to be 0 and optimized this function to just
|
||||
return 0 in all cases.
|
||||
|
||||
This should make the function check the range of the given address and
|
||||
only do the page map check in case it is in the expected range of
|
||||
virtual addresses.
|
||||
|
||||
Fixes: 074a1e1167af ("MIPS: Bounds check virt_addr_valid")
|
||||
Cc: stable@vger.kernel.org # v4.12+
|
||||
Cc: Paul Burton <paul.burton@mips.com>
|
||||
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
|
||||
---
|
||||
arch/mips/mm/mmap.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- a/arch/mips/mm/mmap.c
|
||||
+++ b/arch/mips/mm/mmap.c
|
||||
@@ -203,7 +203,7 @@ unsigned long arch_randomize_brk(struct
|
||||
|
||||
int __virt_addr_valid(const volatile void *kaddr)
|
||||
{
|
||||
- unsigned long vaddr = (unsigned long)vaddr;
|
||||
+ unsigned long vaddr = (unsigned long)kaddr;
|
||||
|
||||
if ((vaddr < PAGE_OFFSET) || (vaddr >= MAP_BASE))
|
||||
return 0;
|
@ -1,35 +0,0 @@
|
||||
From bfe92b01cafebb10f0d7f38dceb37433687b7887 Mon Sep 17 00:00:00 2001
|
||||
From: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
|
||||
Date: Thu, 20 Jun 2019 19:50:22 +0200
|
||||
Subject: [PATCH] usb: dwc2: use a longer AHB idle timeout in dwc2_core_reset()
|
||||
|
||||
Use a 10000us AHB idle timeout in dwc2_core_reset() and make it
|
||||
consistent with the other "wait for AHB master IDLE state" ocurrences.
|
||||
|
||||
This fixes a problem for me where dwc2 would not want to initialize when
|
||||
updating to 4.19 on a MIPS Lantiq VRX200 SoC. dwc2 worked fine with
|
||||
4.14.
|
||||
Testing on my board shows that it takes 180us until AHB master IDLE
|
||||
state is signalled. The very old vendor driver for this SoC (ifxhcd)
|
||||
used a 1 second timeout.
|
||||
Use the same timeout that is used everywhere when polling for
|
||||
GRSTCTL_AHBIDLE instead of using a timeout that "works for one board"
|
||||
(180us in my case) to have consistent behavior across the dwc2 driver.
|
||||
|
||||
Cc: linux-stable <stable@vger.kernel.org> # 4.19+
|
||||
Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
|
||||
---
|
||||
drivers/usb/dwc2/core.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- a/drivers/usb/dwc2/core.c
|
||||
+++ b/drivers/usb/dwc2/core.c
|
||||
@@ -531,7 +531,7 @@ int dwc2_core_reset(struct dwc2_hsotg *h
|
||||
}
|
||||
|
||||
/* Wait for AHB master IDLE state */
|
||||
- if (dwc2_hsotg_wait_bit_set(hsotg, GRSTCTL, GRSTCTL_AHBIDLE, 50)) {
|
||||
+ if (dwc2_hsotg_wait_bit_set(hsotg, GRSTCTL, GRSTCTL_AHBIDLE, 10000)) {
|
||||
dev_warn(hsotg->dev, "%s: HANG! AHB Idle timeout GRSTCTL GRSTCTL_AHBIDLE\n",
|
||||
__func__);
|
||||
return -EBUSY;
|
Loading…
Reference in New Issue