Skip to content

Commit f455742

Browse files
committed
Merge tag 'scmi-fixes-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux into arm/fixes
Arm SCMI firmware interface fixes for v5.18 Few fixes to address assorted set of issues: - Erroneous clearing of Tx channel which only platform firmware must do - Invalid point access pass as parameter to sort() in clock support - Sparse build warnings in OPTEE transport driver - Use of deprecated zero-length arrays * tag 'scmi-fixes-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux: firmware: arm_scmi: Fix sparse warnings in OPTEE transport driver firmware: arm_scmi: Replace zero-length array with flexible-array member firmware: arm_scmi: Fix sorting of retrieved clock rates firmware: arm_scmi: Remove clear channel call on the TX channel Link: https://lore.kernel.org/r/20220407110818.1436181-1-sudeep.holla@arm.com Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2 parents caee010 + bf36619 commit f455742

3 files changed

Lines changed: 9 additions & 7 deletions

File tree

drivers/firmware/arm_scmi/clock.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ struct scmi_msg_resp_clock_describe_rates {
4949
struct {
5050
__le32 value_low;
5151
__le32 value_high;
52-
} rate[0];
52+
} rate[];
5353
#define RATE_TO_U64(X) \
5454
({ \
5555
typeof(X) x = (X); \
@@ -210,7 +210,8 @@ scmi_clock_describe_rates_get(const struct scmi_protocol_handle *ph, u32 clk_id,
210210

211211
if (rate_discrete && rate) {
212212
clk->list.num_rates = tot_rate_cnt;
213-
sort(rate, tot_rate_cnt, sizeof(*rate), rate_cmp_func, NULL);
213+
sort(clk->list.rates, tot_rate_cnt, sizeof(*rate),
214+
rate_cmp_func, NULL);
214215
}
215216

216217
clk->rate_discrete = rate_discrete;

drivers/firmware/arm_scmi/driver.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -679,7 +679,8 @@ static void scmi_handle_response(struct scmi_chan_info *cinfo,
679679

680680
xfer = scmi_xfer_command_acquire(cinfo, msg_hdr);
681681
if (IS_ERR(xfer)) {
682-
scmi_clear_channel(info, cinfo);
682+
if (MSG_XTRACT_TYPE(msg_hdr) == MSG_TYPE_DELAYED_RESP)
683+
scmi_clear_channel(info, cinfo);
683684
return;
684685
}
685686

drivers/firmware/arm_scmi/optee.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -405,8 +405,8 @@ static int scmi_optee_chan_free(int id, void *p, void *data)
405405
return 0;
406406
}
407407

408-
static struct scmi_shared_mem *get_channel_shm(struct scmi_optee_channel *chan,
409-
struct scmi_xfer *xfer)
408+
static struct scmi_shared_mem __iomem *
409+
get_channel_shm(struct scmi_optee_channel *chan, struct scmi_xfer *xfer)
410410
{
411411
if (!chan)
412412
return NULL;
@@ -419,7 +419,7 @@ static int scmi_optee_send_message(struct scmi_chan_info *cinfo,
419419
struct scmi_xfer *xfer)
420420
{
421421
struct scmi_optee_channel *channel = cinfo->transport_info;
422-
struct scmi_shared_mem *shmem = get_channel_shm(channel, xfer);
422+
struct scmi_shared_mem __iomem *shmem = get_channel_shm(channel, xfer);
423423
int ret;
424424

425425
mutex_lock(&channel->mu);
@@ -436,7 +436,7 @@ static void scmi_optee_fetch_response(struct scmi_chan_info *cinfo,
436436
struct scmi_xfer *xfer)
437437
{
438438
struct scmi_optee_channel *channel = cinfo->transport_info;
439-
struct scmi_shared_mem *shmem = get_channel_shm(channel, xfer);
439+
struct scmi_shared_mem __iomem *shmem = get_channel_shm(channel, xfer);
440440

441441
shmem_fetch_response(shmem, xfer);
442442
}

0 commit comments

Comments
 (0)