Skip to content

Commit 857a96e

Browse files
committed
Merge tag 'scmi-updates-6.9' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux into soc/drivers
Arm SCMI updates for v6.9 Quite a few changes to extend support to SCMI v3.2 specification, to enhance notification handling and other miscellaneous updates. 1. Enhancements to notification handling Until now, trying to register a notifier for an unsuppported notification returned an error genrating unneeded message exchanges with the SCMI platform. This can be avoided by looking up in advance the specific protocol and resources available. With these changes SCMI driver user will fail to register a notifier if the related command or resource is not supported (like before) without the need of exchanging any message. Perf notifications are also extended to provide the pre-calculated frequencies corresponding to the level or index carried by the 2. More SCMI v3.2 related updates One of the main addition includes a centralized support to the SCMI core to handle v3.2 optional protocol version negotiation, so that at protocol initialization time, if the platform advertised version is newer than supported by the kernel and protocol version negotiation is supported, the SCMI core will attempt to negotiate an older protocol version. It also includes the clock get permissions which indicates if any of the clock operations are forbidden by the platform for the OSPM agent. It can be used in the clock driver to avoid unnecessary message exchanges between the kernel and the platform which will always end up with the failure. It also includes other missing bits of clock v3.2 protocol so that the supported protocol version can be bumped to 0x30000 (v3.2). 3. Miscellaneous updates This includes addition of warning if the domain frequency multiplier is 0 or rounded off to indicate the actual frequencies are either wrong ot rounded off, hardening of clock domain info lookups, addition of multiple protocols registration support within a SCMI driver, update to SCMI entry in MAINTAINERS to include HWMON driver and constifying the scmi_bus_type structure. This also includes couple for fixes to minor issues: double free in SMC transport cleanup path and struct kernel-doc warnings in optee transport. * tag 'scmi-updates-6.9' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux: (29 commits) MAINTAINERS: Update SCMI entry with HWMON driver firmware: arm_scmi: Update the supported clock protocol version firmware: arm_scmi: Add standard clock OEM definitions firmware: arm_scmi: Add clock check for extended config support firmware: arm_scmi: Add support for v3.2 NEGOTIATE_PROTOCOL_VERSION firmware: arm_scmi: Fix struct kernel-doc warnings in optee transport firmware: arm_scmi: Report frequencies in the perf notifications firmware: arm_scmi: Use opps_by_lvl to store opps firmware: arm_scmi: Implement is_notify_supported callback in powercap protocol firmware: arm_scmi: Implement is_notify_supported callback in reset protocol firmware: arm_scmi: Implement is_notify_supported callback in sensor protocol firmware: arm_scmi: Implement is_notify_supported callback in clock protocol firmware: arm_scmi: Implement is_notify_supported callback in system power protocol firmware: arm_scmi: Implement is_notify_supported callback in power protocol firmware: arm_scmi: Implement is_notify_supported callback in perf protocol firmware: arm_scmi: Add a common helper to check if a message is supported firmware: arm_scmi: Check for notification support firmware: arm_scmi: Make scmi_bus_type const firmware: arm_scmi: Fix double free in SMC transport cleanup path firmware: arm_scmi: Implement clock get permissions ... Link: https://lore.kernel.org/r/20240223033435.118028-1-sudeep.holla@arm.com Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2 parents 6208050 + c2f0961 commit 857a96e

20 files changed

Lines changed: 676 additions & 79 deletions

File tree

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21319,6 +21319,7 @@ F: drivers/clk/clk-sc[mp]i.c
2131921319
F: drivers/cpufreq/sc[mp]i-cpufreq.c
2132021320
F: drivers/firmware/arm_scmi/
2132121321
F: drivers/firmware/arm_scpi.c
21322+
F: drivers/hwmon/scmi-hwmon.c
2132221323
F: drivers/pmdomain/arm/
2132321324
F: drivers/powercap/arm_scmi_powercap.c
2132421325
F: drivers/regulator/scmi-regulator.c

drivers/firmware/arm_scmi/bus.c

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,17 @@ static int scmi_protocol_device_request(const struct scmi_device_id *id_table)
141141
return ret;
142142
}
143143

144+
static int scmi_protocol_table_register(const struct scmi_device_id *id_table)
145+
{
146+
int ret = 0;
147+
const struct scmi_device_id *entry;
148+
149+
for (entry = id_table; entry->name && ret == 0; entry++)
150+
ret = scmi_protocol_device_request(entry);
151+
152+
return ret;
153+
}
154+
144155
/**
145156
* scmi_protocol_device_unrequest - Helper to unrequest a device
146157
*
@@ -186,6 +197,15 @@ static void scmi_protocol_device_unrequest(const struct scmi_device_id *id_table
186197
mutex_unlock(&scmi_requested_devices_mtx);
187198
}
188199

200+
static void
201+
scmi_protocol_table_unregister(const struct scmi_device_id *id_table)
202+
{
203+
const struct scmi_device_id *entry;
204+
205+
for (entry = id_table; entry->name; entry++)
206+
scmi_protocol_device_unrequest(entry);
207+
}
208+
189209
static const struct scmi_device_id *
190210
scmi_dev_match_id(struct scmi_device *scmi_dev, struct scmi_driver *scmi_drv)
191211
{
@@ -263,7 +283,7 @@ static void scmi_dev_remove(struct device *dev)
263283
scmi_drv->remove(scmi_dev);
264284
}
265285

266-
struct bus_type scmi_bus_type = {
286+
const struct bus_type scmi_bus_type = {
267287
.name = "scmi_protocol",
268288
.match = scmi_dev_match,
269289
.probe = scmi_dev_probe,
@@ -279,7 +299,7 @@ int scmi_driver_register(struct scmi_driver *driver, struct module *owner,
279299
if (!driver->probe)
280300
return -EINVAL;
281301

282-
retval = scmi_protocol_device_request(driver->id_table);
302+
retval = scmi_protocol_table_register(driver->id_table);
283303
if (retval)
284304
return retval;
285305

@@ -299,7 +319,7 @@ EXPORT_SYMBOL_GPL(scmi_driver_register);
299319
void scmi_driver_unregister(struct scmi_driver *driver)
300320
{
301321
driver_unregister(&driver->driver);
302-
scmi_protocol_device_unrequest(driver->id_table);
322+
scmi_protocol_table_unregister(driver->id_table);
303323
}
304324
EXPORT_SYMBOL_GPL(scmi_driver_unregister);
305325

0 commit comments

Comments
 (0)