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
Koen Vandeputte 2019-07-29 17:54:16 +02:00
parent 1d45ed1477
commit c7634180fc
74 changed files with 187 additions and 2839 deletions

View File

@ -8,11 +8,11 @@ endif
LINUX_VERSION-4.9 = .186
LINUX_VERSION-4.14 = .134
LINUX_VERSION-4.19 = .57
LINUX_VERSION-4.19 = .62
LINUX_KERNEL_HASH-4.9.186 = 242484430d0729791d8efd92181b7d34b4021050646c6e00cf459866eab94b6a
LINUX_KERNEL_HASH-4.14.134 = 0b21e7b5effd92303a551b5be2380c9703d6fb87cfe5189fe0d795cc73903d2d
LINUX_KERNEL_HASH-4.19.57 = 327c5759d5888361d6c9d6adb0c8ad7e3c624eb05bb9e5869d9f3078dd0d3f87
LINUX_KERNEL_HASH-4.19.62 = 07be647189ced7eb8ba5ee769906e67919975772184842cc517f609df50cdadc
remove_uri_prefix=$(subst git://,,$(subst http://,,$(subst https://,,$(1))))
sanitize_uri=$(call qstrip,$(subst @,_,$(subst :,_,$(subst .,_,$(subst -,_,$(subst /,_,$(1)))))))

View File

@ -22,7 +22,7 @@ Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
--- a/drivers/crypto/amcc/crypto4xx_alg.c
+++ b/drivers/crypto/amcc/crypto4xx_alg.c
@@ -526,8 +526,7 @@ static int crypto4xx_compute_gcm_hash_ke
@@ -540,8 +540,7 @@ static int crypto4xx_compute_gcm_hash_ke
uint8_t src[16] = { 0 };
int rc = 0;

View File

@ -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,
},

View File

@ -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,
},

View File

@ -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);

View File

