Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp82864pxu; Wed, 2 Dec 2020 15:44:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJxNAPq9VM5KlACYfDKBrthWUXanqiRGpT9rqylbGLWzi/TJvY8ypNcnblAlYjlkgVmienYc X-Received: by 2002:aa7:c248:: with SMTP id y8mr436941edo.344.1606952673723; Wed, 02 Dec 2020 15:44:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606952673; cv=none; d=google.com; s=arc-20160816; b=IvBjgW1VXJuHyJ8KVckKBEOHsz4hBsdIWXHLdPRkdu/L4zRxiv9GcinVJzdU6houh6 bQMI7ZhqlDmUFUd55b/IdqgfnNBD4nsaRQKEmds9n3+9ADgMNxn8JNGqc4ojtSTnK08A X65JWaNH0Pnla8veBHcPcGDARsVkYfm1WSmpHBiKx8ZCpl9uNKP/uc5hhGbv69Bh/pdh HVITAyWXdk9PRDogefSiUP8QlT+FfzKpVKbT674zUR76R01xY7I8mJEi2xszejgWW6rn B/pKX/TnwU+CVPcaxftV+xAuP9m/bynaAMkZtf5Jod15aZuWwfUc7c2tOKIB/W4OhsGM EdYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dmarc-filter:sender:dkim-signature; bh=0WKk5xDjofv388J2WnbQdKBLVyRfY397LKch54vy5Yk=; b=a9aRlHLaWVrFlG4sxQqSDxRxW5aM7+Cog1wl8KoaaJi6enW9srTcH9ihnR8mpF4vys MKfykkN7CLEqeozXLsWJBAc+KajB+fTmwwAvkYX5kyfSwCL+qPjEOJ0Lq0eK8TWKh8nF CgiUgxRoD0YAqlNN4P6CysfYY77GQ0CwqnoApw6F7ehwy93o7hX74JA7i4SPeVSQyyqb 9mtuQYAk0WR6PKk5YLeqij86R8/RjXAvqSGufddAYl7bR2B46Hw5e4nW9rIro35j1C1i c6cLFvVMFx+392uRzOP26p7T02nLgmuY+fm+iZfp9JT77NnDI5q6nyw9ejD+MNtrDyTf G6RQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=jquvAgT0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k22si260876edj.473.2020.12.02.15.44.11; Wed, 02 Dec 2020 15:44:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=jquvAgT0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728304AbgLBXlm (ORCPT + 99 others); Wed, 2 Dec 2020 18:41:42 -0500 Received: from a2.mail.mailgun.net ([198.61.254.61]:24011 "EHLO a2.mail.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725899AbgLBXll (ORCPT ); Wed, 2 Dec 2020 18:41:41 -0500 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1606952481; h=References: In-Reply-To: Message-Id: Date: Subject: Cc: To: From: Sender; bh=0WKk5xDjofv388J2WnbQdKBLVyRfY397LKch54vy5Yk=; b=jquvAgT0ppTn6qx3USsGfpviqDmMhep70st66A+Rp3Bt7MqLcAAktjr8TKTn2NoxJ/UOXebF DMUAtgrPCbHnHdfWBNpGWimMio1cwxRGAbl9onJEfWtjBdLia+SNBr2D1eULRQekAb1G8qzX xZXhloyBDcFrYWSq1UGXCrLfTag= X-Mailgun-Sending-Ip: 198.61.254.61 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n08.prod.us-east-1.postgun.com with SMTP id 5fc82605875646f1e98536d9 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Wed, 02 Dec 2020 23:40:53 GMT Sender: bbhatt=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 38451C43463; Wed, 2 Dec 2020 23:40:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=ALL_TRUSTED,BAYES_00,SPF_FAIL, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from malabar-linux.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: bbhatt) by smtp.codeaurora.org (Postfix) with ESMTPSA id 76050C433C6; Wed, 2 Dec 2020 23:40:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 76050C433C6 Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=fail smtp.mailfrom=bbhatt@codeaurora.org From: Bhaumik Bhatt To: manivannan.sadhasivam@linaro.org, hemantk@codeaurora.org Cc: linux-arm-msm@vger.kernel.org, loic.poulain@linaro.org, jhugo@codeaurora.org, linux-kernel@vger.kernel.org, Bhaumik Bhatt Subject: [PATCH v3 7/7] bus: mhi: Improve documentation on channel transfer setup APIs Date: Wed, 2 Dec 2020 15:40:38 -0800 Message-Id: <1606952438-15321-8-git-send-email-bbhatt@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1606952438-15321-1-git-send-email-bbhatt@codeaurora.org> References: <1606952438-15321-1-git-send-email-bbhatt@codeaurora.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The mhi_prepare_for_transfer() and mhi_unprepare_from_transfer() APIs could use better explanation, especially with the addition of two new APIs to start and stop the transfers on channels. Add better set of information for those APIs. Signed-off-by: Bhaumik Bhatt --- include/linux/mhi.h | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/include/linux/mhi.h b/include/linux/mhi.h index 35779a0..bd229da 100644 --- a/include/linux/mhi.h +++ b/include/linux/mhi.h @@ -692,13 +692,35 @@ int mhi_device_get_sync(struct mhi_device *mhi_dev); void mhi_device_put(struct mhi_device *mhi_dev); /** - * mhi_prepare_for_transfer - Setup channel for data transfer + * mhi_prepare_for_transfer - Setup UL and DL channels for data transfer. + * Allocate and initialize the channel context and + * also issue the START channel command to both + * channels. Channels can be started only if both + * host and device execution environments match and + * channels are in a DISABLED state. Calling the + * mhi_start_transfer() function is not required + * afterwards as channels are already started. This + * function also initializes the channel context + * whereas mhi_start_transfer() can only be used to + * issue the start channel command once the context + * is setup. * @mhi_dev: Device associated with the channels */ int mhi_prepare_for_transfer(struct mhi_device *mhi_dev); /** - * mhi_unprepare_from_transfer - Unprepare the channels + * mhi_unprepare_from_transfer - Reset UL and DL channels for data transfer. + * Issue the RESET channel command and let the + * device clean-up the context so no incoming + * transfers are seen on the host. Free memory + * associated with the context on host. If device + * is unresponsive, only perform a host side + * clean-up. Channels can be reset only if both + * host and device execution environments match + * and channels are in an ENABLED, STOPPED or + * SUSPENDED state. Calling mhi_stop_transfer() is + * not required before calling this function as it + * will only stop transfers, not reset channels. * @mhi_dev: Device associated with the channels */ void mhi_unprepare_from_transfer(struct mhi_device *mhi_dev); -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project