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 29507C433EF for ; Fri, 4 Mar 2022 16:20:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc: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=MjvSugduCrbO104ttgcQ9+n2X/o0EYyAGKEWVf6wc3c=; b=ZoIjZjWFA+T2fi ASVI6Abrc8x78o0mgU/TmaoqH5Akm/2hv7yGFxu0wp267K4ot1pEhZlo9Q6K95mOGYzeI2eFM+tAB jsiKIQJTalnDXlXugX8LF7x7k5aAjOTgajQdfXwflYXqmZfNU2RqbticcXFNqq/bZLGSHBW2+BSfe aCiV0n3xakdSmc56b1EOoSRLkNgn2vJE0Qx13HXxr1YAZ5pV6doys0fU0PBWt/tQNnayDeoE02vnV YilV0iadRJTp+pOCp3zFqc2IwVu2CV5idWXn14C0QoHaBpe41oLt48d6R0l756fPI/qflLe4B/U3Z 0wUey0+ucBax1eURNBlQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nQAe6-00AzOI-GP; Fri, 04 Mar 2022 16:19:11 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nQAZ7-00AwzI-SK for linux-arm-kernel@lists.infradead.org; Fri, 04 Mar 2022 16:14:03 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1646410438; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=yN23TSpZltgqZyjDlAMTyjfsqXzU9shHSN2L6xQbb+U=; b=eYYAUhQ5eD1zh2gzRjsvFYd+3DHDtg9mdaQqsMPZ5CTVbmZtNgPPffrJQb0dwjMpzdaFHl V3dYVns9w7Enqp1Eq0vRvKvkWqHPkDsd5NLOgHBpJH8P1f8WyysoqKZoOU3PT6Ggpq4Z2v vQjIMbx/bBGJrqfhYaKzqhfYkqpdVDg= Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-118-q-srYbBDMgGk7zYhaMjFxg-1; Fri, 04 Mar 2022 11:13:54 -0500 X-MC-Unique: q-srYbBDMgGk7zYhaMjFxg-1 Received: by mail-ed1-f69.google.com with SMTP id u28-20020a50d51c000000b004159ffb8f24so4846104edi.4 for ; Fri, 04 Mar 2022 08:13:54 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=yN23TSpZltgqZyjDlAMTyjfsqXzU9shHSN2L6xQbb+U=; b=HG2mHq258YGxMIDiVKg8DMY8tagopJfF+ItjGP6+LAeQYpJG5ylg5HJZfhe3RZ0Qnt zrBgiusKVsvmqgr48NfZd1rU+zXXNGX1nQI5LKhcQIBM6kvcnOe0QuCzXL3kt6hPPqIg spZ8sVpZGOZn4RpLkeQT72dmNbBjiwoE2eKVJxidLgaAC2L0TWFwiCT6dpi5ZkS2vQmi kqCGEynkQDP5ZgDoh8kK7VmapYDiUejlASWuDt9PBqrh00xKAfjoukHzeIDx6/uXOXxU N1T6RdINNp1xphJscoTtGJrSCYdt/r2IAnWmuNjRlycnEEr+UnO1DX4fD1W5a83rW4Zo GavQ== X-Gm-Message-State: AOAM530o8iUvWi2WgsbX+ADbtj8Zczt6pXeC6IHJiGCPIz8wnlXXL333 FgtdNRAfk5xjPGjRHy37rdK/r+WAhi3o2hskMXBMcHD3sko3WoaRMMruroziEr86Kvi5aUwwW4U PEHHQWpl3AV+TF3+cklgrl9QT2s5tdMQDgSM= X-Received: by 2002:a17:907:8a04:b0:6b4:e098:741a with SMTP id sc4-20020a1709078a0400b006b4e098741amr31559907ejc.550.1646410433168; Fri, 04 Mar 2022 08:13:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJywVCdqNAuEyGLyRAIYXc7m5Hm1uJr5dpRKmCREEY2y36QorfEYGEA6Ebi8WzNksObwfDDTyQ== X-Received: by 2002:a17:907:8a04:b0:6b4:e098:741a with SMTP id sc4-20020a1709078a0400b006b4e098741amr31559874ejc.550.1646410432839; Fri, 04 Mar 2022 08:13:52 -0800 (PST) Received: from redhat.com ([2.52.16.157]) by smtp.gmail.com with ESMTPSA id c14-20020a170906340e00b006ce98f2581asm1859825ejb.205.2022.03.04.08.13.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Mar 2022 08:13:52 -0800 (PST) Date: Fri, 4 Mar 2022 11:13:47 -0500 From: "Michael S. Tsirkin" To: Cristian Marussi Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, sudeep.holla@arm.com, james.quinlan@broadcom.com, Jonathan.Cameron@huawei.com, f.fainelli@gmail.com, etienne.carriere@linaro.org, vincent.guittot@linaro.org, souvik.chakravarty@arm.com, peter.hilber@opensynergy.com, igor.skalkin@opensynergy.com Subject: Re: [PATCH v5 0/8] Add SCMI Virtio & Clock atomic support Message-ID: <20220304111032-mutt-send-email-mst@kernel.org> References: <20220217131234.50328-1-cristian.marussi@arm.com> MIME-Version: 1.0 In-Reply-To: <20220217131234.50328-1-cristian.marussi@arm.com> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mst@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220304_081402_078939_C3C98A47 X-CRM114-Status: GOOD ( 36.24 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Feb 17, 2022 at 01:12:26PM +0000, Cristian Marussi wrote: > Hi, > > This small series is the tail-subset of the previous V8 series about atomic > support in SCMI [1], whose 8-patches head-subset has now been queued on > [2]; as such, it is based on [2] on top of tag scmi-updates-5.17: > > commit 94d0cd1da14a ("firmware: arm_scmi: Add new parameter to > mark_txdone") > > Patch [1/8] substitute virtio-scmi ready flag and lock with a reference > counter to keep track of vio channels lifetime while removing the need of > a wide spinlocked section (that would cause issues with introduction of > virtio polling support) > > Patch [2/8] adds a few helpers to handle the TX free_list and a dedicated > spinlock to reduce the reliance on the main one. > > Patch [3/8] adds polling mode to SCMI VirtIO transport in order to support > atomic operations on such transport. > > Patches [4,5/8] introduce a new optional SCMI binding, atomic-threshold-us, > to configure a platform specific time threshold used in the following > patches to select with a finer grain which SCMI resources should be > eligible for atomic operations when requested. > > Patch [6/8] exposes new SCMI Clock protocol operations to allow an SCMI > user to request atomic mode on clock enable commands. > > Patch [7/8] adds support to SCMI Clock protocol for a new clock attributes > field which advertises typical enable latency for a specific resource. > > Finally patch [8/8] add support for atomic operations to the SCMI clock > driver; the underlying logic here is that we register with the Clock > framework atomic-capable clock resources if and only if the backing SCMI > transport is capable of atomic operations AND the specific clock resource > has been advertised by the SCMI platform as having: > > clock_enable_latency <= atomic-threshold-us > > The idea is to avoid costly atomic busy-waiting for resources that have > been advertised as 'slow' to operate upon. (i.e. a PLL vs a gating clock) > > To ease testing the whole series can be find at [3]. > > Any feedback/testing welcome as usual. > > Thanks, > Cristian SCMI specific stuff so I don't have anything to add here. By the way, it does not look like anything regarding SCMI atomic support is needed in the virtio spec - is it true the interface with the device is unaffected? > [1]: https://lore.kernel.org/linux-arm-kernel/20211220195646.44498-1-cristian.marussi@arm.com/ > [2]: https://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux.git/tag/?h=scmi-updates-5.17 > [3]: https://gitlab.arm.com/linux-arm/linux-cm/-/commits/scmi_atomic_clk_virtio_V5/ > > --- > v4 --> v5 > - dt_bindings: fixed example and removed dtschema warnings/errors > - dt_bindings: added 'default: 0' clause > - introduced vio_msg refcounts and helpers to avoid premature reuse of > freed messages when both poling and IRQ path are active on a buffer > - better handling of timed out polled messages on late replies using > new VIO_MSG_POLL_TIMEOUT state > - fixed comments on locks > - removed unneeded virtqueue re-enable when fail to acquire channel in > complete_cb > > V3 --> V4 > - renamed optional DT property to atomic-threshold-us > > V2 --> V3 > - split out virtio_ring RFC patch into a distinct series > - calling virtqueue_broke_device when cleaning up channel > - removed RFC tags from CLK related patches > > V1 --> V2 > - added vio channel refcount support patch > - reviewed free_list support and usage > - added virtio_ring RFC patch > - shrinked spinlocked section within virtio_poll_done to exclude > virtqueue_poll call > - removed poll_lock > - use vio channel refcount acquire/release logic when polling > - using new free_list accessors > - added new dedicated pending_lock to access pending_cmds_list > - fixed a few comments > > Cristian Marussi (8): > firmware: arm_scmi: Add a virtio channel refcount > firmware: arm_scmi: Review virtio free_list handling > firmware: arm_scmi: Add atomic mode support to virtio transport > dt-bindings: firmware: arm,scmi: Add atomic-threshold-us optional > property > firmware: arm_scmi: Support optional system wide atomic-threshold-us > firmware: arm_scmi: Add atomic support to clock protocol > firmware: arm_scmi: Add support for clock_enable_latency > clk: scmi: Support atomic clock enable/disable API > > .../bindings/firmware/arm,scmi.yaml | 10 + > drivers/clk/clk-scmi.c | 71 ++- > drivers/firmware/arm_scmi/Kconfig | 15 + > drivers/firmware/arm_scmi/clock.c | 34 +- > drivers/firmware/arm_scmi/driver.c | 33 +- > drivers/firmware/arm_scmi/virtio.c | 591 +++++++++++++++--- > include/linux/scmi_protocol.h | 9 +- > 7 files changed, 655 insertions(+), 108 deletions(-) > > -- > 2.17.1 > > > _______________________________________________ > linux-arm-kernel mailing list > linux-arm-kernel@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel