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 X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B7C29C43331 for ; Wed, 1 Apr 2020 09:28:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8908F20784 for ; Wed, 1 Apr 2020 09:28:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727723AbgDAJ2W (ORCPT ); Wed, 1 Apr 2020 05:28:22 -0400 Received: from foss.arm.com ([217.140.110.172]:46990 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726205AbgDAJ2W (ORCPT ); Wed, 1 Apr 2020 05:28:22 -0400 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 424511FB; Wed, 1 Apr 2020 02:28:21 -0700 (PDT) Received: from bogus (unknown [10.37.12.97]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id EF5793F52E; Wed, 1 Apr 2020 02:28:19 -0700 (PDT) Date: Wed, 1 Apr 2020 10:28:16 +0100 From: Sudeep Holla To: Peng Fan Cc: "linux-arm-kernel@lists.infradead.org" , "devicetree@vger.kernel.org" , "f.fainelli@gmail.com" , dl-linux-imx Subject: Re: [PATCH 1/4] firmware: arm_scmi: Make mutex channel specific Message-ID: <20200401092816.GD3954@bogus> References: <20200327163654.13389-1-sudeep.holla@arm.com> <20200327163654.13389-2-sudeep.holla@arm.com> <20200401091208.GB3954@bogus> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org On Wed, Apr 01, 2020 at 09:14:36AM +0000, Peng Fan wrote: > > Subject: Re: [PATCH 1/4] firmware: arm_scmi: Make mutex channel specific > > > > On Wed, Apr 01, 2020 at 01:12:37AM +0000, Peng Fan wrote: > > > Hi Sudeep, > > > > > > > Subject: [PATCH 1/4] firmware: arm_scmi: Make mutex channel specific > > > > > > > > In order to support multiple SMC/HVC transport channels with > > > > associated shared memory, > > > > > > Does this mean each channel will have its own shared memory? Or All > > > channels share the same shared memory? > > > > > > > It depends on platform firmware and DT. If there is only one shmem at the top > > level scmi node, all share that single channel. If some/all protocols have their > > own channel, they there must be shmem entry in the corresponding child > > node. > > > > > it is better to maintain the mutex per channel instead of > > > > existing global one. > > > > > > If all channels shared the same memory, use per channel mutex lock > > > will not be able to prevent other channels accessing shared memory at > > > the same time. > > > > > > > No we don't create channel per protocol. If they share, we just share the > > channel pointer. Look at: > > > > if (!info->desc->ops->chan_available(dev, idx)) { > > cinfo = idr_find(idr, SCMI_PROTOCOL_BASE); > > if (unlikely(!cinfo)) /* Possible only if platform has no Rx */ > > return -EINVAL; > > goto idr_alloc; > > } > > > > If a protocol doesn't have a dedicated channel, we just assign the base > > protocol channel to it. We don't call chan_setup at all on that channel. > > Your patch assumed so but the core driver never did that. > > > > Hope this clarifies you doubt. > > Yes. Thanks for the explainaiton. > No worries, I should have seen this during initial review, just missed few trivial things. -- Regards, Sudeep 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 X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 82759C43331 for ; Wed, 1 Apr 2020 09:28:25 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 4474B20784 for ; Wed, 1 Apr 2020 09:28:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="PBW1XbDg" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4474B20784 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=7/6mhTCK++yEtUuzI4XKLC4Z/BlXoIx2fPlM8kOwxIo=; b=PBW1XbDg40+H1Q VY0v1W+rIHjzyNKlfhjjYhYMW+BaSFeL0VZahL6LOc/yObks8DppHY/+3eTSRxJO/ij9TTwhc1WiG qFiRQ6pvHK94O0QkWvRzYG+ay9WQQ7AvmMnwZFdPe5RB/+/d05tw4PjgpaoRBpDg8w+DTk1onnzch 4VlLHCOVJJZDnm2tnCzsiJLERNWUhNJkvQzPImFJST873XlgLKjbG5+FKAXSdWheHx9SSNRWTgbQJ Um/T1YEtchCgvHuBplRGv5JU0ejmXhOrCciqaroo5BCLKd0JzoaT0oNYgIXZ+z+DwKKPZ1GZ+auHg FvQyB4bsAOKe35IJ7Ffw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jJZfc-0006sD-VG; Wed, 01 Apr 2020 09:28:24 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jJZfZ-0006rb-R8 for linux-arm-kernel@lists.infradead.org; Wed, 01 Apr 2020 09:28:23 +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 424511FB; Wed, 1 Apr 2020 02:28:21 -0700 (PDT) Received: from bogus (unknown [10.37.12.97]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id EF5793F52E; Wed, 1 Apr 2020 02:28:19 -0700 (PDT) Date: Wed, 1 Apr 2020 10:28:16 +0100 From: Sudeep Holla To: Peng Fan Subject: Re: [PATCH 1/4] firmware: arm_scmi: Make mutex channel specific Message-ID: <20200401092816.GD3954@bogus> References: <20200327163654.13389-1-sudeep.holla@arm.com> <20200327163654.13389-2-sudeep.holla@arm.com> <20200401091208.GB3954@bogus> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200401_022821_921518_C10A146F X-CRM114-Status: GOOD ( 18.83 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "devicetree@vger.kernel.org" , "f.fainelli@gmail.com" , dl-linux-imx , "linux-arm-kernel@lists.infradead.org" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Apr 01, 2020 at 09:14:36AM +0000, Peng Fan wrote: > > Subject: Re: [PATCH 1/4] firmware: arm_scmi: Make mutex channel specific > > > > On Wed, Apr 01, 2020 at 01:12:37AM +0000, Peng Fan wrote: > > > Hi Sudeep, > > > > > > > Subject: [PATCH 1/4] firmware: arm_scmi: Make mutex channel specific > > > > > > > > In order to support multiple SMC/HVC transport channels with > > > > associated shared memory, > > > > > > Does this mean each channel will have its own shared memory? Or All > > > channels share the same shared memory? > > > > > > > It depends on platform firmware and DT. If there is only one shmem at the top > > level scmi node, all share that single channel. If some/all protocols have their > > own channel, they there must be shmem entry in the corresponding child > > node. > > > > > it is better to maintain the mutex per channel instead of > > > > existing global one. > > > > > > If all channels shared the same memory, use per channel mutex lock > > > will not be able to prevent other channels accessing shared memory at > > > the same time. > > > > > > > No we don't create channel per protocol. If they share, we just share the > > channel pointer. Look at: > > > > if (!info->desc->ops->chan_available(dev, idx)) { > > cinfo = idr_find(idr, SCMI_PROTOCOL_BASE); > > if (unlikely(!cinfo)) /* Possible only if platform has no Rx */ > > return -EINVAL; > > goto idr_alloc; > > } > > > > If a protocol doesn't have a dedicated channel, we just assign the base > > protocol channel to it. We don't call chan_setup at all on that channel. > > Your patch assumed so but the core driver never did that. > > > > Hope this clarifies you doubt. > > Yes. Thanks for the explainaiton. > No worries, I should have seen this during initial review, just missed few trivial things. -- Regards, Sudeep _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel