]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
Fixes for 4.19
authorSasha Levin <sashal@kernel.org>
Sun, 24 Jan 2021 15:36:33 +0000 (10:36 -0500)
committerSasha Levin <sashal@kernel.org>
Sun, 24 Jan 2021 15:36:33 +0000 (10:36 -0500)
Signed-off-by: Sasha Levin <sashal@kernel.org>
14 files changed:
queue-4.19/asoc-intel-haswell-add-missing-pm_ops.patch [new file with mode: 0644]
queue-4.19/clk-tegra30-add-hda-clock-default-rates-to-clock-dri.patch [new file with mode: 0644]
queue-4.19/dm-integrity-select-crypto_skcipher.patch [new file with mode: 0644]
queue-4.19/drm-nouveau-bios-fix-issue-shadowing-expansion-roms.patch [new file with mode: 0644]
queue-4.19/drm-nouveau-i2c-gm200-increase-width-of-aux-semaphor.patch [new file with mode: 0644]
queue-4.19/drm-nouveau-kms-nv50-fix-case-where-notifier-buffer-.patch [new file with mode: 0644]
queue-4.19/drm-nouveau-mmu-fix-vram-heap-sizing.patch [new file with mode: 0644]
queue-4.19/drm-nouveau-privring-ack-interrupts-the-same-way-as-.patch [new file with mode: 0644]
queue-4.19/hid-ignore-battery-for-elan-touchscreen-on-asus-ux55.patch [new file with mode: 0644]
queue-4.19/riscv-fix-kernel-time_init.patch [new file with mode: 0644]
queue-4.19/scsi-qedi-correct-max-length-of-chap-secret.patch [new file with mode: 0644]
queue-4.19/scsi-ufs-correct-the-lun-used-in-eh_device_reset_han.patch [new file with mode: 0644]
queue-4.19/series
queue-4.19/xen-fix-event-channel-callback-via-intx-gsi.patch [new file with mode: 0644]

