Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp3011917rdh; Mon, 27 Nov 2023 04:47:20 -0800 (PST) X-Google-Smtp-Source: AGHT+IES6O+J9YtFFdvQlYVE5hyyj6gTe32pvYo3ItceTv9rAjJm3uOH7Is6LDFPkfhinY/H+r5k X-Received: by 2002:a05:6a00:14c6:b0:6c4:dc5b:5b2b with SMTP id w6-20020a056a0014c600b006c4dc5b5b2bmr11988012pfu.20.1701089240531; Mon, 27 Nov 2023 04:47:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701089240; cv=none; d=google.com; s=arc-20160816; b=YlJpD2eIGM91prNOLrtdCEcEZpvxOia26XNC5JkeBBul2Jnpp4JT0TGrnMoP4zr8tH TIWP2KXiXx0lkAf6It6kA9r20U4yzg99RDhiLdetRRvg+w+FDRsqnC8EjVjvNtkIfByt 72W7PxsNteRrTSOdvRSoffJz2hu4fmIOord/P6s7AzTns0xVzDLConygmBRGI5cjhzUK 5fDF0uXnTa5y5PGwx2jBGpYZI+vK5nor2JpitVIjfRBa6+2JC6ZW/4paTumIlgCUQAjq zV/2z+9MOW0MuFK/9Qkkp44/imT0/G1uNorjC75Absa8LjFLkl+YRgKnT6YLUu1HHnHd rOOQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=n0WeQVv6xDz1fA7FB+siaDKsF7jHm7RdEkvM6+sXcAk=; fh=GCPsaS9gPzUx9ecgCkAchNprj2XO1a7aLVETzufn50Y=; b=t9tTsR2qbLwUIZstT6e/IRKB58rPtkIZSOt/dkRW/e8NSL/OhPBsgQcEXm1+UErjaF 3wzCvXnJoHKpK/jkkeuHUjsk/Gs5K7dG9cEurfV/NDKcxJh9q5wXKJqI3rKCoof/i4ll mJf861C+nPUZeWa/7OQKbXam1gXkXScFx3I/J8TgfigOYOlhkhHPthlQB7rBlrwYPwjz FZvcn1Pv5sN5PBWHGZcG5Mfc8ej7/a9py+fr2nsSbEH6CEfMATpnbqDBBqnU0Z4fWyKD iDepWcTv8ZdhM1gKdEJLKAoZ6bIskN27Xr9REoiG4aGzb+w94nsqjdhBw5O/EtXOdbvi d6Tw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lZ6cKU83; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id a2-20020a63e402000000b005be1e555473si10029408pgi.574.2023.11.27.04.47.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Nov 2023 04:47:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lZ6cKU83; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 fry.vger.email (Postfix) with ESMTP id 1C11C8093799; Mon, 27 Nov 2023 04:47:13 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233480AbjK0Mqi (ORCPT + 99 others); Mon, 27 Nov 2023 07:46:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49458 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233423AbjK0MqR (ORCPT ); Mon, 27 Nov 2023 07:46:17 -0500 Received: from mail-qk1-x729.google.com (mail-qk1-x729.google.com [IPv6:2607:f8b0:4864:20::729]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4FB52D4D for ; Mon, 27 Nov 2023 04:46:12 -0800 (PST) Received: by mail-qk1-x729.google.com with SMTP id af79cd13be357-777745f1541so238561185a.0 for ; Mon, 27 Nov 2023 04:46:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1701089171; x=1701693971; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=n0WeQVv6xDz1fA7FB+siaDKsF7jHm7RdEkvM6+sXcAk=; b=lZ6cKU83Ln+yT/quD7SMkjuwFY3qBG0aTEJS0eDJLPc+z7f10ZTOE9BTw5yPQsMu4B KjA05E+EIQ82KNtEcJ36VDnA78Sz+Pel8lJ1fOAw2dqzaNyxD2Uwfmot7VKOl8WwAtVC vWol2mFYS1sLZKRoplGwX7i4y+wYwYshYesxG7U/3G8fh+5x7vd33LULhwf8G9yXYGXv cJBGctkrKlqBTw0i2lrLUeQ4/sLTHFND19X7Nv+BzbZpvQ7UsNSfS/lLZd63BYfDszcW MLQw4nTqae/FSEK5EarttPP5YNwtAbXJckpVIq/bVSAddd5zD2r87JsLLJk4PeJ7sQG6 2XQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701089171; x=1701693971; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=n0WeQVv6xDz1fA7FB+siaDKsF7jHm7RdEkvM6+sXcAk=; b=oGEkHWSq6QTomEV6/QL8dkTxRhx20SynMNm/1w909cuI99tYl6yyp9qyJ0EaWU0jDn YvWldwlEx/xPW9oidiVZ6XCivp+i0T6yz7/r17UdS9h8Jd/rW7dEKz7vSCQ+jKoMGbAM mRcZbZQhXvpw9hJw7St1DZ/UPCmU3CgQ36+pWxUGH2ceYjbVf4jKiavoqCptZ9eYA2uh GpNDIp/KasKqlIDiqjATOru+n/07iG17MlElcQaFg3iKNW6Xrqe8t8uH42FN+Krcm2hg OQEyNja/YlwnrHJ8+/0g9luiee5sGnQeaLtK+xN9d5+7IvJFpNGD9OG+jr4wq68P4d7/ RixA== X-Gm-Message-State: AOJu0Yz8+edPOmSGVPlS4fPWxpkxpocksmCkkDVzJTsAO5B0xgr5Bx6b qGaV3cSqCxCKqTvJVoRW/qrC X-Received: by 2002:a05:6214:469b:b0:67a:35f3:4408 with SMTP id or27-20020a056214469b00b0067a35f34408mr9911296qvb.31.1701089170905; Mon, 27 Nov 2023 04:46:10 -0800 (PST) Received: from localhost.localdomain ([117.213.103.241]) by smtp.gmail.com with ESMTPSA id er10-20020a056214190a00b0067a204b4688sm2832231qvb.18.2023.11.27.04.46.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Nov 2023 04:46:10 -0800 (PST) From: Manivannan Sadhasivam To: lpieralisi@kernel.org, kw@linux.com Cc: kishon@kernel.org, bhelgaas@google.com, mhi@lists.linux.dev, linux-arm-msm@vger.kernel.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Manivannan Sadhasivam Subject: [PATCH 6/9] PCI: epf-mhi: Enable MHI async read/write support Date: Mon, 27 Nov 2023 18:15:26 +0530 Message-Id: <20231127124529.78203-7-manivannan.sadhasivam@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231127124529.78203-1-manivannan.sadhasivam@linaro.org> References: <20231127124529.78203-1-manivannan.sadhasivam@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email 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 (fry.vger.email [0.0.0.0]); Mon, 27 Nov 2023 04:47:13 -0800 (PST) Now that both eDMA and iATU are prepared to support async transfer, let's enable MHI async read/write by supplying the relevant callbacks. In the absence of eDMA, iATU will be used for both sync and async operations. Signed-off-by: Manivannan Sadhasivam --- drivers/pci/endpoint/functions/pci-epf-mhi.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/pci/endpoint/functions/pci-epf-mhi.c b/drivers/pci/endpoint/functions/pci-epf-mhi.c index 3d09a37e5f7c..d3d6a1054036 100644 --- a/drivers/pci/endpoint/functions/pci-epf-mhi.c +++ b/drivers/pci/endpoint/functions/pci-epf-mhi.c @@ -766,12 +766,13 @@ static int pci_epf_mhi_link_up(struct pci_epf *epf) mhi_cntrl->raise_irq = pci_epf_mhi_raise_irq; mhi_cntrl->alloc_map = pci_epf_mhi_alloc_map; mhi_cntrl->unmap_free = pci_epf_mhi_unmap_free; + mhi_cntrl->read_sync = mhi_cntrl->read_async = pci_epf_mhi_iatu_read; + mhi_cntrl->write_sync = mhi_cntrl->write_async = pci_epf_mhi_iatu_write; if (info->flags & MHI_EPF_USE_DMA) { mhi_cntrl->read_sync = pci_epf_mhi_edma_read; mhi_cntrl->write_sync = pci_epf_mhi_edma_write; - } else { - mhi_cntrl->read_sync = pci_epf_mhi_iatu_read; - mhi_cntrl->write_sync = pci_epf_mhi_iatu_write; + mhi_cntrl->read_async = pci_epf_mhi_edma_read_async; + mhi_cntrl->write_async = pci_epf_mhi_edma_write_async; } /* Register the MHI EP controller */ -- 2.25.1