From: Ashok Vairavan Date: Fri, 9 Dec 2016 21:39:59 +0000 (-0800) Subject: NVMe: reverse IO direction for VUC command code F7 X-Git-Tag: v4.1.12-92~20^2 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=a9ddbd6640c88276b8cc8bea5201bf45df7ab71e;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 --- diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index 96a48c735b2e8..c1e568b2de190 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);