Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp171112rwl; Thu, 23 Mar 2023 14:21:28 -0700 (PDT) Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=EhYvkoKv X-Google-Smtp-Source: AKy350ZbaIJ5luehLjUe0J54JyArt6wJbct/p7kQrKxs8ogtCvNfQkkvtozVHtDYzNesFSGOTbFL X-Received: by 2002:a17:90a:e7cb:b0:237:d44c:5861 with SMTP id kb11-20020a17090ae7cb00b00237d44c5861mr430537pjb.12.1679606488223; Thu, 23 Mar 2023 14:21:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679606488; cv=none; d=google.com; s=arc-20160816; b=UtrKLtVXJ8g/GulKbpeVPQ1/b3pf3+MQlMdbcQjzr8caKIlm2h/j86Y5vyt3uVoXws 9CMBpjs9ORef1wfUQCMpGpscNFM2J/nF8GPAYPxb79KOcejyfdRYAeG+3Hup1xy+arcs BtuMaILL4ttSVnfrm2UY/I+6O1LnOVRQL2e3dWfAih2nbru5gKEisvdcM8PlDcq/AWUU o3N3jmIk0yh1TAwji67ICX50LLabVijSgQnnVx3aRtLxJqzV4sX7Gi5H34qU7KK8Xm6e Nbez2EhS7nJvLI2hHmuotByOZKlID46qx5QV0JgeleuP+PaqD5C6W+J4h8/9j7RDQCMI RCpQ== 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=ySOg0hXaSBkK+dgCX9Sz87GIVKeVP/Ib+/JgtnBJFlEzQFilUP0+g0163M4eafb6SW TevVaKPGhWpb1nP99BvgmwO0n/Tg5xD6tjRmsEPGpVsiRzdut+lDXz5UpDQsfCdCePOA VqPFC4dQR74MSFz7wNiHW0HjI/DYD6AobJyxLua6fE4qgWyUKTjDwY83nV9nMY9qAyaO Aj4iznv+P+VAH5u8StJy1C8+mlucrEAvwZZke7MqjOiBtdqErXr1WG/TxwY2W3rIKlEl VFoWL076JAqmpBnaWoa7pVQfRs3D3kBxNONhmL/YJUX6Oq8Fmp2F1B/voijAa5OxmCXu mb1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=EhYvkoKv; 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 nm4-20020a17090b19c400b00237413f8c6esi2641212pjb.154.2023.03.23.14.21.15; Thu, 23 Mar 2023 14:21:28 -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=EhYvkoKv; 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 S231128AbjCWVKc (ORCPT + 99 others); Thu, 23 Mar 2023 17:10:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37746 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231359AbjCWVK3 (ORCPT ); Thu, 23 Mar 2023 17:10:29 -0400 Received: from mail-pl1-x649.google.com (mail-pl1-x649.google.com [IPv6:2607:f8b0:4864:20::649]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AF4411ADE0 for ; Thu, 23 Mar 2023 14:10:28 -0700 (PDT) Received: by mail-pl1-x649.google.com with SMTP id s11-20020a170902a50b00b001a1f8fc0d2cso32304plq.15 for ; Thu, 23 Mar 2023 14:10:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; t=1679605828; 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=EhYvkoKvgCCbxOwjd6FuNdq1QrRIoJpWIF7cJLLZ9gASmnAaRc+cEHJaCpIAkfBfUg bL/I+y8T8nHmo6qbtvmbKbUsCqzj9JjBzg++8JYVM78eHpCxyl3oilRt/AnkhiAncn90 IKEK+BWoX5XhAUB973cOyK7Jg9eku+sMNyWkrycSxQkg6o5ID2JM0YuLOybxk61aMjWy M+eFazc3nyJLiG9V//Kqckr/f+am+zrkTAsMgXJAA8+U8h2ZeyouKn18jsnA8LYw6T+9 KSiO0GkQ+3CEqqnpdpnP8IqnkO650sTRlV/DS3G3/UVUwQwjag6wNhfkSwnWsIcw+CJb dM1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679605828; 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=bnrY4e9O6H3F5QqVpNT6ecdK2AMIG5JHXPq17wdfkLwWX+KYWDRYY/gLysjtIRUgcH vKBY6pyXaL7xTG1Ym9KQ+V5+ROJMjSDyNMESvvZcXMGUMVbN6JQ2N6DmW9ZhUhy7wa9d n+WS4vi3DfBKPyIG/Wnppn/foUD+T3MtsVusB8yYS6iEIQfcGCEWzYsXezcUYuFrPQIk X/Q3ZUZ2z0KzVSULnQAPqboI3M63+gpP3JXXZaieHqm6vk0hXIMrPo+9QbDxRsJi2331 AtWgnza7Xn9IjgiXHUOM8JKBZQ3fS8jgeZCArwQOFQY/A40QGTpgIx/lx9OXbh9prxUP 4KYQ== X-Gm-Message-State: AO0yUKWqT5krsZBwLMaAW/ferC6ZqUqb49srMML92+gYvYWZTJ/rWO3+ Z4z52rOaSoWsGlSi+a8fnPWoJ+1Eg1Wc7w== X-Received: from mmandlik-cloudtop.c.googlers.com ([fda3:e722:ac3:cc00:24:72f4:c0a8:2893]) (user=mmandlik job=sendgmr) by 2002:a65:5086:0:b0:503:7bbb:9a77 with SMTP id r6-20020a655086000000b005037bbb9a77mr2310504pgp.8.1679605828243; Thu, 23 Mar 2023 14:10:28 -0700 (PDT) Date: Thu, 23 Mar 2023 14:10:17 -0700 In-Reply-To: <20230323140942.v8.1.I9b4e4818bab450657b19cda3497d363c9baa616e@changeid> Mime-Version: 1.0 References: <20230323140942.v8.1.I9b4e4818bab450657b19cda3497d363c9baa616e@changeid> X-Mailer: git-send-email 2.40.0.348.gf938b09366-goog Message-ID: <20230323140942.v8.3.I8cd97c192e8268567b6f467ccd993ec71897318e@changeid> Subject: [PATCH v8 3/4] Bluetooth: btusb: Add btusb devcoredump support From: Manish Mandlik To: marcel@holtmann.org, luiz.dentz@gmail.com Cc: linux-bluetooth@vger.kernel.org, chromeos-bluetooth-upstreaming@chromium.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