Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3345863ybt; Mon, 29 Jun 2020 23:51:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzVBRGH+GskcclCZnSIby0t2FSQFhhuHHcbsUAsKHG3VgiGajziwgskowJaV/l0NwYyucdI X-Received: by 2002:a17:906:a0f:: with SMTP id w15mr17807268ejf.332.1593499905814; Mon, 29 Jun 2020 23:51:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593499905; cv=none; d=google.com; s=arc-20160816; b=qo3mCR9ed2jvf8fEtatNYgDrS6fbK1nfoZ9CSl9yqDxNVEUPFipN0mg44IBxC7vSfa Js8B/H4nKCiy2UKogQCNQMP7D4N/wBGq785lRKk/8SjJmrTE/XK1CxJTQrQ21KsChYi9 U/Mxv7PxvNBpOBQgBzpBAgIyY8Im3nAcWi6tpC6oiaaltzc9K1H+Qne6PAmSFtRYP8qs 9s7ppU3aBx8Vph20B7ikRsIQMwKaPN9cWVTiE/RjVbKY7pVHJWuKP06CAYqKwyN6AoCw CDaB8drKGutW16rM5+pfabFjf5u61K6gLJADdLAhqwe8/wnRfc15OhEY5l20Q+c1lj+u yyQQ== 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=cl8K/uuTvzJnkLHOuJYUWZUVCWVlFfr41AV2AxfUH9U=; b=Thp1HMDfHe7onuSrLfzqllXhRCSYY2Y7Itw2w7UI1tGnU764gbuyCfLRoFHItHWeUN sOpMw1w5JFAY52le1mWTkPxACzBOML9fiORdGtJrnnyvH2NefUzXv1UQm+x+mI/SDlZH Bx4bBXYyoF61CJTQml/Hlp12SXZ4D8mKWAAgdvSKJnWAZrs/4yoGAmOBFFrLfdFNb3k7 DHaiF6og+RjylPgbmKgi7QBIkGQJfYlDRK+2U72QxBrBBDgwN3UQgqOBSEAT+9ShiRNz 5bdzqNw4CATxNbakmVakaW0z39wyu7Khkh3LMm5TXPhb26sSHTGTYJHtmXE8edCnZpce Q/6A== 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 d6si1202658eja.468.2020.06.29.23.51.21; Mon, 29 Jun 2020 23:51:45 -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 S1730447AbgF3Gtw convert rfc822-to-8bit (ORCPT + 99 others); Tue, 30 Jun 2020 02:49:52 -0400 Received: from coyote.holtmann.net ([212.227.132.17]:47425 "EHLO mail.holtmann.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730386AbgF3Gtv (ORCPT ); Tue, 30 Jun 2020 02:49:51 -0400 Received: from marcel-macpro.fritz.box (p5b3d2638.dip0.t-ipconnect.de [91.61.38.56]) by mail.holtmann.org (Postfix) with ESMTPSA id 8E30DCECE2; Tue, 30 Jun 2020 08:59:44 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) Subject: Re: [PATCH v2 12/14] Bluetooth: Update background scan and report device based on advertisement monitors From: Marcel Holtmann In-Reply-To: Date: Tue, 30 Jun 2020 08:49:49 +0200 Cc: linux-bluetooth , Linux Samsung SOC , Miao-chen Chou , Johan Hedberg Content-Transfer-Encoding: 8BIT Message-Id: <2378EEDB-97C4-4AFB-91B7-4EAF63FA4EFD@holtmann.org> References: <4c8aeca04ed20e2776cadd9bdb57a7a3632d622c.1592404644.git.marcel@holtmann.org> To: Marek Szyprowski X-Mailer: Apple Mail (2.3608.80.23.2.2) Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi Marek, >> This calls hci_update_background_scan() when there is any update on the >> advertisement monitors. If there is at least one advertisement monitor, >> the filtering policy of scan parameters should be 0x00. This also reports >> device found mgmt events if there is at least one monitor. >> >> The following cases were tested with btmgmt advmon-* commands. >> (1) add a ADV monitor and observe that the passive scanning is >> triggered. >> (2) remove the last ADV monitor and observe that the passive scanning is >> terminated. >> (3) with a LE peripheral paired, repeat (1) and observe the passive >> scanning continues. >> (4) with a LE peripheral paired, repeat (2) and observe the passive >> scanning continues. >> (5) with a ADV monitor, suspend/resume the host and observe the passive >> scanning continues. >> >> Signed-off-by: Miao-chen Chou >> Signed-off-by: Marcel Holtmann > > This patch landed recently in linux-next as commit 8208f5a9d435 > ("Bluetooth: Update background scan and report device based on > advertisement monitors"). > > It causes a regression, a kernel oops during system suspend/resume cycle > on Samsung Exynos5250 based Snow Chromebook: > > 8<--- cut here --- > Unable to handle kernel NULL pointer dereference at virtual address 00000000 > pgd = 86c149f5 > [00000000] *pgd=00000000 > Internal error: Oops: 5 [#1] SMP ARM > Modules linked in: cmac cros_ec_sysfs cros_ec_lightbar cros_ec_debugfs > cros_ec_chardev cros_ec_keyb cros_ec_dev snd_soc_hdmi_codec cros_ec_i2c > cros_ec snd_soc_snow snd_soc_i2s snd_soc_idma snd_soc_s3c_dma exynosdrm > analogix_dp exynos_gsc v4l2_mem2mem snd_soc_max98095 snd_soc_core > ac97_bus snd_pcm_dmaengine snd_pcm snd_timer nxp_ptn3460 snd soundcore > pwm_samsung spi_s3c64xx cyapatp crc_itu_t mwifiex_sdio mwifiex > sha256_generic libsha256 sha256_arm btmrvl_sdio btmrvl cfg80211 > bluetooth s5p_mfc governor_simpleondemand videobuf2_dma_contig > videobuf2_memops videobuf2_v4l2 ecdh_generic ecc videobuf2_common > videodev phy_exynos_usb2 ohci_exynos panfrost gpu_sched mc s3c2410_wdt > s5p_sss s5p_cec exynos_rng rtc_s3c i2c_arb_gpio_challenge > CPU: 1 PID: 16 Comm: kworker/1:0 Not tainted > 5.7.0-rc7-02995-g8208f5a9d435 #8564 > Hardware name: Samsung Exynos (Flattened Device Tree) > Workqueue: events_freezable mmc_rescan > PC is at __queue_work+0x6c/0x4e8 > LR is at __queue_work+0x68/0x4e8 > pc : [] lr : [] psr: 60000093 > ... > Flags: nZCv IRQs off FIQs on Mode SVC_32 ISA ARM Segment none > Control: 10c5387d Table: 6be2406a DAC: 00000051 > Process kworker/1:0 (pid: 16, stack limit = 0xf9898f75) > Stack: (0xee117de0 to 0xee118000) > ... > [] (__queue_work) from [] (queue_work_on+0x40/0x4c) > [] (queue_work_on) from [] > (hci_adv_monitors_clear+0x74/0x90 [bluetooth]) > [] (hci_adv_monitors_clear [bluetooth]) from [] > (hci_unregister_dev+0x158/0x224 [bluetooth]) > [] (hci_unregister_dev [bluetooth]) from [] > (btmrvl_remove_card+0x58/0x7c [btmrvl]) > [] (btmrvl_remove_card [btmrvl]) from [] > (sdio_bus_remove+0x30/0x11c) > [] (sdio_bus_remove) from [] > (device_release_driver_internal+0xe8/0x1ac) > [] (device_release_driver_internal) from [] > (bus_remove_device+0xcc/0xf8) > [] (bus_remove_device) from [] (device_del+0x15c/0x384) > [] (device_del) from [] (sdio_remove_func+0x20/0x34) > [] (sdio_remove_func) from [] > (mmc_sdio_remove+0x38/0x64) > [] (mmc_sdio_remove) from [] (mmc_sdio_detect+0x6c/0xf8) > [] (mmc_sdio_detect) from [] (mmc_rescan+0x1d0/0x42c) > [] (mmc_rescan) from [] (process_one_work+0x178/0x4ac) > [] (process_one_work) from [] (worker_thread+0x2c/0x530) > [] (worker_thread) from [] (kthread+0x12c/0x158) > [] (kthread) from [] (ret_from_fork+0x14/0x2c) > Exception stack(0xee117fb0 to 0xee117ff8) > ... > ---[ end trace 0ec00d142e0a49cf ]--- > > This board uses btmrvl_sdio bluetooth driver if that helps. Reverting > this commit in linux-next 20200629 'fixes' the issue. > > I can do more tests if needed on this hardware, just let me know how can > I help and what to do. can you check latest bluetooth-next. I think that we applied a fix for it. Regards Marcel