Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp470654rwb; Thu, 22 Sep 2022 22:28:29 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7qPJO1KPlqW3YiIqQAyBWOsV8KgRiisd1+wIdRGPPOqsdiyJUZAOVJ2qjqAo6DIBChZp0p X-Received: by 2002:a17:90a:db8c:b0:200:972f:7fe9 with SMTP id h12-20020a17090adb8c00b00200972f7fe9mr18954451pjv.127.1663910908813; Thu, 22 Sep 2022 22:28:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663910908; cv=none; d=google.com; s=arc-20160816; b=wtAfLHsH6ymt4o842w951n5WZJnCGsy4M679BNxLYOTAoNmCAaXIzb9U2KwnNSPOjm H8lvf4xQx5V0EQso6fLRoBevxv7Zzswm/ukdVESj/+b9U8TyJBKFDWJLOLVlszb9hfOV jYC22eFWuTk8B80cKg1psiZTatYZqRv03jVfh6k6mbnfUebLO9wrBiFghpiqFnX6OTE7 8/DhnGExO/IedIIwhV3WWtZ8vzcEs8cuBYLhtZ4YaVZ1nJeTiPuRGMx5RO2iPhiwpQB/ GGxkmV8ktbwWsxfLRleeBTYjfV58TQxamPPPVPI1AD4wg63SWTswZAKsg5LMA18QjZ11 LI2A== 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=yXjveCbLOdd0JzGR4qE7Eak16YrtEn9JU/5KgKpycQ4=; b=O4tKongQA+kjOVI1FPePMySgLa3fRKR7OQrhHpx1RV8UukvMuIQIjm5sxI7+JMZJnQ r7bRs7fHpHWf3SydtH5wuBjESxkEOz5Z+1rhhLdCODLADB/1ft0/Eyn61eRJP9CZcr4g QgiTGHhAu3YizOnL5tggam6qcXieHKbbwCAZbdhiW26meVmvF4bjUPT5yYeD2Cr4LZ9j EoGGtFlIkGKp/+/BLwUlMaXXKQJz11lcE5Le4tntfQCr2ltMhaq52ImZm4xdNnWPpoPQ M/j0iG2BuUatEIcc+X/0tSUF2EjEkCVwSyBdLGjVCH5AAsj0qR5y8nhpb/V0JPEqmhjZ NxjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=bsyGrP9R; 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 w1-20020a17090ac98100b0020254dfb1ccsi1494161pjt.114.2022.09.22.22.28.02; Thu, 22 Sep 2022 22:28: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=bsyGrP9R; 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 S229522AbiIWFMQ (ORCPT + 99 others); Fri, 23 Sep 2022 01:12:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44682 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229603AbiIWFMO (ORCPT ); Fri, 23 Sep 2022 01:12:14 -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 159EFD692E for ; Thu, 22 Sep 2022 22:12:14 -0700 (PDT) Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-34546b03773so96324227b3.9 for ; Thu, 22 Sep 2022 22:12:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date; bh=yXjveCbLOdd0JzGR4qE7Eak16YrtEn9JU/5KgKpycQ4=; b=bsyGrP9RDOEf3/jOXC2B30WnREaFxo8TgD8RiysbiY21Zx4pM97GzW8B9LBoLLc3MT WkReA5dbfuobZIt2ERF02TM9S2JjuICdzby+kv46P6Re7jKNmbjQjQVklQ3Vs8OlUfOZ wJN4tRh9fAuRuf33bwPhhMn+6rgGI9EI6FOOYz/EmATwev07fw0A16LZnyPakmfn9TNF 3CVnMrq5bYOhYqYV5N72W2AXxMnyUmF8FOAzp2uhN8VtEHlSDFd98AoivDkIWogu9f0I DcZoU/HLkTtJIJiNMw8F09gtli9dXgRK7VHcLOHt5pf0OP/o2cIE7+T42K59/rJ9lMrE FpnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date; bh=yXjveCbLOdd0JzGR4qE7Eak16YrtEn9JU/5KgKpycQ4=; b=laT4gXe4XGAjhUxXGnXcdIlc47q330lqcFBw8UmsvZtbIhoORp57I5GjTaImceXgaA /GGa7T7lyZZqnNCPLu7fefwXaiuwUpy7xX2BirrYfs2n/ZmROupgbmJeNK9qxJlwbP0H XOB6RtjOa/cqWzLLs/yvTk/cdM1qmeWr7KXjif1qwT82M+xFzLgy0oCTSeHYp1vrbG+n ozUZIpGVybkDU7yP7NdfjMzrzSjo2xx7dug6wv6IB9ty2NngN2+o2B44rcFAyb40RqbG N13QYP4bMLRH3mLaATCvTvfDr3b1z6Pm7U6MQRebiYkp24fYVy+FJ9BXmMj9FixwK2TP t8wQ== X-Gm-Message-State: ACrzQf2NDASAlOv47JArk8ch9ueimTZkLg3tOJKcTsInUhriNgs7mi0K 0fozeohLQtG67QDUNriyboZxCLdBhpgxAg== X-Received: from mmandlik.mtv.corp.google.com ([2620:15c:202:201:5808:dcfb:1968:5125]) (user=mmandlik job=sendgmr) by 2002:a25:320d:0:b0:6b0:29ba:fc57 with SMTP id y13-20020a25320d000000b006b029bafc57mr7625919yby.77.1663909933413; Thu, 22 Sep 2022 22:12:13 -0700 (PDT) Date: Thu, 22 Sep 2022 22:12:04 -0700 In-Reply-To: <20220922221037.v6.1.I44a65858f594107d3688087dfbdf669fac450b52@changeid> Mime-Version: 1.0 References: <20220922221037.v6.1.I44a65858f594107d3688087dfbdf669fac450b52@changeid> X-Mailer: git-send-email 2.37.3.998.g577e59143f-goog Message-ID: <20220922221037.v6.2.Id7ed3b8351837e45025add1d496630f0b9b460cb@changeid> Subject: [PATCH v6 2/3] Bluetooth: btusb: Add btusb devcoredump support From: Manish Mandlik To: luiz.dentz@gmail.com, marcel@holtmann.org 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=-9.6 required=5.0 tests=BAYES_00,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=ham 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 --- 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 271963805a38..e9052779f4f8 100644 --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c @@ -4205,6 +4205,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, @@ -4216,6 +4227,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.37.3.998.g577e59143f-goog