From: Ashok Vairavan Date: Mon, 13 Mar 2017 18:34:55 +0000 (-0700) Subject: NVMe: reverse IO direction for VUC command code F7 X-Git-Tag: v4.1.12-102.0.20170601_1400~53 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=9b1e6d340cf627701ab000189457a798c4af6fd1;p=users%2Fjedix%2Flinux-maple.git 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 --- diff --git a/include/linux/nvme.h b/include/linux/nvme.h index dc815cc6718db..d6cc2531251fd 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 {