[PATCH] ath10k: Support firmware crash-by-assert.
Kalle Valo
kvalo at qca.qualcomm.com
Wed Sep 10 08:53:39 PDT 2014
greearb at candelatech.com writes:
> From: Ben Greear <greearb at candelatech.com>
>
> 10.1 firmware does not have an official way to
> cause assert on purpose, but it can be done with
> carefully crafted WMI command. This is a different
> kind of crash from the 'hard' crash, which is
> a bad memory dereference.
>
> Different crashes decode in different manners, so
> this will help the crash-report testing as well as
> offer better ways to test firmware failure and
> recovery.
>
> Signed-off-by: Ben Greear <greearb at candelatech.com>
[...]
> --- a/drivers/net/wireless/ath/ath10k/wmi.c
> +++ b/drivers/net/wireless/ath/ath10k/wmi.c
> @@ -3725,6 +3725,26 @@ int ath10k_wmi_vdev_install_key(struct ath10k *ar,
> ar->wmi.cmd->vdev_install_key_cmdid);
> }
>
> +int ath10k_wmi_vdev_assert(struct ath10k *ar, u32 crashme)
> +{
> + struct wmi_vdev_install_key_cmd *cmd;
> + struct sk_buff *skb;
> +
> + skb = ath10k_wmi_alloc_skb(ar, sizeof(*cmd) + 16);
> + if (!skb)
> + return -ENOMEM;
> +
> + cmd = (struct wmi_vdev_install_key_cmd *)skb->data;
> + memset(cmd, 0, sizeof(*cmd));
> + cmd->vdev_id = __cpu_to_le32(crashme);
> +
> + ath10k_info(ar,
> + "simulating firmware ASSERT with bad install_key vdev-id: 0x%x\n",
> + cmd->vdev_id);
cmd->vdev_id is in little endian here.
> + return ath10k_wmi_cmd_send(ar, skb,
> + ar->wmi.cmd->vdev_install_key_cmdid);
> +}
As this is not a real WMI command, I would actually prefer to have this
in debug.c. With my patch "ath10k: make ath10k_wmi_cmd_send() public"
that's possible now.
I can do the changes and will send v2 shortly. Just need to test it
first.
--
Kalle Valo
More information about the ath10k
mailing list