Received: by 2002:a05:6359:322:b0:b3:69d0:12d8 with SMTP id ef34csp373213rwb; Wed, 10 Aug 2022 09:33:19 -0700 (PDT) X-Google-Smtp-Source: AA6agR7pGu6T/1g7ycDDobJne3c56uwK/wtqWeZW0OovcDy92TUREEyoeWrTQKVwSp+tBGAwCudg X-Received: by 2002:a05:6a00:1c49:b0:52e:4e9a:a07a with SMTP id s9-20020a056a001c4900b0052e4e9aa07amr27837235pfw.26.1660149199351; Wed, 10 Aug 2022 09:33:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660149199; cv=none; d=google.com; s=arc-20160816; b=mbMdS16kU4VWWvfqM+uVLPn/MxYs5PArT5dhGYTaM4mtpI2hS8xrMLOgH4r8/S/FRu Fu6He8cFGf4M71g8I1oNs3WrJ0EnFKsBXY5OuyAH102QinImr79IO1ha5dX9oclpPVyT iQCnQmeqp0v0l8pQ8k2XzXPXRbV9r+/0V7Q8EoJjzU5YC2NIymSX33lGiOFJIgrpEgmo r8NteZMOFVRSqukePfiwpwPWfcscoAjX9bNWYxURjratECix1dqHyxKRyepfs/idNRng AtvHAL4un1FuSUhtR5yRrwm/w/TF2AUb+csTrLcTrYTpu4mSQy2Nw3Vyx+Q+Q5ge2WiL ESvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=5ZujCkYccdKWOdQKYMoR44pl0izBK8gDkA5b64LT7QI=; b=upNm/dR79OCghoZiirZCfnXzVSthy4769KpAF2easHQOIk1hy0Dr6lQL4l8Yd+6Te5 uBxv3S/O9pRW7S1DG/wbigfF71NcxDCVYHu7sAP8ALTR/7CVwwOJeoesUhKUxSMtTrb/ b9GlJYJQ78u9uE4OzcfnVroXeLG44yUcjBbus26swc5/CwwfC2HHx7tm1zNRtDEUYbrg 1APMtJ+tshB0Y0s7upOwP3BvyumC3QolYQMVc0WKfR0WqJi/nDLh2gTpGXKgnvap6aji wAL9i0TwhwliNfpAHbAq33voaUXovWOOjXp/F7umeAU5gx2JKWiJGxKJHYAGXQsgmT1l AKNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ddaOPiRM; 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=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 144-20020a621896000000b0052ef99d2e85si300360pfy.46.2022.08.10.09.32.27; Wed, 10 Aug 2022 09:33:19 -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=@linuxfoundation.org header.s=korg header.b=ddaOPiRM; 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=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232194AbiHJQUe (ORCPT + 99 others); Wed, 10 Aug 2022 12:20:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48616 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230209AbiHJQUe (ORCPT ); Wed, 10 Aug 2022 12:20:34 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A125D642FE; Wed, 10 Aug 2022 09:20:33 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E5BB861138; Wed, 10 Aug 2022 16:20:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C975BC433C1; Wed, 10 Aug 2022 16:20:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660148432; bh=mR5MkiYxhBloitX0py6T+VS5H2HSybt7+7SDSya1JiQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ddaOPiRMPZjMqFSQDysMhAgxeNBDVF3ELzpUlzOcqjKBbyDJlqBcx3fJkRFI4F/Au wjCzv3uUees1c/vtMzKPayd+XxSTF+99eppUs2bFUWR7tfsHzZbqlcOervdPj8NSMy rpKPYY7eg6B0W+str1FCBbwXhxhpfeQMlEb90UY4= Date: Wed, 10 Aug 2022 18:20:24 +0200 From: Greg Kroah-Hartman To: Manish Mandlik Cc: Arend van Spriel , marcel@holtmann.org, luiz.dentz@gmail.com, Johannes Berg , Dan Williams , Jason Gunthorpe , linux-bluetooth@vger.kernel.org, Thomas Gleixner , "Rafael J . Wysocki" , chromeos-bluetooth-upstreaming@chromium.org, Won Chung , Abhishek Pandit-Subedi , Johan Hedberg , linux-kernel@vger.kernel.org Subject: Re: [PATCH v5 4/5] Bluetooth: btusb: Add btusb devcoredump support Message-ID: References: <20220810085753.v5.1.I5622b2a92dca4d2703a0f747e24f3ef19303e6df@changeid> <20220810085753.v5.4.Id0d6e772f00432d55f6bcbf68a50cb4ad89396c6@changeid> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220810085753.v5.4.Id0d6e772f00432d55f6bcbf68a50cb4ad89396c6@changeid> X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 On Wed, Aug 10, 2022 at 09:00:37AM -0700, Manish Mandlik wrote: > This patch implements the btusb driver side .coredump() callback to > trigger a devcoredump via sysfs and .enable_coredump() callback to > check if the devcoredump functionality is enabled for a device. > > Signed-off-by: Manish Mandlik > Reviewed-by: Abhishek Pandit-Subedi > --- > > (no changes since v4) > > Changes in v4: > - New patch in the series > > drivers/bluetooth/btusb.c | 31 +++++++++++++++++++++++++++++++ > 1 file changed, 31 insertions(+) > > diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c > index 30dd443f395f..b00851327aa3 100644 > --- a/drivers/bluetooth/btusb.c > +++ b/drivers/bluetooth/btusb.c > @@ -1510,6 +1510,15 @@ static void btusb_isoc_tx_complete(struct urb *urb) > kfree_skb(skb); > } > > +#ifdef CONFIG_DEV_COREDUMP > +static bool btusb_coredump_enabled(struct hci_dev *hdev) > +{ > + struct btusb_data *data = hci_get_drvdata(hdev); > + > + return !data->intf->dev.coredump_disabled; > +} > +#endif Again, #ifdef in .c files is unmaintainable over time, please do not do it if at all possible. thanks, greg k-h