Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5516717rdb; Wed, 13 Dec 2023 10:49:46 -0800 (PST) X-Google-Smtp-Source: AGHT+IHowgzJl1WBdtVrr7ugd7EmLLdU1eDQ2nrsd+3RdnmQJKHUrjM60+y5Smd3RxrgdURpcxtr X-Received: by 2002:a17:90a:d703:b0:28a:dd4c:87ca with SMTP id y3-20020a17090ad70300b0028add4c87camr1421022pju.20.1702493386514; Wed, 13 Dec 2023 10:49:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702493386; cv=none; d=google.com; s=arc-20160816; b=g3E4l8ZLtKIJk9BqgoE1jVBA4ImjfaC7hf8HuLzQJfY8q78MkT12OklxNt2B8+4drQ sQL/dIcFzLaXNwF7mFRdPiC9z0CCxdIM/l3xRVuRBSaVpmTliTbP+AWztCIX9Fr9kYF2 GmN3OUvgOBaslyvfopHIB74lFl4V/HjzaxVCJjc18Nr9Am94Bw7Y4xKCiput14V0BwXu mz3aiaplRnwkMxAVUzZ49LnXixZNMDJVum4ICb7zBZhAZS3Fd+Tx2SwMj975JAwFYBvY tIspzsu//CKZtUTvoW9GG0S2j8gram6eZg2R5+CQBbllEiftcHVn25XIXOxXJ0ToTM5+ e/hg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=QYvsi1BeF9vZr5nFKSjT9VCibEudQ5MsSdiBfCjNBkM=; fh=R9/X0S8Y6On/oR+e1yMtb8pCo73KBZzA3x8LZJtAq5c=; b=xQvliB6JjrL6wJ1+zHACoYGPXS3lrVW3+2E5Yy2DXYW1TqzJFS8DtUMoKHusWHVIjh OwSt94Rsew8PkfPWuoP7cueCm6/7xxC/FWnAEhSPPPtzDsKEMuFoq0i51asO7bhhpzQF A62n21zitiop0SCdVKVEMdHtUJQisA+5YbRJji+YSZwibRtrwzbF0skEjFgJ0ntI1A9R JgFG4QlkIieArRzkuOAvl94/QaTjKhziZQawcGEOpfGU1+DIatZ/0pDapFYYYItTHff4 EYywltK6ICG6RY4A0hP4xEhMYgyq4hofiUJs9tdfojJeWLFxCvZsLmL9z4wbCuTyoYw7 2Xgg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linux.com Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id ce5-20020a17090aff0500b00285a0b546eesi9829473pjb.155.2023.12.13.10.49.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 10:49:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linux.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 44EA5826EC44; Wed, 13 Dec 2023 10:49:44 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233584AbjLMSta (ORCPT + 99 others); Wed, 13 Dec 2023 13:49:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41640 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233264AbjLMSt3 (ORCPT ); Wed, 13 Dec 2023 13:49:29 -0500 Received: from mail-pf1-f177.google.com (mail-pf1-f177.google.com [209.85.210.177]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 31F13D0; Wed, 13 Dec 2023 10:49:36 -0800 (PST) Received: by mail-pf1-f177.google.com with SMTP id d2e1a72fcca58-6ce72730548so6500761b3a.1; Wed, 13 Dec 2023 10:49:36 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702493375; x=1703098175; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=QYvsi1BeF9vZr5nFKSjT9VCibEudQ5MsSdiBfCjNBkM=; b=AZVviE69W6AAA66gdQ9Fnq+6GinI1VM9AW1s10B47JDHiMNu4KxPJcxW4zLYOdkB/c BDIOf97FNX+XWDryud4mf9f+8O41f6va3hHoVK77/71Qf8Cudm22R1gKWlVzwzqPI1Cy R7L4Q90c2ZK4jqgwtSNti4638X7uzN9LniWpbzPyjn6Ft1xLfAOdWmQGUTIDpnnhxNL2 CkE1JBIIBtkghtZpUFzC+MhPIM2FLqUZWLlJmrHT+OImrTsEQmdJWqu+6c6OkHlnlvrw YR0+9N9GZCnOLgn8DjpSD4jrQh6kKuaYRyzAOY8zdbbNZhFEekopXZlK6e+sGT/UQ84y YgHQ== X-Gm-Message-State: AOJu0YyoOshyRuZ1kakWXLOsfCIif5HJko+jumbEXKK3hgGA1rfLKKfS F13vfJkA6D3col8/H5Fvcro= X-Received: by 2002:a05:6a00:2d9d:b0:6cd:d639:b353 with SMTP id fb29-20020a056a002d9d00b006cdd639b353mr10248064pfb.18.1702493375559; Wed, 13 Dec 2023 10:49:35 -0800 (PST) Received: from localhost (fpd11144dd.ap.nuro.jp. [209.17.68.221]) by smtp.gmail.com with ESMTPSA id o73-20020a62cd4c000000b006c875abecbcsm10687034pfg.121.2023.12.13.10.49.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 10:49:34 -0800 (PST) Date: Thu, 14 Dec 2023 03:49:33 +0900 From: Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= To: Manivannan Sadhasivam Cc: lpieralisi@kernel.org, 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 Subject: Re: [PATCH 4/9] PCI: epf-mhi: Simulate async read/write using iATU Message-ID: <20231213184933.GB924726@rocinante> References: <20231127124529.78203-1-manivannan.sadhasivam@linaro.org> <20231127124529.78203-5-manivannan.sadhasivam@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20231127124529.78203-5-manivannan.sadhasivam@linaro.org> X-Spam-Status: No, score=-0.8 required=5.0 tests=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 morse.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 (morse.vger.email [0.0.0.0]); Wed, 13 Dec 2023 10:49:44 -0800 (PST) Hello, > 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; > } Looks good! Reviewed-by: Krzysztof WilczyƄski Krzysztof