Commit 3bc8caed authored by Sameer Wadgaonkar's avatar Sameer Wadgaonkar Committed by Greg Kroah-Hartman

staging: unisys: visorhba: fix s-Par to boot with option CONFIG_VMAP_STACK set to y


[ Upstream commit 3c2bf0bd ]

The root issue is that we are not allowed to have items on the
stack being passed to "DMA" like operations. In this case we have
a vmcall and an inline completion of scsi command.

This patch fixes the issue by moving the variables on stack in
do_scsi_nolinuxstat() to heap memory.
Signed-off-by: default avatarSameer Wadgaonkar <sameer.wadgaonkar@unisys.com>
Signed-off-by: default avatarDavid Kershner <david.kershner@unisys.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 9bf9e352
...@@ -792,7 +792,7 @@ static void ...@@ -792,7 +792,7 @@ static void
do_scsi_nolinuxstat(struct uiscmdrsp *cmdrsp, struct scsi_cmnd *scsicmd) do_scsi_nolinuxstat(struct uiscmdrsp *cmdrsp, struct scsi_cmnd *scsicmd)
{ {
struct scsi_device *scsidev; struct scsi_device *scsidev;
unsigned char buf[36]; unsigned char *buf;
struct scatterlist *sg; struct scatterlist *sg;
unsigned int i; unsigned int i;
char *this_page; char *this_page;
...@@ -807,6 +807,10 @@ do_scsi_nolinuxstat(struct uiscmdrsp *cmdrsp, struct scsi_cmnd *scsicmd) ...@@ -807,6 +807,10 @@ do_scsi_nolinuxstat(struct uiscmdrsp *cmdrsp, struct scsi_cmnd *scsicmd)
if (cmdrsp->scsi.no_disk_result == 0) if (cmdrsp->scsi.no_disk_result == 0)
return; return;
buf = kzalloc(sizeof(char) * 36, GFP_KERNEL);
if (!buf)
return;
/* Linux scsi code wants a device at Lun 0 /* Linux scsi code wants a device at Lun 0
* to issue report luns, but we don't want * to issue report luns, but we don't want
* a disk there so we'll present a processor * a disk there so we'll present a processor
...@@ -820,6 +824,7 @@ do_scsi_nolinuxstat(struct uiscmdrsp *cmdrsp, struct scsi_cmnd *scsicmd) ...@@ -820,6 +824,7 @@ do_scsi_nolinuxstat(struct uiscmdrsp *cmdrsp, struct scsi_cmnd *scsicmd)
if (scsi_sg_count(scsicmd) == 0) { if (scsi_sg_count(scsicmd) == 0) {
memcpy(scsi_sglist(scsicmd), buf, memcpy(scsi_sglist(scsicmd), buf,
cmdrsp->scsi.bufflen); cmdrsp->scsi.bufflen);
kfree(buf);
return; return;
} }
...@@ -831,6 +836,7 @@ do_scsi_nolinuxstat(struct uiscmdrsp *cmdrsp, struct scsi_cmnd *scsicmd) ...@@ -831,6 +836,7 @@ do_scsi_nolinuxstat(struct uiscmdrsp *cmdrsp, struct scsi_cmnd *scsicmd)
memcpy(this_page, buf + bufind, sg[i].length); memcpy(this_page, buf + bufind, sg[i].length);
kunmap_atomic(this_page_orig); kunmap_atomic(this_page_orig);
} }
kfree(buf);
} else { } else {
devdata = (struct visorhba_devdata *)scsidev->host->hostdata; devdata = (struct visorhba_devdata *)scsidev->host->hostdata;
for_each_vdisk_match(vdisk, devdata, scsidev) { for_each_vdisk_match(vdisk, devdata, scsidev) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment