Message ID | 20240212123233.1230090-1-cristian.marussi@arm.com |
---|---|
Headers |
Return-Path: <linux-kernel+bounces-61547-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp2395855dyd; Mon, 12 Feb 2024 04:33:19 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXN9Hcm9pIacP1q2agrlYfdUzeoFtDefSt88c1QSUOVOdJjn0pYNhjJsWlPy1JkQEdmQF/A3mgbCejVbFfKKvZxsSRB5A== X-Google-Smtp-Source: AGHT+IGUCzANWspRkvrodM8zIpAjCYRajInod8cefXS8rG8svVK8wiQTLDY3oQaBLCfkX7fJ+DJT X-Received: by 2002:a17:903:40ca:b0:1d9:63a3:e962 with SMTP id t10-20020a17090340ca00b001d963a3e962mr7533711pld.6.1707741199732; Mon, 12 Feb 2024 04:33:19 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707741199; cv=pass; d=google.com; s=arc-20160816; b=DctqpxMs4nxwjcdgDM/MiVmznlSihDfkaO7qQnYQvQXC6E5/GC/LC2CGOg+0PY7f59 aIV08WDCBLxmn53L0bRMj04GeImb51cm3NbMS/lIUik9gLod0Uw0He4QMa4/n8F1pUoT B99A0gWkRP/ziPxVw7exZuIbmNG/7ib+I/2UTVoYII5NBcCvUyyIGcRS//5hxWVnVs3U 5saSRn0BoKlC/2iTSqlCQEOOT18PUQiUt45/buSYvjD1+KdUgy624jQD1XWPTZhxRM2P NgzOqigmJF8mX82gTOp8zvbmAd74jeWMflB99DR0/dpOmqE1b0N8StmV8YMbqFYOr0uH 3O5Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from; bh=aFjgNr7sfkKjoXXw7KKfuy19JtsB6n/tYaZiaZG0830=; fh=Jygh3BHIFvaL4fNnI5Q+O7R7tM31PqZHqWNIXWhFwwY=; b=tGgCqy68glXcxPEMzsksAAbJQaBP1WGc3sjLBRImaFjrPSESYgaoDy+gO/9stlXP2S tuXtBtdqt73DnDh/C4q1/267jfXZyWb+JM7DOOxu96CQvYLZsTs0g7XUrWwAnvGtkznK i5+kw7FmbzoPotawUzgyI8JZL2cdWl2ADk8mtYl//vUiqpBx/QiqziWQ3qV73RN4VjkM ynULUbi4a72NdnSP3VVjylBfdy8N//u7z9shZTYJdigf2K5fZjsx1XS0LrZo2kQ3fnIS r05/S9IH231E7pSZdf/yOm/ZZ66Ath+f63WI0cA5isp5/kdPVm3cUswsxgaBkNDEktxy qLaQ==; 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-61547-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61547-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com X-Forwarded-Encrypted: i=2; AJvYcCV8rEIXlzEf8M2WQTJ7cPeWtQLQvjyPGVq1lnR1N9srGYomESsCXEYRamwPNMdMU24C1EwdJ8XaQ3iWyXrQ7H5TPXv6mw== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id iw4-20020a170903044400b001db28b0bf39si189668plb.57.2024.02.12.04.33.19 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 04:33:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-61547-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; 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-61547-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61547-ouuuleilei=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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 826C9287E7F for <ouuuleilei@gmail.com>; Mon, 12 Feb 2024 12:33:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AE95C39FF8; Mon, 12 Feb 2024 12:33:05 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 324E51E482 for <linux-kernel@vger.kernel.org>; Mon, 12 Feb 2024 12:33:01 +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=1707741184; cv=none; b=rf4CJCQBrrIAWVvPcPLKglQyt6KGDp4IxKSbLNza8ScG3HeeY6nrMkTC0tEfCNfmXKu1LD5iWA/zgZWs+1aN0ZD71Uby5eYLAE9QgBQCHMReu2fJi18dbKzJbvPmnIdDRpLD+byTXKz6PdkioOzp/27DprTgkhU4wHePbgFXBqg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707741184; c=relaxed/simple; bh=lsZVN1LqvRvnK1gbO+NtoBOF2GURNE7UO+ht2iOyTSc=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=KOoK4sGmSQ2x9IE8oJ9S2UIGwpGHCfyKI3bmlJ006/tnL64Jk7ngg7yWWDMSFTVWPxwc8ouWJ10am7r6UMPWp2ZArd/g36/IQC6AnCr2/2+NlrDIHOT9R7Ls3hYsf0qWMRqYdS5mANh2lUvA7OvjsNz+Xsdz4IZoQO6jaqH/exQ= 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 94BA5DA7; Mon, 12 Feb 2024 04:33:42 -0800 (PST) Received: from pluto.fritz.box (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 9DBEC3F7BD; Mon, 12 Feb 2024 04:32:59 -0800 (PST) From: Cristian Marussi <cristian.marussi@arm.com> To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: sudeep.holla@arm.com, vincent.guittot@linaro.org, peng.fan@oss.nxp.com, michal.simek@amd.com, quic_sibis@quicinc.com, quic_nkela@quicinc.com, souvik.chakravarty@arm.com, Cristian Marussi <cristian.marussi@arm.com> Subject: [PATCH 00/11] Add SCMI core checks for notification support. Date: Mon, 12 Feb 2024 12:32:22 +0000 Message-ID: <20240212123233.1230090-1-cristian.marussi@arm.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790696436155965132 X-GMAIL-MSGID: 1790696436155965132 |
Series |
Add SCMI core checks for notification support.
|
|
Message
Cristian Marussi
Feb. 12, 2024, 12:32 p.m. UTC
Hi, this small series adds a new logic into the SCMI core to implicitly check for notification support when some SCMI driver attempts to register for notifications. Till now, trying to register a notifier for an unsuppported notification returned an error and this behaviour generated unneeded message exchanges: the only way to avoid this was to lookup in advance the specific protocol and resources available in order to avoid registering at all any notifier where not supported. Anyway, not all protocols currently expose the related notification info to lookup and, moreover, no check was performed anywhere to verify if the specific notification enable/disable command was supported at all (almost all of these notification enable commands are optional). Last but not least, this kind of support checks could and should be handled transparently by the SCMI core. With this series each protocol can optionally provide an event_ops callcback that will be invoked by the core to lookup if the specific command and event/resource notification is supported on the running platform; the SCMI core then, at initialization time, will use such callbacks to take care to collect such info and mark unsupported events/resources. Later on, when an SCMI driver attempts to register a notifier for a specific event/resources, it will fail and return an error to the caller if the requested notification was not supported. The end-result is that the SCMI driver user will fail to register a notifier if the related command or resource is not supported (like before), BUT without the need of exchanging any message NOR the need to actively lookup if the specified notification is supported. The last two patches in the series, instead, take care to extend the Perf notification report to provide the pre-calculated frequencies corresponding to the level or index carried by the specific notification report. These latter 2 patches are indeed only slighly related to this series at large but are provided here for ease of access. Based on sudeep/for-next/scmi/updates on top of commit 7dd3d11f4dac ("clk: scmi: Add support for forbidden clock state controls") Thanks, Cristian --- Cristian Marussi (11): firmware: arm_scmi: Check for notification support firmware: arm_scmi: Add a common helper to check if a message is supported firmware: arm_scmi: Implement Perf .is_notify_supported callback firmware: arm_scmi: Implement Power .is_notify_supported callback firmware: arm_scmi: Implement SysPower .is_notify_supported callback firmware: arm_scmi: Implement Clock .is_notify_supported callback firmware: arm_scmi: Implement Sensor .is_notify_supported callback firmware: arm_scmi: Implement Reset .is_notify_supported callback firmware: arm_scmi: Implement Powercap .is_notify_supported callback firmware: arm_scmi: Use opps_by_lvl to store opps firmware: arm_scmi: Report frequencies in Perf notifications drivers/firmware/arm_scmi/clock.c | 47 ++++++++- drivers/firmware/arm_scmi/driver.c | 34 ++++++ drivers/firmware/arm_scmi/notify.c | 17 ++- drivers/firmware/arm_scmi/notify.h | 4 + drivers/firmware/arm_scmi/perf.c | 144 +++++++++++++++++++++++--- drivers/firmware/arm_scmi/power.c | 30 +++++- drivers/firmware/arm_scmi/powercap.c | 45 +++++++- drivers/firmware/arm_scmi/protocols.h | 4 + drivers/firmware/arm_scmi/reset.c | 37 +++++-- drivers/firmware/arm_scmi/sensors.c | 37 ++++++- drivers/firmware/arm_scmi/system.c | 16 +++ include/linux/scmi_protocol.h | 3 + 12 files changed, 383 insertions(+), 35 deletions(-)
Comments
On Mon, 12 Feb 2024 12:32:22 +0000, Cristian Marussi wrote: > this small series adds a new logic into the SCMI core to implicitly check > for notification support when some SCMI driver attempts to register for > notifications. > > Till now, trying to register a notifier for an unsuppported notification > returned an error and this behaviour generated unneeded message exchanges: > the only way to avoid this was to lookup in advance the specific protocol > and resources available in order to avoid registering at all any notifier > where not supported. > > [...] Applied to sudeep.holla/linux (for-next/scmi/updates), thanks! [01/11] firmware: arm_scmi: Check for notification support https://git.kernel.org/sudeep.holla/c/8733e86a80f5 [02/11] firmware: arm_scmi: Add a common helper to check if a message is supported https://git.kernel.org/sudeep.holla/c/637b6d6cae9c [03/11] firmware: arm_scmi: Implement Perf .is_notify_supported callback https://git.kernel.org/sudeep.holla/c/120d26312abc [04/11] firmware: arm_scmi: Implement Power .is_notify_supported callback https://git.kernel.org/sudeep.holla/c/b7e400bc2e2d [05/11] firmware: arm_scmi: Implement SysPower .is_notify_supported callback https://git.kernel.org/sudeep.holla/c/9f5ddbc22225 [06/11] firmware: arm_scmi: Implement Clock .is_notify_supported callback https://git.kernel.org/sudeep.holla/c/cf1bba2775ec [07/11] firmware: arm_scmi: Implement Sensor .is_notify_supported callback https://git.kernel.org/sudeep.holla/c/7ac7932df247 [08/11] firmware: arm_scmi: Implement Reset .is_notify_supported callback https://git.kernel.org/sudeep.holla/c/12d6a03f3224 [09/11] firmware: arm_scmi: Implement Powercap .is_notify_supported callback https://git.kernel.org/sudeep.holla/c/e85beaf76080 [10/11] firmware: arm_scmi: Use opps_by_lvl to store opps https://git.kernel.org/sudeep.holla/c/23443a3c7c0c [11/11] firmware: arm_scmi: Report frequencies in Perf notifications https://git.kernel.org/sudeep.holla/c/22ffc748a647 -- Regards, Sudeep