@ -917,7 +917,7 @@ Fixes https://github.com/raspberrypi/linux/issues/2408
}
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -5207,7 +5207,7 @@ static void port_event(struct usb_hub *h
@@ -5210,7 +5210,7 @@ static void port_event(struct usb_hub *h
u16 status = 0, unused;
port_dev->over_current_count++;

View File

@ -24,7 +24,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.org>
--- a/drivers/net/can/spi/mcp251x.c
+++ b/drivers/net/can/spi/mcp251x.c
@@ -951,6 +951,9 @@ static int mcp251x_open(struct net_devic
@@ -950,6 +950,9 @@ static int mcp251x_open(struct net_devic
priv->tx_skb = NULL;
priv->tx_len = 0;

View File

@ -35,7 +35,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.org>
gpiod_err(desc,
"%s: tried to set a GPIO tied to an IRQ as output\n",
__func__);
@@ -3311,7 +3313,7 @@ int gpiochip_lock_as_irq(struct gpio_chi
@@ -3312,7 +3314,7 @@ int gpiochip_lock_as_irq(struct gpio_chi
}
}

View File

@ -472,7 +472,7 @@ Signed-off-by: Jiri Kosina <jkosina@suse.cz>
+MODULE_LICENSE("GPL");
--- a/drivers/hid/hid-ids.h
+++ b/drivers/hid/hid-ids.h
@@ -232,6 +232,9 @@
@@ -233,6 +233,9 @@
#define USB_VENDOR_ID_BETOP_2185V2PC 0x8380
#define USB_VENDOR_ID_BETOP_2185V2BFM 0x20bc

View File

@ -26,7 +26,7 @@ Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
int bcm2835_v4l2_debug;
module_param_named(debug, bcm2835_v4l2_debug, int, 0644);
MODULE_PARM_DESC(bcm2835_v4l2_debug, "Debug level 0-2");
@@ -1967,3 +1961,9 @@ static struct platform_driver bcm2835_ca
@@ -1980,3 +1974,9 @@ static struct platform_driver bcm2835_ca
};
module_platform_driver(bcm2835_camera_driver)

View File

@ -15,7 +15,7 @@ Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
--- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
+++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
@@ -1539,8 +1539,11 @@ static int mmal_init(struct bm2835_mmal_
@@ -1552,8 +1552,11 @@ static int mmal_init(struct bm2835_mmal_
struct vchiq_mmal_component *camera;
ret = vchiq_mmal_init(&dev->instance);
@ -28,7 +28,7 @@ Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
/* get the camera component ready */
ret = vchiq_mmal_component_init(dev->instance, "ril.camera",
@@ -1549,7 +1552,9 @@ static int mmal_init(struct bm2835_mmal_
@@ -1562,7 +1565,9 @@ static int mmal_init(struct bm2835_mmal_
goto unreg_mmal;
camera = dev->component[MMAL_COMPONENT_CAMERA];
@ -39,7 +39,7 @@ Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
ret = -EINVAL;
goto unreg_camera;
}
@@ -1557,8 +1562,11 @@ static int mmal_init(struct bm2835_mmal_
@@ -1570,8 +1575,11 @@ static int mmal_init(struct bm2835_mmal_
ret = set_camera_parameters(dev->instance,
camera,
dev);
@ -52,7 +52,7 @@ Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
/* There was an error in the firmware that meant the camera component
* produced BGR instead of RGB.
@@ -1647,8 +1655,8 @@ static int mmal_init(struct bm2835_mmal_
@@ -1660,8 +1668,8 @@ static int mmal_init(struct bm2835_mmal_
if (dev->component[MMAL_COMPONENT_PREVIEW]->inputs < 1) {
ret = -EINVAL;
@ -63,7 +63,7 @@ Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
goto unreg_preview;
}
@@ -1661,8 +1669,8 @@ static int mmal_init(struct bm2835_mmal_
@@ -1674,8 +1682,8 @@ static int mmal_init(struct bm2835_mmal_
if (dev->component[MMAL_COMPONENT_IMAGE_ENCODE]->inputs < 1) {
ret = -EINVAL;
@ -74,7 +74,7 @@ Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
1);
goto unreg_image_encoder;
}
@@ -1676,8 +1684,8 @@ static int mmal_init(struct bm2835_mmal_
@@ -1689,8 +1697,8 @@ static int mmal_init(struct bm2835_mmal_
if (dev->component[MMAL_COMPONENT_VIDEO_ENCODE]->inputs < 1) {
ret = -EINVAL;
@ -85,7 +85,7 @@ Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
1);
goto unreg_vid_encoder;
}
@@ -1706,8 +1714,11 @@ static int mmal_init(struct bm2835_mmal_
@@ -1719,8 +1727,11 @@ static int mmal_init(struct bm2835_mmal_
sizeof(enable));
}
ret = bm2835_mmal_set_all_camera_controls(dev);
@ -98,7 +98,7 @@ Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
return 0;
@@ -1867,21 +1878,29 @@ static int bcm2835_mmal_probe(struct pla
@@ -1880,21 +1891,29 @@ static int bcm2835_mmal_probe(struct pla
snprintf(dev->v4l2_dev.name, sizeof(dev->v4l2_dev.name),
"%s", BM2835_MMAL_MODULE_NAME);
ret = v4l2_device_register(NULL, &dev->v4l2_dev);
@ -132,7 +132,7 @@ Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
/* initialize queue */
q = &dev->capture.vb_vidq;
memset(q, 0, sizeof(*q));
@@ -1899,16 +1918,19 @@ static int bcm2835_mmal_probe(struct pla
@@ -1912,16 +1931,19 @@ static int bcm2835_mmal_probe(struct pla
/* initialise video devices */
ret = bm2835_mmal_init_device(dev, &dev->vdev);
@ -155,7 +155,7 @@ Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
goto unreg_dev;
}
@@ -1932,8 +1954,6 @@ cleanup_gdev:
@@ -1945,8 +1967,6 @@ cleanup_gdev:
bcm2835_cleanup_instance(gdev[i]);
gdev[i] = NULL;
}

View File

@ -16,7 +16,7 @@ Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
--- a/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c
+++ b/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c
@@ -1624,8 +1624,11 @@ int vchiq_mmal_component_init(struct vch
@@ -1620,8 +1620,11 @@ int vchiq_mmal_component_init(struct vch
component = &instance->component[instance->component_idx];
ret = create_component(instance, component, name);

View File

@ -16,7 +16,7 @@ Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
--- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
+++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
@@ -1847,6 +1847,12 @@ static int bcm2835_mmal_probe(struct pla
@@ -1860,6 +1860,12 @@ static int bcm2835_mmal_probe(struct pla
num_cameras = get_num_cameras(instance,
resolutions,
MAX_BCM2835_CAMERAS);
@ -29,7 +29,7 @@ Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
if (num_cameras > MAX_BCM2835_CAMERAS)
num_cameras = MAX_BCM2835_CAMERAS;
@@ -1955,6 +1961,9 @@ cleanup_gdev:
@@ -1968,6 +1974,9 @@ cleanup_gdev:
gdev[i] = NULL;
}

View File

@ -32,7 +32,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
/* mmal instance */
struct vchiq_mmal_instance *instance;
/* mmal port */
@@ -167,6 +169,9 @@ struct vchiq_mmal_instance {
@@ -168,6 +170,9 @@ struct vchiq_mmal_instance {
/* component to use next */
int component_idx;
struct vchiq_mmal_component component[VCHIQ_MMAL_MAX_COMPONENTS];
@ -42,7 +42,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
};
static struct mmal_msg_context *
@@ -248,7 +253,44 @@ static void buffer_work_cb(struct work_s
@@ -251,7 +256,44 @@ static void buffer_work_cb(struct work_s
msg_context->u.bulk.mmal_flags,
msg_context->u.bulk.dts,
msg_context->u.bulk.pts);
@ -87,7 +87,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
}
/* enqueue a bulk receive for a given message context */
@@ -257,7 +299,6 @@ static int bulk_receive(struct vchiq_mma
@@ -260,7 +302,6 @@ static int bulk_receive(struct vchiq_mma
struct mmal_msg_context *msg_context)
{
unsigned long rd_len;
@ -95,7 +95,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
rd_len = msg->u.buffer_from_host.buffer_header.length;
@@ -293,45 +334,10 @@ static int bulk_receive(struct vchiq_mma
@@ -294,45 +335,10 @@ static int bulk_receive(struct vchiq_mma
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;
@ -144,16 +144,16 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
}
/* data in message, memcpy from packet into output buffer */
@@ -379,6 +385,8 @@ buffer_from_host(struct vchiq_mmal_insta
@@ -380,6 +386,8 @@ buffer_from_host(struct vchiq_mmal_insta
/* initialise work structure ready to schedule callback */
INIT_WORK(&msg_context->u.bulk.work, buffer_work_cb);
+ INIT_WORK(&msg_context->u.bulk.buffer_to_host_work,
+ buffer_to_host_work_cb);
/* prep the buffer from host message */
memset(&m, 0xbc, sizeof(m)); /* just to make debug clearer */
@@ -459,7 +467,7 @@ static void buffer_to_host_cb(struct vch
atomic_inc(&port->buffers_with_vpu);
@@ -465,7 +473,7 @@ static void buffer_to_host_cb(struct vch
if (msg->u.buffer_from_host.buffer_header.flags &
MMAL_BUFFER_HEADER_FLAG_EOS) {
msg_context->u.bulk.status =
@ -162,7 +162,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
if (msg_context->u.bulk.status == 0)
return; /* successful bulk submission, bulk
* completion will trigger callback
@@ -1793,6 +1801,9 @@ int vchiq_mmal_finalise(struct vchiq_mma
@@ -1789,6 +1797,9 @@ int vchiq_mmal_finalise(struct vchiq_mma
mutex_unlock(&instance->vchiq_mutex);
@ -172,7 +172,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
vfree(instance->bulk_scratch);
idr_destroy(&instance->context_map);
@@ -1862,6 +1873,11 @@ int vchiq_mmal_init(struct vchiq_mmal_in
@@ -1858,6 +1869,11 @@ int vchiq_mmal_init(struct vchiq_mmal_in
params.callback_param = instance;
@ -184,7 +184,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
status = vchi_service_open(vchi_instance, &params, &instance->handle);
if (status) {
pr_err("Failed to open VCHI service connection (status=%d)\n",
@@ -1876,8 +1892,9 @@ int vchiq_mmal_init(struct vchiq_mmal_in
@@ -1872,8 +1888,9 @@ int vchiq_mmal_init(struct vchiq_mmal_in
return 0;
err_close_services:

View File

@ -20,7 +20,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
--- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
+++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
@@ -360,8 +360,13 @@ static void buffer_cb(struct vchiq_mmal_
@@ -363,8 +363,13 @@ static void buffer_cb(struct vchiq_mmal_
}
} else {
if (dev->capture.frame_count) {
@ -36,7 +36,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
ktime_t timestamp;
s64 runtime_us = pts -
dev->capture.vc_start_timestamp;
@@ -374,10 +379,28 @@ static void buffer_cb(struct vchiq_mmal_
@@ -377,10 +382,28 @@ static void buffer_cb(struct vchiq_mmal_
ktime_to_ns(timestamp));
buf->vb.vb2_buf.timestamp = ktime_to_ns(timestamp);
} else {
@ -66,7 +66,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
vb2_buffer_done(&buf->vb.vb2_buf, VB2_BUF_STATE_DONE);
if (mmal_flags & MMAL_BUFFER_HEADER_FLAG_EOS &&
@@ -543,6 +566,7 @@ static int start_streaming(struct vb2_qu
@@ -546,6 +569,7 @@ static int start_streaming(struct vb2_qu
dev->capture.vc_start_timestamp, parameter_size);
dev->capture.kernel_start_ts = ktime_get();

View File

@ -13,7 +13,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
--- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
+++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
@@ -398,6 +398,9 @@ static void buffer_cb(struct vchiq_mmal_
@@ -401,6 +401,9 @@ static void buffer_cb(struct vchiq_mmal_
dev->capture.last_timestamp = buf->vb.vb2_buf.timestamp;
vb2_set_plane_payload(&buf->vb.vb2_buf, 0, length);

View File

@ -24,10 +24,10 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
+
+ if (length == 0) {
/* stream ended */
if (buf) {
/* this should only ever happen if the port is
@@ -358,71 +360,72 @@ static void buffer_cb(struct vchiq_mmal_
/* signal frame completion */
if (dev->capture.frame_count) {
/* empty buffer whilst capturing - expected to be an
@@ -361,71 +363,72 @@ static void buffer_cb(struct vchiq_mmal_
vb2_buffer_done(&buf->vb.vb2_buf, VB2_BUF_STATE_ERROR);
complete(&dev->capture.frame_cmplt);
}
- } else {
@ -158,7 +158,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
}
static int enable_camera(struct bm2835_mmal_dev *dev)
@@ -802,27 +805,29 @@ static int vidioc_overlay(struct file *f
@@ -815,27 +818,29 @@ static int vidioc_overlay(struct file *f
ret = vchiq_mmal_port_set_format(dev->instance, src);
if (ret < 0)

View File

@ -152,7 +152,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
}
static void buffer_cb(struct vchiq_mmal_instance *instance,
@@ -436,7 +436,7 @@ static int enable_camera(struct bm2835_m
@@ -439,7 +439,7 @@ static int enable_camera(struct bm2835_m
if (!dev->camera_use_count) {
ret = vchiq_mmal_port_parameter_set(
dev->instance,
@ -161,7 +161,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
MMAL_PARAMETER_CAMERA_NUM, &dev->camera_num,
sizeof(dev->camera_num));
if (ret < 0) {
@@ -447,7 +447,7 @@ static int enable_camera(struct bm2835_m
@@ -450,7 +450,7 @@ static int enable_camera(struct bm2835_m
ret = vchiq_mmal_component_enable(
dev->instance,
@ -170,7 +170,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
if (ret < 0) {
v4l2_err(&dev->v4l2_dev,
"Failed enabling camera, ret %d\n", ret);
@@ -479,7 +479,7 @@ static int disable_camera(struct bm2835_
@@ -482,7 +482,7 @@ static int disable_camera(struct bm2835_
ret =
vchiq_mmal_component_disable(
dev->instance,
@ -179,7 +179,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
if (ret < 0) {
v4l2_err(&dev->v4l2_dev,
"Failed disabling camera, ret %d\n", ret);
@@ -487,7 +487,7 @@ static int disable_camera(struct bm2835_
@@ -490,7 +490,7 @@ static int disable_camera(struct bm2835_
}
vchiq_mmal_port_parameter_set(
dev->instance,
@ -188,7 +188,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
MMAL_PARAMETER_CAMERA_NUM, &i,
sizeof(i));
}
@@ -539,7 +539,7 @@ static int start_streaming(struct vb2_qu
@@ -542,7 +542,7 @@ static int start_streaming(struct vb2_qu
/* if the preview is not already running, wait for a few frames for AGC
* to settle down.
*/
@ -197,7 +197,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
msleep(300);
/* enable the connection from camera to encoder (if applicable) */
@@ -762,9 +762,9 @@ static int vidioc_s_fmt_vid_overlay(stru
@@ -775,9 +775,9 @@ static int vidioc_s_fmt_vid_overlay(stru
vidioc_try_fmt_vid_overlay(file, priv, f);
dev->overlay = f->fmt.win;
@ -209,7 +209,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
}
return 0;
@@ -777,13 +777,13 @@ static int vidioc_overlay(struct file *f
@@ -790,13 +790,13 @@ static int vidioc_overlay(struct file *f
struct vchiq_mmal_port *src;
struct vchiq_mmal_port *dst;
@ -227,7 +227,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
if (!on) {
/* disconnect preview ports and disable component */
@@ -795,14 +795,14 @@ static int vidioc_overlay(struct file *f
@@ -808,14 +808,14 @@ static int vidioc_overlay(struct file *f
if (ret >= 0)
ret = vchiq_mmal_component_disable(
dev->instance,
@ -244,7 +244,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
ret = vchiq_mmal_port_set_format(dev->instance, src);
if (ret < 0)
@@ -819,7 +819,7 @@ static int vidioc_overlay(struct file *f
@@ -832,7 +832,7 @@ static int vidioc_overlay(struct file *f
ret = vchiq_mmal_component_enable(
dev->instance,
@ -253,7 +253,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
if (ret < 0)
return ret;
@@ -840,8 +840,8 @@ static int vidioc_g_fbuf(struct file *fi
@@ -853,8 +853,8 @@ static int vidioc_g_fbuf(struct file *fi
*/
struct bm2835_mmal_dev *dev = video_drvdata(file);
struct vchiq_mmal_port *preview_port =
@ -264,7 +264,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
a->capability = V4L2_FBUF_CAP_EXTERNOVERLAY |
V4L2_FBUF_CAP_GLOBAL_ALPHA;
@@ -1044,31 +1044,31 @@ static int mmal_setup_components(struct
@@ -1057,31 +1057,31 @@ static int mmal_setup_components(struct
}
/* format dependent port setup */
switch (mfmt->mmal_component) {
@ -311,7 +311,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
break;
default:
break;
@@ -1110,13 +1110,12 @@ static int mmal_setup_components(struct
@@ -1123,13 +1123,12 @@ static int mmal_setup_components(struct
if (!ret
&& camera_port ==
@ -329,7 +329,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
/* Preview and encode ports need to match on resolution */
if (overlay_enabled) {
/* Need to disable the overlay before we can update
@@ -1147,7 +1146,7 @@ static int mmal_setup_components(struct
@@ -1160,7 +1159,7 @@ static int mmal_setup_components(struct
ret = vchiq_mmal_port_connect_tunnel(
dev->instance,
preview_port,
@ -338,7 +338,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
if (!ret)
ret = vchiq_mmal_port_enable(dev->instance,
preview_port,
@@ -1201,11 +1200,11 @@ static int mmal_setup_components(struct
@@ -1214,11 +1213,11 @@ static int mmal_setup_components(struct
port->format.encoding_variant = 0;
/* Set any encoding specific parameters */
switch (mfmt->mmal_component) {
@ -352,7 +352,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
/* Could set EXIF parameters here */
break;
default:
@@ -1580,14 +1579,14 @@ static int mmal_init(struct bm2835_mmal_
@@ -1593,14 +1592,14 @@ static int mmal_init(struct bm2835_mmal_
/* get the camera component ready */
ret = vchiq_mmal_component_init(dev->instance, "ril.camera",
@ -371,7 +371,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
ret = -EINVAL;
goto unreg_camera;
}
@@ -1609,7 +1608,7 @@ static int mmal_init(struct bm2835_mmal_
@@ -1622,7 +1621,7 @@ static int mmal_init(struct bm2835_mmal_
dev->rgb_bgr_swapped = true;
param_size = sizeof(supported_encodings);
ret = vchiq_mmal_port_parameter_get(dev->instance,
@ -380,7 +380,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
MMAL_PARAMETER_SUPPORTED_ENCODINGS,
&supported_encodings,
&param_size);
@@ -1630,7 +1629,7 @@ static int mmal_init(struct bm2835_mmal_
@@ -1643,7 +1642,7 @@ static int mmal_init(struct bm2835_mmal_
}
}
}
@ -389,7 +389,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
format->encoding = MMAL_ENCODING_OPAQUE;
format->encoding_variant = MMAL_ENCODING_I420;
@@ -1644,7 +1643,7 @@ static int mmal_init(struct bm2835_mmal_
@@ -1657,7 +1656,7 @@ static int mmal_init(struct bm2835_mmal_
format->es->video.frame_rate.num = 0; /* Rely on fps_range */
format->es->video.frame_rate.den = 1;
@ -398,7 +398,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
format->encoding = MMAL_ENCODING_OPAQUE;
format->encoding_variant = MMAL_ENCODING_I420;
@@ -1658,7 +1657,7 @@ static int mmal_init(struct bm2835_mmal_
@@ -1671,7 +1670,7 @@ static int mmal_init(struct bm2835_mmal_
format->es->video.frame_rate.num = 0; /* Rely on fps_range */
format->es->video.frame_rate.den = 1;
@ -407,7 +407,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
format->encoding = MMAL_ENCODING_OPAQUE;
@@ -1682,28 +1681,28 @@ static int mmal_init(struct bm2835_mmal_
@@ -1695,28 +1694,28 @@ static int mmal_init(struct bm2835_mmal_
/* get the preview component ready */
ret = vchiq_mmal_component_init(
dev->instance, "ril.video_render",
@ -442,7 +442,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
1);
goto unreg_image_encoder;
}
@@ -1711,21 +1710,21 @@ static int mmal_init(struct bm2835_mmal_
@@ -1724,21 +1723,21 @@ static int mmal_init(struct bm2835_mmal_
/* get the video encoder component ready */
ret = vchiq_mmal_component_init(dev->instance, "ril.video_encode",
&dev->
@ -468,7 +468,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
encoder_port->format.encoding = MMAL_ENCODING_H264;
ret = vchiq_mmal_port_set_format(dev->instance,
encoder_port);
@@ -1736,12 +1735,12 @@ static int mmal_init(struct bm2835_mmal_
@@ -1749,12 +1748,12 @@ static int mmal_init(struct bm2835_mmal_
vchiq_mmal_port_parameter_set(
dev->instance,
@ -483,7 +483,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
MMAL_PARAMETER_MINIMISE_FRAGMENTATION,
&enable,
sizeof(enable));
@@ -1759,23 +1758,23 @@ unreg_vid_encoder:
@@ -1772,23 +1771,23 @@ unreg_vid_encoder:
pr_err("Cleanup: Destroy video encoder\n");
vchiq_mmal_component_finalise(
dev->instance,
@ -511,7 +511,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
unreg_mmal:
vchiq_mmal_finalise(dev->instance);
@@ -1831,21 +1830,21 @@ static void bcm2835_cleanup_instance(str
@@ -1844,21 +1843,21 @@ static void bcm2835_cleanup_instance(str
dev->capture.encode_component);
}
vchiq_mmal_component_disable(dev->instance,

View File

@ -23,7 +23,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
}
static void buffer_cb(struct vchiq_mmal_instance *instance,
@@ -782,8 +781,7 @@ static int vidioc_overlay(struct file *f
@@ -795,8 +794,7 @@ static int vidioc_overlay(struct file *f
return 0; /* already in requested state */
src =
@ -33,7 +33,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
if (!on) {
/* disconnect preview ports and disable component */
@@ -840,8 +838,7 @@ static int vidioc_g_fbuf(struct file *fi
@@ -853,8 +851,7 @@ static int vidioc_g_fbuf(struct file *fi
*/
struct bm2835_mmal_dev *dev = video_drvdata(file);
struct vchiq_mmal_port *preview_port =
@ -43,7 +43,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
a->capability = V4L2_FBUF_CAP_EXTERNOVERLAY |
V4L2_FBUF_CAP_GLOBAL_ALPHA;
@@ -1033,8 +1030,7 @@ static int mmal_setup_components(struct
@@ -1046,8 +1043,7 @@ static int mmal_setup_components(struct
dev->capture.camera_port, NULL);
dev->capture.camera_port = NULL;
ret = vchiq_mmal_component_disable(dev->instance,
@ -53,7 +53,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
if (ret)
v4l2_err(&dev->v4l2_dev,
"Failed to disable encode component %d\n",
@@ -1049,26 +1045,22 @@ static int mmal_setup_components(struct
@@ -1062,26 +1058,22 @@ static int mmal_setup_components(struct
if (f->fmt.pix.width <= max_video_width
&& f->fmt.pix.height <= max_video_height)
camera_port = port =
@ -84,7 +84,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
break;
default:
break;
@@ -1110,8 +1102,7 @@ static int mmal_setup_components(struct
@@ -1123,8 +1115,7 @@ static int mmal_setup_components(struct
if (!ret
&& camera_port ==
@ -94,7 +94,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
bool overlay_enabled =
!!dev->component[COMP_PREVIEW]->enabled;
struct vchiq_mmal_port *preview_port =
@@ -1248,9 +1239,8 @@ static int mmal_setup_components(struct
@@ -1261,9 +1252,8 @@ static int mmal_setup_components(struct
port->current_buffer.size);
port->current_buffer.size =
(f->fmt.pix.sizeimage <
@ -106,7 +106,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
}
v4l2_dbg(1, bcm2835_v4l2_debug,
&dev->v4l2_dev,
@@ -1709,8 +1699,7 @@ static int mmal_init(struct bm2835_mmal_
@@ -1722,8 +1712,7 @@ static int mmal_init(struct bm2835_mmal_
/* get the video encoder component ready */
ret = vchiq_mmal_component_init(dev->instance, "ril.video_encode",
@ -116,7 +116,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
if (ret < 0)
goto unreg_image_encoder;
@@ -1833,12 +1822,10 @@ static void bcm2835_cleanup_instance(str
@@ -1846,12 +1835,10 @@ static void bcm2835_cleanup_instance(str
dev->component[COMP_CAMERA]);
vchiq_mmal_component_finalise(dev->instance,

View File

@ -14,7 +14,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
--- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
+++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
@@ -566,10 +566,11 @@ static int start_streaming(struct vb2_qu
@@ -569,10 +569,11 @@ static int start_streaming(struct vb2_qu
/* Flag to indicate just to rely on kernel timestamps */
dev->capture.vc_start_timestamp = -1;
@ -42,7 +42,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
static int ctrl_set_flicker_avoidance(struct bm2835_mmal_dev *dev,
--- a/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c
+++ b/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c
@@ -1262,9 +1262,10 @@ static int port_parameter_get(struct vch
@@ -1268,9 +1268,10 @@ static int port_parameter_get(struct vch
memcpy(value, &rmsg->u.port_parameter_get_reply.value,
*value_size);
*value_size = rmsg->u.port_parameter_get_reply.size;

View File

@ -14,7 +14,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
--- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
+++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
@@ -542,8 +542,8 @@ static int start_streaming(struct vb2_qu
@@ -545,8 +545,8 @@ static int start_streaming(struct vb2_qu
msleep(300);
/* enable the connection from camera to encoder (if applicable) */
@ -25,7 +25,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
ret = vchiq_mmal_port_enable(dev->instance,
dev->capture.camera_port, NULL);
if (ret) {
@@ -1043,8 +1043,8 @@ static int mmal_setup_components(struct
@@ -1056,8 +1056,8 @@ static int mmal_setup_components(struct
switch (mfmt->mmal_component) {
case COMP_CAMERA:
/* Make a further decision on port based on resolution */
@ -36,7 +36,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
camera_port = port =
&dev->component[COMP_CAMERA]->output[CAM_PORT_VIDEO];
else
@@ -1101,8 +1101,8 @@ static int mmal_setup_components(struct
@@ -1114,8 +1114,8 @@ static int mmal_setup_components(struct
ret = vchiq_mmal_port_set_format(dev->instance, camera_port);

View File

@ -17,7 +17,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
--- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
+++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c
@@ -412,8 +412,7 @@ static void buffer_cb(struct vchiq_mmal_
@@ -415,8 +415,7 @@ static void buffer_cb(struct vchiq_mmal_
buf->vb.flags |= V4L2_BUF_FLAG_KEYFRAME;
v4l2_dbg(1, bcm2835_v4l2_debug, &dev->v4l2_dev,
@ -27,7 +27,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
vb2_buffer_done(&buf->vb.vb2_buf, VB2_BUF_STATE_DONE);
if (mmal_flags & MMAL_BUFFER_HEADER_FLAG_EOS &&
@@ -581,8 +580,8 @@ static int start_streaming(struct vb2_qu
@@ -584,8 +583,8 @@ static int start_streaming(struct vb2_qu
vchiq_mmal_port_enable(dev->instance, dev->capture.port, buffer_cb);
if (ret) {
v4l2_err(&dev->v4l2_dev,
@ -38,7 +38,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
vchiq_mmal_port_disable(dev->instance,
dev->capture.camera_port);
@@ -978,8 +977,7 @@ static int vidioc_try_fmt_vid_cap(struct
@@ -991,8 +990,7 @@ static int vidioc_try_fmt_vid_cap(struct
f->fmt.pix.bytesperline =
(f->fmt.pix.bytesperline + align_mask) & ~align_mask;
v4l2_dbg(1, bcm2835_v4l2_debug, &dev->v4l2_dev,
@ -48,7 +48,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
f->fmt.pix.bytesperline, align_mask);
}
@@ -1325,7 +1323,7 @@ static int vidioc_s_fmt_vid_cap(struct f
@@ -1338,7 +1336,7 @@ static int vidioc_s_fmt_vid_cap(struct f
}
static int vidioc_enum_framesizes(struct file *file, void *fh,
@ -104,7 +104,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
case MMAL_CONTROL_TYPE_CLUSTER:
--- a/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c
+++ b/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.c
@@ -645,7 +645,7 @@ static int send_synchronous_mmal_msg(str
@@ -651,7 +651,7 @@ static int send_synchronous_mmal_msg(str
if (payload_len >
(MMAL_MSG_MAX_SIZE - sizeof(struct mmal_msg_header))) {
pr_err("payload length %d exceeds max:%d\n", payload_len,
@ -115,7 +115,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
}
--- a/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.h
+++ b/drivers/staging/vc04_services/bcm2835-camera/mmal-vchiq.h
@@ -128,7 +128,7 @@ int vchiq_mmal_port_enable(
@@ -131,7 +131,7 @@ int vchiq_mmal_port_enable(
* disable a port will dequeue any pending buffers
*/
int vchiq_mmal_port_disable(struct vchiq_mmal_instance *instance,
@ -124,7 +124,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
int vchiq_mmal_port_parameter_set(struct vchiq_mmal_instance *instance,
struct vchiq_mmal_port *port,
@@ -146,8 +146,8 @@ int vchiq_mmal_port_set_format(struct vc
@@ -149,8 +149,8 @@ int vchiq_mmal_port_set_format(struct vc
struct vchiq_mmal_port *port);
int vchiq_mmal_port_connect_tunnel(struct vchiq_mmal_instance *instance,

View File

@ -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 */

View File

@ -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)

View File

@ -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);

View File

@ -30,16 +30,16 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
/*#define FULL_MSG_DUMP 1*/
@@ -173,8 +176,6 @@ struct vchiq_mmal_instance {
struct idr context_map;
spinlock_t context_map_lock;
@@ -174,8 +177,6 @@ struct vchiq_mmal_instance {
/* protect accesses to context_map */
struct mutex context_map_lock;
- /* component to use next */
- int component_idx;
struct vchiq_mmal_component component[VCHIQ_MMAL_MAX_COMPONENTS];
/* ordered workqueue to process all bulk operations */
@@ -1631,18 +1632,24 @@ int vchiq_mmal_component_init(struct vch
@@ -1632,18 +1633,24 @@ int vchiq_mmal_component_init(struct vch
{
int ret;
int idx; /* port index */
@ -68,7 +68,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
ret = create_component(instance, component, name);
if (ret < 0) {
pr_err("%s: failed to create component %d (Not enough GPU mem?)\n",
@@ -1693,8 +1700,6 @@ int vchiq_mmal_component_init(struct vch
@@ -1694,8 +1701,6 @@ int vchiq_mmal_component_init(struct vch
goto release_component;
}
@ -77,7 +77,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
*component_out = component;
mutex_unlock(&instance->vchiq_mutex);
@@ -1704,6 +1709,8 @@ int vchiq_mmal_component_init(struct vch
@@ -1705,6 +1710,8 @@ int vchiq_mmal_component_init(struct vch
release_component:
destroy_component(instance, component);
unlock:
@ -86,7 +86,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
mutex_unlock(&instance->vchiq_mutex);
return ret;
@@ -1726,6 +1733,8 @@ int vchiq_mmal_component_finalise(struct
@@ -1727,6 +1734,8 @@ int vchiq_mmal_component_finalise(struct
ret = destroy_component(instance, component);

View File

@ -14,7 +14,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
--- a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
+++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
@@ -860,9 +860,9 @@ static int port_info_get(struct vchiq_mm
@@ -861,9 +861,9 @@ static int port_info_get(struct vchiq_mm
goto release_msg;
if (rmsg->u.port_info_get_reply.port.is_enabled == 0)
@ -26,7 +26,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
/* copy the values out of the message */
port->handle = rmsg->u.port_info_get_reply.port_handle;
@@ -1299,7 +1299,7 @@ static int port_disable(struct vchiq_mma
@@ -1300,7 +1300,7 @@ static int port_disable(struct vchiq_mma
if (!port->enabled)
return 0;
@ -35,7 +35,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
ret = port_action_port(instance, port,
MMAL_MSG_PORT_ACTION_TYPE_DISABLE);
@@ -1351,7 +1351,7 @@ static int port_enable(struct vchiq_mmal
@@ -1352,7 +1352,7 @@ static int port_enable(struct vchiq_mmal
if (ret)
goto done;
@ -44,7 +44,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
if (port->buffer_cb) {
/* send buffer headers to videocore */
@@ -1523,7 +1523,7 @@ int vchiq_mmal_port_connect_tunnel(struc
@@ -1524,7 +1524,7 @@ int vchiq_mmal_port_connect_tunnel(struc
pr_err("failed disconnecting src port\n");
goto release_unlock;
}
@ -53,7 +53,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
src->connected = NULL;
}
@@ -1759,7 +1759,7 @@ int vchiq_mmal_component_enable(struct v
@@ -1760,7 +1760,7 @@ int vchiq_mmal_component_enable(struct v
ret = enable_component(instance, component);
if (ret == 0)
@ -62,7 +62,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
mutex_unlock(&instance->vchiq_mutex);
@@ -1785,7 +1785,7 @@ int vchiq_mmal_component_disable(struct
@@ -1786,7 +1786,7 @@ int vchiq_mmal_component_disable(struct
ret = disable_component(instance, component);
if (ret == 0)

View File

@ -27,7 +27,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
/*#define FULL_MSG_DUMP 1*/
#ifdef DEBUG
@@ -691,7 +697,7 @@ static int send_synchronous_mmal_msg(str
@@ -692,7 +698,7 @@ static int send_synchronous_mmal_msg(str
}
timeout = wait_for_completion_timeout(&msg_context->u.sync.cmplt,

View File

@ -216,7 +216,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
/* */
--- a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
+++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
@@ -258,17 +258,25 @@ static void buffer_work_cb(struct work_s
@@ -259,17 +259,25 @@ static void buffer_work_cb(struct work_s
{
struct mmal_msg_context *msg_context =
container_of(work, struct mmal_msg_context, u.bulk.work);
@ -247,7 +247,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
}
/* workqueue scheduled callback to handle receiving buffers
@@ -1326,11 +1334,14 @@ static int port_disable(struct vchiq_mma
@@ -1327,11 +1335,14 @@ static int port_disable(struct vchiq_mma
mmalbuf = list_entry(buf_head, struct mmal_buffer,
list);
list_del(buf_head);

View File

@ -83,7 +83,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
int status; /* context status */
@@ -237,18 +239,6 @@ release_msg_context(struct mmal_msg_cont
@@ -238,18 +240,6 @@ release_msg_context(struct mmal_msg_cont
kfree(msg_context);
}
@ -102,7 +102,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
/* workqueue scheduled callback
*
* we do this because it is important we do not call any other vchiq
@@ -270,13 +260,18 @@ static void buffer_work_cb(struct work_s
@@ -271,13 +261,18 @@ static void buffer_work_cb(struct work_s
buffer->mmal_flags = msg_context->u.bulk.mmal_flags;
buffer->dts = msg_context->u.bulk.dts;
buffer->pts = msg_context->u.bulk.pts;
@ -122,7 +122,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
}
/* workqueue scheduled callback to handle receiving buffers
@@ -355,6 +350,7 @@ static int bulk_receive(struct vchiq_mma
@@ -356,6 +351,7 @@ static int bulk_receive(struct vchiq_mma
msg_context->u.bulk.buffer_used = rd_len;
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;
@ -130,7 +130,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
queue_work(msg_context->instance->bulk_wq,
&msg_context->u.bulk.buffer_to_host_work);
@@ -456,6 +452,103 @@ buffer_from_host(struct vchiq_mmal_insta
@@ -457,6 +453,103 @@ buffer_from_host(struct vchiq_mmal_insta
return ret;
}
@ -234,7 +234,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
/* deals with receipt of buffer to host message */
static void buffer_to_host_cb(struct vchiq_mmal_instance *instance,
struct mmal_msg *msg, u32 msg_len)
@@ -1339,6 +1432,7 @@ static int port_disable(struct vchiq_mma
@@ -1340,6 +1433,7 @@ static int port_disable(struct vchiq_mma
mmalbuf->mmal_flags = 0;
mmalbuf->dts = MMAL_TIME_UNKNOWN;
mmalbuf->pts = MMAL_TIME_UNKNOWN;
@ -242,7 +242,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
port->buffer_cb(instance,
port, 0, mmalbuf);
}
@@ -1640,6 +1734,43 @@ int mmal_vchi_buffer_cleanup(struct mmal
@@ -1641,6 +1735,43 @@ int mmal_vchi_buffer_cleanup(struct mmal
}
EXPORT_SYMBOL_GPL(mmal_vchi_buffer_cleanup);
@ -286,7 +286,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
/* Initialise a mmal component and its ports
*
*/
@@ -1683,6 +1814,7 @@ int vchiq_mmal_component_init(struct vch
@@ -1684,6 +1815,7 @@ int vchiq_mmal_component_init(struct vch
ret = port_info_get(instance, &component->control);
if (ret < 0)
goto release_component;
@ -294,7 +294,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
for (idx = 0; idx < component->inputs; idx++) {
component->input[idx].type = MMAL_PORT_TYPE_INPUT;
@@ -1693,6 +1825,7 @@ int vchiq_mmal_component_init(struct vch
@@ -1694,6 +1826,7 @@ int vchiq_mmal_component_init(struct vch
ret = port_info_get(instance, &component->input[idx]);
if (ret < 0)
goto release_component;
@ -302,7 +302,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
}
for (idx = 0; idx < component->outputs; idx++) {
@@ -1704,6 +1837,7 @@ int vchiq_mmal_component_init(struct vch
@@ -1705,6 +1838,7 @@ int vchiq_mmal_component_init(struct vch
ret = port_info_get(instance, &component->output[idx]);
if (ret < 0)
goto release_component;
@ -310,7 +310,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
}
for (idx = 0; idx < component->clocks; idx++) {
@@ -1715,6 +1849,7 @@ int vchiq_mmal_component_init(struct vch
@@ -1716,6 +1850,7 @@ int vchiq_mmal_component_init(struct vch
ret = port_info_get(instance, &component->clock[idx]);
if (ret < 0)
goto release_component;
@ -318,7 +318,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
}
*component_out = component;
@@ -1740,7 +1875,7 @@ EXPORT_SYMBOL_GPL(vchiq_mmal_component_i
@@ -1741,7 +1876,7 @@ EXPORT_SYMBOL_GPL(vchiq_mmal_component_i
int vchiq_mmal_component_finalise(struct vchiq_mmal_instance *instance,
struct vchiq_mmal_component *component)
{
@ -327,7 +327,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
if (mutex_lock_interruptible(&instance->vchiq_mutex))
return -EINTR;
@@ -1752,6 +1887,13 @@ int vchiq_mmal_component_finalise(struct
@@ -1753,6 +1888,13 @@ int vchiq_mmal_component_finalise(struct
component->in_use = 0;

View File

@ -15,7 +15,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
--- a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
+++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
@@ -427,11 +427,19 @@ buffer_from_host(struct vchiq_mmal_insta
@@ -428,11 +428,19 @@ buffer_from_host(struct vchiq_mmal_insta
m.u.buffer_from_host.buffer_header.data =
(u32)(unsigned long)buf->buffer;
m.u.buffer_from_host.buffer_header.alloc_size = buf->buffer_size;

View File

@ -53,7 +53,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
#define USE_VCHIQ_ARM
#include "interface/vchi/vchi.h"
@@ -424,8 +427,13 @@ buffer_from_host(struct vchiq_mmal_insta
@@ -425,8 +428,13 @@ buffer_from_host(struct vchiq_mmal_insta
/* buffer header */
m.u.buffer_from_host.buffer_header.cmd = 0;
@ -69,7 +69,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
m.u.buffer_from_host.buffer_header.alloc_size = buf->buffer_size;
if (port->type == MMAL_PORT_TYPE_OUTPUT) {
m.u.buffer_from_host.buffer_header.length = 0;
@@ -590,6 +598,22 @@ static void buffer_to_host_cb(struct vch
@@ -591,6 +599,22 @@ static void buffer_to_host_cb(struct vch
msg_context->u.bulk.status = msg->h.status;
@ -92,7 +92,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
} else if (msg->u.buffer_from_host.buffer_header.length == 0) {
/* empty buffer */
if (msg->u.buffer_from_host.buffer_header.flags &
@@ -1537,6 +1561,9 @@ int vchiq_mmal_port_parameter_set(struct
@@ -1538,6 +1562,9 @@ int vchiq_mmal_port_parameter_set(struct
mutex_unlock(&instance->vchiq_mutex);
@ -102,7 +102,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
return ret;
}
EXPORT_SYMBOL_GPL(vchiq_mmal_port_parameter_set);
@@ -1705,6 +1732,31 @@ int vchiq_mmal_submit_buffer(struct vchi
@@ -1706,6 +1733,31 @@ int vchiq_mmal_submit_buffer(struct vchi
unsigned long flags = 0;
int ret;
@ -134,7 +134,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
ret = buffer_from_host(instance, port, buffer);
if (ret == -EINVAL) {
/* Port is disabled. Queue for when it is enabled. */
@@ -1738,6 +1790,16 @@ int mmal_vchi_buffer_cleanup(struct mmal
@@ -1739,6 +1791,16 @@ int mmal_vchi_buffer_cleanup(struct mmal
release_msg_context(msg_context);
buf->msg_context = NULL;

View File

@ -19,7 +19,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
--- a/drivers/media/common/videobuf2/videobuf2-core.c
+++ b/drivers/media/common/videobuf2/videobuf2-core.c
@@ -1847,12 +1847,12 @@ static int __find_plane_by_offset(struct
@@ -1851,12 +1851,12 @@ static int __find_plane_by_offset(struct
return -EINVAL;
}
@ -35,7 +35,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
struct dma_buf *dbuf;
if (q->memory != VB2_MEMORY_MMAP) {
@@ -1902,6 +1902,21 @@ int vb2_core_expbuf(struct vb2_queue *q,
@@ -1906,6 +1906,21 @@ int vb2_core_expbuf(struct vb2_queue *q,
return -EINVAL;
}

View File

@ -36,7 +36,7 @@ Signed-off-by: Tomasz Figa <tfiga@chromium.org>
--- a/drivers/media/common/videobuf2/videobuf2-core.c
+++ b/drivers/media/common/videobuf2/videobuf2-core.c
@@ -550,20 +550,6 @@ bool vb2_buffer_in_use(struct vb2_queue
@@ -554,20 +554,6 @@ bool vb2_buffer_in_use(struct vb2_queue
}
EXPORT_SYMBOL(vb2_buffer_in_use);
@ -57,7 +57,7 @@ Signed-off-by: Tomasz Figa <tfiga@chromium.org>
void vb2_core_querybuf(struct vb2_queue *q, unsigned int index, void *pb)
{
call_void_bufop(q, fill_user_buffer, q->bufs[index], pb);
@@ -675,16 +661,7 @@ int vb2_core_reqbufs(struct vb2_queue *q
@@ -679,16 +665,7 @@ int vb2_core_reqbufs(struct vb2_queue *q
if (*count == 0 || q->num_buffers != 0 ||
(q->memory != VB2_MEMORY_UNKNOWN && q->memory != memory)) {

View File

@ -22,7 +22,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
--- a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
+++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
@@ -472,9 +472,9 @@ buffer_from_host(struct vchiq_mmal_insta
@@ -473,9 +473,9 @@ buffer_from_host(struct vchiq_mmal_insta
static void event_to_host_cb(struct vchiq_mmal_instance *instance,
struct mmal_msg *msg, u32 msg_len)
{
@ -34,7 +34,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
struct vchiq_mmal_port *port = NULL;
struct mmal_msg_context *msg_context;
u32 port_num = msg->u.event_to_host.port_num;
@@ -1073,7 +1073,7 @@ static int create_component(struct vchiq
@@ -1074,7 +1074,7 @@ static int create_component(struct vchiq
/* build component create message */
m.h.type = MMAL_MSG_TYPE_COMPONENT_CREATE;
@ -43,7 +43,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
strncpy(m.u.component_create.name, name,
sizeof(m.u.component_create.name));
@@ -1868,6 +1868,12 @@ int vchiq_mmal_component_init(struct vch
@@ -1869,6 +1869,12 @@ int vchiq_mmal_component_init(struct vch
goto unlock;
}

View File

@ -100,7 +100,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
u32 cmd; /* MMAL command. 0=data. */
--- a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
+++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
@@ -1793,7 +1793,7 @@ int mmal_vchi_buffer_cleanup(struct mmal
@@ -1794,7 +1794,7 @@ int mmal_vchi_buffer_cleanup(struct mmal
if (buf->vcsm_handle) {
int ret;

View File

@ -22,7 +22,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
--- a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
+++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
@@ -1412,11 +1412,12 @@ static int port_parameter_get(struct vch
@@ -1413,11 +1413,12 @@ static int port_parameter_get(struct vch
*/
memcpy(value, &rmsg->u.port_parameter_get_reply.value,
*value_size);

View File

@ -17,7 +17,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
--- a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
+++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
@@ -1400,7 +1400,8 @@ static int port_parameter_get(struct vch
@@ -1401,7 +1401,8 @@ static int port_parameter_get(struct vch
goto release_msg;
}

View File

@ -137,7 +137,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
/* If both ports disabled, then disable the component */
--- a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
+++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
@@ -1784,13 +1784,9 @@ int mmal_vchi_buffer_init(struct vchiq_m
@@ -1785,13 +1785,9 @@ int mmal_vchi_buffer_init(struct vchiq_m
}
EXPORT_SYMBOL_GPL(mmal_vchi_buffer_init);
@ -153,7 +153,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
if (buf->vcsm_handle) {
int ret;
@@ -1802,6 +1798,19 @@ int mmal_vchi_buffer_cleanup(struct mmal
@@ -1803,6 +1799,19 @@ int mmal_vchi_buffer_cleanup(struct mmal
pr_err("%s: vcsm_free failed, ret %d\n", __func__, ret);
buf->vcsm_handle = 0;
}

View File

@ -17,7 +17,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
--- a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
+++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
@@ -1981,6 +1981,8 @@ int vchiq_mmal_component_finalise(struct
@@ -1982,6 +1982,8 @@ int vchiq_mmal_component_finalise(struct
for (idx = 0; idx < component->clocks; idx++)
free_event_context(&component->clock[idx]);

View File

@ -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;

View File

@ -27,7 +27,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.org>
/* Disable rate control for now */
bcmgenet_tdma_ring_writel(priv, index, flow_period_val,
TDMA_FLOW_PERIOD);
@@ -3576,9 +3576,12 @@ static int bcmgenet_probe(struct platfor
@@ -3571,9 +3571,12 @@ static int bcmgenet_probe(struct platfor
netif_set_real_num_rx_queues(priv->dev, priv->hw_params->rx_queues + 1);
/* Set default coalescing parameters */

View File

@ -15,7 +15,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
--- a/drivers/media/common/videobuf2/videobuf2-core.c
+++ b/drivers/media/common/videobuf2/videobuf2-core.c
@@ -550,6 +550,20 @@ bool vb2_buffer_in_use(struct vb2_queue
@@ -554,6 +554,20 @@ bool vb2_buffer_in_use(struct vb2_queue
}
EXPORT_SYMBOL(vb2_buffer_in_use);
@ -36,7 +36,7 @@ Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
void vb2_core_querybuf(struct vb2_queue *q, unsigned int index, void *pb)
{
call_void_bufop(q, fill_user_buffer, q->bufs[index], pb);
@@ -661,7 +675,16 @@ int vb2_core_reqbufs(struct vb2_queue *q
@@ -665,7 +679,16 @@ int vb2_core_reqbufs(struct vb2_queue *q
if (*count == 0 || q->num_buffers != 0 ||
(q->memory != VB2_MEMORY_UNKNOWN && q->memory != memory)) {

View File

@ -92,7 +92,7 @@ Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
============
--- a/drivers/media/common/videobuf2/videobuf2-core.c
+++ b/drivers/media/common/videobuf2/videobuf2-core.c
@@ -680,11 +680,9 @@ int vb2_core_reqbufs(struct vb2_queue *q
@@ -684,11 +684,9 @@ int vb2_core_reqbufs(struct vb2_queue *q
* are not in use and can be freed.
*/
mutex_lock(&q->mmap_lock);

View File

@ -458,7 +458,7 @@
/*
--- a/arch/mips/mm/tlbex.c
+++ b/arch/mips/mm/tlbex.c
@@ -967,6 +967,9 @@ void build_get_pgde32(u32 **p, unsigned
@@ -972,6 +972,9 @@ void build_get_pgde32(u32 **p, unsigned
uasm_i_srl(p, ptr, ptr, SMP_CPUID_PTRSHIFT);
uasm_i_addu(p, ptr, tmp, ptr);
#else
@ -468,7 +468,7 @@
UASM_i_LA_mostly(p, ptr, pgdc);
#endif
uasm_i_mfc0(p, tmp, C0_BADVADDR); /* get faulting address */
@@ -1327,6 +1330,9 @@ static void build_r4000_tlb_refill_handl
@@ -1333,6 +1336,9 @@ static void build_r4000_tlb_refill_handl
#ifdef CONFIG_64BIT
build_get_pmde64(&p, &l, &r, K0, K1); /* get pmd in K1 */
#else
@ -478,7 +478,7 @@
build_get_pgde32(&p, K0, K1); /* get pgd in K1 */
#endif
@@ -1338,6 +1344,9 @@ static void build_r4000_tlb_refill_handl
@@ -1344,6 +1350,9 @@ static void build_r4000_tlb_refill_handl
build_update_entries(&p, K0, K1);
build_tlb_write_entry(&p, &l, &r, tlb_random);
uasm_l_leave(&l, p);
@ -488,7 +488,7 @@
uasm_i_eret(&p); /* return from trap */
}
#ifdef CONFIG_MIPS_HUGE_TLB_SUPPORT
@@ -2028,6 +2037,9 @@ build_r4000_tlbchange_handler_head(u32 *
@@ -2039,6 +2048,9 @@ build_r4000_tlbchange_handler_head(u32 *
#ifdef CONFIG_64BIT
build_get_pmde64(p, l, r, wr.r1, wr.r2); /* get pmd in ptr */
#else
@ -498,7 +498,7 @@
build_get_pgde32(p, wr.r1, wr.r2); /* get pgd in ptr */
#endif
@@ -2074,6 +2086,9 @@ build_r4000_tlbchange_handler_tail(u32 *
@@ -2085,6 +2097,9 @@ build_r4000_tlbchange_handler_tail(u32 *
build_tlb_write_entry(p, l, r, tlb_indexed);
uasm_l_leave(l, *p);
build_restore_work_registers(p);

View File

@ -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>;

View File

@ -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

View File

@ -48,7 +48,7 @@ Reviewed-by: John Gilmore <gnu@toad.com>
#define INADDR_ANY ((unsigned long int) 0x00000000)
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -941,7 +941,7 @@ static int inet_abc_len(__be32 addr)
@@ -949,7 +949,7 @@ static int inet_abc_len(__be32 addr)
{
int rc = -1; /* Something else, probably a multicast. */
@ -57,7 +57,7 @@ Reviewed-by: John Gilmore <gnu@toad.com>
rc = 0;
else {
__u32 haddr = ntohl(addr);
@@ -952,6 +952,8 @@ static int inet_abc_len(__be32 addr)
@@ -960,6 +960,8 @@ static int inet_abc_len(__be32 addr)
rc = 16;
else if (IN_CLASSC(haddr))
rc = 24;

View File

@ -48,7 +48,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
MODULE_AUTHOR("Pablo Neira Ayuso <pablo@netfilter.org>");
--- a/net/netfilter/nft_flow_offload.c
+++ b/net/netfilter/nft_flow_offload.c
@@ -197,47 +197,14 @@ static struct nft_expr_type nft_flow_off
@@ -208,47 +208,14 @@ static struct nft_expr_type nft_flow_off
.owner = THIS_MODULE,
};

View File

@ -25,9 +25,9 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
- rt = (struct rtable *)flow->tuplehash[dir].tuple.dst_cache;
+ rt = (struct rtable *)flow->tuplehash[!dir].tuple.dst_cache;
if (unlikely(nf_flow_exceeds_mtu(skb, flow->tuplehash[dir].tuple.mtu)) &&
(ip_hdr(skb)->frag_off & htons(IP_DF)) != 0)
@@ -465,7 +465,7 @@ nf_flow_offload_ipv6_hook(void *priv, st
if (unlikely(nf_flow_exceeds_mtu(skb, flow->tuplehash[dir].tuple.mtu)))
return NF_ACCEPT;
@@ -464,7 +464,7 @@ nf_flow_offload_ipv6_hook(void *priv, st
dir = tuplehash->tuple.dir;
flow = container_of(tuplehash, struct flow_offload, tuplehash[dir]);
@ -38,7 +38,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
return NF_ACCEPT;
--- a/net/netfilter/nft_flow_offload.c
+++ b/net/netfilter/nft_flow_offload.c
@@ -18,13 +18,11 @@ struct nft_flow_offload {
@@ -17,13 +17,11 @@ struct nft_flow_offload {
struct nft_flowtable *flowtable;
};
@ -56,7 +56,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
struct flowi fl;
memset(&fl, 0, sizeof(fl));
@@ -39,8 +37,21 @@ static int nft_flow_route(const struct n
@@ -38,8 +36,21 @@ static int nft_flow_route(const struct n
break;
}

View File

@ -353,7 +353,6 @@ CONFIG_ARM_GIC_MAX_NR=1
# CONFIG_ARM_UNWIND is not set
# CONFIG_ARM_VIRT_EXT is not set
# CONFIG_AS3935 is not set
# CONFIG_ASIX_PHY is not set
# CONFIG_ASM9260_TIMER is not set
# CONFIG_ASUS_LAPTOP is not set
# CONFIG_ASUS_WIRELESS is not set
@ -427,6 +426,7 @@ CONFIG_ATM_CLIP_NO_ICMP=y
# CONFIG_AX25 is not set
# CONFIG_AX25_DAMA_SLAVE is not set
# CONFIG_AX88796 is not set
# CONFIG_AX88796B is not set
# CONFIG_AXP20X_ADC is not set
# CONFIG_AXP20X_POWER is not set
# CONFIG_AXP288_ADC is not set

View File

@ -91,7 +91,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
#include <linux/mutex.h>
#include <linux/err.h>
#include <linux/of.h>
@@ -3037,3 +3038,5 @@ static int __init regmap_initcall(void)
@@ -3039,3 +3040,5 @@ static int __init regmap_initcall(void)
return 0;
}
postcore_initcall(regmap_initcall);

View File

@ -13,7 +13,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/net/bridge/br_input.c
+++ b/net/bridge/br_input.c
@@ -110,10 +110,14 @@ int br_handle_frame_finish(struct net *n
@@ -108,10 +108,14 @@ int br_handle_frame_finish(struct net *n
}
}

View File

@ -52,7 +52,7 @@
/* For layer 4 checksum field offset. */
#include <linux/tcp.h>
#include <linux/udp.h>
@@ -268,6 +269,7 @@ nf_flow_offload_ip_hook(void *priv, stru
@@ -267,6 +268,7 @@ nf_flow_offload_ip_hook(void *priv, stru
skb->dev = outdev;
nexthop = rt_nexthop(rt, flow->tuplehash[!dir].tuple.src_v4.s_addr);
skb_dst_set_noref(skb, &rt->dst);
@ -60,7 +60,7 @@
neigh_xmit(NEIGH_ARP_TABLE, outdev, &nexthop, skb);
return NF_STOLEN;
@@ -488,6 +490,7 @@ nf_flow_offload_ipv6_hook(void *priv, st
@@ -487,6 +489,7 @@ nf_flow_offload_ipv6_hook(void *priv, st
skb->dev = outdev;
nexthop = rt6_nexthop(rt, &flow->tuplehash[!dir].tuple.src_v6);
skb_dst_set_noref(skb, &rt->dst);

View File

@ -55,7 +55,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
register_qdisc(&pfifo_head_drop_qdisc_ops);
--- a/net/sched/sch_fq_codel.c
+++ b/net/sched/sch_fq_codel.c
@@ -716,7 +716,7 @@ static const struct Qdisc_class_ops fq_c
@@ -714,7 +714,7 @@ static const struct Qdisc_class_ops fq_c
.walk = fq_codel_walk,
};
@ -64,7 +64,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
.cl_ops = &fq_codel_class_ops,
.id = "fq_codel",
.priv_size = sizeof(struct fq_codel_sched_data),
@@ -731,6 +731,7 @@ static struct Qdisc_ops fq_codel_qdisc_o
@@ -729,6 +729,7 @@ static struct Qdisc_ops fq_codel_qdisc_o
.dump_stats = fq_codel_dump_stats,
.owner = THIS_MODULE,
};

View File

@ -15,7 +15,7 @@
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -1506,6 +1506,9 @@ int genphy_update_link(struct phy_device
@@ -1512,6 +1512,9 @@ int genphy_update_link(struct phy_device
{
int status;

View File

@ -221,7 +221,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
if (!root_irq_dir)
--- a/kernel/time/timer_list.c
+++ b/kernel/time/timer_list.c
@@ -374,6 +374,8 @@ static int __init init_timer_list_procfs
@@ -375,6 +375,8 @@ static int __init init_timer_list_procfs
{
struct proc_dir_entry *pe;

View File

@ -45,7 +45,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
#include <uapi/linux/dma-buf.h>
@@ -1158,4 +1159,5 @@ static void __exit dma_buf_deinit(void)
@@ -1159,4 +1160,5 @@ static void __exit dma_buf_deinit(void)
{
dma_buf_uninit_debugfs();
}

View File

@ -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[])
{

View File

@ -15,7 +15,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/net/bridge/br_input.c
+++ b/net/bridge/br_input.c
@@ -195,6 +195,9 @@ static void __br_handle_local_finish(str
@@ -193,6 +193,9 @@ 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)
{
@ -25,7 +25,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
__br_handle_local_finish(skb);
/* return 1 to signal the okfn() was called so it's ok to use the skb */
@@ -291,6 +294,17 @@ rx_handler_result_t br_handle_frame(stru
@@ -289,6 +292,17 @@ rx_handler_result_t br_handle_frame(stru
forward:
switch (p->state) {

View File

@ -11,7 +11,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/arch/mips/Makefile
+++ b/arch/mips/Makefile
@@ -90,7 +90,7 @@ all-$(CONFIG_SYS_SUPPORTS_ZBOOT)+= vmlin
@@ -91,7 +91,7 @@ all-$(CONFIG_SYS_SUPPORTS_ZBOOT)+= vmlin
# machines may also. Since BFD is incredibly buggy with respect to
# crossformat linking we rely on the elf2ecoff tool for format conversion.
#

View File

@ -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;

View File

@ -47,7 +47,7 @@ v2: incorporated changes suggested by Jonas Gorski
select OF
--- a/arch/mips/Makefile
+++ b/arch/mips/Makefile
@@ -322,7 +322,7 @@ OBJCOPYFLAGS += --remove-section=.regin
@@ -323,7 +323,7 @@ OBJCOPYFLAGS += --remove-section=.regin
head-y := arch/mips/kernel/head.o
libs-y += arch/mips/lib/

View File

@ -11,7 +11,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/arch/mips/Makefile
+++ b/arch/mips/Makefile
@@ -93,8 +93,18 @@ all-$(CONFIG_SYS_SUPPORTS_ZBOOT)+= vmlin
@@ -94,8 +94,18 @@ all-$(CONFIG_SYS_SUPPORTS_ZBOOT)+= vmlin
cflags-y += -G 0 -mno-abicalls -fno-pic -pipe -mno-branch-likely
cflags-y += -msoft-float
LDFLAGS_vmlinux += -G 0 -static -n -nostdlib

View File

@ -11,7 +11,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
--- a/arch/mips/Makefile
+++ b/arch/mips/Makefile
@@ -176,7 +176,7 @@ cflags-$(CONFIG_CPU_VR41XX) += -march=r4
@@ -177,7 +177,7 @@ cflags-$(CONFIG_CPU_VR41XX) += -march=r4
cflags-$(CONFIG_CPU_R4X00) += -march=r4600 -Wa,--trap
cflags-$(CONFIG_CPU_TX49XX) += -march=r4600 -Wa,--trap
cflags-$(CONFIG_CPU_MIPS32_R1) += -march=mips32 -Wa,--trap

View File

@ -552,7 +552,7 @@ Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
nest = nla_nest_start(skb, NFTA_FLOWTABLE_HOOK);
--- a/net/netfilter/nft_flow_offload.c
+++ b/net/netfilter/nft_flow_offload.c
@@ -124,6 +124,9 @@ static void nft_flow_offload_eval(const
@@ -135,6 +135,9 @@ static void nft_flow_offload_eval(const
if (ret < 0)
goto err_flow_add;

View File

@ -11,7 +11,7 @@ Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -1130,6 +1130,9 @@ void phy_detach(struct phy_device *phyde
@@ -1136,6 +1136,9 @@ void phy_detach(struct phy_device *phyde
struct module *ndev_owner = dev->dev.parent->driver->owner;
struct mii_bus *bus;

View File

@ -46,7 +46,7 @@ Subject: [PATCH 30/38] NET: add qualcomm mdio and PHY
obj-$(CONFIG_AMD_PHY) += amd.o
obj-$(CONFIG_AQUANTIA_PHY) += aquantia.o
+obj-$(CONFIG_AR40XX_PHY) += ar40xx.o
obj-$(CONFIG_ASIX_PHY) += asix.o
obj-$(CONFIG_AX88796B_PHY) += ax88796b.o
obj-$(CONFIG_AT803X_PHY) += at803x.o
obj-$(CONFIG_BCM63XX_PHY) += bcm63xx.o
--- /dev/null

View File

@ -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;

View File

@ -14,7 +14,7 @@ Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
--- a/drivers/net/phy/sfp.c
+++ b/drivers/net/phy/sfp.c
@@ -229,6 +229,7 @@ static const struct sff_data sfp_data =
@@ -230,6 +230,7 @@ static const struct sff_data sfp_data =
static const struct of_device_id sfp_of_match[] = {
{ .compatible = "sff,sff", .data = &sff_data, },
{ .compatible = "sff,sfp", .data = &sfp_data, },

View File

@ -10,7 +10,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
--- a/drivers/net/phy/sfp.c
+++ b/drivers/net/phy/sfp.c
@@ -1131,6 +1131,184 @@ static void sfp_hwmon_remove(struct sfp
@@ -1132,6 +1132,184 @@ static void sfp_hwmon_remove(struct sfp
}
#endif
@ -195,7 +195,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
/* Helpers */
static void sfp_module_tx_disable(struct sfp *sfp)
{
@@ -1375,6 +1553,8 @@ static int sfp_sm_mod_probe(struct sfp *
@@ -1376,6 +1554,8 @@ static int sfp_sm_mod_probe(struct sfp *
{
/* SFP module inserted - read I2C data */
struct sfp_eeprom_id id;
@ -204,7 +204,7 @@ Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
bool cotsworks;
u8 check;
int ret;
@@ -1431,12 +1611,87 @@ static int sfp_sm_mod_probe(struct sfp *
@@ -1432,12 +1612,87 @@ static int sfp_sm_mod_probe(struct sfp *
sfp->id = id;

View File

@ -12,7 +12,7 @@ Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
--- a/drivers/net/phy/sfp.c
+++ b/drivers/net/phy/sfp.c
@@ -1570,9 +1570,9 @@ static int sfp_sm_mod_probe(struct sfp *
@@ -1571,9 +1571,9 @@ static int sfp_sm_mod_probe(struct sfp *
return -EAGAIN;
}
@ -25,7 +25,7 @@ Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
*/
cotsworks = !memcmp(id.base.vendor_name, "COTSWORKS ", 16);
@@ -1611,11 +1611,12 @@ static int sfp_sm_mod_probe(struct sfp *
@@ -1612,11 +1612,12 @@ static int sfp_sm_mod_probe(struct sfp *
sfp->id = id;

View File

@ -13,7 +13,7 @@ Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
--- a/drivers/net/phy/sfp.c
+++ b/drivers/net/phy/sfp.c
@@ -1373,7 +1373,7 @@ static void sfp_sm_phy_detach(struct sfp
@@ -1374,7 +1374,7 @@ static void sfp_sm_phy_detach(struct sfp
sfp->mod_phy = NULL;
}
@ -22,7 +22,7 @@ Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
{
struct phy_device *phy;
int err;
@@ -1383,11 +1383,11 @@ static void sfp_sm_probe_phy(struct sfp
@@ -1384,11 +1384,11 @@ static void sfp_sm_probe_phy(struct sfp
phy = mdiobus_scan(sfp->i2c_mii, SFP_PHY_ADDR);
if (phy == ERR_PTR(-ENODEV)) {
dev_info(sfp->dev, "no PHY detected\n");
@ -36,7 +36,7 @@ Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
}
err = sfp_add_phy(sfp->sfp_bus, phy);
@@ -1395,11 +1395,13 @@ static void sfp_sm_probe_phy(struct sfp
@@ -1396,11 +1396,13 @@ static void sfp_sm_probe_phy(struct sfp
phy_device_remove(phy);
phy_device_free(phy);
dev_err(sfp->dev, "sfp_add_phy failed: %d\n", err);
@ -51,7 +51,7 @@ Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
}
static void sfp_sm_link_up(struct sfp *sfp)
@@ -1463,14 +1465,9 @@ static void sfp_sm_fault(struct sfp *sfp
@@ -1464,14 +1466,9 @@ static void sfp_sm_fault(struct sfp *sfp
static void sfp_sm_mod_init(struct sfp *sfp)
{
@ -68,7 +68,7 @@ Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
/* Setting the serdes link mode is guesswork: there's no
* field in the EEPROM which indicates what mode should
@@ -1484,7 +1481,22 @@ static void sfp_sm_mod_init(struct sfp *
@@ -1485,7 +1482,22 @@ static void sfp_sm_mod_init(struct sfp *
if (sfp->id.base.e1000_base_t ||
sfp->id.base.e100_base_lx ||
sfp->id.base.e100_base_fx)