From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx08-001d1705.pphosted.com (mx08-001d1705.pphosted.com [185.183.30.70]) (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 A60C62905; Tue, 17 Sep 2024 08:28:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=185.183.30.70 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726561733; cv=fail; b=J8RqC3MbEihwfu42kpsmLSFLleCv26fprLcygkI0ZrMxfDj4lzla90QUzdY4KFsjrbh2mc+Nz0JYNGerzw9Lguw3O71waIzoB1JE57Prso1oxhfM9x/13zpn25jTejsHA0QwngCsCt6a288ngpxLYPA7hpQcMTiCSfzd0XW+ykU= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726561733; c=relaxed/simple; bh=mUEqAtkE+7I2D82YuhuCaib28qBvUECUMl4yvWUwywk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=EJvLfysKaAb/UNxgp9kmTZoqzz67k8YeeQhC39D3m9oBuUs26x9tWOhn9jPX86SZVfwd3NeNZthuCF5u/Z5cwFHSTwxwgOAuNPCGNhFCjRexLwu4euMliw9UcMFun8KROtVXB2MFnKMHL2RZrjHFSzavA/bZQUbj7oX2KXymvfY= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sony.com; spf=pass smtp.mailfrom=sony.com; dkim=pass (2048-bit key) header.d=sony.com header.i=@sony.com header.b=mCu8FSXs; arc=fail smtp.client-ip=185.183.30.70 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sony.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sony.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sony.com header.i=@sony.com header.b="mCu8FSXs" Received: from pps.filterd (m0209322.ppops.net [127.0.0.1]) by mx08-001d1705.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 48H5TXFj014389; Tue, 17 Sep 2024 08:28:43 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sony.com; h=cc :content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to; s=S1; bh=wZN90nCH1izEV0+NnHH5QzsIahBb59k nve/D9XqTneg=; b=mCu8FSXsmpuRGuEC0gJQOfm6zN7EL2joc81L1Mm76j8957j 7KKsqC2b5Ok8duw1JXW0XsalTP7qZ0yH0Y2+Y6BBDja931IEBrgR5HEqJPoHY825 7rpzEiTueUzrJd/mb9xwh2jOxFSGshysvu0WV9gPP89MlvjsxKuIYA13KWO7/2r7 mddzUodjJskuVC43ziEgSoZyzHiDj6vwmxrdYdYZFVrOjm9S8NXAm4BGcydhirVH eQODN5DoeM0tk18q+4NC4mazJyVy6zJDGTLplE+Tau2JNq8Mw2Fmr+uMKEE46Cq1 gDf+wPD5V5/1CI3tlCpB5TPvzthlRAvU7KEnUBg== Received: from nam04-bn8-obe.outbound.protection.outlook.com (mail-bn8nam04lp2040.outbound.protection.outlook.com [104.47.74.40]) by mx08-001d1705.pphosted.com (PPS) with ESMTPS id 41n3jaa1kd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 17 Sep 2024 08:28:43 +0000 (GMT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=n/9g+tX4URvisCTqf18982A2w5o+iIAMMjpnurM2nVYNE90IEsPJ3LHDHYXUThCPzjOgGetn4BrKpqzjCSjsPdO5AQLDtsAOaRkh+Ka3nv5it4MssEz31TXNlbTyIECa9Tcbn8ms23JvmDOH5Y/QOaV6pt0xQtYJ1u3aQ/7n5DYEi2q9q0ztA6p/54bL7JkizajUUjoVZbR6fQm+ROIpHAIfv7ge/44wN7K3rJPB0RVBfll4J7BPsc1JjuPECazBH+csj3erJP2riU7peGBl5sZyTWvny5zCafneEQCECg7eKfNpU/3CiYyMlA3+EQ+soslYeXaJNGf1cq0rCf093w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=wZN90nCH1izEV0+NnHH5QzsIahBb59knve/D9XqTneg=; b=yKsaEzOy5fZFgnI9v1tmvwNzqTrHmK5g+H+ZAabQnX22RxgAqX0qAxk4vQwOXeZN9LAzWoZ/SMhsQtD5sIYwD5juunf2XNNu7XtFYc7Kmf6U3LDmdJV8H4UWPRFh5oxeTXbFHLd6h/Y+waCKsZtfx4rCfvp3CcCRijYY0oME4wuSnWmd4XflIlzAXlJ6s+6z45q90XW18SnHcEg/tD3JYTEI0xHblA+8+ME4bS2eeR/ySyv2oGJokgI/tuiSlhKIIACHFjd0RnaS0ozBeP7J8JxsYe+Upum3192/awkuDnRl0nTDh4R7sCXGqMXFE23t6tg5sajox7rV+wQflSZjPQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=fail (sender ip is 121.100.38.198) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=sony.com; dmarc=fail (p=none sp=none pct=100) action=none header.from=sony.com; dkim=none (message not signed); arc=none (0) Received: from CH0PR03CA0341.namprd03.prod.outlook.com (2603:10b6:610:11a::18) by PH0PR13MB6086.namprd13.prod.outlook.com (2603:10b6:510:29c::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7962.24; Tue, 17 Sep 2024 08:28:38 +0000 Received: from DS3PEPF000099E1.namprd04.prod.outlook.com (2603:10b6:610:11a:cafe::21) by CH0PR03CA0341.outlook.office365.com (2603:10b6:610:11a::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7939.30 via Frontend Transport; Tue, 17 Sep 2024 08:28:37 +0000 X-MS-Exchange-Authentication-Results: spf=fail (sender IP is 121.100.38.198) smtp.mailfrom=sony.com; dkim=none (message not signed) header.d=none;dmarc=fail action=none header.from=sony.com; Received-SPF: Fail (protection.outlook.com: domain of sony.com does not designate 121.100.38.198 as permitted sender) receiver=protection.outlook.com; client-ip=121.100.38.198; helo=gepdcl09.sg.gdce.sony.com.sg; Received: from gepdcl09.sg.gdce.sony.com.sg (121.100.38.198) by DS3PEPF000099E1.mail.protection.outlook.com (10.167.17.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.13 via Frontend Transport; Tue, 17 Sep 2024 08:28:36 +0000 Received: from gepdcl04.s.gdce.sony.com.sg (SGGDCSE1NS08.sony.com.sg [146.215.123.198]) by gepdcl09.sg.gdce.sony.com.sg (8.14.7/8.14.4) with ESMTP id 48H8SYQK027145; Tue, 17 Sep 2024 16:28:34 +0800 Received: from mail.sony.com ([43.88.80.182]) by gepdcl04.s.gdce.sony.com.sg (8.14.7/8.14.4) with ESMTP id 48H8SXeG032144; Tue, 17 Sep 2024 16:28:33 +0800 Received: by mail.sony.com (Postfix, from userid 1000) id 2AC151BA9034; Tue, 17 Sep 2024 14:25:50 +0530 (IST) Date: Tue, 17 Sep 2024 14:25:50 +0530 From: Nayeemahmed Badebade To: Rob Herring Cc: krzk+dt@kernel.org, conor+dt@kernel.org, gregkh@linuxfoundation.org, rafael@kernel.org, yoshihiro.toyama@sony.com, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Subject: Re: [PATCH 2/2] driver: core: add probe control driver Message-ID: References: <20240911142319.3435746-1-nayeemahmed.badebade@sony.com> <20240911142319.3435746-3-nayeemahmed.badebade@sony.com> <20240912204634.GA738361-robh@kernel.org> Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240912204634.GA738361-robh@kernel.org> X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS3PEPF000099E1:EE_|PH0PR13MB6086:EE_ X-MS-Office365-Filtering-Correlation-Id: 96cfbcdf-3bfa-4f53-6f9b-08dcd6f2ba19 x-proofpoint-id: d8690225-876f-412f-87c6-a7cb45557a4c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|376014|82310400026|1800799024; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?ib3bbU/P92lPpQgH1XeSa6CWEk2Cjj2MipD0RWRpgEJ/bNNnpXi0qhma3a7p?= =?us-ascii?Q?Rs20I6SW1HY/RB2PSlHrA6+rp7az1dDftSXOYe9vqxFZV4pIDboXnaNONcC5?= =?us-ascii?Q?ufLT8CGL0YM6JfL4Gca+GkYFV6nnqlgZJjS9dW6fMxYMS/UhehoUh9eofi/R?= =?us-ascii?Q?Vth7u+JqlNxkHz4umgNr+lDJ737gDJfXKKMBl3mvXZA6vK7+bkeCFtb4nnpm?= =?us-ascii?Q?ycpAGTLqY0NVM6eeyHyCBXFzaMEzq5yyX90pGkpf5aKAXI6VZmfVT+gdMAQh?= =?us-ascii?Q?nkpWBZnMu/6dmXeessv1zZHqs/QbiD6y4e7Urz1qiJ5EH0WW1GvHO0w2XJtv?= =?us-ascii?Q?HQt9i8A9URFTGjFRpsKDcavu4iDTn8gtriaDupZ7xEBnOGM2G9++EwD0u6xd?= =?us-ascii?Q?jHrwpLVdgRo8jPANIbNTa8nRzMkIAbFAcNYkCWE/ZN/xEgHu3WVgFVqD2qb1?= =?us-ascii?Q?0GvCJ65OKH8uB1Z/+Hyd7uFksyr+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= =?us-ascii?Q?/PZaFqBGV6FsPxvFw4qjORRIfoNi?= X-Forefront-Antispam-Report: CIP:121.100.38.198;CTRY:SG;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:gepdcl09.sg.gdce.sony.com.sg;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700013)(376014)(82310400026)(1800799024);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: yjxoFSJshcCaogqGH3GoA4x3kvVj4dp3moQ1FDa4Un98o3SYhPljWjd+vEnOH+TPkvccGCEvNas9tBgvq6Z4EIcgvCACV8O88VXoNTiCjek9ygddc+2EAGxxt7gpH/2Iu8pjmq+kW7Z1Pkrdf+yohfp5VV+lE58pCzoJZk8o73HKJjBPS+qj04TgWBMe7mM1kZ6ZbFL6hfiENJlCBP8vIOD13/XgrRlF2hiXnV90z/297/Mf3kXUZDAeMd0T/kFGrtikU2Kuahs4Ppkzn5L3HZpYQMhncyQoZ+cdwx4iLvWwK39gbQ4N8rTB78j6WqG1RaADjZ+/hA/eR0RU+8wwl3M6ol+nh1LoB/HIpyO7pGItUZ0O64VX4uvgwwlNYAQeJTzAsq999XSQrbfSs9kWPuR5h+0EEAw2ba3m0welo+zjlhDMP4+QNH3CUpDbeDDiq3QLCHR4d17cavMrG/Kq7sQF52waagtnBGn1YPKVt8mb2RTPfvV5zJiidgj6rM7Se+GA01PghDnCxuMuAQKT1V8WcqfvacAHq5MLfZia7roX+hQuUSlLC+SiKyDG14JsjTgkFN8LhSgM/CnwoRFfMI2ke/SlGhC/2VzOdEqCOyOBkBKjzgFfS7WYrbEJ8xeE X-OriginatorOrg: sony.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Sep 2024 08:28:36.5395 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 96cfbcdf-3bfa-4f53-6f9b-08dcd6f2ba19 X-MS-Exchange-CrossTenant-Id: 66c65d8a-9158-4521-a2d8-664963db48e4 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=66c65d8a-9158-4521-a2d8-664963db48e4;Ip=[121.100.38.198];Helo=[gepdcl09.sg.gdce.sony.com.sg] X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: TreatMessagesAsInternal-DS3PEPF000099E1.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR13MB6086 X-Proofpoint-GUID: hePDI1DisJr7qcXLXC0vmmL2yGaZ3Noz X-Proofpoint-ORIG-GUID: hePDI1DisJr7qcXLXC0vmmL2yGaZ3Noz X-Sony-Outbound-GUID: hePDI1DisJr7qcXLXC0vmmL2yGaZ3Noz X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-17_02,2024-09-16_01,2024-09-02_01 Hi Rob, Thank you for taking the time to check our patch and provide valuable feedback. We appreciate your comments/suggestions. Please find our reply to your comments. On Thu, Sep 12, 2024 at 03:46:34PM -0500, Rob Herring wrote: > On Wed, Sep 11, 2024 at 07:53:19PM +0530, Nayeemahmed Badebade wrote: > > Probe control driver framework allows deferring the probes of a group of > > devices to an arbitrary time, giving the user control to trigger the probes > > after boot. This is useful for deferring probes from builtin drivers that > > are not required during boot and probe when user wants after boot. > > This seems like the wrong way around to me. Why not define what you want > to probe first or some priority order? I could see use for kernel to > probe whatever is the console device first. Or the rootfs device... You > don't need anything added to DT for those. > > Of course, there's the issue that Linux probes are triggered bottom-up > rather than top-down. > Our intention is to only postpone some driver probes not required during boot, similar to https://elinux.org/Deferred_Initcalls. But instead of delaying initcall execution(which requires initmem to be kept and not freed during boot) we are trying to delay driver probes as this is much simpler. > > > This is achieved by adding a dummy device aka probe control device node > > as provider to a group of devices(consumer nodes) in platform's device > > tree. Consumers are the devices we want to probe after boot. > > There's the obvious question of then why not make those devices modules > instead of built-in? > Yes we can use modules for this, but there are drivers that cannot be built as modules and this framework is specifically for such scenario. Example: drivers/pci/controller/dwc/pci-imx6.c > > > > To establish control over consumer device probes, each consumer device node > > need to refer the probe control provider node by the phandle. > > 'probe-control-supply' property is used for this. > > > > Example: > > // The node below defines a probe control device/provider node > > prb_ctrl_dev_0: prb_ctrl_dev_0 { > > compatible = "linux,probe-control"; > > }; > > > > // The node below is the consumer device node that refers to provider > > // node by its phandle and a result will not be probed until provider > > // node is probed. > > pcie@1ffc000 { > > reg = <0x01ffc000 0x04000>, <0x01f00000 0x80000>; > > #address-cells = <3>; > > #size-cells = <2>; > > device_type = "pci"; > > ranges = <0x81000000 0 0 0x01f80000 0 0x00010000>, > > <0x82000000 0 0x01000000 0x01000000 0 0x00f00000>; > > > > probe-control-supply = <&prb_ctrl_dev_0>; > > }; > > Sorry, but this isn't going to happen in DT. > You mean we cannot add custom properties like this to an existing device node in DT? > > > > fw_devlink ensures consumers are not probed until provider is probed > > successfully. The provider probe during boot returns -ENXIO and is not > > re-probed again. > > > > The driver provides debug interface /sys/kernel/debug/probe_control_status > > for checking probe control status of registered probe control devices. > > # cat /sys/kernel/debug/probe_control_status > > prb_ctrl_dev_0: [not triggered] > > Consumers: 1ffc000.pcie > > > > Interface /sys/kernel/probe_control/trigger is provided for triggering > > probes of the probe control devices. User can write to this interface to > > trigger specific or all device probes managed by this driver. > > Once the probe is triggered by user, provider probe control device is added > > to deferred_probe_pending_list and driver_deferred_probe_trigger() is > > triggered. This time the probe of probe control device will be > > successful and its consumers will then be probed. > > > > To trigger specific provider probe: > > # echo prb_ctrl_dev_0 > /sys/kernel/probe_control/trigger > > > > To trigger all registered provider probes > > # echo all > /sys/kernel/probe_control/trigger > > > > Signed-off-by: Toyama Yoshihiro > > Signed-off-by: Nayeemahmed Badebade > > This is wrong. Either Toyama is the author and you need to fix the git > author, or you both are authors and you need a Co-developed-by tag for > Toyama. Sorry about that, we will fix this. Thanks, Nayeem