Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp4667995rwl; Tue, 28 Mar 2023 09:39:18 -0700 (PDT) X-Google-Smtp-Source: AKy350ZCWvn9oo6BqqSAi1Q2q1F/k3XTpcpwjkWFkIrxOXcKupxtg/zbORWINZ7wbU8iMp6CkA/4 X-Received: by 2002:a17:903:22c7:b0:19e:674a:1fb9 with SMTP id y7-20020a17090322c700b0019e674a1fb9mr16822940plg.69.1680021558582; Tue, 28 Mar 2023 09:39:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680021558; cv=none; d=google.com; s=arc-20160816; b=m2zwKl0g5wiBrItfyue1ZkAM+cieXOg9cebX4i+fGstyxwu2jcUMWopsguPtFrmgYF KJlnFFwKmNTHPR8V7piqyRWJM/qP4vceoXUIC1C8jJVXYPAwdJJpyOyLbVJQxlOYljsb 7RUcR8pemvpl2NFHRACf3Coj3VsfeykrzXhBa2R3X9LlB3dPBpSAKyBP+DMX/6LjCKHQ NPlJzPj4NUruBD8El+IENOp9PNyVWVZCyaAGw55z6Nz54Guewu8FaBpJyZCoTDuUV1JF zIm9SF1o4CoUy6Jx4bYXlG8amaoIXm3Z1Mlah3Gw/AqTlqGLYiAdEqImR8XXwxfAHNSk aGlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:dkim-signature; bh=3IPXOF71xhyJEtqQ3Z98VllJlolVRDwWUwDqo2jNXHo=; b=uoDBDDlbUIr+bZweGWeZBmljxaZeEOREg8RHdowR0lGHieDZLVldX97ARb9G6FX7l8 rhe/IArJvo6fpcsfpu/v6UVt84Zl85cGH0PLz7B6l+vqzcOE4+/aXtNogtExgV7fUgM5 h4vjWyo7W3q8Xl9HwxSEoRL2WeiQJi+nr6rX6DcsvMsX4hJ61H94Rrb6YyNFH4GUUg8h LgX6B5w0JorS5zZnz2xz0VWVixw6+30hf8RRm/kz4X9WcY3zqvJGEB/CXOBl39UxqDgf gOrRPjc2Lue7fd2Vfa9jqeyomQurg/3vZJQ3qCaI0kRgbNzaqNUBQeBX5+ErTVwX0mJA ZhRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=iHSKdWsb; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j25-20020a635519000000b0050303dea3f0si29409714pgb.572.2023.03.28.09.39.05; Tue, 28 Mar 2023 09:39:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=iHSKdWsb; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233267AbjC1Qam (ORCPT + 99 others); Tue, 28 Mar 2023 12:30:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39748 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233262AbjC1Qa3 (ORCPT ); Tue, 28 Mar 2023 12:30:29 -0400 Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A1ADCB446 for ; Tue, 28 Mar 2023 09:30:28 -0700 (PDT) Received: by mail-yb1-xb4a.google.com with SMTP id 8-20020a250508000000b00b7c653a0a4aso4605742ybf.23 for ; Tue, 28 Mar 2023 09:30:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; t=1680021028; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=3IPXOF71xhyJEtqQ3Z98VllJlolVRDwWUwDqo2jNXHo=; b=iHSKdWsbQy/GeVzBB8qj+guo53lEw4PtllPBGrE0VU/M2dkD23/QOZGGuR0wKM1woY xoRId10Gu9qAKC5ovRdE30LmAdcD4GA4VgwOvURL5CKioWDBdCPVcAgPqKSm/GnRBLC6 Wr1asA9XzPKSlnb3CkPAvOeE1DSAsxamg7910KDePodfi8AFZRY98KL1TEJ0DhKqnY9i Ff4neDE62XKXPZQYmz8aDY8qlxjyhhLp9tWIv3nrlugxV+bmhh+Xng2r74fru7LZ/LPQ jsNBwK15z+3dffzyJ4LfvNokbOI11Gq4phqSvLhgy0v7wXktgPHVTH0LyaUBlCRQ1y46 hZig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680021028; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=3IPXOF71xhyJEtqQ3Z98VllJlolVRDwWUwDqo2jNXHo=; b=8Id0m1Xjk9tj5AYtqlc0Ov9zcSbQG6kDTdcfYnQU6PBC7fbEbhWogI4JuuUn9pDi1P aiPwQ/3EmX04RqYjRxoW2+jCI0v8EhY8l35fr4ZHvD8fu9jbbBgkfm/LdxuGThpeusYz MJ+Qr3KDjXsC+VOg45so9D0GH3SjAPkN4Fp22WeiilBro2bplEEfOWzDjmyyC/BEc+xG Kpwn56t/cn6Efz51SM0PGGFVDySEls/qGNNWFbujDDGlephyb33IyuW+WhuztMJSRXPE fabNKOiAR++2Y/C8K4MObraJ6m8kLQRaxV6La8rMp5EQfr3W0kVcGf43gjGH33TCiHnQ 55Og== X-Gm-Message-State: AAQBX9eXZ0tzWJk5VgcRYZsWFx1os9LnfzW4ydy4a5MbuDhaHC1jLtGH fFt9kPpXQdpnEn1MdyDG5gMHFEUV1tiXkA== X-Received: from mmandlik-cloudtop.c.googlers.com ([fda3:e722:ac3:cc00:24:72f4:c0a8:2893]) (user=mmandlik job=sendgmr) by 2002:a05:6902:154e:b0:b77:d2db:5f8f with SMTP id r14-20020a056902154e00b00b77d2db5f8fmr10015853ybu.12.1680021027873; Tue, 28 Mar 2023 09:30:27 -0700 (PDT) Date: Tue, 28 Mar 2023 09:30:18 -0700 In-Reply-To: <20230328093000.v10.1.I9b4e4818bab450657b19cda3497d363c9baa616e@changeid> Mime-Version: 1.0 References: <20230328093000.v10.1.I9b4e4818bab450657b19cda3497d363c9baa616e@changeid> X-Mailer: git-send-email 2.40.0.348.gf938b09366-goog Message-ID: <20230328093000.v10.3.I8cd97c192e8268567b6f467ccd993ec71897318e@changeid> Subject: [PATCH v10 3/4] Bluetooth: btusb: Add btusb devcoredump support From: Manish Mandlik To: marcel@holtmann.org, luiz.dentz@gmail.com Cc: chromeos-bluetooth-upstreaming@chromium.org, linux-bluetooth@vger.kernel.org, Manish Mandlik , Abhishek Pandit-Subedi , Johan Hedberg , linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-7.7 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org This patch implements the btusb driver side .coredump() callback to trigger a devcoredump via sysfs. Signed-off-by: Manish Mandlik Reviewed-by: Abhishek Pandit-Subedi --- (no changes since v6) Changes in v6: - Remove dev->coredump_disabled check since the sysfs flag related change has been abandoned Changes in v4: - New patch in the series drivers/bluetooth/btusb.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c index 4ca91c033d2f..9c9f7bf1375a 100644 --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c @@ -4385,6 +4385,17 @@ static int btusb_resume(struct usb_interface *intf) } #endif +#ifdef CONFIG_DEV_COREDUMP +static void btusb_coredump(struct device *dev) +{ + struct btusb_data *data = dev_get_drvdata(dev); + struct hci_dev *hdev = data->hdev; + + if (hdev->dump.coredump) + hdev->dump.coredump(hdev); +} +#endif + static struct usb_driver btusb_driver = { .name = "btusb", .probe = btusb_probe, @@ -4396,6 +4407,14 @@ static struct usb_driver btusb_driver = { .id_table = btusb_table, .supports_autosuspend = 1, .disable_hub_initiated_lpm = 1, + +#ifdef CONFIG_DEV_COREDUMP + .drvwrap = { + .driver = { + .coredump = btusb_coredump, + }, + }, +#endif }; module_usb_driver(btusb_driver); -- 2.40.0.348.gf938b09366-goog