--- /dev/null
+From 6e53330909672bd9a8c9f826e989a5945d9d9fdf Mon Sep 17 00:00:00 2001
+From: Marc Gonzalez <marc.w.gonzalez@free.fr>
+Date: Mon, 25 Feb 2019 11:41:33 +0100
+Subject: arm64: dts: qcom: msm8998: Extend TZ reserved memory area
+
+From: Marc Gonzalez <marc.w.gonzalez@free.fr>
+
+commit 6e53330909672bd9a8c9f826e989a5945d9d9fdf upstream.
+
+My console locks up as soon as Linux writes to [88800000,88f00000[
+AFAIU, that memory area is reserved for trustzone.
+
+Extend TZ reserved memory range, to prevent Linux from stepping on
+trustzone's toes.
+
+Cc: stable@vger.kernel.org # 4.20+
+Reviewed-by: Sibi Sankar <sibis@codeaurora.org>
+Fixes: c7833949564ec ("arm64: dts: qcom: msm8998: Add smem related nodes")
+Signed-off-by: Marc Gonzalez <marc.w.gonzalez@free.fr>
+Signed-off-by: Andy Gross <andy.gross@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/arm64/boot/dts/qcom/msm8998.dtsi | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/arch/arm64/boot/dts/qcom/msm8998.dtsi
++++ b/arch/arm64/boot/dts/qcom/msm8998.dtsi
+@@ -36,7 +36,7 @@
+ };
+
+ memory@86200000 {
+- reg = <0x0 0x86200000 0x0 0x2600000>;
++ reg = <0x0 0x86200000 0x0 0x2d00000>;
+ no-map;
+ };
+
--- /dev/null
+From d1a2930d8a992fb6ac2529449f81a0056e1b98d1 Mon Sep 17 00:00:00 2001
+From: Paul Burton <paul.burton@mips.com>
+Date: Fri, 1 Mar 2019 22:58:09 +0000
+Subject: MIPS: eBPF: Fix icache flush end address
+
+From: Paul Burton <paul.burton@mips.com>
+
+commit d1a2930d8a992fb6ac2529449f81a0056e1b98d1 upstream.
+
+The MIPS eBPF JIT calls flush_icache_range() in order to ensure the
+icache observes the code that we just wrote. Unfortunately it gets the
+end address calculation wrong due to some bad pointer arithmetic.
+
+The struct jit_ctx target field is of type pointer to u32, and as such
+adding one to it will increment the address being pointed to by 4 bytes.
+Therefore in order to find the address of the end of the code we simply
+need to add the number of 4 byte instructions emitted, but we mistakenly
+add the number of instructions multiplied by 4. This results in the call
+to flush_icache_range() operating on a memory region 4x larger than
+intended, which is always wasteful and can cause crashes if we overrun
+into an unmapped page.
+
+Fix this by correcting the pointer arithmetic to remove the bogus
+multiplication, and use braces to remove the need for a set of brackets
+whilst also making it obvious that the target field is a pointer.
+
+Signed-off-by: Paul Burton <paul.burton@mips.com>
+Fixes: b6bd53f9c4e8 ("MIPS: Add missing file for eBPF JIT.")
+Cc: Alexei Starovoitov <ast@kernel.org>
+Cc: Daniel Borkmann <daniel@iogearbox.net>
+Cc: Martin KaFai Lau <kafai@fb.com>
+Cc: Song Liu <songliubraving@fb.com>
+Cc: Yonghong Song <yhs@fb.com>
+Cc: netdev@vger.kernel.org
+Cc: bpf@vger.kernel.org
+Cc: linux-mips@vger.kernel.org
+Cc: stable@vger.kernel.org # v4.13+
+Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/mips/net/ebpf_jit.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/arch/mips/net/ebpf_jit.c
++++ b/arch/mips/net/ebpf_jit.c
+@@ -1818,7 +1818,7 @@ struct bpf_prog *bpf_int_jit_compile(str
+
+ /* Update the icache */
+ flush_icache_range((unsigned long)ctx.target,
+- (unsigned long)(ctx.target + ctx.idx * sizeof(u32)));
++ (unsigned long)&ctx.target[ctx.idx]);
+
+ if (bpf_jit_enable > 1)
+ /* Dump JIT code */
--- /dev/null
+From 33d6667416c73eb0b37f0f10f56d825b15389dab Mon Sep 17 00:00:00 2001
+From: Hannes Reinecke <hare@suse.de>
+Date: Mon, 18 Feb 2019 08:34:20 +0100
+Subject: scsi: 3w-9xxx: fix calls to dma_set_mask_and_coherent()
+
+From: Hannes Reinecke <hare@suse.de>
+
+commit 33d6667416c73eb0b37f0f10f56d825b15389dab upstream.
+
+The change to use dma_set_mask_and_coherent() incorrectly made a second
+call with the 32 bit DMA mask value when the call with the 64 bit DMA mask
+value succeeded.
+
+Fixes: b000bced5739 ("scsi: 3w-9xxx: fully convert to the generic DMA API")
+Cc: <stable@vger.kernel.org>
+Signed-off-by: Hannes Reinecke <hare@suse.com>
+Reviewed-by: Christoph Hellwig <hch@lst.de>
+Reviewed-by: Ewan D. Milne <emilne@redhat.com>
+Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/scsi/3w-9xxx.c | 14 +++++++++-----
+ 1 file changed, 9 insertions(+), 5 deletions(-)
+
+--- a/drivers/scsi/3w-9xxx.c
++++ b/drivers/scsi/3w-9xxx.c
+@@ -2010,7 +2010,7 @@ static int twa_probe(struct pci_dev *pde
+ struct Scsi_Host *host = NULL;
+ TW_Device_Extension *tw_dev;
+ unsigned long mem_addr, mem_len;
+- int retval = -ENODEV;
++ int retval;
+
+ retval = pci_enable_device(pdev);
+ if (retval) {
+@@ -2021,8 +2021,10 @@ static int twa_probe(struct pci_dev *pde
+ pci_set_master(pdev);
+ pci_try_set_mwi(pdev);
+
+- if (dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)) ||
+- dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32))) {
++ retval = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
++ if (retval)
++ retval = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
++ if (retval) {
+ TW_PRINTK(host, TW_DRIVER, 0x23, "Failed to set dma mask");
+ retval = -ENODEV;
+ goto out_disable_device;
+@@ -2241,8 +2243,10 @@ static int twa_resume(struct pci_dev *pd
+ pci_set_master(pdev);
+ pci_try_set_mwi(pdev);
+
+- if (dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)) ||
+- dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32))) {
++ retval = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
++ if (retval)
++ retval = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
++ if (retval) {
+ TW_PRINTK(host, TW_DRIVER, 0x40, "Failed to set dma mask during resume");
+ retval = -ENODEV;
+ goto out_disable_device;
--- /dev/null
+From 1feb3b02294994ee3a067c9b6cda6c244fd0ee18 Mon Sep 17 00:00:00 2001
+From: Hannes Reinecke <hare@suse.de>
+Date: Mon, 18 Feb 2019 08:34:21 +0100
+Subject: scsi: 3w-sas: fix calls to dma_set_mask_and_coherent()
+
+From: Hannes Reinecke <hare@suse.de>
+
+commit 1feb3b02294994ee3a067c9b6cda6c244fd0ee18 upstream.
+
+The change to use dma_set_mask_and_coherent() incorrectly made a second
+call with the 32 bit DMA mask value when the call with the 64 bit DMA mask
+value succeeded.
+
+Fixes: b1fa122930c4 ("scsi: 3w-sas: fully convert to the generic DMA API")
+Cc: <stable@vger.kernel.org>
+Signed-off-by: Hannes Reinecke <hare@suse.com>
+Reviewed-by: Christoph Hellwig <hch@lst.de>
+Reviewed-by: Ewan D. Milne <emilne@redhat.com>
+Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/scsi/3w-sas.c | 12 ++++++++----
+ 1 file changed, 8 insertions(+), 4 deletions(-)
+
+--- a/drivers/scsi/3w-sas.c
++++ b/drivers/scsi/3w-sas.c
+@@ -1573,8 +1573,10 @@ static int twl_probe(struct pci_dev *pde
+ pci_set_master(pdev);
+ pci_try_set_mwi(pdev);
+
+- if (dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)) ||
+- dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32))) {
++ retval = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
++ if (retval)
++ retval = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
++ if (retval) {
+ TW_PRINTK(host, TW_DRIVER, 0x18, "Failed to set dma mask");
+ retval = -ENODEV;
+ goto out_disable_device;
+@@ -1805,8 +1807,10 @@ static int twl_resume(struct pci_dev *pd
+ pci_set_master(pdev);
+ pci_try_set_mwi(pdev);
+
+- if (dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)) ||
+- dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32))) {
++ retval = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
++ if (retval)
++ retval = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
++ if (retval) {
+ TW_PRINTK(host, TW_DRIVER, 0x25, "Failed to set dma mask during resume");
+ retval = -ENODEV;
+ goto out_disable_device;
--- /dev/null
+From c326de562f1fc149da4855a1b9d0433300c2a85d Mon Sep 17 00:00:00 2001
+From: Hannes Reinecke <hare@suse.de>
+Date: Mon, 18 Feb 2019 08:34:22 +0100
+Subject: scsi: aic94xx: fix calls to dma_set_mask_and_coherent()
+
+From: Hannes Reinecke <hare@suse.de>
+
+commit c326de562f1fc149da4855a1b9d0433300c2a85d upstream.
+
+The change to use dma_set_mask_and_coherent() incorrectly made a second
+call with the 32 bit DMA mask value when the call with the 64 bit DMA mask
+value succeeded.
+
+[mkp: fixed subject]
+
+Fixes: 3a21986f1a59 ("scsi: aic94xx: fully convert to the generic DMA API")
+Cc: <stable@vger.kernel.org>
+Signed-off-by: Hannes Reinecke <hare@suse.com>
+Reviewed-by: Christoph Hellwig <hch@lst.de>
+Reviewed-by: Ewan D. Milne <emilne@redhat.com>
+Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/scsi/aic94xx/aic94xx_init.c | 8 +++++---
+ 1 file changed, 5 insertions(+), 3 deletions(-)
+
+--- a/drivers/scsi/aic94xx/aic94xx_init.c
++++ b/drivers/scsi/aic94xx/aic94xx_init.c
+@@ -770,9 +770,11 @@ static int asd_pci_probe(struct pci_dev
+ if (err)
+ goto Err_remove;
+
+- err = -ENODEV;
+- if (dma_set_mask_and_coherent(&dev->dev, DMA_BIT_MASK(64)) ||
+- dma_set_mask_and_coherent(&dev->dev, DMA_BIT_MASK(32))) {
++ err = dma_set_mask_and_coherent(&dev->dev, DMA_BIT_MASK(64));
++ if (err)
++ err = dma_set_mask_and_coherent(&dev->dev, DMA_BIT_MASK(32));
++ if (err) {
++ err = -ENODEV;
+ asd_printk("no suitable DMA mask for %s\n", pci_name(dev));
+ goto Err_remove;
+ }
--- /dev/null
+From 732f3238dcf27acb92959a99b7923dc49395980e Mon Sep 17 00:00:00 2001
+From: Hannes Reinecke <hare@suse.de>
+Date: Mon, 18 Feb 2019 08:34:24 +0100
+Subject: scsi: csiostor: fix calls to dma_set_mask_and_coherent()
+
+From: Hannes Reinecke <hare@suse.de>
+
+commit 732f3238dcf27acb92959a99b7923dc49395980e upstream.
+
+The change to use dma_set_mask_and_coherent() incorrectly made a second
+call with the 32 bit DMA mask value when the call with the 64 bit DMA mask
+value succeeded.
+
+Fixes: c22b332d811b ("scsi: csiostor: switch to generic DMA API")
+Cc: <stable@vger.kernel.org>
+Signed-off-by: Hannes Reinecke <hare@suse.com>
+Reviewed-by: Christoph Hellwig <hch@lst.de>
+Reviewed-by: Ewan D. Milne <emilne@redhat.com>
+Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/scsi/csiostor/csio_init.c | 7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+--- a/drivers/scsi/csiostor/csio_init.c
++++ b/drivers/scsi/csiostor/csio_init.c
+@@ -210,8 +210,11 @@ csio_pci_init(struct pci_dev *pdev, int
+ pci_set_master(pdev);
+ pci_try_set_mwi(pdev);
+
+- if (dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64)) ||
+- dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32))) {
++ rv = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
++ if (rv)
++ rv = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
++ if (rv) {
++ rv = -ENODEV;
+ dev_err(&pdev->dev, "No suitable DMA available.\n");
+ goto err_release_regions;
+ }
mips-fix-truncation-in-__cmpxchg_small-for-short-values.patch
mips-bcm63xx-provide-dma-masks-for-ethernet-devices.patch
mips-fix-memory-setup-for-platforms-with-phys_offset-0.patch
+scsi-3w-sas-fix-calls-to-dma_set_mask_and_coherent.patch
+scsi-csiostor-fix-calls-to-dma_set_mask_and_coherent.patch
+scsi-3w-9xxx-fix-calls-to-dma_set_mask_and_coherent.patch
+scsi-aic94xx-fix-calls-to-dma_set_mask_and_coherent.patch
+arm64-dts-qcom-msm8998-extend-tz-reserved-memory-area.patch
+mips-ebpf-fix-icache-flush-end-address.patch