Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1668598rwl; Wed, 29 Mar 2023 23:07:16 -0700 (PDT) X-Google-Smtp-Source: AKy350bvHSgrkQ7eSNXItuypNghVmPB8+KsrzUVLGcMRVK5jlo9UrFB+9qiHDK2jXCZoT7MJrP/q X-Received: by 2002:a17:906:4e1a:b0:935:20d8:c3c with SMTP id z26-20020a1709064e1a00b0093520d80c3cmr22050595eju.61.1680156436507; Wed, 29 Mar 2023 23:07:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680156436; cv=none; d=google.com; s=arc-20160816; b=Ccc+IHglxgtydN1FZm11VbWEjpWeROTUoI7qWvINRQpZNwZzKF1XFcMjUO+mvth5iV NMNEAEr2JW97SQ1Rp8+UTo6Hx3BcpwuNhPss+e7/ATFqiJs2yEQNLT26Czjua+wh7jGI Esl4Q4YTEaW6aS5NF3cwnFYIqtHoYVFBrEau53iOwg1Fr30yhhg9MVNV+RKsGclnkPX7 lWEf2lkyPZFqOCnOFXlDVRoVhnzWZn9G18MUfulGD5yBW9f0KoOqxepFFQpFSQtSkO/q yMAiUfnVyaiLZPzVGC7E5LeQ+iEMeQk5jlKhmgXXoEuYbZQz+i5TMo6MvaBHpDi9oY34 Kl/w== 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=hBN9uTD9aSYDv/bysEaZM+q+iq7arXrQktz8AwoefJnEagtnSe37ZsnK3+GL0rPLca hDZsq1Ewlay9WoEWI+lBcIdD/wLYnKYHETET5dK34FI+3a8GLA0r98taIBuvZkh8SVG0 xoo/MhGnSJDxwtb6UhfIttXkfZ4XO+1IYdtqtmurFnnmY4AwazeYhIZ6S9sWi65rM921 A/inARZgkHEDf0B//rKCuC0yGvuvgk4LkGMBqjNiv5yic3DYKBFKqXFtWufx5YIFvqGD V0JRBI267nP0Y0qfAzw9KEUsWYSxQxoGCUDPF2pEDva2tPV0w4dexCP8I0sm0hMgXzGh hS2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b="T2Xd/vq4"; 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 g23-20020aa7d1d7000000b004acce6da55bsi34928818edp.33.2023.03.29.23.06.51; Wed, 29 Mar 2023 23:07:16 -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="T2Xd/vq4"; 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 S230024AbjC3GFf (ORCPT + 99 others); Thu, 30 Mar 2023 02:05:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60918 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230057AbjC3GFd (ORCPT ); Thu, 30 Mar 2023 02:05:33 -0400 Received: from mail-yw1-x114a.google.com (mail-yw1-x114a.google.com [IPv6:2607:f8b0:4864:20::114a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 36EB61BD6 for ; Wed, 29 Mar 2023 23:05:32 -0700 (PDT) Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-54574d6204aso177543587b3.15 for ; Wed, 29 Mar 2023 23:05:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; t=1680156331; 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=T2Xd/vq4QTC43NzxMiqSqBA8msNyNnHwNo6UYCR6DdjwKSdN7puBZQbpLOgxQylu5B 6MryFowxU9/CeP3PrNz+SadXmpimku7vRJFPmIOAC8YNblPOJSp8D77HXjV0tpgVLiVI 4N9IJgrdUVI0eYrleZN00+XjcsyauZiCpIOvxba7pJHKJ8UIiMTqNEqYHHJdJlrU36Jf 1UHQ85XZwKvyo5W1l8U1Y/vTNdvQ4/1V3Kab1d5t33t/oC2QF85nUUxF5svdiLJGLxAU Nm64To0CMn9CYygJZW+ulUToZlW0X1dmq9+XUIH++wvAE4gbShgrsYTjPbJkv00R6QjC SBow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680156331; 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=srU9lTfCdOXeNdZxpfvaBjx73ApBASZ13yUEgOzTX64RDA6QCkmz9k/7U3QKoISp8o W7JdL/r1GPffq1XGx0iPBCchqd0rHkeiqs7TbPAsM8tqjkDYAaiiOZpGhQzW9BLmZPx8 8V+Dyj7esCosrrh8SNcEJuCPKrvEcJtJr5wqJ3M4Gi+RWxiBWkI3X0q9Vyh30ueeXjxv OgpqH7usaEekTfgk1y2tyNY0k63eG+gn+lfm9zGTm/loXKkmhfOVKB/ywUkVPds/2aVd J40S3yO4PBwTHIJOzx5KyshY59gfO6oItgMEWcwGNx4J0Jbs3p9pSqLkY0pBSy4Zh0y+ pmKA== X-Gm-Message-State: AAQBX9fzmZCnd4/B4Uxs2behZ5rmN5jlesOZvg5zjXrZvuC5FPOKuoxK woTrk88DEPCGCNYQerM+FzS3ldXLrhWA9g== X-Received: from mmandlik-cloudtop.c.googlers.com ([fda3:e722:ac3:cc00:24:72f4:c0a8:2893]) (user=mmandlik job=sendgmr) by 2002:a25:e08a:0:b0:b72:fff0:2f7f with SMTP id x132-20020a25e08a000000b00b72fff02f7fmr3211068ybg.4.1680156331464; Wed, 29 Mar 2023 23:05:31 -0700 (PDT) Date: Wed, 29 Mar 2023 23:05:22 -0700 In-Reply-To: <20230329230447.v12.1.I9b4e4818bab450657b19cda3497d363c9baa616e@changeid> Mime-Version: 1.0 References: <20230329230447.v12.1.I9b4e4818bab450657b19cda3497d363c9baa616e@changeid> X-Mailer: git-send-email 2.40.0.348.gf938b09366-goog Message-ID: <20230329230447.v12.3.I8cd97c192e8268567b6f467ccd993ec71897318e@changeid> Subject: [PATCH v12 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