Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp5993249pxb; Tue, 16 Feb 2021 12:58:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJwzux1Zu3s9cON+JGXY3FuOsnG+UdWLDWrvNUgf6cO0AHA9Bvhu3y+gTmrEukjoGA35i5dZ X-Received: by 2002:a17:906:2bce:: with SMTP id n14mr21655612ejg.171.1613509117094; Tue, 16 Feb 2021 12:58:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613509117; cv=none; d=google.com; s=arc-20160816; b=WclnjRz3oVuy4QqgaVUu7Cso7DX5YGkI6SEY0rZMnqBILtVCg1GctzYEuocyoILRiM 5IPHVrCNOQ6qHDaFpccWK44C1ZQVrJ+arrfc2d5+oLBLCjoKAsCxGJDt7j/MWAg8/C7K H8jDigXt93Jung2stPJAwtn04Ke4NDRzLIFEpJWZ50t3D71MWlITScmgGvPTjap66TtL 9WLl0o2/hgwpFFia444i8BAD2AgjnYS8LW8cQtbQgi5C6cqS5y7kYncbxD6u7BR6SY5M 3BS/JZl/W5KjSIwE/zkXfl/ePfxuG56PNw8ClIn9e7CwQteSWdX9ZZb8hEskVU0uqHdY loTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dmarc-filter:sender:dkim-signature; bh=vMW15tcB/VDtgwUABqW7aniqJwPV/31hchhXCEizb9w=; b=mazw6B1qI5EAxM+Z+vuzpyNGiZnnFcZWzu5nJAMd3x0kdFWFwo0PSIcZLxAMV0jdYv oW8g7I3Az3SoQLSZM4yonfFNKOlCzyUqZTCiC+fOxLBrUl/oD9yj9MNkB2XCpGPvIUI/ ZRoRujWbeMEVE7EYkXYPDwn0HpUhy5vc+AEUupqVIzLR7NtbptaDZP2jY0pugh8Biumo bdbyYs+iH8F9yke/FPqggWnhiDBnZWfd0WE2Te/rNbqyT+ArfYpm/KDcmzE50ZrpfrZv mlQfZ21i4kicbTxJGOuMW4UzNd1+SKzC5CpQ/jQb1JvP3mBQDcxegMvmfUoYJib5ZmX/ C2+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=iSFBwicr; 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 k7si8351ejb.442.2021.02.16.12.58.13; Tue, 16 Feb 2021 12:58:37 -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=iSFBwicr; 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 S229577AbhBPUyh (ORCPT + 99 others); Tue, 16 Feb 2021 15:54:37 -0500 Received: from z11.mailgun.us ([104.130.96.11]:55791 "EHLO z11.mailgun.us" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229699AbhBPUy1 (ORCPT ); Tue, 16 Feb 2021 15:54:27 -0500 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1613508849; h=Content-Transfer-Encoding: Content-Type: In-Reply-To: MIME-Version: Date: Message-ID: From: References: Cc: To: Subject: Sender; bh=vMW15tcB/VDtgwUABqW7aniqJwPV/31hchhXCEizb9w=; b=iSFBwicr9WTgcWaFj969SQMwGCZ/M+S9d/dMNrQGy+vHlzPJ07nd93nwSOHUQaIJK5lzNxQJ I4q9guTk3r5mQGvlxeUFyDb/9w9eeG/5CglUgpEnmz3AikctitrZ2QBMI+p7Gqfdr1+Jz0A5 DsKbZPoX8yEUwZ8U6o/oAE9T3zM= X-Mailgun-Sending-Ip: 104.130.96.11 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-n03.prod.us-east-1.postgun.com with SMTP id 602c30d3790422e0fe4fbff4 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Tue, 16 Feb 2021 20:53:39 GMT Sender: jhugo=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 3E141C433CA; Tue, 16 Feb 2021 20:53:39 +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, NICE_REPLY_A,SPF_FAIL,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from [10.226.59.216] (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: jhugo) by smtp.codeaurora.org (Postfix) with ESMTPSA id 2FA32C433C6; Tue, 16 Feb 2021 20:53:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 2FA32C433C6 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=jhugo@codeaurora.org Subject: Re: [PATCH] mhi_bus: core: Return EBUSY if MHI ring is full To: bbhatt@codeaurora.org Cc: manivannan.sadhasivam@linaro.org, hemantk@codeaurora.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Fan Wu , jhugo=codeaurora.org@codeaurora.org References: <1613501314-2392-1-git-send-email-jhugo@codeaurora.org> From: Jeffrey Hugo Message-ID: <5a6a77d2-fc67-753f-7b9f-4a60c808ac92@codeaurora.org> Date: Tue, 16 Feb 2021 13:53:37 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/16/2021 1:22 PM, Bhaumik Bhatt wrote: > On 2021-02-16 10:48 AM, Jeffrey Hugo wrote: >> From: Fan Wu >> >> Currently ENOMEM is returned when MHI ring is full. This error code is >> very misleading. Change to EBUSY instead. >> >> Signed-off-by: Fan Wu >> Signed-off-by: Jeffrey Hugo >> --- >>  drivers/bus/mhi/core/main.c | 2 +- >>  1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/drivers/bus/mhi/core/main.c b/drivers/bus/mhi/core/main.c >> index f182736..21eb5fc 100644 >> --- a/drivers/bus/mhi/core/main.c >> +++ b/drivers/bus/mhi/core/main.c >> @@ -996,7 +996,7 @@ static int mhi_queue(struct mhi_device *mhi_dev, >> struct mhi_buf_info *buf_info, >> >>      ret = mhi_is_ring_full(mhi_cntrl, tre_ring); >>      if (unlikely(ret)) { >> -        ret = -ENOMEM; >> +        ret = -EBUSY; >>          goto exit_unlock; >>      } > > ENOMEM is descriptive of the state of the ring since you basically > cannot queue any > more packets as no memory is currently available. > > But I agree, it can be misleading for this API. How about EAGAIN in > place of EBUSY, > which tells the user to try the queue attempt again implying memory > should become > available as more elements are consumed by the device/client? Fan and I think EAGAIN is fine. Will send a v2. -- Jeffrey Hugo Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.