]> git.baikalelectronics.ru Git - kernel.git/commit
firmware: arm_scmi: Relax CLOCK_DESCRIBE_RATES out-of-spec checks
authorCristian Marussi <cristian.marussi@arm.com>
Thu, 16 Jun 2022 17:03:47 +0000 (18:03 +0100)
committerSudeep Holla <sudeep.holla@arm.com>
Mon, 20 Jun 2022 09:17:33 +0000 (10:17 +0100)
commit1a8d5986c2296e1b0c33784a01ee6a512c6f7dbd
treec0f1f79fdfbc15fadc335bce1b11a12c1f74987c
parent0aa894c5f3d005e49ed5ef0434d9c343190f18c0
firmware: arm_scmi: Relax CLOCK_DESCRIBE_RATES out-of-spec checks

A reply to CLOCK_DESCRIBE_RATES issued against a non rate-discrete clock
should be composed of a triplet of rates descriptors (min/max/step)
returned all in one reply message.

This is not always the case when dealing with some SCMI server deployed in
the wild: relax such constraint while maintaining memory safety by checking
carefully the returned payload size.

While at that cleanup a stale debug printout.

Link: https://lore.kernel.org/r/20220616170347.2800771-1-cristian.marussi@arm.com
Fixes: 90b15b11b7b4 ("firmware: arm_scmi: Use common iterators in the clock protocol")
Tested-by: Robin Murphy <robin.murphy@arm.com>
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
drivers/firmware/arm_scmi/clock.c
drivers/firmware/arm_scmi/driver.c
drivers/firmware/arm_scmi/protocols.h