Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp2420259rdb; Mon, 12 Feb 2024 04:33:13 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCV4JR9XSDooHCVNMzyW1PItkeEC/sbFegI+NonRynRHmWrC8uRq3CjCQb0tcEPkw6zKUPpqPlf61q+RzizOTUk3k0FkBD53sD5nZZt1eQ== X-Google-Smtp-Source: AGHT+IGMPI158RrFwUJcs/S/GnhUpT84S1f6U4Jy4Ie8Ek3R9d2Nrvnnxh7sRf2Dxbhe4pYlijQy X-Received: by 2002:a17:906:eb14:b0:a3c:c167:169c with SMTP id mb20-20020a170906eb1400b00a3cc167169cmr1002448ejb.16.1707741193065; Mon, 12 Feb 2024 04:33:13 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707741193; cv=pass; d=google.com; s=arc-20160816; b=INXyOCDOdtRodFAz+hxCNBIg6BHBMsLfJyoHSUk3RfpW/LWYZQH4xvkwhEnDamaYvO yZOaC6ONvm9CmcfquYrfQw3Vo+w2BdInVy3ezJaE4opUsVZOA3vzbsZ4IFs/aGM+E8oh czy+z7HB5kY5onGRkb6aelviK/2WuJl4Pa+9hwTK52M4YVS5Yby84KbQozZ5GlTQT4wH EaIaeZR4O/WK79VH7XezMynXP/R/YkpmBEcQvUFblsOyrwleapAqs+W8pdgw25eaXL1H P4hflIa9hGJz5ARIx6/1H8EA9eSkxBRK4yuWP1GTv7kCGu3j9lg/FAJyB8u1xFQoR1me eUaw== 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=A2FRIS+olfVBWpUloCKD2v4WbQI311/pdIDNVmFGpvM=; b=lAkGo/QwxEWM5hcDuZNVSzV2Mdt25f4Ly4B5VuRzuyYKVe8yXDcww8tPmVYJcvnS6J pZY0ZKpRhan/LGLxv5sq5Ea1BqWr1xGauXdGBAfElJ62lpMAVmKEDKy+iJFRXNjgRNwI whTF+bYONF5+mEKExBg1VRKCmj9HCLWkmyT4+D4qup0n861A9M6iQkkv8TRLEvUvLFIH pbmF91BneCruYbisur8FzNlOdccrhzP2Y3BYYno8jASPtobmV66tXPR9ERT8tp17nutq uk7nmmxDZjAq2+0uLr4BZ2EMZJlKjF/Wk/dUrOWCBCqa45cKHsN51bt2724++8sOLBT5 JaoA==; 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-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61547-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com X-Forwarded-Encrypted: i=2; AJvYcCW9ClUynLNqc34fTT2q9iFFFqQQ9F3oJM8aYQRNp6FFcwa0kBjdTswOcbMggk3k9HFv7Az4th/Rc2Au2WWT8/IiBM/OK9dgAytsBoXr5A== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id ci18-20020a170906c35200b00a3c1df84402si157184ejb.150.2024.02.12.04.33.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 04:33:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-61547-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; 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-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61547-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 902CB1F26019 for ; Mon, 12 Feb 2024 12:33:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A53092EB0E; Mon, 12 Feb 2024 12:33:04 +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 ; 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 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 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: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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(-) -- 2.43.0