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 7870B386450 for ; Tue, 21 Jul 2026 18:01:41 +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=1784656902; cv=none; b=eUcPgHNVGjk8sq97rKhAxjCRUgXAdh5fJI1J4Jb9Kpb+h3eeQgVk/16+lDisN4w9KPbUEu1N8lnJmCpMwcZEg1Nc5HIaUZzu7jJDUrFxY10ndjzcmK+ZGB6ZvO22EUT7jLnUizLgmuTAJNgtPCWq3daNNpojW1kIZTzrzqmeus0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784656902; c=relaxed/simple; bh=aqq0bZT/hXwWx8UmLFddb1dgw0fuBz0WtdUMce/GDRc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=o4NISxeLqQ5U4A464fwamOwBIjmm/M/l6Z8a079h0gyh1YHnQ7iFlnGAVD5rKVlBz//BbukWXJN3B8pP/g2KQSkjhInE1wFv4CoGnYV/ungqvzn5rtqu0f92LJSFcjWXEn0LyfoRIYH7yELnDWzDIlghhjqSHlWdyL/Xv2pl7io= 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=mLQXOczG; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=NQro9mb9; 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="mLQXOczG"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="NQro9mb9" Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 66LHROZQ2494482 for ; Tue, 21 Jul 2026 18:01:40 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to; s=qcppdkim1; bh=/6k5png2EebTSIaZVxRWm8CM pbRPFtbdYVyNuYkr3Bc=; b=mLQXOczGSWLql6CaoiBRiSt2MSd/PEkDyEOCPiO9 Qi2BBfj7JoMKyL6h7LFo2V3JMxJQTywe2i1oTTKpzKC9q3Hz0Njq4d7bboprE6CC iWSW2bW74uDvso864zQ938lON6ywA1pYuTMVm+IFAkpOCmlACRB9zQr5GOBmYv5x ZHwK8NP5yC53S4a5Rh3FROK/zOlBOd+7aG9uvZUGdN5id6Fg2J4uf/UObCKn02uS MYcrAKzMTPI6qrUhjWk8Bzwd/Hv+HHbJZS93p75EG9f9+0fwl5H7ytjhh55AXjQU M1MKKRM4Pa+Bf38JL7Z/TsQk/dh9Z5EsdNXwda7M7jaDyQ== Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4fjd6d85ry-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 21 Jul 2026 18:01:39 +0000 (GMT) Received: by mail-pl1-f198.google.com with SMTP id d9443c01a7336-2cc640dfde3so95506485ad.1 for ; Tue, 21 Jul 2026 11:01:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1784656899; x=1785261699; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=/6k5png2EebTSIaZVxRWm8CMpbRPFtbdYVyNuYkr3Bc=; b=NQro9mb9YFMmJYVJYCS3NubMk9dQY5D+6jClI9bw/MbHLFwkIQ6rRo7rB3G3MFUAUp UJOqrazWWcPO6NhTM5o5DWoHjvLF7+wrplmxOQTfL7oi6+5L4ZQJ6eWp2WSqOzw0N0GA lmiH4mrc4SD2Cu2ZaGMKif6oSguhnty82VOXjsNJV7ZG3OkWOrMHPbzSoJUr3f1rKkYk I79cFGakDUkZBh6rHTSBDtWWYhz/LTVU66J8H0+ET9aRv2fhYzNyJTRpeYeW5i46qPbM aiRQ4LyKZUr2JcnkdOwFX7wCmJYDgKwxZK6AAsVvQsOp12NRfFQq62ZoGSBN6xqeb2wg D0FA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784656899; x=1785261699; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=/6k5png2EebTSIaZVxRWm8CMpbRPFtbdYVyNuYkr3Bc=; b=img2WT0qjUz5sU1bFB+w5FyIeLiIbjfaEs+/Cvn+26eJRFq5XmJsxbPvaolRyY/Wnk 1UMw/I6MJvsdzXRbNSo0MHAfbMZlZUfnF4eFL2ZpXE4rV5DmIjRrTHw6htlWYLS7Czw5 NHDbgL1IqI3WgJH9c/8EQ0aJWLsm6qOjyNSVRc/OfFus7hX5jQy81A/FM8SJKwthUQNl 1ab7btvYe74Zq9clNtbss5XtoKy4uIPr9S4HN4o8pkII6cvbraYPjmqCCHxlweINMe2q FRnzkyF6WNLtMHJYia3f+j88lZdtZIW0bmed194Yz8Yn8ZjIZz7yDOIHhvWXVpbIf6Vn 92ow== X-Forwarded-Encrypted: i=1; AHgh+RrImdWxRu4WdYgjPk/g7DyAb31djgCRSKHe0JGC3zE1h/HMBLvgJiD2THH8F55jOf+co599HBOtFE7trqc=@vger.kernel.org X-Gm-Message-State: AOJu0YwCab/cuP6qZMXHVIBWEueeAU/G6eRgAVts6721hd6apk5QfKE2 Y1hRZi6C7QRVha7uCqeaiKECLI1Q6bZPnPDcf/bV0sjzGreQWRoItuscjqHu+X5H0F9CpvudJfW 5GExIxOSuhmAKFqCfA0QcNSEz0nXZhMjtY6YEafv6DKhTfDLpMOiiJaR/njr4RIXI9SA= X-Gm-Gg: AR+sD11nD2D+epc0eYyzRkVDdBCb1YB2DtvmHYBbpAnxAKXZYDPVsaidbhfRr4pHE+x Xp+lHsCKhTdpMw9BoU0UsqYPSF9g0PPeMzmkulqwfxPdVAJ1JNg8kkrnuWjGQ1h2kseBc3Uh/d9 ixi/7dSsjoiA1HUKr7Z1P7eFpq+GuLS9u4MK/jBPkiwN80I6sFuMNnKpOA1IB3iK7N1IY28/YNe DbwubxV9HHrDYq/pLm7nPbNL8dTWMvCsVoma3TRgrwXSWPa+LCUYwhzQekbfC5XXPJHZm65zUsi B6QNr24DBnZ8AF31duWAyYTB+5av+2/VX5rZLH8mYJEuECZMpIYVawwseJD9cUYIhGGHh0Gzva7 jOV4UwDx9I6J4KXAwTzXqE2/NykWX/a9cAg== X-Received: by 2002:a17:903:15cf:b0:2ca:be8:62d with SMTP id d9443c01a7336-2cf349b5923mr205347355ad.32.1784656897480; Tue, 21 Jul 2026 11:01:37 -0700 (PDT) X-Received: by 2002:a17:903:15cf:b0:2ca:be8:62d with SMTP id d9443c01a7336-2cf349b5923mr205346725ad.32.1784656896901; Tue, 21 Jul 2026 11:01:36 -0700 (PDT) Received: from hu-pkondeti-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-3147dc61637sm1021861eec.8.2026.07.21.11.01.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jul 2026 11:01:35 -0700 (PDT) Date: Tue, 21 Jul 2026 23:30:59 +0530 From: Pavan Kondeti To: Shivendra Pratap Cc: Sebastian Reichel , Mark Rutland , Lorenzo Pieralisi , "Rafael J. Wysocki" , Daniel Lezcano , Christian Loehle , Ulf Hansson , Lee Jones , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Konrad Dybcio , Arnd Bergmann , Souvik Chakravarty , Andy Yan , Matthias Brugger , John Stultz , Moritz Fischer , Bartosz Golaszewski , Sudeep Holla , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, Florian Fainelli , Krzysztof Kozlowski , Dmitry Baryshkov , Mukesh Ojha , Andre Draszik , Greg Kroah-Hartman , Kathiravan Thirumoorthy , mfd@lists.linux.dev, Srinivas Kandagatla , Sebastian Reichel , Bartosz Golaszewski Subject: Re: [PATCH v23 01/13] power: reset: reboot-mode: Remove devres based allocations Message-ID: References: <20260714-arm-psci-system_reset2-vendor-reboots-v23-0-e7453c548c21@oss.qualcomm.com> <20260714-arm-psci-system_reset2-vendor-reboots-v23-1-e7453c548c21@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-kernel@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: <20260714-arm-psci-system_reset2-vendor-reboots-v23-1-e7453c548c21@oss.qualcomm.com> X-Proofpoint-Spam-Info: AW1haW4tMjYwNzIxMDE5MCBTYWx0ZWRfXxhqAtmF/PTpu odDHlyIT8zzltoIu9B00girvuAyEE1CvMrpuu8uJSy+IzFnOxHI3OibIsbEtEXmivTeGu9ghrMT PGnQ/AklQcsUsDNGkLLhnZxKebgQ0Fs= X-Authority-Analysis: v=2.4 cv=Ipsutr/g c=1 sm=1 tr=0 ts=6a5fb404 cx=c_pps a=MTSHoo12Qbhz2p7MsH1ifg==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=kj9zAlcOel0A:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=3WHJM1ZQz_JShphwDgj5:22 a=QX4gbG5DAAAA:8 a=EUspDBNiAAAA:8 a=GxRVn01Nmxo37F9Fo38A:9 a=CjuIK1q_8ugA:10 a=GvdueXVYPmCkWapjIL-Q:22 a=AbAUZ8qAyYyZVLSsDulk:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzIxMDE5MCBTYWx0ZWRfXyJ64o4smpapw mnOW/kg/5UUEEFAhAqBL2uu0x4vzS4f04ZQP2+sArU5emx+04+xOm8+W6k/egRtO1LD7eJqfUpK sz2SjoZ/I5CPrg5bUHJQHEXY1jbus7MHV4oiTnGt0VdVWbSdLvYojNHOfTGmx/0vg7okdcMxr+d oXDil4ASAiIcuXUVBLmE5jtnipSoabysaH6nUw89h/f6uHs5Io3wTRAm2F7LrG9UqtFP0mrIZvQ 6/s0olfSv78EVU+Fg/j7nQ/Yyp7l+5m4pKZOlGVtH+QXg9LnvNgjLCUJBF3TQDEEqD9Lv/iZqvY Hbv+8cUu8kcHnWMksnGNTK8ENta8mtziNPQ9uMnPYncz3AUCrtxcCmrPytXSm+9Zj39PlscxgUc iIvsEtyCkqIVlv9JlyBTnfiw3UECYg9lvygeoRDdpyOxe7hs2GeyfoTrgWsNalPXEa3ijpol92B rcvWO+sQcRnGa5PojPQ== X-Proofpoint-GUID: bhgdU0nj1v4AJjmLonDxAeuVxzEAQ4ie X-Proofpoint-ORIG-GUID: bhgdU0nj1v4AJjmLonDxAeuVxzEAQ4ie X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-07-21_03,2026-07-21_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 suspectscore=0 spamscore=0 phishscore=0 bulkscore=0 priorityscore=1501 impostorscore=0 malwarescore=0 adultscore=0 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607210190 On Tue, Jul 14, 2026 at 10:46:29PM +0530, Shivendra Pratap wrote: > Devres APIs are intended for use in drivers, where the managed lifetime > of resources is tied directly to the driver attach/detach cycle. In > shared subsystem code, there is no guarantee that the subsystem > functions will only be called after a driver has been attached, nor that You mentioned driver may not be attached. reboot_mode_register()->reboot_mode_create_device() is using `reboot->dev->driver->name` directly for creating the reboot class device? > they will not be referenced after the managed resources have been > released during driver detach. > > To ensure correct lifetime handling, avoid using devres-based > allocations in the reboot-mode and explicitly handle allocation and > cleanup of resources. > > Reviewed-by: Sebastian Reichel > Reviewed-by: Bartosz Golaszewski > Signed-off-by: Shivendra Pratap > --- > drivers/power/reset/reboot-mode.c | 32 ++++++++++++++++++++------------ > 1 file changed, 20 insertions(+), 12 deletions(-) > > diff --git a/drivers/power/reset/reboot-mode.c b/drivers/power/reset/reboot-mode.c > index d20e44db0532..7a74f72a8313 100644 > --- a/drivers/power/reset/reboot-mode.c > +++ b/drivers/power/reset/reboot-mode.c > @@ -3,6 +3,8 @@ > * Copyright (c) 2016, Fuzhou Rockchip Electronics Co., Ltd > */ > > +#define pr_fmt(fmt) "reboot-mode: " fmt > + > #include > #include > #include > @@ -10,6 +12,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -168,10 +171,11 @@ static int reboot_mode_create_device(struct reboot_mode_driver *reboot) > */ > int reboot_mode_register(struct reboot_mode_driver *reboot) > { > - struct mode_info *info; > + struct mode_info *info = NULL; > struct property *prop; > struct device_node *np = reboot->dev->of_node; > size_t len = strlen(PREFIX); > + u32 magic; > int ret; > > INIT_LIST_HEAD(&reboot->head); > @@ -180,19 +184,18 @@ int reboot_mode_register(struct reboot_mode_driver *reboot) > if (strncmp(prop->name, PREFIX, len)) > continue; > > - info = devm_kzalloc(reboot->dev, sizeof(*info), GFP_KERNEL); > + if (device_property_read_u32(reboot->dev, prop->name, &magic)) { > + pr_debug("reboot mode %s without magic number\n", prop->name); Any reason for converting dev_xxx to pr_xxx here and below? > + continue; > + } > + > + info = kzalloc(sizeof(*info), GFP_KERNEL); The recent commits to this driver adopted kzalloc_obj(). Thanks, Pavan