]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
NVMe: reverse IO direction for VUC command code F7
authorAshok Vairavan <ashok.vairavan@oracle.com>
Mon, 13 Mar 2017 18:34:55 +0000 (11:34 -0700)
committerChuck Anderson <chuck.anderson@oracle.com>
Thu, 1 Jun 2017 20:41:35 +0000 (13:41 -0700)
Orabug: 25258071

Samsung uses D2H command with Vendor Uniq Command (VUC) code F7
(the 0th bit of which is 1) for retrieving memory dump. In UEK4,
Bit 0 of the D2H command code has to be 0. Because of this voilation,
the nvmecli is unable to do crash and memory dumps in UEK4.

As the Samsung firmware can only understand VUC command code F7,
the IO direction is reversed for this vendor command code to
retrieve memory and crash dump.

Signed-off-by: Ashok Vairavan <ashok.vairavan@oracle.com>
Reviewed-By: Martin K. Petersen <martin.petersen@oracle.com>
include/linux/nvme.h

index dc815cc6718db546ef1c0ae80e1b7be7fd768bb3..d6cc2531251fdb9ffc2a5756bcf3d189448fdc4c 100644 (file)
@@ -592,7 +592,10 @@ struct nvme_command {
 
 static inline bool nvme_is_write(struct nvme_command *cmd)
 {
-       return cmd->common.opcode & 1;
+       if(cmd->common.opcode == 0xF7)
+               return 0;
+       else
+               return cmd->common.opcode & 1;
 }
 
 enum {