Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp3991991ybl; Mon, 12 Aug 2019 09:35:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqzInlSp+DVAhmNuACRpyjTaiwrgZ62+F7yDojBKkgCwKakGkt2OxsmuXQbOhnSdgVUuU61m X-Received: by 2002:a17:902:4b:: with SMTP id 69mr33757029pla.89.1565627741111; Mon, 12 Aug 2019 09:35:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565627741; cv=none; d=google.com; s=arc-20160816; b=mj3BvCIQDJlHMZ2uRBAfrvcymOzixHFbfjJ8r2A5ZZERJDrtBBr3QtKS19d5xQUO3N ZQMcrMSR73zSwFURmaseIlZVceVpFD1HXTltwELa1x1S3Kyjfl9atVEuzfZ/UpvXJzfM P2DQoIOaKACeL/i8lF9ohKRyjfR6IRHMKkk0yiau+u0H7v07WPPmfBJLHjBQCpmulDHu c+yr18vpSPMdVfs/O0+g2Ef2cTYmLKzKNzDqGq5Ssk8WBKsjSlbNPptGlxuPQyLWvPpQ wpBktnYxy6SiFhjiJfaSh00F/7hIuY3XLIC+gorrswfckxTWiHSwwUTfIsIh8Q2p6q9y PVeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version; bh=kQZqIBWz1OrUUKvhhqlkzDydCX2Djr9/Oay/i7VTFmk=; b=y/GXS5iWlzkUmeUeUkye7fOWJVRlRD/Iu81xcyzFmdq7Ua6BfD24Nazt+CXWIwoo5P YvxDympmB5nTJO07eFOugK9xLiAThE2BDpabdQihJCglS5Ba7CRv4UROgteONFrGo8C1 UgiPga9jbAGGKHP8aQgeMFL7iQra6HAb5dre0p287wiT7L5Qo2aW78CfrejfXn2oNsu/ qkqnfyB/UhiFutaa9qp5aFYnYS7e5fFDmc0ai5r8dejLQbJ/Pdvv+sLnNPdJSjBsc3Lo /J7t8jH143qiDSvHt4nsDpjF7aLQ9mZUzmHof55rdl6ep1uGx0KC6aT06QW+ptdGQhm5 68Tg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i14si9373998pfq.287.2019.08.12.09.35.25; Mon, 12 Aug 2019 09:35:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726463AbfHLQfW convert rfc822-to-8bit (ORCPT + 99 others); Mon, 12 Aug 2019 12:35:22 -0400 Received: from coyote.holtmann.net ([212.227.132.17]:57334 "EHLO mail.holtmann.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725822AbfHLQfW (ORCPT ); Mon, 12 Aug 2019 12:35:22 -0400 Received: from marcel-macbook.fritz.box (p4FEFC580.dip0.t-ipconnect.de [79.239.197.128]) by mail.holtmann.org (Postfix) with ESMTPSA id 23B94CECF3; Mon, 12 Aug 2019 18:44:02 +0200 (CEST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: Re: [PATCH v2] Bluetooth: btrtl: Save firmware and config From: Marcel Holtmann In-Reply-To: <20190805030733.GA11069@toshiba> Date: Mon, 12 Aug 2019 18:35:20 +0200 Cc: Johan Hedberg , linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org, Max Chou Content-Transfer-Encoding: 8BIT Message-Id: <1BB38E27-5FAD-4402-86C1-6AA47E6BA08A@holtmann.org> References: <20190805030733.GA11069@toshiba> To: Alex Lu X-Mailer: Apple Mail (2.3445.104.11) Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi Alex, > usb reset resume will cause downloading firmware again and > requesting firmware may be failed while host is resuming > > Signed-off-by: Alex Lu > --- > drivers/bluetooth/btrtl.c | 101 ++++++++++++++++++++++++++++++++++++-- > 1 file changed, 97 insertions(+), 4 deletions(-) > > diff --git a/drivers/bluetooth/btrtl.c b/drivers/bluetooth/btrtl.c > index 208feef63de4..416a5cb676e3 100644 > --- a/drivers/bluetooth/btrtl.c > +++ b/drivers/bluetooth/btrtl.c > @@ -56,6 +56,8 @@ struct btrtl_device_info { > int cfg_len; > }; > > +static struct btrtl_device_info dev_info; > + No. We are are not using magic global variables. What happens if you attach more than one device? Also I assumed that request_firmware has a caching capability of sorts so that drivers don’t have to re-implement caching of the firmware. Regards Marcel