From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 075C0CFC52C for ; Mon, 14 Oct 2024 10:10:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=eCFnGzktkZ2uWEIDDNv4M1kj6BYQHN94MZ/qlf4qTdo=; b=lfuTTALGB+Syp0Jv+UmZTbpQ6E nCm0XGS42vraj4NMkeKdA4F2Ht4+E+XKmjSCPIpGMYyrTVkCdJRND8okmIqLBgV3NGYrkGYwXx9tY F4KD+48JN6iKyK1mezYq6BngYfz750P/a4rv2qu6X/Qc6vRnrrULEyHD1pYGasz1RPuKQGAOwDTpD zrV90CLRa2ev1Si2o7vhJZNTMxmrOyHL7VuLiMwfYv9Is9b4dHVmPswmrKkPmoTZccaPovdTmv/QQ FZAiiekL5w85OuHhXXtFyeO8o3XWPMka6TF+5fIsJJitfeBZjmhs/2+YTlDJILWbhRRTfJ7TJ1QOK 4nIMcAkw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t0I1h-00000004eUa-2woG; Mon, 14 Oct 2024 10:10:09 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t0HnL-00000004c3S-3WEx for linux-arm-kernel@lists.infradead.org; Mon, 14 Oct 2024 09:55:21 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 48E5C1007; Mon, 14 Oct 2024 02:55:47 -0700 (PDT) Received: from bogus (e133711.arm.com [10.1.196.55]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B49B13F51B; Mon, 14 Oct 2024 02:55:16 -0700 (PDT) Date: Mon, 14 Oct 2024 10:55:14 +0100 From: Sudeep Holla To: Cristian Marussi Cc: Justin Chen , arm-scmi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, peng.fan@nxp.com, bcm-kernel-feedback-list@broadcom.com, florian.fainelli@broadcom.com Subject: Re: [PATCH v2] firmware: arm_scmi: Queue in scmi layer for mailbox implementation Message-ID: References: <20241009192637.1090238-1-justin.chen@broadcom.com> <50f4d2d6-dead-4053-834f-134d2df0d6bd@broadcom.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241014_025519_945246_1AC70B18 X-CRM114-Status: GOOD ( 14.87 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Sun, Oct 13, 2024 at 10:26:49AM +0100, Cristian Marussi wrote: > On Fri, Oct 11, 2024 at 12:15:07PM -0700, Justin Chen wrote: > > > > Yes, I see the implementation. Looks like it returns the position in the > > ring buffer. I also confirmed with CONFIG_DEBUG_MUTEXES which triggers a > > warning. > > > > What about this? > > if (ret >= 0) > > ret = 0 > > else > > mutex_unlock(&smbox->chan_lock); > > > > A bit easier to read IMO. > > Oh yes much better definitely...or, maybe, even more simply to read: > > ... > > mutex_lock(&smbox->chan_lock); > ret = mbox_send_message(smbox->chan, xfer); > if (ret < 0) { > mutex_unlock(&smbox->chan_lock); > return ret; > } > > return 0; > } > > .... up to You...not sure what Sudeep prefers... > I like this better. Also I was hoping Justin would send v3 soonish, I want to send PR for fixes soon. So I have gone ahead and fixed all your comments myself. I had seen the doxygen one from builder already and had fixed it up last week when I added this to -next. -- Regards, Sudeep