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 DBFF8400DF3 for ; Tue, 11 Aug 2026 07:32:50 +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=1786433573; cv=none; b=A8xunRu8rpQhkLdp0CVTu/qIetMnHunUbGURCpdfoYUXEKPqx4XvnZ58BHcNNkTC7PXmE45R/q+aq5h7oNZyYhN/Fc74zcO/d6oh0LrICLFASsfqj8cQ0Vf/haMYGvE+8srnZ+bwyFXzWl05hOkfj43apJGN7/Dru5/APRcyhYg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786433573; c=relaxed/simple; bh=+tp2PqGdyroqhAj3m1ptq0FdDfaJu4hLv1vVQUx8a4I=; h=Message-ID:Date:MIME-Version:From:Subject:To:Cc:References: In-Reply-To:Content-Type; b=nW50EcchMARddzCRoRjnc4mYoogLihT3UgGItNcHdXmlJevvW5BsuztJ0B3BSVFkidVTJXp4B4MeJoeyi2pJBfQ1ad7PyvgnQJdnM7c3IXliW3LmqegEwwkvxB2f42acrRzpSp1R+fpAru0JQzaVpmGyJ+A5zgkPYFC1jDqDabM= 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=FR0FZJzc; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=LXYI+R6h; 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="FR0FZJzc"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="LXYI+R6h" Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 67B726Dt2937175 for ; Tue, 11 Aug 2026 07:32:49 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= Zik0MM+Spytg8wiKrAMNSNHAKxnc0Bb68YfojdbtMK8=; b=FR0FZJzcNUR7w6Pg oL8H6ZkTmc0LNQKOxbJGG+cgzeVC+2q++BK6wBlW0mr9wKl+yzJ22eF9u+oVjhR2 FrC3jTMC567StOT/lOytiU0oGtrNy4Bin+/iw+ZiR+3iZwDhAtnh0sOrktSyQgnf DNLH9w30DOWOKsGCqC23Obnja5KDo2P0AupE2r7HD5gEImW/Eq7EdNu1qoEjF1ok Iqdj/sLxVONotn6Z6WHyjjsfrGY0dnWOAkDvezpd6WyG6azUpKzNLht6Za0TlwIK deNKX8bB+HMFcWfQOuVqTXFy2l1r5Xjs3o/IfK3iOo9Vfjh37QgTJtLecpTj3DIG 77/ZvQ== Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4fyjjv2w7m-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 11 Aug 2026 07:32:49 +0000 (GMT) Received: by mail-qk1-f197.google.com with SMTP id af79cd13be357-934956beec8so515494185a.0 for ; Tue, 11 Aug 2026 00:32:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1786433569; x=1787038369; 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=Zik0MM+Spytg8wiKrAMNSNHAKxnc0Bb68YfojdbtMK8=; b=LXYI+R6hYMTebyjhHl8DhEcg4BfLPAUI/BRhonLwCpJQv/quLMkT/gcltaJIHDhw8M u75/ME/KxgP52rT2vAYGPmD9fgqIA6BwvqOreGVuepS6GEPkJftvf1InlIukmpmg7oMy Vn3HpDbDa7Jom8+1W3sshOOABs3q4YeyvTk+sDQ3JDGw5Xq59t6U3Wx2gPKREQvjqIYX DjV3n/m9LUOfKqzkKZf2sZE+T+eCHLpDgeXYr9c0CNZFiSuYDIYEdOXm0JGaNBINnrN2 SLJseUITohtuoDfIs6tlgWd9MlEyBibDP5HN2fchMrVg35rkGI5qasGhEEUIbZOUCFTP JIGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786433569; x=1787038369; 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=Zik0MM+Spytg8wiKrAMNSNHAKxnc0Bb68YfojdbtMK8=; b=cUHUKNrm8+EdA5CVeZR5fnaS3QAX7vqjkaryB44XIT2njw5a0eVTrgsZZvfLweb1cq 651s0LhwdjJO5/ApArnOlslrrPct3aVcgHf6eCCF0aC71kps2StLi6JDlGexkx9zxmqn 2y7mVSAdmbBozEsTTQy02ekpAODUMsKW8TPBL3Ftsb9KAmqCTJQpshWE2tNR4oDzivch KVK4waZ8sDHTf1SO5AE1BA0qzMcxMuR6fCjxjCqYaOsoRG7kV6C4uUqgIh6HvapxXXTK 4It7E19vcsQ+t0KHlbjI+ea/aSOrEZW/HqEc7HnWsSZ5A6CWuDvXOpk0TiN+htCF9TFW dxhg== X-Forwarded-Encrypted: i=1; AHgh+RrFQyS/YJPiyvkGbRNJ+7W5I9YsBRdHdI7CvS5vtAKzQ/HnENrBeEC/O5I2IIfuBQCRTbd+fSXAhQHDmjY=@vger.kernel.org X-Gm-Message-State: AOJu0YxwZ4vjdb4AOofFfMFt5npTL/uRceJXe2JQVzyISe1cFz7Qeqq7 HorZvhVh3owUpzWX8fbY5sbeyk2egyYzbwymTvoAdQ8Ev7wnRiFVK4Lv9Pc7lZu9LaX68QPqdma GjOG9ijK0TTi+HtR3ndanmNsKvehp5PMTub2jwLp7/7JNj45EdkSV5SVTwjNI0TwW+UI= X-Gm-Gg: AR+sD132zDQ9jrtAf/E8yoEHnaLzWuyhXblLqKvRsiIcEw+pKLcRBappG0ejXV6KzyJ D34gqFu0dd/oFgR+DXM5HVXz4W0bv5gVc35t8eV830pvB8RB42p7dCubkCFqK8C1C6OoHakSgY8 SonFmXC4b07wEaTn8ucEX5RqsoV3FJuD7txyTY9qs6WSvtie4951ybW0RqLv2PpL/iI+19uZ1xw v93EjlLxwZtEEp6pUwG1A928mdMrFQw3rZJ3DREJ0wx5A79XAb0BXI95M5FFLnOEUVbqFgjRVPc YqEbPvdWRsl1FW9aOhI8cKG5kXbABXyQyhW1RqWG0+r3NSigqC9+4QGk2KP9clccZrvu/QcB00K uLrb4xwSlCQl+1hdg2861z1zd34yUhcYusrJkOy9ofHjFSSUg/iwMtjSedQY++Q9iog2Qdct1kx Kb7bbK3DkaxPUtg7PMHrLBvX72Xqpk1JHs2DQhmLSTkrv76EfLCCG/Ym+xc+lmKeN85GE= X-Received: by 2002:a05:620a:6482:b0:932:d9c4:3bec with SMTP id af79cd13be357-936a8f3d2cemr97740385a.38.1786433568641; Tue, 11 Aug 2026 00:32:48 -0700 (PDT) X-Received: by 2002:a05:620a:6482:b0:932:d9c4:3bec with SMTP id af79cd13be357-936a8f3d2cemr97737685a.38.1786433568211; Tue, 11 Aug 2026 00:32:48 -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-c20e40cc5c4sm22718566b.8.2026.08.11.00.32.46 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 11 Aug 2026 00:32:47 -0700 (PDT) Message-ID: Date: Tue, 11 Aug 2026 09:32:45 +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 , Daniel Golle Cc: "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> Content-Language: en-US, nl In-Reply-To: <2026081139-strenuous-greasily-f4e5@gregkh> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwODExMDA2MSBTYWx0ZWRfXwJ6OZ1JW8EIu tU9qviPtwCd0VhgRp+Dm5dMrXul81phhl/ZV6mW+aP1tbAC15OuOB9Jt/ZAIkX6LTFMZhDI/n31 uuVMCOpfegZ1zCbTfb843qLiVA3GgKXfFHMYsMChsjhh+BPhoAMyLpuBj+ka5Rhi9NtmWP4ZRpb Ev84zRKkJBjI4GQyG8SRvtL9tBvDZuC2Ci9gOBatNiV9oWUppnXjs/mi/pjr6r04qTayYV3CQKM 3bvSB5lNAywiQTSKQKA2WXEebS5nNYdLWlV7GDmjJUdKN13VyddpgmKdPE+OEhEcNWRd/ldtZIh cEHuQKrEtoUHAWCWlrXhPqZtZofLG49GScmr5j9AYf23X9+vl7oOmvh+9MeAM3kAyRh+PxXTjYL cQCnQdkIUjJMN9RtbdznFJ2bhLI+2FNw7NxsO5TvOCDRO5NAbmjIY+82Mqjc8q5gwbhCl4+QUs2 M8/xuHBrpO+rRhfUjYA== X-Proofpoint-ORIG-GUID: i5cIh6Jgx_ASqpwqVhmWpgxG8S7DHZWa X-Authority-Analysis: v=2.4 cv=KLtqylFo c=1 sm=1 tr=0 ts=6a7ad021 cx=c_pps a=50t2pK5VMbmlHzFWWp8p/g==:117 a=xqWC_Br6kY4A:10 a=IkcTkHD0fZMA:10 a=Sv0fKeRqtYgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=ZpdpYltYx_vBUK5n70dp:22 a=8OD1bfQqW12JbmighQMA:9 a=QEXdDO2ut3YA:10 a=IoWCM6iH3mJn3m4BftBB:22 X-Proofpoint-GUID: i5cIh6Jgx_ASqpwqVhmWpgxG8S7DHZWa X-Proofpoint-Spam-Info: AW1haW4tMjYwODExMDA2MSBTYWx0ZWRfX/Sw6CiqAwq6I LqXMHpsbqAdlSzamn9O6TtpCr2Fu1lCbtcA1kyDO0H+lQuZauMKyDZDTbbBHdCIo055Ijy7SmSr KmAK1BRLiyBtfAI178AUN8/IhCEZwhU= 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 clxscore=1015 impostorscore=0 priorityscore=1501 bulkscore=0 spamscore=0 adultscore=0 suspectscore=0 malwarescore=0 lowpriorityscore=0 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2608110061 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. 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. Regards, Hans > >> The hand-rolled copies share two bug classes: the work function >> ends with module_put(THIS_MODULE), > > That's broken as-is. a module should NEVER be calling > module_get(THIS_MODULE) either. > >> racing a concurrent rmmod freeing >> the module text (the race module_put_and_kthread_exit() exists to >> close for kthreads), and nothing synchronizes the deferred detach >> against device_shutdown() or an administrative unbind. > > yeah, that's a mess, don't do that. > > Fix up the original drivers please, let's not encourage others to copy > this broken scheme. > > Also, your patches were not threaded properly :( > > thanks, > > greg k-h