diff --git a/queue-4.19/asoc-intel-haswell-add-missing-pm_ops.patch b/queue-4.19/asoc-intel-haswell-add-missing-pm_ops.patch
new file mode 100644 (file)
index 0000000..6612482
--- /dev/null
@@ -0,0 +1,36 @@
+From bd6cf331faead713fb685e46e80e1e7ea96a924d Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Thu, 17 Dec 2020 11:54:01 +0100
+Subject: ASoC: Intel: haswell: Add missing pm_ops
+
+From: Cezary Rojewski <cezary.rojewski@intel.com>
+
+[ Upstream commit bb224c3e3e41d940612d4cc9573289cdbd5cb8f5 ]
+
+haswell machine board is missing pm_ops what prevents it from undergoing
+suspend-resume procedure successfully. Assign default snd_soc_pm_ops so
+this is no longer the case.
+
+Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
+Link: https://lore.kernel.org/r/20201217105401.27865-1-cezary.rojewski@intel.com
+Signed-off-by: Mark Brown <broonie@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ sound/soc/intel/boards/haswell.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/sound/soc/intel/boards/haswell.c b/sound/soc/intel/boards/haswell.c
+index a4022983a7ce0..67eb4a446c3cb 100644
+--- a/sound/soc/intel/boards/haswell.c
++++ b/sound/soc/intel/boards/haswell.c
+@@ -198,6 +198,7 @@ static struct platform_driver haswell_audio = {
+       .probe = haswell_audio_probe,
+       .driver = {
+               .name = "haswell-audio",
++              .pm = &snd_soc_pm_ops,
+       },
+ };
+-- 
+2.27.0
+
diff --git a/queue-4.19/clk-tegra30-add-hda-clock-default-rates-to-clock-dri.patch b/queue-4.19/clk-tegra30-add-hda-clock-default-rates-to-clock-dri.patch
new file mode 100644 (file)
index 0000000..82184e4
--- /dev/null
@@ -0,0 +1,43 @@
+From 72a638889746d0a8c1b42ccd93dedf4ab5760963 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Fri, 8 Jan 2021 13:59:12 +0000
+Subject: clk: tegra30: Add hda clock default rates to clock driver
+
+From: Peter Geis <pgwipeout@gmail.com>
+
+[ Upstream commit f4eccc7fea203cfb35205891eced1ab51836f362 ]
+
+Current implementation defaults the hda clocks to clk_m. This causes hda
+to run too slow to operate correctly. Fix this by defaulting to pll_p and
+setting the frequency to the correct rate.
+
+This matches upstream t124 and downstream t30.
+
+Acked-by: Jon Hunter <jonathanh@nvidia.com>
+Tested-by: Ion Agorria <ion@agorria.com>
+Acked-by: Sameer Pujar <spujar@nvidia.com>
+Acked-by: Thierry Reding <treding@nvidia.com>
+Signed-off-by: Peter Geis <pgwipeout@gmail.com>
+Link: https://lore.kernel.org/r/20210108135913.2421585-2-pgwipeout@gmail.com
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/clk/tegra/clk-tegra30.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/drivers/clk/tegra/clk-tegra30.c b/drivers/clk/tegra/clk-tegra30.c
+index e0aaecd98fbff..678019f86bc7a 100644
+--- a/drivers/clk/tegra/clk-tegra30.c
++++ b/drivers/clk/tegra/clk-tegra30.c
+@@ -1274,6 +1274,8 @@ static struct tegra_clk_init_table init_table[] __initdata = {
+       { TEGRA30_CLK_I2S3_SYNC, TEGRA30_CLK_CLK_MAX, 24000000, 0 },
+       { TEGRA30_CLK_I2S4_SYNC, TEGRA30_CLK_CLK_MAX, 24000000, 0 },
+       { TEGRA30_CLK_VIMCLK_SYNC, TEGRA30_CLK_CLK_MAX, 24000000, 0 },
++      { TEGRA30_CLK_HDA, TEGRA30_CLK_PLL_P, 102000000, 0 },
++      { TEGRA30_CLK_HDA2CODEC_2X, TEGRA30_CLK_PLL_P, 48000000, 0 },
+       /* must be the last entry */
+       { TEGRA30_CLK_CLK_MAX, TEGRA30_CLK_CLK_MAX, 0, 0 },
+ };
+-- 
+2.27.0
+
diff --git a/queue-4.19/dm-integrity-select-crypto_skcipher.patch b/queue-4.19/dm-integrity-select-crypto_skcipher.patch
new file mode 100644 (file)
index 0000000..4f0325c
--- /dev/null
@@ -0,0 +1,37 @@
+From 38125b15ecaac034e17b869c9180683fbd8b1a64 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 14 Dec 2020 18:18:11 +0100
+Subject: dm integrity: select CRYPTO_SKCIPHER
+
+From: Anthony Iliopoulos <ailiop@suse.com>
+
+[ Upstream commit f7b347acb5f6c29d9229bb64893d8b6a2c7949fb ]
+
+The integrity target relies on skcipher for encryption/decryption, but
+certain kernel configurations may not enable CRYPTO_SKCIPHER, leading to
+compilation errors due to unresolved symbols. Explicitly select
+CRYPTO_SKCIPHER for DM_INTEGRITY, since it is unconditionally dependent
+on it.
+
+Signed-off-by: Anthony Iliopoulos <ailiop@suse.com>
+Signed-off-by: Mike Snitzer <snitzer@redhat.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/md/Kconfig | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/drivers/md/Kconfig b/drivers/md/Kconfig
+index 8b8c123cae66f..7d61ef03cb187 100644
+--- a/drivers/md/Kconfig
++++ b/drivers/md/Kconfig
+@@ -527,6 +527,7 @@ config DM_INTEGRITY
+       select BLK_DEV_INTEGRITY
+       select DM_BUFIO
+       select CRYPTO
++      select CRYPTO_SKCIPHER
+       select ASYNC_XOR
+       ---help---
+         This device-mapper target emulates a block device that has
+-- 
+2.27.0
+
diff --git a/queue-4.19/drm-nouveau-bios-fix-issue-shadowing-expansion-roms.patch b/queue-4.19/drm-nouveau-bios-fix-issue-shadowing-expansion-roms.patch
new file mode 100644 (file)
index 0000000..ebc6eb9
--- /dev/null
@@ -0,0 +1,50 @@
+From b4859c490ebaaa85002ece33eac70ede3b3828eb Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 13 Jan 2021 17:12:52 +1000
+Subject: drm/nouveau/bios: fix issue shadowing expansion ROMs
+
+From: Ben Skeggs <bskeggs@redhat.com>
+
+[ Upstream commit 402a89660e9dc880710b12773076a336c9dab3d7 ]
+
+This issue has generally been covered up by the presence of additional
+expansion ROMs after the ones we're interested in, with header fetches
+of subsequent images loading enough of the ROM to hide the issue.
+
+Noticed on GA102, which lacks a type 0x70 image compared to TU102,.
+
+[  906.364197] nouveau 0000:09:00.0: bios: 00000000: type 00, 65024 bytes
+[  906.381205] nouveau 0000:09:00.0: bios: 0000fe00: type 03, 91648 bytes
+[  906.405213] nouveau 0000:09:00.0: bios: 00026400: type e0, 22016 bytes
+[  906.410984] nouveau 0000:09:00.0: bios: 0002ba00: type e0, 366080 bytes
+
+vs
+
+[   22.961901] nouveau 0000:09:00.0: bios: 00000000: type 00, 60416 bytes
+[   22.984174] nouveau 0000:09:00.0: bios: 0000ec00: type 03, 71168 bytes
+[   23.010446] nouveau 0000:09:00.0: bios: 00020200: type e0, 48128 bytes
+[   23.028220] nouveau 0000:09:00.0: bios: 0002be00: type e0, 140800 bytes
+[   23.080196] nouveau 0000:09:00.0: bios: 0004e400: type 70, 7168 bytes
+
+Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
+index 7deb81b6dbac6..4b571cc6bc70f 100644
+--- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
++++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c
+@@ -75,7 +75,7 @@ shadow_image(struct nvkm_bios *bios, int idx, u32 offset, struct shadow *mthd)
+       nvkm_debug(subdev, "%08x: type %02x, %d bytes\n",
+                  image.base, image.type, image.size);
+-      if (!shadow_fetch(bios, mthd, image.size)) {
++      if (!shadow_fetch(bios, mthd, image.base + image.size)) {
+               nvkm_debug(subdev, "%08x: fetch failed\n", image.base);
+               return 0;
+       }
+-- 
+2.27.0
+
diff --git a/queue-4.19/drm-nouveau-i2c-gm200-increase-width-of-aux-semaphor.patch b/queue-4.19/drm-nouveau-i2c-gm200-increase-width-of-aux-semaphor.patch
new file mode 100644 (file)
index 0000000..e789c93
--- /dev/null
@@ -0,0 +1,55 @@
+From d6f8298e479bbc0f0666384eb127fc4fb2036c5c Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 13 Jan 2021 17:12:52 +1000
+Subject: drm/nouveau/i2c/gm200: increase width of aux semaphore owner fields
+
+From: Ben Skeggs <bskeggs@redhat.com>
+
+[ Upstream commit ba6e9ab0fcf3d76e3952deb12b5f993991621d9c ]
+
+Noticed while debugging GA102.
+
+Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxgm200.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxgm200.c b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxgm200.c
+index edb6148cbca04..d0e80ad526845 100644
+--- a/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxgm200.c
++++ b/drivers/gpu/drm/nouveau/nvkm/subdev/i2c/auxgm200.c
+@@ -33,7 +33,7 @@ static void
+ gm200_i2c_aux_fini(struct gm200_i2c_aux *aux)
+ {
+       struct nvkm_device *device = aux->base.pad->i2c->subdev.device;
+-      nvkm_mask(device, 0x00d954 + (aux->ch * 0x50), 0x00310000, 0x00000000);
++      nvkm_mask(device, 0x00d954 + (aux->ch * 0x50), 0x00710000, 0x00000000);
+ }
+ static int
+@@ -54,10 +54,10 @@ gm200_i2c_aux_init(struct gm200_i2c_aux *aux)
+                       AUX_ERR(&aux->base, "begin idle timeout %08x", ctrl);
+                       return -EBUSY;
+               }
+-      } while (ctrl & 0x03010000);
++      } while (ctrl & 0x07010000);
+       /* set some magic, and wait up to 1ms for it to appear */
+-      nvkm_mask(device, 0x00d954 + (aux->ch * 0x50), 0x00300000, ureq);
++      nvkm_mask(device, 0x00d954 + (aux->ch * 0x50), 0x00700000, ureq);
+       timeout = 1000;
+       do {
+               ctrl = nvkm_rd32(device, 0x00d954 + (aux->ch * 0x50));
+@@ -67,7 +67,7 @@ gm200_i2c_aux_init(struct gm200_i2c_aux *aux)
+                       gm200_i2c_aux_fini(aux);
+                       return -EBUSY;
+               }
+-      } while ((ctrl & 0x03000000) != urep);
++      } while ((ctrl & 0x07000000) != urep);
+       return 0;
+ }
+-- 
+2.27.0
+
diff --git a/queue-4.19/drm-nouveau-kms-nv50-fix-case-where-notifier-buffer-.patch b/queue-4.19/drm-nouveau-kms-nv50-fix-case-where-notifier-buffer-.patch
new file mode 100644 (file)
index 0000000..4883cdf
--- /dev/null
@@ -0,0 +1,70 @@
+From d254d0194fd414357eef4ccdafa26e2413a1cfff Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 13 Jan 2021 17:12:52 +1000
+Subject: drm/nouveau/kms/nv50-: fix case where notifier buffer is at offset 0
+
+From: Ben Skeggs <bskeggs@redhat.com>
+
+[ Upstream commit caeb6ab899c3d36a74cda6e299c6e1c9c4e2a22e ]
+
+VRAM offset 0 is a valid address, triggered on GA102.
+
+Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/gpu/drm/nouveau/dispnv50/disp.c     | 4 ++--
+ drivers/gpu/drm/nouveau/dispnv50/disp.h     | 2 +-
+ drivers/gpu/drm/nouveau/dispnv50/wimmc37b.c | 2 +-
+ 3 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c b/drivers/gpu/drm/nouveau/dispnv50/disp.c
+index 1bb0a9f6fa730..fbe156302ee86 100644
+--- a/drivers/gpu/drm/nouveau/dispnv50/disp.c
++++ b/drivers/gpu/drm/nouveau/dispnv50/disp.c
+@@ -131,7 +131,7 @@ nv50_dmac_destroy(struct nv50_dmac *dmac)
+ int
+ nv50_dmac_create(struct nvif_device *device, struct nvif_object *disp,
+-               const s32 *oclass, u8 head, void *data, u32 size, u64 syncbuf,
++               const s32 *oclass, u8 head, void *data, u32 size, s64 syncbuf,
+                struct nv50_dmac *dmac)
+ {
+       struct nouveau_cli *cli = (void *)device->object.client;
+@@ -166,7 +166,7 @@ nv50_dmac_create(struct nvif_device *device, struct nvif_object *disp,
+       if (ret)
+               return ret;
+-      if (!syncbuf)
++      if (syncbuf < 0)
+               return 0;
+       ret = nvif_object_init(&dmac->base.user, 0xf0000000, NV_DMA_IN_MEMORY,
+diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.h b/drivers/gpu/drm/nouveau/dispnv50/disp.h
+index 66c125a6b0b3c..55205d23360c8 100644
+--- a/drivers/gpu/drm/nouveau/dispnv50/disp.h
++++ b/drivers/gpu/drm/nouveau/dispnv50/disp.h
+@@ -68,7 +68,7 @@ struct nv50_dmac {
+ int nv50_dmac_create(struct nvif_device *device, struct nvif_object *disp,
+                    const s32 *oclass, u8 head, void *data, u32 size,
+-                   u64 syncbuf, struct nv50_dmac *dmac);
++                   s64 syncbuf, struct nv50_dmac *dmac);
+ void nv50_dmac_destroy(struct nv50_dmac *);
+ u32 *evo_wait(struct nv50_dmac *, int nr);
+diff --git a/drivers/gpu/drm/nouveau/dispnv50/wimmc37b.c b/drivers/gpu/drm/nouveau/dispnv50/wimmc37b.c
+index f7dbd965e4e72..b49a212af4d8d 100644
+--- a/drivers/gpu/drm/nouveau/dispnv50/wimmc37b.c
++++ b/drivers/gpu/drm/nouveau/dispnv50/wimmc37b.c
+@@ -68,7 +68,7 @@ wimmc37b_init_(const struct nv50_wimm_func *func, struct nouveau_drm *drm,
+       int ret;
+       ret = nv50_dmac_create(&drm->client.device, &disp->disp->object,
+-                             &oclass, 0, &args, sizeof(args), 0,
++                             &oclass, 0, &args, sizeof(args), -1,
+                              &wndw->wimm);
+       if (ret) {
+               NV_ERROR(drm, "wimm%04x allocation failed: %d\n", oclass, ret);
+-- 
+2.27.0
+
diff --git a/queue-4.19/drm-nouveau-mmu-fix-vram-heap-sizing.patch b/queue-4.19/drm-nouveau-mmu-fix-vram-heap-sizing.patch
new file mode 100644 (file)
index 0000000..8ebc00a
--- /dev/null
@@ -0,0 +1,35 @@
+From 064ae63785bcc56e06f22a26922ebd90f6f4868b Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 13 Jan 2021 17:12:52 +1000
+Subject: drm/nouveau/mmu: fix vram heap sizing
+
+From: Ben Skeggs <bskeggs@redhat.com>
+
+[ Upstream commit add42781ad76c5ae65127bf13852a4c6b2f08849 ]
+
+Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/gpu/drm/nouveau/nvkm/subdev/mmu/base.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/base.c
+index ee11ccaf0563c..cb51e248cb41b 100644
+--- a/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/base.c
++++ b/drivers/gpu/drm/nouveau/nvkm/subdev/mmu/base.c
+@@ -316,9 +316,9 @@ nvkm_mmu_vram(struct nvkm_mmu *mmu)
+ {
+       struct nvkm_device *device = mmu->subdev.device;
+       struct nvkm_mm *mm = &device->fb->ram->vram;
+-      const u32 sizeN = nvkm_mm_heap_size(mm, NVKM_RAM_MM_NORMAL);
+-      const u32 sizeU = nvkm_mm_heap_size(mm, NVKM_RAM_MM_NOMAP);
+-      const u32 sizeM = nvkm_mm_heap_size(mm, NVKM_RAM_MM_MIXED);
++      const u64 sizeN = nvkm_mm_heap_size(mm, NVKM_RAM_MM_NORMAL);
++      const u64 sizeU = nvkm_mm_heap_size(mm, NVKM_RAM_MM_NOMAP);
++      const u64 sizeM = nvkm_mm_heap_size(mm, NVKM_RAM_MM_MIXED);
+       u8 type = NVKM_MEM_KIND * !!mmu->func->kind;
+       u8 heap = NVKM_MEM_VRAM;
+       int heapM, heapN, heapU;
+-- 
+2.27.0
+
diff --git a/queue-4.19/drm-nouveau-privring-ack-interrupts-the-same-way-as-.patch b/queue-4.19/drm-nouveau-privring-ack-interrupts-the-same-way-as-.patch
new file mode 100644 (file)
index 0000000..d714bf6
--- /dev/null
@@ -0,0 +1,119 @@
+From 30ed94e137ff70ea910a5deec53f6d7270cc8524 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 13 Jan 2021 17:12:52 +1000
+Subject: drm/nouveau/privring: ack interrupts the same way as RM
+
+From: Ben Skeggs <bskeggs@redhat.com>
+
+[ Upstream commit e05e06cd34f5311f677294a08b609acfbc315236 ]
+
+Whatever it is that we were doing before doesn't work on Ampere.
+
+Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/gpu/drm/nouveau/nvkm/subdev/ibus/gf100.c | 10 +++++++---
+ drivers/gpu/drm/nouveau/nvkm/subdev/ibus/gk104.c | 10 +++++++---
+ 2 files changed, 14 insertions(+), 6 deletions(-)
+
+diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/ibus/gf100.c b/drivers/gpu/drm/nouveau/nvkm/subdev/ibus/gf100.c
+index d80dbc8f09b20..55a4ea4393c62 100644
+--- a/drivers/gpu/drm/nouveau/nvkm/subdev/ibus/gf100.c
++++ b/drivers/gpu/drm/nouveau/nvkm/subdev/ibus/gf100.c
+@@ -22,6 +22,7 @@
+  * Authors: Ben Skeggs
+  */
+ #include "priv.h"
++#include <subdev/timer.h>
+ static void
+ gf100_ibus_intr_hub(struct nvkm_subdev *ibus, int i)
+@@ -31,7 +32,6 @@ gf100_ibus_intr_hub(struct nvkm_subdev *ibus, int i)
+       u32 data = nvkm_rd32(device, 0x122124 + (i * 0x0400));
+       u32 stat = nvkm_rd32(device, 0x122128 + (i * 0x0400));
+       nvkm_debug(ibus, "HUB%d: %06x %08x (%08x)\n", i, addr, data, stat);
+-      nvkm_mask(device, 0x122128 + (i * 0x0400), 0x00000200, 0x00000000);
+ }
+ static void
+@@ -42,7 +42,6 @@ gf100_ibus_intr_rop(struct nvkm_subdev *ibus, int i)
+       u32 data = nvkm_rd32(device, 0x124124 + (i * 0x0400));
+       u32 stat = nvkm_rd32(device, 0x124128 + (i * 0x0400));
+       nvkm_debug(ibus, "ROP%d: %06x %08x (%08x)\n", i, addr, data, stat);
+-      nvkm_mask(device, 0x124128 + (i * 0x0400), 0x00000200, 0x00000000);
+ }
+ static void
+@@ -53,7 +52,6 @@ gf100_ibus_intr_gpc(struct nvkm_subdev *ibus, int i)
+       u32 data = nvkm_rd32(device, 0x128124 + (i * 0x0400));
+       u32 stat = nvkm_rd32(device, 0x128128 + (i * 0x0400));
+       nvkm_debug(ibus, "GPC%d: %06x %08x (%08x)\n", i, addr, data, stat);
+-      nvkm_mask(device, 0x128128 + (i * 0x0400), 0x00000200, 0x00000000);
+ }
+ void
+@@ -90,6 +88,12 @@ gf100_ibus_intr(struct nvkm_subdev *ibus)
+                       intr1 &= ~stat;
+               }
+       }
++
++      nvkm_mask(device, 0x121c4c, 0x0000003f, 0x00000002);
++      nvkm_msec(device, 2000,
++              if (!(nvkm_rd32(device, 0x121c4c) & 0x0000003f))
++                      break;
++      );
+ }
+ static int
+diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/ibus/gk104.c b/drivers/gpu/drm/nouveau/nvkm/subdev/ibus/gk104.c
+index 9025ed1bd2a99..4caf3ef087e1d 100644
+--- a/drivers/gpu/drm/nouveau/nvkm/subdev/ibus/gk104.c
++++ b/drivers/gpu/drm/nouveau/nvkm/subdev/ibus/gk104.c
+@@ -22,6 +22,7 @@
+  * Authors: Ben Skeggs
+  */
+ #include "priv.h"
++#include <subdev/timer.h>
+ static void
+ gk104_ibus_intr_hub(struct nvkm_subdev *ibus, int i)
+@@ -31,7 +32,6 @@ gk104_ibus_intr_hub(struct nvkm_subdev *ibus, int i)
+       u32 data = nvkm_rd32(device, 0x122124 + (i * 0x0800));
+       u32 stat = nvkm_rd32(device, 0x122128 + (i * 0x0800));
+       nvkm_debug(ibus, "HUB%d: %06x %08x (%08x)\n", i, addr, data, stat);
+-      nvkm_mask(device, 0x122128 + (i * 0x0800), 0x00000200, 0x00000000);
+ }
+ static void
+@@ -42,7 +42,6 @@ gk104_ibus_intr_rop(struct nvkm_subdev *ibus, int i)
+       u32 data = nvkm_rd32(device, 0x124124 + (i * 0x0800));
+       u32 stat = nvkm_rd32(device, 0x124128 + (i * 0x0800));
+       nvkm_debug(ibus, "ROP%d: %06x %08x (%08x)\n", i, addr, data, stat);
+-      nvkm_mask(device, 0x124128 + (i * 0x0800), 0x00000200, 0x00000000);
+ }
+ static void
+@@ -53,7 +52,6 @@ gk104_ibus_intr_gpc(struct nvkm_subdev *ibus, int i)
+       u32 data = nvkm_rd32(device, 0x128124 + (i * 0x0800));
+       u32 stat = nvkm_rd32(device, 0x128128 + (i * 0x0800));
+       nvkm_debug(ibus, "GPC%d: %06x %08x (%08x)\n", i, addr, data, stat);
+-      nvkm_mask(device, 0x128128 + (i * 0x0800), 0x00000200, 0x00000000);
+ }
+ void
+@@ -90,6 +88,12 @@ gk104_ibus_intr(struct nvkm_subdev *ibus)
+                       intr1 &= ~stat;
+               }
+       }
++
++      nvkm_mask(device, 0x12004c, 0x0000003f, 0x00000002);
++      nvkm_msec(device, 2000,
++              if (!(nvkm_rd32(device, 0x12004c) & 0x0000003f))
++                      break;
++      );
+ }
+ static int
+-- 
+2.27.0
+
diff --git a/queue-4.19/hid-ignore-battery-for-elan-touchscreen-on-asus-ux55.patch b/queue-4.19/hid-ignore-battery-for-elan-touchscreen-on-asus-ux55.patch
new file mode 100644 (file)
index 0000000..17e00c4
--- /dev/null
@@ -0,0 +1,49 @@
+From e3c25f070cb487ee3e731c4d77897635baedcc95 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 4 Jan 2021 22:58:12 -0600
+Subject: HID: Ignore battery for Elan touchscreen on ASUS UX550
+
+From: Seth Miller <miller.seth@gmail.com>
+
+[ Upstream commit 7c38e769d5c508939ce5dc26df72602f3c902342 ]
+
+Battery status is being reported for the Elan touchscreen on ASUS
+UX550 laptops despite not having a batter. It always shows either 0 or
+1%.
+
+Signed-off-by: Seth Miller <miller.seth@gmail.com>
+Signed-off-by: Jiri Kosina <jkosina@suse.cz>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/hid/hid-ids.h   | 1 +
+ drivers/hid/hid-input.c | 2 ++
+ 2 files changed, 3 insertions(+)
+
+diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
+index 6d118da1615d4..ab2be7a115d8f 100644
+--- a/drivers/hid/hid-ids.h
++++ b/drivers/hid/hid-ids.h
+@@ -386,6 +386,7 @@
+ #define USB_DEVICE_ID_TOSHIBA_CLICK_L9W       0x0401
+ #define USB_DEVICE_ID_HP_X2           0x074d
+ #define USB_DEVICE_ID_HP_X2_10_COVER  0x0755
++#define USB_DEVICE_ID_ASUS_UX550_TOUCHSCREEN  0x2706
+ #define USB_VENDOR_ID_ELECOM          0x056e
+ #define USB_DEVICE_ID_ELECOM_BM084    0x0061
+diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
+index 13deb9a676855..4dd151b2924e2 100644
+--- a/drivers/hid/hid-input.c
++++ b/drivers/hid/hid-input.c
+@@ -334,6 +334,8 @@ static const struct hid_device_id hid_battery_quirks[] = {
+       { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_LOGITECH,
+               USB_DEVICE_ID_LOGITECH_DINOVO_EDGE_KBD),
+         HID_BATTERY_QUIRK_IGNORE },
++      { HID_USB_DEVICE(USB_VENDOR_ID_ELAN, USB_DEVICE_ID_ASUS_UX550_TOUCHSCREEN),
++        HID_BATTERY_QUIRK_IGNORE },
+       {}
+ };
+-- 
+2.27.0
+
diff --git a/queue-4.19/riscv-fix-kernel-time_init.patch b/queue-4.19/riscv-fix-kernel-time_init.patch
new file mode 100644 (file)
index 0000000..b33f667
--- /dev/null
@@ -0,0 +1,48 @@
+From 8899559cebcc8442d630ce5e9b726d1bf7b20674 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Sun, 13 Dec 2020 22:50:34 +0900
+Subject: riscv: Fix kernel time_init()
+
+From: Damien Le Moal <damien.lemoal@wdc.com>
+
+[ Upstream commit 11f4c2e940e2f317c9d8fb5a79702f2a4a02ff98 ]
+
+If of_clk_init() is not called in time_init(), clock providers defined
+in the system device tree are not initialized, resulting in failures for
+other devices to initialize due to missing clocks.
+Similarly to other architectures and to the default kernel time_init()
+implementation, call of_clk_init() before executing timer_probe() in
+time_init().
+
+Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
+Acked-by: Stephen Boyd <sboyd@kernel.org>
+Reviewed-by: Palmer Dabbelt <palmerdabbelt@google.com>
+Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ arch/riscv/kernel/time.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/arch/riscv/kernel/time.c b/arch/riscv/kernel/time.c
+index 1911c8f6b8a69..15f4ab40e2221 100644
+--- a/arch/riscv/kernel/time.c
++++ b/arch/riscv/kernel/time.c
+@@ -12,6 +12,7 @@
+  *   GNU General Public License for more details.
+  */
++#include <linux/of_clk.h>
+ #include <linux/clocksource.h>
+ #include <linux/delay.h>
+ #include <asm/sbi.h>
+@@ -29,5 +30,7 @@ void __init time_init(void)
+       riscv_timebase = prop;
+       lpj_fine = riscv_timebase / HZ;
++
++      of_clk_init(NULL);
+       timer_probe();
+ }
+-- 
+2.27.0
+
diff --git a/queue-4.19/scsi-qedi-correct-max-length-of-chap-secret.patch b/queue-4.19/scsi-qedi-correct-max-length-of-chap-secret.patch
new file mode 100644 (file)
index 0000000..4305095
--- /dev/null
@@ -0,0 +1,46 @@
+From 7ee736ddeea240a645f9d95f76ca8aa728e480ff Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Thu, 17 Dec 2020 02:51:44 -0800
+Subject: scsi: qedi: Correct max length of CHAP secret
+
+From: Nilesh Javali <njavali@marvell.com>
+
+[ Upstream commit d50c7986fbf0e2167279e110a2ed5bd8e811c660 ]
+
+The CHAP secret displayed garbage characters causing iSCSI login
+authentication failure. Correct the CHAP password max length.
+
+Link: https://lore.kernel.org/r/20201217105144.8055-1-njavali@marvell.com
+Reviewed-by: Lee Duncan <lduncan@suse.com>
+Signed-off-by: Nilesh Javali <njavali@marvell.com>
+Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/scsi/qedi/qedi_main.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/scsi/qedi/qedi_main.c b/drivers/scsi/qedi/qedi_main.c
+index eaa50328de90c..e201c163ea1c8 100644
+--- a/drivers/scsi/qedi/qedi_main.c
++++ b/drivers/scsi/qedi/qedi_main.c
+@@ -2129,7 +2129,7 @@ qedi_show_boot_tgt_info(struct qedi_ctx *qedi, int type,
+                            chap_name);
+               break;
+       case ISCSI_BOOT_TGT_CHAP_SECRET:
+-              rc = sprintf(buf, "%.*s\n", NVM_ISCSI_CFG_CHAP_NAME_MAX_LEN,
++              rc = sprintf(buf, "%.*s\n", NVM_ISCSI_CFG_CHAP_PWD_MAX_LEN,
+                            chap_secret);
+               break;
+       case ISCSI_BOOT_TGT_REV_CHAP_NAME:
+@@ -2137,7 +2137,7 @@ qedi_show_boot_tgt_info(struct qedi_ctx *qedi, int type,
+                            mchap_name);
+               break;
+       case ISCSI_BOOT_TGT_REV_CHAP_SECRET:
+-              rc = sprintf(buf, "%.*s\n", NVM_ISCSI_CFG_CHAP_NAME_MAX_LEN,
++              rc = sprintf(buf, "%.*s\n", NVM_ISCSI_CFG_CHAP_PWD_MAX_LEN,
+                            mchap_secret);
+               break;
+       case ISCSI_BOOT_TGT_FLAGS:
+-- 
+2.27.0
+
diff --git a/queue-4.19/scsi-ufs-correct-the-lun-used-in-eh_device_reset_han.patch b/queue-4.19/scsi-ufs-correct-the-lun-used-in-eh_device_reset_han.patch
new file mode 100644 (file)
index 0000000..f5f4ef8
--- /dev/null
@@ -0,0 +1,65 @@
+From 8394463e1de3f28afa16c2d2e1290b91c79c1bec Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 28 Dec 2020 04:04:36 -0800
+Subject: scsi: ufs: Correct the LUN used in eh_device_reset_handler() callback
+
+From: Can Guo <cang@codeaurora.org>
+
+[ Upstream commit 35fc4cd34426c242ab015ef280853b7bff101f48 ]
+
+Users can initiate resets to specific SCSI device/target/host through
+IOCTL. When this happens, the SCSI cmd passed to eh_device/target/host
+_reset_handler() callbacks is initialized with a request whose tag is -1.
+In this case it is not right for eh_device_reset_handler() callback to
+count on the LUN get from hba->lrb[-1]. Fix it by getting LUN from the SCSI
+device associated with the SCSI cmd.
+
+Link: https://lore.kernel.org/r/1609157080-26283-1-git-send-email-cang@codeaurora.org
+Reviewed-by: Avri Altman <avri.altman@wdc.com>
+Reviewed-by: Stanley Chu <stanley.chu@mediatek.com>
+Signed-off-by: Can Guo <cang@codeaurora.org>
+Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/scsi/ufs/ufshcd.c | 11 ++++-------
+ 1 file changed, 4 insertions(+), 7 deletions(-)
+
+diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
+index 40f478c4d118f..b18430efb00fb 100644
+--- a/drivers/scsi/ufs/ufshcd.c
++++ b/drivers/scsi/ufs/ufshcd.c
+@@ -5772,19 +5772,16 @@ static int ufshcd_eh_device_reset_handler(struct scsi_cmnd *cmd)
+ {
+       struct Scsi_Host *host;
+       struct ufs_hba *hba;
+-      unsigned int tag;
+       u32 pos;
+       int err;
+-      u8 resp = 0xF;
+-      struct ufshcd_lrb *lrbp;
++      u8 resp = 0xF, lun;
+       unsigned long flags;
+       host = cmd->device->host;
+       hba = shost_priv(host);
+-      tag = cmd->request->tag;
+-      lrbp = &hba->lrb[tag];
+-      err = ufshcd_issue_tm_cmd(hba, lrbp->lun, 0, UFS_LOGICAL_RESET, &resp);
++      lun = ufshcd_scsi_to_upiu_lun(cmd->device->lun);
++      err = ufshcd_issue_tm_cmd(hba, lun, 0, UFS_LOGICAL_RESET, &resp);
+       if (err || resp != UPIU_TASK_MANAGEMENT_FUNC_COMPL) {
+               if (!err)
+                       err = resp;
+@@ -5793,7 +5790,7 @@ static int ufshcd_eh_device_reset_handler(struct scsi_cmnd *cmd)
+       /* clear the commands that were pending for corresponding LUN */
+       for_each_set_bit(pos, &hba->outstanding_reqs, hba->nutrs) {
+-              if (hba->lrb[pos].lun == lrbp->lun) {
++              if (hba->lrb[pos].lun == lun) {
+                       err = ufshcd_clear_cmd(hba, pos);
+                       if (err)
+                               break;
+-- 
+2.27.0
+
index 469ac9db29c9f268ab0a182fffcbe0a3c2c020df..69ebc2db7bcf23ae8a1c44ed552b8e9508c4a0e4 100644 (file)
@@ -8,3 +8,16 @@ mmc-sdhci-xenon-fix-1.8v-regulator-stabilization.patch
 dm-avoid-filesystem-lookup-in-dm_get_dev_t.patch
 dm-integrity-fix-a-crash-if-recalculate-used-without-internal_hash.patch
 drm-atomic-put-state-on-error-path.patch
+asoc-intel-haswell-add-missing-pm_ops.patch
+dm-integrity-select-crypto_skcipher.patch
+scsi-ufs-correct-the-lun-used-in-eh_device_reset_han.patch
+scsi-qedi-correct-max-length-of-chap-secret.patch
+riscv-fix-kernel-time_init.patch
+hid-ignore-battery-for-elan-touchscreen-on-asus-ux55.patch
+clk-tegra30-add-hda-clock-default-rates-to-clock-dri.patch
+xen-fix-event-channel-callback-via-intx-gsi.patch
+drm-nouveau-bios-fix-issue-shadowing-expansion-roms.patch
+drm-nouveau-privring-ack-interrupts-the-same-way-as-.patch
+drm-nouveau-i2c-gm200-increase-width-of-aux-semaphor.patch
+drm-nouveau-mmu-fix-vram-heap-sizing.patch
+drm-nouveau-kms-nv50-fix-case-where-notifier-buffer-.patch
diff --git a/queue-4.19/xen-fix-event-channel-callback-via-intx-gsi.patch b/queue-4.19/xen-fix-event-channel-callback-via-intx-gsi.patch
new file mode 100644 (file)
index 0000000..0445ca9
--- /dev/null
@@ -0,0 +1,253 @@
+From f5a44db544910be592f738a18cb606d3d82f4855 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 13 Jan 2021 13:26:02 +0000
+Subject: xen: Fix event channel callback via INTX/GSI
+
+From: David Woodhouse <dwmw@amazon.co.uk>
+
+[ Upstream commit 3499ba8198cad47b731792e5e56b9ec2a78a83a2 ]
+
+For a while, event channel notification via the PCI platform device
+has been broken, because we attempt to communicate with xenstore before
+we even have notifications working, with the xs_reset_watches() call
+in xs_init().
+
+We tend to get away with this on Xen versions below 4.0 because we avoid
+calling xs_reset_watches() anyway, because xenstore might not cope with
+reading a non-existent key. And newer Xen *does* have the vector
+callback support, so we rarely fall back to INTX/GSI delivery.
+
+To fix it, clean up a bit of the mess of xs_init() and xenbus_probe()
+startup. Call xs_init() directly from xenbus_init() only in the !XS_HVM
+case, deferring it to be called from xenbus_probe() in the XS_HVM case
+instead.
+
+Then fix up the invocation of xenbus_probe() to happen either from its
+device_initcall if the callback is available early enough, or when the
+callback is finally set up. This means that the hack of calling
+xenbus_probe() from a workqueue after the first interrupt, or directly
+from the PCI platform device setup, is no longer needed.
+
+Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
+Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
+Link: https://lore.kernel.org/r/20210113132606.422794-2-dwmw2@infradead.org
+Signed-off-by: Juergen Gross <jgross@suse.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ arch/arm/xen/enlighten.c          |  2 +-
+ drivers/xen/events/events_base.c  | 10 ----
+ drivers/xen/platform-pci.c        |  1 -
+ drivers/xen/xenbus/xenbus.h       |  1 +
+ drivers/xen/xenbus/xenbus_comms.c |  8 ---
+ drivers/xen/xenbus/xenbus_probe.c | 81 +++++++++++++++++++++++++------
+ include/xen/xenbus.h              |  2 +-
+ 7 files changed, 70 insertions(+), 35 deletions(-)
+
+diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c
+index 07060e5b58641..8aa901e20ca8e 100644
+--- a/arch/arm/xen/enlighten.c
++++ b/arch/arm/xen/enlighten.c
+@@ -405,7 +405,7 @@ static int __init xen_guest_init(void)
+       }
+       gnttab_init();
+       if (!xen_initial_domain())
+-              xenbus_probe(NULL);
++              xenbus_probe();
+       /*
+        * Making sure board specific code will not set up ops for
+diff --git a/drivers/xen/events/events_base.c b/drivers/xen/events/events_base.c
+index aca8456752797..8c08c7d46d3d0 100644
+--- a/drivers/xen/events/events_base.c
++++ b/drivers/xen/events/events_base.c
+@@ -1987,16 +1987,6 @@ static struct irq_chip xen_percpu_chip __read_mostly = {
+       .irq_ack                = ack_dynirq,
+ };
+-int xen_set_callback_via(uint64_t via)
+-{
+-      struct xen_hvm_param a;
+-      a.domid = DOMID_SELF;
+-      a.index = HVM_PARAM_CALLBACK_IRQ;
+-      a.value = via;
+-      return HYPERVISOR_hvm_op(HVMOP_set_param, &a);
+-}
+-EXPORT_SYMBOL_GPL(xen_set_callback_via);
+-
+ #ifdef CONFIG_XEN_PVHVM
+ /* Vector callbacks are better than PCI interrupts to receive event
+  * channel notifications because we can receive vector callbacks on any
+diff --git a/drivers/xen/platform-pci.c b/drivers/xen/platform-pci.c
+index 5d7dcad0b0a0d..4cec8146609ad 100644
+--- a/drivers/xen/platform-pci.c
++++ b/drivers/xen/platform-pci.c
+@@ -162,7 +162,6 @@ static int platform_pci_probe(struct pci_dev *pdev,
+       ret = gnttab_init();
+       if (ret)
+               goto grant_out;
+-      xenbus_probe(NULL);
+       return 0;
+ grant_out:
+       gnttab_free_auto_xlat_frames();
+diff --git a/drivers/xen/xenbus/xenbus.h b/drivers/xen/xenbus/xenbus.h
+index 88516a8a9f932..a9bb5f91082d3 100644
+--- a/drivers/xen/xenbus/xenbus.h
++++ b/drivers/xen/xenbus/xenbus.h
+@@ -115,6 +115,7 @@ int xenbus_probe_node(struct xen_bus_type *bus,
+                     const char *type,
+                     const char *nodename);
+ int xenbus_probe_devices(struct xen_bus_type *bus);
++void xenbus_probe(void);
+ void xenbus_dev_changed(const char *node, struct xen_bus_type *bus);
+diff --git a/drivers/xen/xenbus/xenbus_comms.c b/drivers/xen/xenbus/xenbus_comms.c
+index eb5151fc8efab..e5fda0256feb3 100644
+--- a/drivers/xen/xenbus/xenbus_comms.c
++++ b/drivers/xen/xenbus/xenbus_comms.c
+@@ -57,16 +57,8 @@ DEFINE_MUTEX(xs_response_mutex);
+ static int xenbus_irq;
+ static struct task_struct *xenbus_task;
+-static DECLARE_WORK(probe_work, xenbus_probe);
+-
+-
+ static irqreturn_t wake_waiting(int irq, void *unused)
+ {
+-      if (unlikely(xenstored_ready == 0)) {
+-              xenstored_ready = 1;
+-              schedule_work(&probe_work);
+-      }
+-
+       wake_up(&xb_waitq);
+       return IRQ_HANDLED;
+ }
+diff --git a/drivers/xen/xenbus/xenbus_probe.c b/drivers/xen/xenbus/xenbus_probe.c
+index e6d0903459e11..14ccf13ab8fa1 100644
+--- a/drivers/xen/xenbus/xenbus_probe.c
++++ b/drivers/xen/xenbus/xenbus_probe.c
+@@ -683,29 +683,76 @@ void unregister_xenstore_notifier(struct notifier_block *nb)
+ }
+ EXPORT_SYMBOL_GPL(unregister_xenstore_notifier);
+-void xenbus_probe(struct work_struct *unused)
++void xenbus_probe(void)
+ {
+       xenstored_ready = 1;
++      /*
++       * In the HVM case, xenbus_init() deferred its call to
++       * xs_init() in case callbacks were not operational yet.
++       * So do it now.
++       */
++      if (xen_store_domain_type == XS_HVM)
++              xs_init();
++
+       /* Notify others that xenstore is up */
+       blocking_notifier_call_chain(&xenstore_chain, 0, NULL);
+ }
+-EXPORT_SYMBOL_GPL(xenbus_probe);
+-static int __init xenbus_probe_initcall(void)
++/*
++ * Returns true when XenStore init must be deferred in order to
++ * allow the PCI platform device to be initialised, before we
++ * can actually have event channel interrupts working.
++ */
++static bool xs_hvm_defer_init_for_callback(void)
+ {
+-      if (!xen_domain())
+-              return -ENODEV;
++#ifdef CONFIG_XEN_PVHVM
++      return xen_store_domain_type == XS_HVM &&
++              !xen_have_vector_callback;
++#else
++      return false;
++#endif
++}
+-      if (xen_initial_domain() || xen_hvm_domain())
+-              return 0;
++static int __init xenbus_probe_initcall(void)
++{
++      /*
++       * Probe XenBus here in the XS_PV case, and also XS_HVM unless we
++       * need to wait for the platform PCI device to come up.
++       */
++      if (xen_store_domain_type == XS_PV ||
++          (xen_store_domain_type == XS_HVM &&
++           !xs_hvm_defer_init_for_callback()))
++              xenbus_probe();
+-      xenbus_probe(NULL);
+       return 0;
+ }
+-
+ device_initcall(xenbus_probe_initcall);
++int xen_set_callback_via(uint64_t via)
++{
++      struct xen_hvm_param a;
++      int ret;
++
++      a.domid = DOMID_SELF;
++      a.index = HVM_PARAM_CALLBACK_IRQ;
++      a.value = via;
++
++      ret = HYPERVISOR_hvm_op(HVMOP_set_param, &a);
++      if (ret)
++              return ret;
++
++      /*
++       * If xenbus_probe_initcall() deferred the xenbus_probe()
++       * due to the callback not functioning yet, we can do it now.
++       */
++      if (!xenstored_ready && xs_hvm_defer_init_for_callback())
++              xenbus_probe();
++
++      return ret;
++}
++EXPORT_SYMBOL_GPL(xen_set_callback_via);
++
+ /* Set up event channel for xenstored which is run as a local process
+  * (this is normally used only in dom0)
+  */
+@@ -818,11 +865,17 @@ static int __init xenbus_init(void)
+               break;
+       }
+-      /* Initialize the interface to xenstore. */
+-      err = xs_init();
+-      if (err) {
+-              pr_warn("Error initializing xenstore comms: %i\n", err);
+-              goto out_error;
++      /*
++       * HVM domains may not have a functional callback yet. In that
++       * case let xs_init() be called from xenbus_probe(), which will
++       * get invoked at an appropriate time.
++       */
++      if (xen_store_domain_type != XS_HVM) {
++              err = xs_init();
++              if (err) {
++                      pr_warn("Error initializing xenstore comms: %i\n", err);
++                      goto out_error;
++              }
+       }
+       if ((xen_store_domain_type != XS_LOCAL) &&
+diff --git a/include/xen/xenbus.h b/include/xen/xenbus.h
+index eba01ab5a55e0..fe9a9fa2ebc45 100644
+--- a/include/xen/xenbus.h
++++ b/include/xen/xenbus.h
+@@ -187,7 +187,7 @@ void xs_suspend_cancel(void);
+ struct work_struct;
+-void xenbus_probe(struct work_struct *);
++void xenbus_probe(void);
+ #define XENBUS_IS_ERR_READ(str) ({                    \
+       if (!IS_ERR(str) && strlen(str) == 0) {         \
+-- 
+2.27.0
+