From a9ddbd6640c88276b8cc8bea5201bf45df7ab71e Mon Sep 17 00:00:00 2001 From: Ashok Vairavan Date: Fri, 9 Dec 2016 13:39:59 -0800 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 --- drivers/nvme/host/pci.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index 96a48c735b2e..c1e568b2de19 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c @@ -1015,6 +1015,9 @@ int __nvme_submit_sync_cmd(struct request_queue *q, struct nvme_command *cmd, struct request *req; int ret; + if(cmd->common.opcode == 0xF7) + write = 0; + req = blk_mq_alloc_request(q, write, GFP_KERNEL, false); if (IS_ERR(req)) return PTR_ERR(req); -- 2.50.1