From: Simon Horman <simon.horman@corigine.com>
To: Manish Mandlik <mmandlik@google.com>
Cc: marcel@holtmann.org, luiz.dentz@gmail.com,
chromeos-bluetooth-upstreaming@chromium.org,
linux-bluetooth@vger.kernel.org,
Abhishek Pandit-Subedi <abhishekpandit@chromium.org>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>,
Johan Hedberg <johan.hedberg@gmail.com>,
Paolo Abeni <pabeni@redhat.com>,
linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH v9 1/4] Bluetooth: Add support for hci devcoredump
Date: Tue, 28 Mar 2023 20:37:51 +0200 [thread overview]
Message-ID: <ZCMz/7L8GdMzDDT4@corigine.com> (raw)
In-Reply-To: <20230327181825.v9.1.I9b4e4818bab450657b19cda3497d363c9baa616e@changeid>
On Mon, Mar 27, 2023 at 06:18:54PM -0700, Manish Mandlik wrote:
> From: Abhishek Pandit-Subedi <abhishekpandit@chromium.org>
>
> Add devcoredump APIs to hci core so that drivers only have to provide
> the dump skbs instead of managing the synchronization and timeouts.
>
> The devcoredump APIs should be used in the following manner:
> - hci_devcoredump_init is called to allocate the dump.
> - hci_devcoredump_append is called to append any skbs with dump data
> OR hci_devcoredump_append_pattern is called to insert a pattern.
> - hci_devcoredump_complete is called when all dump packets have been
> sent OR hci_devcoredump_abort is called to indicate an error and
> cancel an ongoing dump collection.
>
> The high level APIs just prepare some skbs with the appropriate data and
> queue it for the dump to process. Packets part of the crashdump can be
> intercepted in the driver in interrupt context and forwarded directly to
> the devcoredump APIs.
>
> Internally, there are 5 states for the dump: idle, active, complete,
> abort and timeout. A devcoredump will only be in active state after it
> has been initialized. Once active, it accepts data to be appended,
> patterns to be inserted (i.e. memset) and a completion event or an abort
> event to generate a devcoredump. The timeout is initialized at the same
> time the dump is initialized (defaulting to 10s) and will be cleared
> either when the timeout occurs or the dump is complete or aborted.
>
> Signed-off-by: Abhishek Pandit-Subedi <abhishekpandit@chromium.org>
> Signed-off-by: Manish Mandlik <mmandlik@google.com>
> Reviewed-by: Abhishek Pandit-Subedi <abhishekpandit@chromium.org>
As it looks like you'll need to respin [1]
[1] https://lore.kernel.org/oe-kbuild-all/202303281102.Wu5F8pYw-lkp@intel.com/
> +void hci_devcd_handle_pkt_pattern(struct hci_dev *hdev, struct sk_buff *skb)
> +{
> + struct hci_devcoredump_skb_pattern *pattern;
> +
> + if (hdev->dump.state != HCI_DEVCOREDUMP_ACTIVE) {
> + DBG_UNEXPECTED_STATE();
> + return;
> + }
> +
> + if (skb->len != sizeof(*pattern)) {
> + bt_dev_dbg(hdev, "Invalid pattern skb");
> + return;
> + }
> +
> + pattern = skb_pull_data(skb, sizeof(*pattern));;
nit: s/;;/;/
> +
> + if (!hci_devcd_memset(hdev, pattern->pattern, pattern->len))
> + bt_dev_dbg(hdev, "Failed to set pattern");
> +}
...
prev parent reply other threads:[~2023-03-28 18:38 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-28 1:18 [PATCH v9 1/4] Bluetooth: Add support for hci devcoredump Manish Mandlik
2023-03-28 1:18 ` [PATCH v9 2/4] Bluetooth: Add vhci devcoredump support Manish Mandlik
2023-03-28 1:18 ` [PATCH v9 3/4] Bluetooth: btusb: Add btusb " Manish Mandlik
2023-03-28 1:18 ` [PATCH v9 4/4] Bluetooth: btintel: Add Intel " Manish Mandlik
2023-03-28 2:36 ` [v9,1/4] Bluetooth: Add support for hci devcoredump bluez.test.bot
2023-03-28 3:46 ` [PATCH v9 1/4] " kernel test robot
2023-03-28 18:37 ` Simon Horman [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZCMz/7L8GdMzDDT4@corigine.com \
--to=simon.horman@corigine.com \
--cc=abhishekpandit@chromium.org \
--cc=chromeos-bluetooth-upstreaming@chromium.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=johan.hedberg@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-bluetooth@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luiz.dentz@gmail.com \
--cc=marcel@holtmann.org \
--cc=mmandlik@google.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox