Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp3011454rdh; Mon, 27 Nov 2023 04:46:32 -0800 (PST) X-Google-Smtp-Source: AGHT+IGGOqP6uS2kjklwGX2yR6xT6AqNJDU30v6k2CviWP8bapYRaLks47OE+SKhh3yWlV6oyyvN X-Received: by 2002:a05:6808:11c6:b0:3af:d9ea:74b6 with SMTP id p6-20020a05680811c600b003afd9ea74b6mr14558713oiv.43.1701089192679; Mon, 27 Nov 2023 04:46:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701089192; cv=none; d=google.com; s=arc-20160816; b=cWI5p1R7IsttBED8ESZsJHmUuSdm+2pE36K0jZNqMs+8nIAAosGQrDhXpvGcuKlUuk IN+OeFbF7tbikCbrI2fuOIU0ER4YESiuggS3mxfx0R3xQMhvjWG++skW6Ptr4RrFSjSB Li/b5QjIPR+GqS8uhyc7qvi8xeNrPX+et6Q5oAV9/85rUOwFeO7I5ubhBU5LrJ1mP+/9 PvjTO9T0nZkWz4eXXMBjZ41O4i/DrnJmr/gPlStNTFlWCL+OI3bvdo8zKDfQxxRIU87J o9qy+P5G5yDgPdul33lZ2kRtlsofZZC3A4Wjrp2LXhqdyCe5f5tXkVNmVFjsfAGuq9kl qUcg== 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=szORryW2l9J0pCg1kQG3OS6E1waFAt6BYGHK4qsw87M=; fh=GCPsaS9gPzUx9ecgCkAchNprj2XO1a7aLVETzufn50Y=; b=fnFdkwCAm2jqM7EhkV5UcwkKxiZjrD1p1XIBTiG7b4UltrkhwnRvl9pj+3gTt5NwV4 +mdLqA1+cjs9r37jle/FFGY5S+mk65UZuSCB/ik2aLfl3COMr9ug/TvyxnIfUKx/B1Xa QfA2KcZ9t8Vfck7DYp1OiVG1CEh2wqVXdAeN7MPw8EDS2NyD5dZGxsHL/XAkLIOWY0I1 wi5aMVBsKEf9IPuOBGIM7kztjd7dpXedCJfTxf9l5qavdtlj2x3j8DUIMAGxQuCrzgHN CNhB9KV8tPHjWq1r5rGy9LN1qD0usLYDUBshBC4Uo+aQAsgjEA6ZsENP7GjTXNyh5Hyj oMrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VAGhosd+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id g8-20020a0568080dc800b003b83ecc828dsi3308014oic.204.2023.11.27.04.46.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Nov 2023 04:46:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VAGhosd+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 B42BA8078617; Mon, 27 Nov 2023 04:46:29 -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 S233456AbjK0MqJ (ORCPT + 99 others); Mon, 27 Nov 2023 07:46:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40908 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233410AbjK0MqB (ORCPT ); Mon, 27 Nov 2023 07:46:01 -0500 Received: from mail-qv1-xf30.google.com (mail-qv1-xf30.google.com [IPv6:2607:f8b0:4864:20::f30]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F26A3D5D for ; Mon, 27 Nov 2023 04:46:02 -0800 (PST) Received: by mail-qv1-xf30.google.com with SMTP id 6a1803df08f44-67a12079162so16282776d6.1 for ; Mon, 27 Nov 2023 04:46:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1701089162; x=1701693962; 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=szORryW2l9J0pCg1kQG3OS6E1waFAt6BYGHK4qsw87M=; b=VAGhosd+z4xCejRdQEfPTtAgYbU0nVPbLa8Nq4RJjBNaj79B97hgFMQkObjHlqGfcr Znpb7txSt7DOV0k+R+G0cGz1HtkIuUJFIxd8VwpJrWG9rJul8rprB19xwhcyyAP1SxAq aDnUoo7auy4+MM78SavGy4XVDMpSo0ExF5M5R7nPY5ooj6+MqhR2IKb/oMz2hqx3mATW sa7P5U1ZougXN6WWfVXrwNnITBEIg5TaQoEGr40P+jUtjmV8merK8RhOrZ34/zQMhKjw 2KtYHfkU1rQR8KtaLmPNWZGqSkgNzXoYm8LBAPzPSZRXPE7G8P8S5opVdC9G9ozna4Ur K83w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701089162; x=1701693962; 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=szORryW2l9J0pCg1kQG3OS6E1waFAt6BYGHK4qsw87M=; b=i8HegVR79/m6PwXRQFAGT5Ctk76ZFVIHL6QFjlIB/NyIQO8XgzWBzpFiSJuOkwf32X I0zhEBh5zCZcHzJlF0Hr5hqTKuLvxaTFqlaM9zaXTnskrMUdYF32t7Gmnz+Mo4ydxmzc zE/n8jvEtO9FWMiUJxJ/2us2nd4ZQY++cIi52C4fBJXv5xWzK14WpXOyII4YCHThEpvk YH3uEVT97iLYgIeaFH54zZJ1HxKCQM/MmZoR969zB6rkjQ91GkMiTsdy7MCm3/6GOQMa hvFMbC6m/ljpCT179M1Pttn5Toqd9lGoRrgZMV0bo6hgpEpn4SpaAomHgr0r4uUrE0Li N9/Q== X-Gm-Message-State: AOJu0YzBPF2fOukjAQTOTvz4rjl3zCbkElgf/7lX9zHq/pxXr0Iku18w RPggvTJJ6Jmn643dYIeJg11S X-Received: by 2002:a05:6214:5596:b0:67a:191f:2872 with SMTP id mi22-20020a056214559600b0067a191f2872mr12122455qvb.11.1701089162091; Mon, 27 Nov 2023 04:46:02 -0800 (PST) Received: from localhost.localdomain ([117.213.103.241]) by smtp.gmail.com with ESMTPSA id er10-20020a056214190a00b0067a204b4688sm2832231qvb.18.2023.11.27.04.45.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Nov 2023 04:46:01 -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 4/9] PCI: epf-mhi: Simulate async read/write using iATU Date: Mon, 27 Nov 2023 18:15:24 +0530 Message-Id: <20231127124529.78203-5-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:46:30 -0800 (PST) Even though iATU only supports synchronous read/write, the MHI stack may call async read/write callbacks without knowing the limitations of the controller driver. So in order to maintain compatibility, let's simulate async read/write operation with iATU by invoking the completion callback after memcpy. Signed-off-by: Manivannan Sadhasivam --- drivers/pci/endpoint/functions/pci-epf-mhi.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/pci/endpoint/functions/pci-epf-mhi.c b/drivers/pci/endpoint/functions/pci-epf-mhi.c index 34e7191f9508..7214f4da733b 100644 --- a/drivers/pci/endpoint/functions/pci-epf-mhi.c +++ b/drivers/pci/endpoint/functions/pci-epf-mhi.c @@ -234,6 +234,9 @@ static int pci_epf_mhi_iatu_read(struct mhi_ep_cntrl *mhi_cntrl, mutex_unlock(&epf_mhi->lock); + if (buf_info->cb) + buf_info->cb(buf_info); + return 0; } @@ -262,6 +265,9 @@ static int pci_epf_mhi_iatu_write(struct mhi_ep_cntrl *mhi_cntrl, mutex_unlock(&epf_mhi->lock); + if (buf_info->cb) + buf_info->cb(buf_info); + return 0; } -- 2.25.1