]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
scsi: cxlflash: Remove zeroing of private command data
authorMatthew R. Ochs <mrochs@linux.vnet.ibm.com>
Fri, 7 Jul 2017 16:05:54 +0000 (13:05 -0300)
committerThadeu Lima de Souza Cascardo <cascardo@canonical.com>
Fri, 14 Jul 2017 14:33:29 +0000 (11:33 -0300)
BugLink: http://bugs.launchpad.net/bugs/1702521
The SCSI core now zeroes the per-command private data area prior to
calling into the LLD. Replace the clearing operation that takes place
when the private command data reference is obtained with a routine that
performs common initializations. The zeroing that takes place in the
device reset path remains intact as the private command data associated
with the specified SCSI command is not guaranteed to be cleared.

Signed-off-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com>
Signed-off-by: Uma Krishnan <ukrishn@linux.vnet.ibm.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 479ad8e9d48c4d82c92417b012193e967fc33b8a)
Signed-off-by: Victor Aoqui <victora@linux.vnet.ibm.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
drivers/scsi/cxlflash/common.h
drivers/scsi/cxlflash/main.c

index e95e5a516b5eb3d92a504c88f02ea0d907b0968c..6d95e8e147e0823741be9b9cc68ed1f4188b4a5c 100644 (file)
@@ -178,15 +178,22 @@ static inline struct afu_cmd *sc_to_afuc(struct scsi_cmnd *sc)
        return PTR_ALIGN(scsi_cmd_priv(sc), __alignof__(struct afu_cmd));
 }
 
-static inline struct afu_cmd *sc_to_afucz(struct scsi_cmnd *sc)
+static inline struct afu_cmd *sc_to_afuci(struct scsi_cmnd *sc)
 {
        struct afu_cmd *afuc = sc_to_afuc(sc);
 
-       memset(afuc, 0, sizeof(*afuc));
        INIT_LIST_HEAD(&afuc->queue);
        return afuc;
 }
 
+static inline struct afu_cmd *sc_to_afucz(struct scsi_cmnd *sc)
+{
+       struct afu_cmd *afuc = sc_to_afuc(sc);
+
+       memset(afuc, 0, sizeof(*afuc));
+       return sc_to_afuci(sc);
+}
+
 struct hwq {
        /* Stuff requiring alignment go first. */
        struct sisl_ioarcb sq[NUM_SQ_ENTRY];            /* 16K SQ */
index 0cce442c260adc7690217f95f33b3dbf42d816d0..43389825299abc88a8d9323f858bcfb9f0640889 100644 (file)
@@ -543,7 +543,7 @@ static int cxlflash_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *scp)
        struct cxlflash_cfg *cfg = shost_priv(host);
        struct afu *afu = cfg->afu;
        struct device *dev = &cfg->dev->dev;
-       struct afu_cmd *cmd = sc_to_afucz(scp);
+       struct afu_cmd *cmd = sc_to_afuci(scp);
        struct scatterlist *sg = scsi_sglist(scp);
        int hwq_index = cmd_to_target_hwq(host, scp, afu);
        struct hwq *hwq = get_hwq(afu, hwq_index);