Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp347095pxj; Fri, 7 May 2021 09:56:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwiW2rqSkotC/BSVh6u7yzWI5Lo6sL1ek0SDADLsj+xZC38RD/dGGJnweQ/RfC+0xmlv1Zf X-Received: by 2002:a63:a547:: with SMTP id r7mr10797061pgu.7.1620406561557; Fri, 07 May 2021 09:56:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620406561; cv=none; d=google.com; s=arc-20160816; b=J3CrLX7CTHAQfExzk+XIVBoMr1p6wL025lnVqO3Swr6TuqGsbHTZHXvslXYLG/50Lt BoUWe2tJqJjj7fFnWGIl37sAOC0gkC1X9QlD1keMxBA9vuOycg8ldxsWuqs3j0Vccz2l D3i3UsL4drKRloKs7vetqJSa3QNcHW1+xm6kMSN7zDdmGwlioxbHdmr42J++1KK8wDsC x4mYdC9z4DoC0z0CcBnGAo1QmBoW5ALH7vnucFFyEbLFpJ5plnvgUL4QFIdbmyaFDRe1 UzAa5MAXEKWG0LQM2WjKFCAEYtrwsElvTYEW6McA/6U6U3LNoDVQMoCea0pAz4e7hXWS VNBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version; bh=gu2zeHl6xS7g7ViiztCLaaecbXJ28umXcYnbU+5uWWI=; b=CPsQ/07cFzX4u5IpYDmY7tBu3KzzX6B4b2wVsKNx/Bir8jjGxXpBbmyL7IRyISpYdX gGH/soRPnuOk380tSw9NzG/olH8PIqBOmtN/eu3wiBnd/THorXYdpS8++8wS6iV4rvLB tTdCY0I62VPgPc7DAicBuXl/dm3papaFNqxsp6e0uUMDWIjUoIuedmpIDLi13ImsT1eI ZMLagiH5jVOJ93JGkELuGpO6wUiv+cqpcMMUtw7SZaR1Uczmrpg9urCqxYlmjrqmtqfz vFOmuaAVwMSM872NpLJgPEyz4TV0SPSI4RUeaESXP7tw/iRdqZi2FMOoY/gP6yZigCMc L9JA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lt4si8548809pjb.32.2021.05.07.09.55.36; Fri, 07 May 2021 09:56:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237107AbhEGMw6 convert rfc822-to-8bit (ORCPT + 99 others); Fri, 7 May 2021 08:52:58 -0400 Received: from coyote.holtmann.net ([212.227.132.17]:42869 "EHLO mail.holtmann.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236772AbhEGMw5 (ORCPT ); Fri, 7 May 2021 08:52:57 -0400 Received: from smtpclient.apple (p4fefc624.dip0.t-ipconnect.de [79.239.198.36]) by mail.holtmann.org (Postfix) with ESMTPSA id 27C9DCECE1; Fri, 7 May 2021 14:59:45 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.80.0.2.43\)) Subject: Re: [PATCH] Bluetooth: btqca: Don't modify firmware contents in-place From: Marcel Holtmann In-Reply-To: <20210507122733.11250-1-cwabbott0@gmail.com> Date: Fri, 7 May 2021 14:51:53 +0200 Cc: Bluetooth Kernel Mailing List , Venkata Lakshmi Narayana Gubba , stable@vger.kernel.org Content-Transfer-Encoding: 8BIT Message-Id: References: <20210507122733.11250-1-cwabbott0@gmail.com> To: Connor Abbott X-Mailer: Apple Mail (2.3654.80.0.2.43) Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi Connor, > struct firmware::data is marked const, and when the firmware is > compressed with xz (default at least with Fedora) it's mapped read-only > which results in a crash: > > BUG: unable to handle page fault for address: ffffae57c0ca5047 > PGD 100000067 P4D 100000067 PUD 1001ce067 PMD 10165a067 PTE 8000000112bba161 > Oops: 0003 [#1] SMP NOPTI > CPU: 3 PID: 204 Comm: kworker/u17:0 Not tainted 5.12.1-test+ #1 > Hardware name: Dell Inc. XPS 13 9310/0F7M4C, BIOS 1.2.5 12/10/2020 > Workqueue: hci0 hci_power_on [bluetooth] > RIP: 0010:qca_download_firmware+0x27c/0x4e0 [btqca] > Code: 1b 75 04 80 48 0c 01 0f b7 c6 8d 54 02 0c 41 39 d7 0f 8e 62 fe ff ff 48 63 c2 4c 01 e8 0f b7 38 0f b7 70 02 66 83 ff 11 75 d3 <80> 48 0c 80 41 83 fc 03 7e 6e 88 58 0d eb ce 41 0f b6 45 0e 48 8b > RSP: 0018:ffffae57c08dfc68 EFLAGS: 00010246 > RAX: ffffae57c0ca503b RBX: 000000000000000e RCX: 0000000000000000 > RDX: 0000000000000037 RSI: 0000000000000006 RDI: 0000000000000011 > RBP: ffff978d9949e000 R08: ffff978d84ed7540 R09: ffffae57c0ca5000 > R10: 000000000010cd00 R11: 0000000000000001 R12: 0000000000000005 > R13: ffffae57c0ca5004 R14: ffff978d98ca8680 R15: 00000000000016a9 > FS: 0000000000000000(0000) GS:ffff9794ef6c0000(0000) knlGS:0000000000000000 > CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 > CR2: ffffae57c0ca5047 CR3: 0000000113d5a004 CR4: 0000000000770ee0 > PKRU: 55555554 > Call Trace: > qca_uart_setup+0x2cb/0x1390 [btqca] > ? qca_read_soc_version+0x136/0x220 [btqca] > qca_setup+0x288/0xab0 [hci_uart] > hci_dev_do_open+0x1f3/0x780 [bluetooth] > ? try_to_wake_up+0x1c1/0x4f0 > hci_power_on+0x3f/0x200 [bluetooth] > process_one_work+0x1ec/0x380 > worker_thread+0x53/0x3e0 > ? process_one_work+0x380/0x380 > kthread+0x11b/0x140 > ? kthread_associate_blkcg+0xa0/0xa0 > ret_from_fork+0x1f/0x30 > Modules linked in: llc ip_set nf_tables nfnetlink snd_soc_skl_hda_dsp(+) ip6table_filter snd_soc_hdac_hdmi ip6_tables qrtr_mhi iptable_filter snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_codec_generic s> > dell_wmi_sysman(+) dell_smbios snd dcdbas mhi vfat videobuf2_vmalloc i2c_i801 videobuf2_memops videobuf2_v4l2 dell_wmi_descriptor fat wmi_bmof soundcore i2c_smbus videobuf2_common libarc4 mei_me mei hid_se> > i2c_hid_acpi i2c_hid video pinctrl_tigerlake fuse > CR2: ffffae57c0ca5047 > > This also seems to fix a failure to suspend due to the firmware > download on bootup getting interrupted by the crash: > > Bluetooth: hci0: SSR or FW download time out > PM: dpm_run_callback(): acpi_subsys_suspend+0x0/0x60 returns -110 > PM: Device serial0-0 failed to suspend: error -110 > PM: Some devices failed to suspend, or early wake event detected > > Fixes: 83e8196 ("Bluetooth: btqca: Introduce generic QCA ROME support") > Cc: Venkata Lakshmi Narayana Gubba > Cc: stable@vger.kernel.org > Signed-off-by: Connor Abbott > --- > drivers/bluetooth/btqca.c | 27 ++++++++++++++++++++------- > 1 file changed, 20 insertions(+), 7 deletions(-) patch has been applied to bluetooth-next tree. Regards Marcel