Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp679388lqs; Fri, 14 Jun 2024 02:19:56 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXkL1FB5XfBJrkF+iGIl2DDePqRKAVIN01+sNxq0XN/Zog1NtUtcKPE/Oair6POzSX08CVmeGlOzKCPUVR/0ohIvmTwXkbp+hn7t0n56Q== X-Google-Smtp-Source: AGHT+IEBE3hqk6dIY1TkWk1dkP6+cV/q9RMQSDvFI9ml5+mRs78qgFdXPjMD1fxdffyMuYivvCb5 X-Received: by 2002:a17:906:ca0d:b0:a6f:5f75:209f with SMTP id a640c23a62f3a-a6f60dc2040mr149863166b.55.1718356796519; Fri, 14 Jun 2024 02:19:56 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718356796; cv=pass; d=google.com; s=arc-20160816; b=F6p2lELmPoivOeZWULeK76ycYM3WLbqCnpNhXXvG45uxWzP4+I+1SRYDpgxz1HyP/E elkOJTuCJedoLrzu5ao19bq2XEiDmv3DXFa+6hr73l4tRpaTjKinQFAicSo4QbVHcgtL HB8T/kjcd78Wo64bxVdyc9NptUAHqdUEQpR5kFQwAhsrOkD0Bmom9R/7aGwcsYCWlXbs QscKYUPt5Q9Qm6M2ptifnznzOxTxZhl2/tyn1J+BPbvc5HdVkP+SwauPudqBYxQfo9j3 GfOOquP5fsxPi4Ksdkg5VqDGS3sQeE+IO3r2Y40sGY3sWvepoX5fn4dFp1X6qSeM2mW0 gGLw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date; bh=iY8ehRkWaH2JjiB9a7NlFmskLSkzFS9rgA/CRQpSFqg=; fh=O+GdufyEtMW60ULD5JPeoy0QlmhAw1JDCuDCPKralyQ=; b=nAeu9j/7CLY3/mcoy4GVq5d+H4o0RNYHCn/np9kC/X2eohbWal7H3pBWbpv6tJvJp/ DpRBQ1OgNV+53OFuzMPs4+OwDsp+Sioij+ySYx5KJNs1WSmlV8DrDZrHLP0LYVI6OpHg b3KU19Fl0rYo/TSuFG/ssuJHGl+H9l+f8vamj6hWy8ef6+LA/cLrCdOV4fyc3eZB3nax 603mPlw+IJ08BbsusBrgwElFGKJkRqt0MmLdo8X+0TRK5TCqnJlDbf0NrhvUS2kAw992 nSm5z/UTNIWp0fBFTxmLg0VCsS0pYOou+W5cM1h4jA1qZsBJC723JYbgT/Pg3rkH/cpR ntMA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-214621-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-214621-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a6f56df4a50si153447266b.492.2024.06.14.02.19.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Jun 2024 02:19:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-214621-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-214621-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-214621-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 3BF7A1F23E1B for ; Fri, 14 Jun 2024 09:19:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0F0BE1922D6; Fri, 14 Jun 2024 09:19:49 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6E62B7E574; Fri, 14 Jun 2024 09:19:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718356788; cv=none; b=HuN8RsFSsuga9wf+ZZglI5T8xmrN6SIIw6FNg7nNlLx01twKHUj3fI5jj5cWP3PoFIQGZOlZcdq9fo0LrTOdcjK51CiFE1eXye1ZsaJiKW1dEJ05FWYUmwaVL2o/l3aAD55N7TDTcF020t7X2aNQlebo/q76uk2Emvvoa9Ue+YA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718356788; c=relaxed/simple; bh=GBUGIbROlFX1OdcaWHEELKAdQiLL5ncUEClh6MLQAww=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=QNwlgHehUruBEjgqZ4HDrd1GM3B1lCWYIOtas3LsRHuWxIHvWfuUY3V7dUu29VkF8XJwMr2mCoSeigpYi03KyJbLaemOpDGvI9UlyFJIlVzzRc9QCwfvEKWUPFIyDbguhyIO6rzkQY8RFl4ftC+6EGMA7g5KWLseHlw0/UEkGKU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com 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 47D68339; Fri, 14 Jun 2024 02:20:10 -0700 (PDT) Received: from bogus (e103737-lin.cambridge.arm.com [10.1.197.49]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 6730F3F5A1; Fri, 14 Jun 2024 02:19:44 -0700 (PDT) Date: Fri, 14 Jun 2024 10:19:42 +0100 From: Sudeep Holla To: "Peng Fan (OSS)" Cc: Cristian Marussi , Rob Herring , Sudeep Holla , Krzysztof Kozlowski , Conor Dooley , linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Peng Fan Subject: Re: [PATCH v2 2/2] firmware: arm_scmi: mailbox: support P2A channel completion Message-ID: References: <20240510-scmi-notify-v2-0-e994cf14ef86@nxp.com> <20240510-scmi-notify-v2-2-e994cf14ef86@nxp.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240510-scmi-notify-v2-2-e994cf14ef86@nxp.com> On Fri, May 10, 2024 at 11:19:48AM +0800, Peng Fan (OSS) wrote: There was some coding style error reported(unbalanced {}) which made me look at the code again. I don't think we need to splat out error. > @@ -300,8 +326,30 @@ static void mailbox_fetch_notification(struct scmi_chan_info *cinfo, > static void mailbox_clear_channel(struct scmi_chan_info *cinfo) > { > struct scmi_mailbox *smbox = cinfo->transport_info; > + struct device *cdev = cinfo->dev; > + struct mbox_chan *intr; > + int ret; > > shmem_clear_channel(smbox->shmem); > + > + if (!shmem_channel_intr_enabled(smbox->shmem)) > + return; > + > + if (smbox->chan_platform_receiver) > + intr = smbox->chan_platform_receiver; > + else if (smbox->chan) > + intr = smbox->chan; > + else { > + dev_err(cdev, "Channel INTR wrongly set?\n"); > + return; > + } > If it is OK I would like to fix it up with below change. Regards, Sudeep -->8 diff --git i/drivers/firmware/arm_scmi/mailbox.c w/drivers/firmware/arm_scmi/mailbox.c index adb69a6a0223..3bb3fba8f478 100644 --- i/drivers/firmware/arm_scmi/mailbox.c +++ w/drivers/firmware/arm_scmi/mailbox.c @@ -326,30 +326,25 @@ static void mailbox_fetch_notification(struct scmi_chan_info *cinfo, static void mailbox_clear_channel(struct scmi_chan_info *cinfo) { struct scmi_mailbox *smbox = cinfo->transport_info; - struct device *cdev = cinfo->dev; - struct mbox_chan *intr; + struct mbox_chan *intr_chan = NULL; int ret; shmem_clear_channel(smbox->shmem); - if (!shmem_channel_intr_enabled(smbox->shmem)) - return; - if (smbox->chan_platform_receiver) - intr = smbox->chan_platform_receiver; + intr_chan = smbox->chan_platform_receiver; else if (smbox->chan) - intr = smbox->chan; - else { - dev_err(cdev, "Channel INTR wrongly set?\n"); + intr_chan = smbox->chan; + + if (!(intr_chan && shmem_channel_intr_enabled(smbox->shmem))) return; - } - ret = mbox_send_message(intr, NULL); + ret = mbox_send_message(intr_chan, NULL); /* mbox_send_message returns non-negative value on success, so reset */ if (ret > 0) ret = 0; - mbox_client_txdone(intr, ret); + mbox_client_txdone(intr_chan, ret); } static bool