From 9b1e6d340cf627701ab000189457a798c4af6fd1 Mon Sep 17 00:00:00 2001 From: Ashok Vairavan Date: Mon, 13 Mar 2017 11:34:55 -0700 Subject: [PATCH] NVMe: reverse IO direction for VUC command code F7 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 Reviewed-By: Martin K. Petersen --- include/linux/nvme.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/linux/nvme.h b/include/linux/nvme.h index dc815cc6718d..d6cc2531251f 100644 --- a/include/linux/nvme.h +++ b/include/linux/nvme.h @@ -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 { -- 2.50.1