From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1A3D741DDF3 for ; Tue, 11 Aug 2026 08:51:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786438320; cv=none; b=D4THLlseHjWt24igtWRT99ugnuWv+WPC+E7UkRTLyryeo7FYY6KSwA2TULougti60ALyc2Ki8VLERQfP7qBYeQGOmLmh8GMKFtpLCOvH3GdAlJ5VLkjAcSOuEloxRa8qsSwsH60cXKyEk3Cd4ENP3LmcnYfXM/kbHMCU/XiBgBA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786438320; c=relaxed/simple; bh=I7nPnuHKAd6p8Q9qirUeBbr32XOXSg2puw/1Nr5yEm0=; h=Message-ID:Date:MIME-Version:From:Subject:To:Cc:References: In-Reply-To:Content-Type; b=sCCnipbkMTndPy6vDCq8sDghsjxNCUqHJCtfDBFOH0cJV7skzxQyBXjv+Iqxj0B4v8gCPg5VsgX/IhALPxsnufEZ4ylbHNN1Zk9BXE9Blaon9/KHD1ylD6yGrjLJ6xPesMD6nbrC5J0Dn92TTefYAbRKh7LE1r7APvStahcAbog= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=mptQ0Iov; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=cjLvkADN; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="mptQ0Iov"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="cjLvkADN" Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 67B791GW2995757 for ; Tue, 11 Aug 2026 08:51:54 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= SPf3Qq35sizRfvRrlkrIrvuvqWT7RAryjsZcrodDY1c=; b=mptQ0Iovyl5nzwSj ktLVhbhNHYukgPzRYfj0kXZdB+EENabqatZRi1PaX4XaKAo6xmWM0j5WXvaHAu13 kmWQzWoLWtOtG1SMUndmnMgMUolNj4+igIHS5ucD8ni3UnGVZYwep6P0J0A0+XQO z7ewLdAafeE3raFSWXBca+XFuwGJkEv1UdkTW5exBom63ZGLhK1FBGLHP/nXoCjv iSMj5rjzYr0I1UKEBMLMdMpfBGTKl2MwPBin6aBJ2/tUdLJ+2HjsPLkbpOHTAyzW pROeblbMy+53LiLvunvfd1ID8yOWaikgNGxASqxi+V2NEnSjncRji4VrYllF8N3Q MGNzkA== Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4fyjyf362b-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 11 Aug 2026 08:51:54 +0000 (GMT) Received: by mail-qk1-f198.google.com with SMTP id af79cd13be357-936aa3d9dfbso13314585a.0 for ; Tue, 11 Aug 2026 01:51:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1786438314; x=1787043114; darn=vger.kernel.org; h=content-transfer-encoding:content-type:in-reply-to:content-language :references:cc:to:subject:from:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to:content-type; bh=SPf3Qq35sizRfvRrlkrIrvuvqWT7RAryjsZcrodDY1c=; b=cjLvkADNswzCKZrJDrNcCBUTBbTiiRjapumb8XUk+NbIrInzaPtqihEDM/9MyIv3S9 n5kXPob9lylZ7cFwys/lEJKUtctKkQ5efvrey0Oi+GpQ72/F9maKCte/2BcfTgWpQ5S4 jKrhTmog5b0azaFnl0CcO7rbi3n9owuRe2Q0/kpqUBbypjmDG0veC7aebJRkzLBiccjM CQvF+RPDCuDqNKXlOPBuNH4LqSYXiYsXuX3zCRj22y9l1gJU31ww8uFK22Y1+9/Q8ZMZ snlH4RKdB42OE+cwukE12shQrxftRfUW3WDOSEEJ/IkSXBT6QOtxd0+MwK02Vtvp8n1V NlxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786438314; x=1787043114; h=content-transfer-encoding:content-type:in-reply-to:content-language :references:cc:to:subject:from:user-agent:mime-version:date :message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=SPf3Qq35sizRfvRrlkrIrvuvqWT7RAryjsZcrodDY1c=; b=bkaHiOxT1EoJiimDpWnowgYRHfq10tx2H9BbT0NtOovcIEo8r1EaXqk351S5xCEKb7 f1+SPb9bOGaUlnGoBeU1TpyTrxmnAl8MGNuUI2EVhDSaA+2jSBrOvQXDbsJCK+zK7DMw GWGmu+yxeG7mwYJH9D1S/BKzzO4lh/FLayo4SvgHVgyAJGEceoJmB8xr6YPaF0JRzt6y v9DTC/CUb71pXNfUWDoUkwUGXO/BOr4cwWmEZlR4iaCGI6FS0FIKy0noQQNcR1+T/LdO ojP2AY1qbk4vzeq9MjE0kOoi3GoRn/MT6THiZJ4pvSMtrFSmwojvL3LDp6QKADsINoGI CYWA== X-Forwarded-Encrypted: i=1; AHgh+RqgfeCwAtKNrgSrZyQlx/v3byRv+324vsEdPiikOe6aV6C7BoYcRJ/SBHuLkinFk0eYBzov+5IZ/VI/m80=@vger.kernel.org X-Gm-Message-State: AOJu0YzmX7Zspbq7ZcmcX4/84KerxaRZTFwpUeTaLV60s4rgCxbw0GvX feGKEQrSOXZHCXlm6uK6P94BITRyTxM8m4yAl2tJN89g6MYi5Lbhoyc42HdyV/C833Jp7NdHPWa EPJ9SnmmkJxzhoelvNbd+ENpoy+twoV2Au+mnKe0w+oCnt5umY42t1efhTc3nkRVQTT0= X-Gm-Gg: AR+sD12k86xb33dk4MKG+WJKPGVKvz88H0LlvuzT30zWxmirSUCl0A6ogfmKmgeu6D/ vAFKiwIe1hxhqZbX5F7v1L13P0nsZcJgYvNLhKDRNZBN56Yj4QyzQAdm99Kv5ZpaUHs20xsWQAL 4iT0vEjxkKF2f7EmpYr1bXAC3lYm0fxHW1P2aJ5WK2c+Fqd13jrW3cIGWhbzt084neH+m4eOs9L b7oOKEtXkyDfcEbmuT5lurHPGygGviG5CbYoBqL6yaIZnWHo7XKiT8HqKTEK4yJy7x0VT+NTrTF 4DrKZiQgSda3duwy1qYJ09GmN9Zq9O1LqZAeDk1dL1Q65LU5Ix+CqsxHIYrJT7kqZQa2PSJ79Aq JnzoxuOF4UtjTzr0LJjrOOn75C8Xblrpjd183jaoSj//nQ+INTxwmjcmrz+3/BKzlN9XGQmPWva Hf9sJpHexRkOS6rrkfxOWX+jRjQvk3ZD6StJ88inzWHMMEXCfQPU0cYE2XGYjK5JJ0SaA= X-Received: by 2002:a05:622a:4d0a:b0:52c:cc14:ff5f with SMTP id d75a77b69052e-52d5869539amr13603441cf.38.1786438313968; Tue, 11 Aug 2026 01:51:53 -0700 (PDT) X-Received: by 2002:a05:622a:4d0a:b0:52c:cc14:ff5f with SMTP id d75a77b69052e-52d5869539amr13603161cf.38.1786438313450; Tue, 11 Aug 2026 01:51:53 -0700 (PDT) Received: from ?IPV6:2001:1c00:c32:7800:5bfa:a036:83f0:f9ec? (2001-1c00-0c32-7800-5bfa-a036-83f0-f9ec.cable.dynamic.v6.ziggo.nl. [2001:1c00:c32:7800:5bfa:a036:83f0:f9ec]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-c20e435981asm27364266b.42.2026.08.11.01.51.52 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 11 Aug 2026 01:51:52 -0700 (PDT) Message-ID: <154779e8-5f73-4f3e-8618-104effb85538@oss.qualcomm.com> Date: Tue, 11 Aug 2026 10:51:51 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Hans de Goede Subject: Re: [RFC PATCH 0/4] device_schedule_reprobe(): core helper and conversions To: Greg Kroah-Hartman Cc: Daniel Golle , "Rafael J. Wysocki" , Danilo Krummrich , driver-core@lists.linux.dev, "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , Andrew Lunn , Vladimir Oltean , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Miri Korenblit , linux-wireless@vger.kernel.org, Marcel Holtmann , Luiz Augusto von Dentz , linux-bluetooth@vger.kernel.org References: <2026081139-strenuous-greasily-f4e5@gregkh> <2026081133-crazy-enquirer-97ce@gregkh> Content-Language: en-US, nl In-Reply-To: <2026081133-crazy-enquirer-97ce@gregkh> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Proofpoint-ORIG-GUID: 9gtRf8FnnDoZ5PDrrCvZ88W5MQO9nITT X-Proofpoint-Spam-Info: AW1haW4tMjYwODExMDA3MyBTYWx0ZWRfXwr2FoCzPPlXP Ba6bxUjzXWlvPzX3UQ9jkNKhGvjNJ78UI4rvey9tcK/Y1C7F96hJPBUDtJaJMwsuWLFgFL28yI1 73BQAtW1XQ5EYIQnTSFEH7vtzVJeCCA= X-Proofpoint-GUID: 9gtRf8FnnDoZ5PDrrCvZ88W5MQO9nITT X-Authority-Analysis: v=2.4 cv=NqnhtcdJ c=1 sm=1 tr=0 ts=6a7ae2aa cx=c_pps a=qKBjSQ1v91RyAK45QCPf5w==:117 a=xqWC_Br6kY4A:10 a=IkcTkHD0fZMA:10 a=Sv0fKeRqtYgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=gowsoOTTUOVcmtlkKump:22 a=66NDgXRySrwKPkD-ur8A:9 a=QEXdDO2ut3YA:10 a=NFOGd7dJGGMPyQGDc5-O:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwODExMDA3MyBTYWx0ZWRfX7zJNsEG/UWwt Nx0bHGtes5yoOCBsnfXxRy3zkV23PKTBJiQfxhlLyRqzODNOECTGAyfW6qRtwIW1exMQ3adK7zY D8BATQxrgRLKTIqxZiyQHussidBEL407B36/WtpRra3VOoMC4NeV4QRm/rzIziaPv1KRCPmoA/s 27R80KbaSy/KDkp1v44e1fYOZdzq2urhU8g8/niHQD387G5CR6c1D3OVUHh2ffbgumtc67XS9/j 15lxHP0jLF55Sl0hETlGeISR4umjr2VcX3IwlOhBmDudPgM3qUI5IuArhjU5HgzsN00UxIpqCPP dLAd/hSrZ3sP801LOOKj7negqKVJXhfciqFGKiVAhWEqJMKE3ai3ujAHryw6JjChPXsoaspPx1B XUyHcnDgMvGHmo7Hu7Fo6n3wWRRnbCqD7R1Y/BH6G30qZg71tD3ysQS08fXgVU9fzGCQUbvqfVT 33lsdJcfGhhiGqx1OZg== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-08-10_06,2026-08-10_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 clxscore=1015 impostorscore=0 spamscore=0 malwarescore=0 phishscore=0 adultscore=0 lowpriorityscore=0 priorityscore=1501 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2608110073 Hi, On 11-Aug-26 10:07, Greg Kroah-Hartman wrote: > On Tue, Aug 11, 2026 at 09:32:45AM +0200, Hans de Goede wrote: >> Hi Greg, >> >> On 11-Aug-26 04:33, Greg Kroah-Hartman wrote: >>> On Tue, Aug 11, 2026 at 01:47:17AM +0100, Daniel Golle wrote: >>>> Three in-tree drivers (iwlwifi, hci_h5, btintel_pcie) schedule a >>>> deferred re-probe of their own device from a work item in module >>>> text. >>> >>> That's a mess, why? Why not fix that up to not do that? Thousands of >>> other kernel drivers do not do that, what makes these so special? >> >> I can only speak for the hci_h5 driver where I added the reprobe code-path. >> >> The problem is some of the Bluetooth HCI devices using hci_h5 loose all >> state during system-suspend. This means that the HCI and the Bluetooth core >> end up being out of sync. >> >> So we basically need to tear down and re-build everything including >> e.g. the firmware upload which happens at probe(). Doing a full reprobe >> is by far the easiest way to do this. >> >> I suspect the other 4 users + the pending driver which triggered >> this are similar. > > Full reprobe feels different than the THIS_MODULE stuff, which is what I > objected to here. Right, the helper from 1/4 to safely do reprobe from a worker actually removes the need for THIS_MODULE stuff :) The THIS_MODULE stuff in the open-coded implementations is there to avoid someone doing a rmmod while the reprobe is running. The new helper replaces this with some checks in the workqueue function checking the driver has not been rmmod-ed in the mean time. >> Sure we can do the whole tear-down + setup from some worker >> scheduled at resume, while keep the driver attached but if we need >> to duplicate that over 4 drivers + the pending driver which triggers >> this then IMHO those 5 users are a pattern which deserves having >> some helper to do this through the existing probe() + remove(), >> rather then requiring those 5 drivers to open code this themselves. >> >> Note that we already have device_reprobe(), which has 15 existing >> users. This series just adds a helper to do a device_reprobe() from >> a worker in a safe way. > > That feels a bit better, as long as this code really is "safe" :) > > So, how can this be tested and fixed up so it isn't a RFC anymore? To me it looks like the main things are: 1. Agree that a helper to safely do a device_reprobe() from a worker is helpful (I think this is done now?) 2. Get patch 1/4 reviewed. I can do an initial review but I'm not very familiar with the driver/device core internals. 3. Test this. I can test this on a hci_h5 BT HCI that will hit this code path. I'll try to get 2. and 3. done soon-ish. Regards, Hans