Commit f455742a authored by Arnd Bergmann's avatar Arnd Bergmann

Merge tag 'scmi-fixes-5.18' of...

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.comSigned-off-by: default avatarArnd Bergmann <arnd@arndb.de>
parents caee0105 bf36619a
......@@ -49,7 +49,7 @@ struct scmi_msg_resp_clock_describe_rates {
struct {
__le32 value_low;
__le32 value_high;
} rate[0];
} rate[];
#define RATE_TO_U64(X) \
({ \
typeof(X) x = (X); \
......@@ -210,7 +210,8 @@ scmi_clock_describe_rates_get(const struct scmi_protocol_handle *ph, u32 clk_id,
if (rate_discrete && rate) {
clk->list.num_rates = tot_rate_cnt;
sort(rate, tot_rate_cnt, sizeof(*rate), rate_cmp_func, NULL);
sort(clk->list.rates, tot_rate_cnt, sizeof(*rate),
rate_cmp_func, NULL);
}
clk->rate_discrete = rate_discrete;
......
......@@ -679,7 +679,8 @@ static void scmi_handle_response(struct scmi_chan_info *cinfo,
xfer = scmi_xfer_command_acquire(cinfo, msg_hdr);
if (IS_ERR(xfer)) {
scmi_clear_channel(info, cinfo);
if (MSG_XTRACT_TYPE(msg_hdr) == MSG_TYPE_DELAYED_RESP)
scmi_clear_channel(info, cinfo);
return;
}
......
......@@ -405,8 +405,8 @@ static int scmi_optee_chan_free(int id, void *p, void *data)
return 0;
}
static struct scmi_shared_mem *get_channel_shm(struct scmi_optee_channel *chan,
struct scmi_xfer *xfer)
static struct scmi_shared_mem __iomem *
get_channel_shm(struct scmi_optee_channel *chan, struct scmi_xfer *xfer)
{
if (!chan)
return NULL;
......@@ -419,7 +419,7 @@ static int scmi_optee_send_message(struct scmi_chan_info *cinfo,
struct scmi_xfer *xfer)
{
struct scmi_optee_channel *channel = cinfo->transport_info;
struct scmi_shared_mem *shmem = get_channel_shm(channel, xfer);
struct scmi_shared_mem __iomem *shmem = get_channel_shm(channel, xfer);
int ret;
mutex_lock(&channel->mu);
......@@ -436,7 +436,7 @@ static void scmi_optee_fetch_response(struct scmi_chan_info *cinfo,
struct scmi_xfer *xfer)
{
struct scmi_optee_channel *channel = cinfo->transport_info;
struct scmi_shared_mem *shmem = get_channel_shm(channel, xfer);
struct scmi_shared_mem __iomem *shmem = get_channel_shm(channel, xfer);
shmem_fetch_response(shmem, xfer);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment