Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5796332rdb; Wed, 13 Dec 2023 22:33:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IFPayHttrMEFTqzH+gXa3PdvmuolnN3YBZOM7vSsBTXIz0OO5XY33X2XagfTX+oypBNxIAO X-Received: by 2002:a0d:dc82:0:b0:5d7:1940:dd71 with SMTP id f124-20020a0ddc82000000b005d71940dd71mr7482935ywe.71.1702535627365; Wed, 13 Dec 2023 22:33:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702535627; cv=none; d=google.com; s=arc-20160816; b=MRpCt3I2tTXCgl48Gvjgo6SSJ8eDfRrqnzLHXtdmeCWtI2WXnARfsSMnwa3hGZQ0G1 JauoXOyX8Hn+WYEJnl0IMwnv4RyBeg7FKZ+ELoZHj3eINC6SjlLTFHMJCmUdSBK27WY3 87uuZoC2uOZFr7K/1bv5ztsY8qgXK8A3C28cKcfDecw9BgKmHIRyp34i60xjNNEq/KCu PGX+bGrlxIVRZdHs+UGGt18TIbw0jSbTlYgQiNY2a+mY+sQmDWtfFD8FEftTew1z4SVn dOQc25Zm3hZ+AkGAKPtpEtgx6VdNJaADjxEtJ+2oRS5xS4w7GU90T5qlbpY/aJW05P09 /qoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=DQa3Oh83Y7BJ5yvT1MB3NL690VGSVlOorSazsJGg8O8=; fh=ZgFndhaiy2ZqVRYzZ4zFpPqlCexXCuBbFdt2kNb4p4E=; b=Uirymf7MvaWNWcJrI+a/zD2F/KvtU/VmRjHkikFXqppScTyYgm9TawBISPVT4Ct3IU SpWgO46UlD6usMdaeRTdIdyaPpbfxL03PmTzHC3lxETqeFkFTGPBe12rY1aaJfLlPVGN AKEnLijeN7/jCi0PnObOkzmsVM/1UkcqDVQjgQxn7E3C/lG7hlM7nbXUJ7fLh6b4idzT lDjFLvWFoOESmiQcH1r1yF78UptoMaRCkzmb+pwvDDQ4Jh8PKFjuWhGtVyZ/G+r5ABzC h/2D8Z2ouUhC65q+c1WoKpCwjFH7MgtUM4ee2yo0FKxLLTfocy5CkOaXPFZGTXBGRd/Q pNQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DvBunkzR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id n3-20020a170903110300b001d31c9b3bdbsi6399061plh.311.2023.12.13.22.33.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 22:33:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=DvBunkzR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id CB72B802A6EA; Wed, 13 Dec 2023 22:33:45 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234275AbjLNGdh (ORCPT + 99 others); Thu, 14 Dec 2023 01:33:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52928 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229629AbjLNGdg (ORCPT ); Thu, 14 Dec 2023 01:33:36 -0500 Received: from mail-il1-x131.google.com (mail-il1-x131.google.com [IPv6:2607:f8b0:4864:20::131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CCC59B9 for ; Wed, 13 Dec 2023 22:33:41 -0800 (PST) Received: by mail-il1-x131.google.com with SMTP id e9e14a558f8ab-35f418f394dso21335795ab.0 for ; Wed, 13 Dec 2023 22:33:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1702535621; x=1703140421; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=DQa3Oh83Y7BJ5yvT1MB3NL690VGSVlOorSazsJGg8O8=; b=DvBunkzR3aTXEws5zejCNZYt1dYO8HtNv22PpeD6BZKmjD3eCmS2gsZcsK+FCMSpNb QS8k2g9Z/aROFkkN6BnY14YNekty0/5l1xGNxGO8EhvXOGrstspSFxWTH4A+zvTVeNQX ddp6QzKJ2HIh72VkQS49DM8JLBZGnlhsln2b/UPTx4iJI7cFrm3RaHr2zH1kfyuFaHLP CTzk3hfIXFofXherSmYH5jbKYjpSmUuChlAw5RCe3HjNi6pOWBfnnrTNKgtIZ2o/Qr8C E5Ox8aAYefsHXyyeGqzoEMbb4p0l2CPZOs9xkm1cuTOEvAsuRQarmwSElYU9rjTfgSb2 z6Zw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702535621; x=1703140421; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=DQa3Oh83Y7BJ5yvT1MB3NL690VGSVlOorSazsJGg8O8=; b=lRzGynY7NjYQ2u0RBCw3XOpjLgBiYY6qCftWfU+4K7pmntReJQRf5nkmuaOesTJf6p Cmaa6nneCGDLojun2yqpAZoNryzoHUyasLwCXWCpMWOT5kUTPrA+1uqETUYxVq1VlDg7 8Cn2daviy/iyzxpf+LZx07Nhww9IdZXESoIjrd9Bje3dSzDtB12ZLJtTJWL3GuPvLOET LtwQzT1vifi7KqvZG39eDIrAVpwdhhKzRJqdVXahq2ynZ5cqKT80H4lMViuChDylVVQt y5Zf84mOX4ZdTrGnYTHwDzf0i/EIsN+qYXxluVL2VEmQHZbaMkK/i9B/4MiQOFcxG/O8 nDcA== X-Gm-Message-State: AOJu0Yw1ptAgI985u8Fuhz7QP1qXGSp28fMZUeFi5ebNgkixAPzY/B4Q qUkQP2+oyHppVFwGSbw/3Sq6 X-Received: by 2002:a05:6e02:184b:b0:35d:6d53:5439 with SMTP id b11-20020a056e02184b00b0035d6d535439mr14590043ilv.11.1702535621114; Wed, 13 Dec 2023 22:33:41 -0800 (PST) Received: from localhost.localdomain ([117.213.102.12]) by smtp.gmail.com with ESMTPSA id q19-20020a170902bd9300b001cc2ebd2c2csm11639491pls.256.2023.12.13.22.33.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 22:33:40 -0800 (PST) From: Manivannan Sadhasivam To: lpieralisi@kernel.org, kw@linux.com, bhelgaas@google.com Cc: kishon@kernel.org, mhi@lists.linux.dev, linux-arm-msm@vger.kernel.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Manivannan Sadhasivam Subject: [PATCH] PCI: epf-mhi: Fix the DMA data direction of dma_unmap_single() Date: Thu, 14 Dec 2023 12:03:28 +0530 Message-Id: <20231214063328.40657-1-manivannan.sadhasivam@linaro.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 13 Dec 2023 22:33:46 -0800 (PST) In the error path of pci_epf_mhi_edma_write() function, the DMA data direction passed (DMA_FROM_DEVICE) doesn't match the actual direction used for the data transfer. Fix it by passing the correct one (DMA_TO_DEVICE). Fixes: 7b99aaaddabb ("PCI: epf-mhi: Add eDMA support") Signed-off-by: Manivannan Sadhasivam --- Bjorn, Krzysztof, I'd like to apply this patch to MHI tree on top of eDMA async patches due to dependency: https://lore.kernel.org/linux-pci/20231127124529.78203-1-manivannan.sadhasivam@linaro.org/ drivers/pci/endpoint/functions/pci-epf-mhi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pci/endpoint/functions/pci-epf-mhi.c b/drivers/pci/endpoint/functions/pci-epf-mhi.c index 472bc489b754..d3d6a1054036 100644 --- a/drivers/pci/endpoint/functions/pci-epf-mhi.c +++ b/drivers/pci/endpoint/functions/pci-epf-mhi.c @@ -424,7 +424,7 @@ static int pci_epf_mhi_edma_write(struct mhi_ep_cntrl *mhi_cntrl, } err_unmap: - dma_unmap_single(dma_dev, src_addr, buf_info->size, DMA_FROM_DEVICE); + dma_unmap_single(dma_dev, src_addr, buf_info->size, DMA_TO_DEVICE); err_unlock: mutex_unlock(&epf_mhi->lock); base-commit: f5668f251e29292326e45a022f933c15740a8af2 -- 2.25.1