Received: by 2002:a05:6358:e9c4:b0:b2:91dc:71ab with SMTP id hc4csp6071726rwb; Tue, 9 Aug 2022 08:38:21 -0700 (PDT) X-Google-Smtp-Source: AA6agR4x38Y/spEijvFEKGuHjcjVCGOraMjKATJ3PJZHwwjCZ41AXP/aHNM8ZJID5EqAKGJScUcj X-Received: by 2002:a17:902:f641:b0:16d:351d:c1ea with SMTP id m1-20020a170902f64100b0016d351dc1eamr23030760plg.174.1660059501202; Tue, 09 Aug 2022 08:38:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660059501; cv=none; d=google.com; s=arc-20160816; b=0ukaBfNxYNTeJh1E82aC6CFMB3Yh+2M25EYvR9k1GyNVk00UT0FXqlv0SGGbg3eBrU hu2oMgiLPQqJdgXolaC+RTuA/OTA97acFVEjVeSmKi+O+9GvuQGAe91o5DxgWPsxc1wi 4Hf6Huj/E6IwGB1UT58hpT6h33KVGw+c4C3Fm1GAzprSSdXdLssIhwoSIIIc9ZIIFuHD BFmtk35mTY9xiVh88zO3Ct7YAJwhYfR2szO5AcRVeA5//GxwWvaSViI8Rb48h5Uanjel e5GyKb/1oUPmEBAdSOUBSAdBN1FW/EhHDvbeYhEuOcNqALDBHLSoQwc/UqE74A0lRXAE KKiQ== 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:mime-version:message-id:date :dkim-signature; bh=9waxFKEckRsksR/CxnLtO8m90vPWn0K31uAAo7MYkNw=; b=FszJQL71tezgn7Iw+zJkDDlO2WH6RKQR799sVQ3L9enZJOc5ch0s607zZc2/dLslAK RXS4AlRyiot6y8m99A9N0cyIOQesZ6jYgewx/FEP0PnCGPuPm7fthIdgPFO4p4ieeZ5k FiufurasQnmaOfRCsy/UBcCACN4ifYS/lSaPV0XOUSD01qI4JK3dP51R+Jh+iuW1TzlG NQkXZKX7t39KlTE8OBawj+vcjJ9aijmDVt3zSrSemQzLt3bUhhd3buUdhn0yHhle0R/q NOcqr1DAx3mQXgWCgEjosnsPc0CGj1o7mQ4YhyIRsWOXwf6X0xxZUDcGJFRsKV4vWFDC 6/sQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=QtfuSAE6; 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 g16-20020a056a001a1000b00527d7f8e7ebsi37007pfv.274.2022.08.09.08.37.47; Tue, 09 Aug 2022 08:38:21 -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=QtfuSAE6; 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 S244830AbiHIPgA (ORCPT + 99 others); Tue, 9 Aug 2022 11:36:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40426 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233527AbiHIPfm (ORCPT ); Tue, 9 Aug 2022 11:35:42 -0400 Received: from mail-yw1-x1149.google.com (mail-yw1-x1149.google.com [IPv6:2607:f8b0:4864:20::1149]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DDF2A25F6 for ; Tue, 9 Aug 2022 08:35:40 -0700 (PDT) Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-31f3959ba41so103755737b3.2 for ; Tue, 09 Aug 2022 08:35:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:from:subject:mime-version:message-id:date:from:to:cc; bh=9waxFKEckRsksR/CxnLtO8m90vPWn0K31uAAo7MYkNw=; b=QtfuSAE6stzliaPoJKxzJzaBikU713Hfx91gcTP2JzAGReZCY+d6FvciQFr5T7EcPU tENWbnTjdO+QBSjAZdWGcReGy5kgvh8UZz26/Bl1N+WUyA9kZgl6A51S6D8WqASaHPKb q6XARQyIhZGlYcNTSXLJD4DvaPQh74RVK9rv5PaA95BKemlPUTI7MEKh7efCsfZvxeNT 2p5Vzaaj+vce1ZTc/jtHDfwlMC/zakzGKSOR12ae8FdKvI4jSvBQD0TxFmKxnlTP6u89 Sb+QojnyTfAQunzgPFb8MBGv+0eqTSX19ejWXkw3JUAxQ/ubzf5Hk23cvoulwuVrymMz rGdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:from:subject:mime-version:message-id:date:x-gm-message-state :from:to:cc; bh=9waxFKEckRsksR/CxnLtO8m90vPWn0K31uAAo7MYkNw=; b=Pfb++7321Drk/tWW2jxnyoDl/VemCPlXR15PS+rdC7wHhPDnJDbtgv6M3q+4x3vs7P ey6i/R+hGFBZtrQpY/EFeVu0YCoBBF2zuWaRgCtOb3tC3m0CPHEublPMf/kgJIfsWDEY QWMJ1gQrbZ19IqAG7c7zCYGNygC2Y3LottIgRNqli33YYUHjSpPjqQ8AiYikbiA6KFSu V99LdvatCjK/T+pHoSvjdwyAt/IqxLF9Gbfv/Dut8wIX5JRfOy4Ubt4RJwzn9/owWLgX DvUu0PlZiUvD24UMtxKvMoM/2FaBPx2m6N8lMDniJWyLZXUWaGEeJQu/G3671Nvuxncm e8kg== X-Gm-Message-State: ACgBeo2bg8VIomvWEBursLGDFKk7bkPpEghIB/i5s7F5NyAPnDWpNUMb i+9i0nSdwzqwPDhF29wM0UxkmhehIKU1/g== X-Received: from mmandlik.mtv.corp.google.com ([2620:15c:202:201:91a6:8007:96f6:3fb3]) (user=mmandlik job=sendgmr) by 2002:a81:9245:0:b0:31f:4e3e:363d with SMTP id j66-20020a819245000000b0031f4e3e363dmr23716836ywg.119.1660059340189; Tue, 09 Aug 2022 08:35:40 -0700 (PDT) Date: Tue, 9 Aug 2022 08:35:23 -0700 Message-Id: <20220809083112.v4.1.I5622b2a92dca4d2703a0f747e24f3ef19303e6df@changeid> Mime-Version: 1.0 X-Mailer: git-send-email 2.37.1.559.g78731f0fdb-goog Subject: [PATCH v4 1/5] sysfs: Add attribute info for /sys/devices/.../coredump_disabled From: Manish Mandlik To: Arend van Spriel , marcel@holtmann.org, luiz.dentz@gmail.com Cc: chromeos-bluetooth-upstreaming@chromium.org, linux-bluetooth@vger.kernel.org, Manish Mandlik , Abhishek Pandit-Subedi , 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,T_SCC_BODY_TEXT_LINE,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 adds the specification for /sys/devices/.../coredump_disabled attribute which allows the userspace to enable/disable devcoredump for a particular device and drivers can use it to enable/disable functionality accordingly. It is available when the CONFIG_DEV_COREDUMP is enabled and driver has implemented the .coredump() callback. Signed-off-by: Manish Mandlik Reviewed-by: Abhishek Pandit-Subedi --- Hi Arend, The existing /sys/class/devcoredump/disabled provides only a one-way disable functionality for devcoredump. It also disables the devcoredump for everyone who is using it. This and the next patch provides a way to selectively enable/disable the devcoredump by creating a /sys/devices/.../coredump_disabled sysfs entry. The userspace can write 0/1 to it to enable/disable devcoredump for that particular device and drivers can use it accordingly. It will only be available along with the /sys/devices/.../coredump sysfs entry when the CONFIG_DEV_COREDUMP is enabled and the driver has implemented the .coredump() callback. Please let me know what you think about this. Thanks, Manish. Changes in v4: - New patch in the series Documentation/ABI/testing/sysfs-devices-coredump | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Documentation/ABI/testing/sysfs-devices-coredump b/Documentation/ABI/testing/sysfs-devices-coredump index e459368533a4..4bcfc7dbad67 100644 --- a/Documentation/ABI/testing/sysfs-devices-coredump +++ b/Documentation/ABI/testing/sysfs-devices-coredump @@ -8,3 +8,17 @@ Description: file will trigger the .coredump() callback. Available when CONFIG_DEV_COREDUMP is enabled. + +What: /sys/devices/.../coredump_disabled +Date: July 2022 +Contact: Manish Mandlik +Description: + The /sys/devices/.../coredump_disabled attribute can be used by + drivers to selectively enable/disable devcoredump functionality + for a device. The userspace can write 0/1 to it to control + enabling/disabling of devcoredump for that particular device. + This attribute is present only when the device is bound to a + driver which implements the .coredump() callback. The attribute + is readable and writeable. + + Available when CONFIG_DEV_COREDUMP is enabled. -- 2.37.1.559.g78731f0fdb-goog