From nobody Fri Jul 24 21:31:20 2026 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.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 8719C2DC79A for ; Fri, 24 Jul 2026 13:16:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784899002; cv=none; b=cx3MTRnR7usXkbvTQOdwlQ2xrVyyQHhA5pg8KO3tLriAGVWcI1tSPd/2jodH9uPgSXP5rsgwt2hjW81u3iOg6oEPReT91hWOksI2QBgQ7HCjscTVpbD9q9mJzm+lFjstgjU/edMjBkUAZECZShXWelYvjW4G7sccOfayMKSLbfE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784899002; c=relaxed/simple; bh=/yj8bLKbPpZes7L89vCr9HdB3oJ01AECc11k9j6p5p0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:Cc; b=B9H/pbc/j/meKgfbhuw4cZ5gm312Ojb5+1Bp2e1nfiCwg3O0UWJ+/iZ08ji40BjitNJJ7SdcWatIoTdk1/o1z4cg6027TXQcxVJfi241rN2VzU8JqmTqWLZiLNbDMDra8EDzC02KWEuATgROfqt/oDwWmLfQi58+XkQKClsF7Ds= 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=BSTTNFEb; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=cB6JZBHt; arc=none smtp.client-ip=205.220.168.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="BSTTNFEb"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="cB6JZBHt" Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 66OCm60u2601709 for ; Fri, 24 Jul 2026 13:16:40 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:message-id :mime-version:subject:to; s=qcppdkim1; bh=OWsy9ZZFAQt5AZSfvQGZt2 cTwChZXHQpVHpQFqYJSoM=; b=BSTTNFEbpL+BALtW+FcMTYxpQv6ctNhDL3ehAa IVvWPTQQpVctoi7CGTYVWaVvMpQzSnJsqBukY0z4rY9pi83dBgkVXuDUH9NDnYBa 9KJLVKF97XdBMj5XQ9RR3g4hPoN+uw6sd6IeB9fhEcJrfxRSXdJZhsUIE2NcOLp0 94Jg8ShKLqzftivGVmWWYbE8f9k6zCHiawhimBrLnPSe4sXxd23Nccn2cjWRP7ds I7O827xRJru0jybWLSa0Q2jLcfyOaWuak0qAbvtngb7kgKWThvRT4gehPLkP9Zxg dYdOl+ut6+2pYgrAPolLSrsIN3E0taoSs8e+Clb7lkM8lbOQ== Received: from mail-pl1-f200.google.com (mail-pl1-f200.google.com [209.85.214.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4fm8cgg2y0-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Fri, 24 Jul 2026 13:16:40 +0000 (GMT) Received: by mail-pl1-f200.google.com with SMTP id d9443c01a7336-2cee1ec30f2so5565255ad.3 for ; Fri, 24 Jul 2026 06:16:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1784899000; x=1785503800; darn=vger.kernel.org; h=cc:to:message-id:content-transfer-encoding:content-type :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to:content-type; bh=OWsy9ZZFAQt5AZSfvQGZt2cTwChZXHQpVHpQFqYJSoM=; b=cB6JZBHt5Ba3mg06Nxhc1bHguhJ58jpykWxX5FrK6iVyc7Tv+/9LwP3sPWIHoThv9E GhUjvzaV/kRd2nqezw7gPfyVgRVRWH1xcHGExK6/XNdBjzEyemcN1zQu5eqWoH2Qe4SD PGqH0Siou1Y/FWmW0oWGOUyDNCWVnHmTazx1wSycYsj6XiniB6MUxZ78OHe832e1I3/u 4EbpWRwbHhgM7P9CER01Hor++eM/5fgQ0Ut811ZXHAE8wxo3P4VAN3KdXXljqz065QO7 rH/0bjM81sJnLOVxndW19SaV/Y64jCrw2HTaDn9tcvTQ21vQ/2mUoAaycBUmOuC7DLJB 4e1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784899000; x=1785503800; h=cc:to:message-id:content-transfer-encoding:content-type :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to:content-type; bh=OWsy9ZZFAQt5AZSfvQGZt2cTwChZXHQpVHpQFqYJSoM=; b=j8Y2TKHN8sgp2DlCZigKmp32TR2EFCE667DCrUcRK7I3fas7Grg/8tP0DZ5jXMkxWo O99LYc2LkVSB2CJAvMTzeDvLmvJQ8eJuhqXuYd4c59b7SwYhi+f1kQTbjIXXOfJbODIl nxcMQ2oloG5yHyLeO4ooyaYyodAMN1ZQ9almJk3+KI9ruOor7PFSk82xg8D3CKzlxJxe q22hJdNGbSGSTaSJEnTz1rhqIhtsA1Kc7MFjj0V4BZPrFm762KVHhKUFPz8m/y4BHNmi CzNt+ZBbtczyFhF8yzEgPs0Z0ShFww+UWLRj9/teQAPZPYu1Jrzm2uN7DDyCpIYIQuET a6iA== X-Forwarded-Encrypted: i=1; AHgh+RqaHvXfoUBJYkQ95+CJIHNGovWEF94i8QmDb4E8Nq2hH6p9d9S7EaDZSdh+RHYWf35k9LASnIHMmIa9OLU=@vger.kernel.org X-Gm-Message-State: AOJu0YwbzY2XNbaBBxUb7IW0pPzGv2aznRtS0qnTZR5DkaieCgwKyU+S IxeLMsDpvQ0XsWMbBtY2cUu2AvSBKAnGFOfRan9e//6moalcTzcIzvc2d3h+pVtlVBRdmkxbvWi lAvPtETAyKDEZMeFJRVAVunKBGnQoptwvm1Qb5X/e4sNlRrUy4Rxy2KWDtH+4avOc1Z8yycCQG8 M= X-Gm-Gg: AR+sD13/GHJLi7oAJSHtk6HRfxZT+JC/Fyqf0ka+y+ic47t34VuXn3Fjv1qIdTGyZL8 JL2EchVdAlqLX+jwxj3oIinUoQvC8FlPjrPSh4KZJ9IVIQSkZl6d12LfY+OGHSgarGosJP6wWCh wgpu/tXrH6mkUbhQBSVch3k9zXj+hFf3fqVY/oqx6fHulqxoropkURNDJsAX6eDYVj+LT4DlFaE 09AxvyNZpW0B7xtX5qvMHFncHmcAdMSl+IFbbI+UtVwzK5UBV/YyUR3sUXHO55jx/tRMYSl7qik WbjwRVHBNexj1zxvRlMdZjCuv8eUpL/P9KxrkVhpZzDDBdZGacXEIc/iayv87xWUbMIZy7gd0al 7CDLBTt5Q7L2LpNAN2Cs0JkAH33aLBWBMCiFG X-Received: by 2002:a17:902:d486:b0:2c9:e846:a57e with SMTP id d9443c01a7336-2cfa67039d2mr80763185ad.0.1784898999799; Fri, 24 Jul 2026 06:16:39 -0700 (PDT) X-Received: by 2002:a17:902:d486:b0:2c9:e846:a57e with SMTP id d9443c01a7336-2cfa67039d2mr80762705ad.0.1784898999215; Fri, 24 Jul 2026 06:16:39 -0700 (PDT) Received: from hu-spratap-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2cf8efd76cfsm52162965ad.20.2026.07.24.06.16.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jul 2026 06:16:26 -0700 (PDT) From: Shivendra Pratap Date: Fri, 24 Jul 2026 18:46:04 +0530 Subject: [PATCH v24] power: reset: reboot-mode: Remove devres based allocations 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="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260724-arm-psci-system_reset2-vendor-reboots-v24-1-ed5125785ef6@oss.qualcomm.com> X-B4-Tracking: v=1; b=H4sIAJNlY2oC/53U22rcMBAG4FcJvo6DNCN5Rr3qe5RSdBglhuw6t bZLQ9h3r7yUeKEVKLkxSKBvxuIfvQ1F1lnK8OXubVjlPJd5OdYFmPu7IT7546OMc6obAyiwipQ b/XoYX0qcx/JaTnL4sUqRE4xnOaZlHVcJy3Iqo5kiK2WMzzEP1XpZJc+/r4W+fa/rp7mclvX1W ves1bb9t4RWnSXqsVGNQmSQGDGZ+HUp5eHnL/8cl8PhoX62yp9SAyQMzBCE7b/q9gNnrW+bpm5 eVz5lFAigGSO2eLjhQXfzUHmm4CNKNADS4vGW7+8eKz8FToCoLTtu8WbnWdtu3lQeKYHL1vnof Iu3O+8AunlbeYqCXjETZ93ip3deqw90P23JcewleQ8ozbunndfdE1WPVd5MotiG6E2MLZ53HgC 7ed7uHrJ3QpPkdjDdLc/dvNuGNQRnJ2VRNZMD72/BpFCZXh62qY2ZEpoaTyRo8XrnTX/u4Tq1M TskIivUuhyAnbe6v/ttaoG9DUkUGW7yuPP0AR6vD6WxGK3hCP/L/eVy+QMG7W0oDQYAAA== X-Change-ID: 20250709-arm-psci-system_reset2-vendor-reboots-46c80044afcf To: Sebastian Reichel , Shivendra Pratap , Bartosz Golaszewski , Pavan Kumar Kondeti Cc: Sebastian Reichel , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, kernel test robot X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1784898981; l=4865; i=shivendra.pratap@oss.qualcomm.com; s=20250710; h=from:subject:message-id; bh=/yj8bLKbPpZes7L89vCr9HdB3oJ01AECc11k9j6p5p0=; b=VnGDA9/ouU3zsWzUnHx8R9UnQZfrozq3UVFd8Augs2YnFve7vaqEFSUrNzcENqOJlukQFyaWf snNykxhlqN+AtTSdVx2XH6p4y2UONSed6mGrAk/XORxrYaADupHuLby X-Developer-Key: i=shivendra.pratap@oss.qualcomm.com; a=ed25519; pk=CpsuL7yZ8NReDPhGgq6Xn/SRoa59mAvzWOW0QZoo4gw= X-Authority-Analysis: v=2.4 cv=JOMLdcKb c=1 sm=1 tr=0 ts=6a6365b8 cx=c_pps a=IZJwPbhc+fLeJZngyXXI0A==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=DJpcGTmdVt4CTyJn9g5Z:22 a=VwQbUJbxAAAA:8 a=QyXUC8HyAAAA:8 a=bC-a23v3AAAA:8 a=EUspDBNiAAAA:8 a=QX4gbG5DAAAA:8 a=igCNvyY4kf761yXvtm8A:9 a=QEXdDO2ut3YA:10 a=uG9DUKGECoFWVXl0Dc02:22 a=FO4_E8m0qiDe52t0p3_H:22 a=AbAUZ8qAyYyZVLSsDulk:22 X-Proofpoint-ORIG-GUID: wfrJnzLtz6Le__-_U_yshwkCn7BN_wbM X-Proofpoint-Spam-Info: AW1haW4tMjYwNzI0MDEyMCBTYWx0ZWRfX9qHNX7NMpWox hmsTWPdpJVJ4eM+S7sBgV5TcCcg59OuKKjeYOYYGE9hfOx5DSttw1WF5f9wknMXdR8VIoVTs8ZU gsXUx87AHq9EU+S/8bhxQTFTNVP6cRo= X-Proofpoint-GUID: wfrJnzLtz6Le__-_U_yshwkCn7BN_wbM X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzI0MDEyMCBTYWx0ZWRfXw/p/MIjuU1n6 1sLGNiIuoia11ziN9oFB8gvFOPsRCuRz+OHpKH8FKJhWS4X4Bzf/iRxDi4xJejYswSz1KSxoGyE scNLieqkcaezmlr75YUmqcIDTMr1BWScRc2SyT5SD7Y2oexTiv4lhyrwQTSdEjJMBf9gEKrnUTW NIH4ZUL9quGn3/zT9CrS6WHri66j8oLur0pcyad//MdicP53E/cJZRV2DyLsvlxik1ASFg7R3PH E38ZpnY59JDmzzX8+65AyOnkja1jGjEriXdf6M1xmADFseUH6rL43hRLgTxL0NjQ4Htn8B9nED+ u5HV6x4CCwBExnHe/gQH4layEmo0F+O3iMdm8DKxXz3CC2ZZuZaR1+MCU34ouWLwNlbGYwb29hk 4HERXZcnTF15PZRBX955qA4UFSPsy34K5mcwxgACwatVTzL1arF6NRaub5a5B+0mK+76O88dMip xPOwW5WpwmEKgIvbgzg== 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-24_03,2026-07-24_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 suspectscore=0 impostorscore=0 spamscore=0 bulkscore=0 clxscore=1015 adultscore=0 lowpriorityscore=0 priorityscore=1501 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607240120 Devres APIs are intended for use in drivers, where the managed lifetime of resources is tied directly to the driver attach/detach cycle. To ensure correct lifetime handling, avoid using devres-based allocations in the reboot-mode and explicitly handle allocation and cleanup of resources. Fixes: cfaf0a90789a ("power: reset: reboot-mode: Expose sysfs for registere= d reboot_modes") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202607191025.h6bQp891-lkp@int= el.com/ Reviewed-by: Sebastian Reichel Reviewed-by: Bartosz Golaszewski Signed-off-by: Shivendra Pratap --- This patch is split from the original series, "Implement PSCI reboot mode driver for PSCI resets", and sent separately as it fixes a recent issue introduced by "power: reset: reboot-mode: Expose sysfs for registered reboot_modes" and is independently applicable to the reboot-mode framework. --- Changes in v24: - Split from the original series and add a Fixes tag. - Use kzalloc_obj. (By Pavan) - Do not change dev_err to pr_err. (By Pavan) - Convert dev_err to dev_dbg for missing magic-number log as it is not an error scenario. =20 - Fix a pre-existing space issue. - Link to v23: https://patch.msgid.link/20260714-arm-psci-system_reset2-ven= dor-reboots-v23-0-e7453c548c21@oss.qualcomm.com To: Sebastian Reichel To: Shivendra Pratap To: Bartosz Golaszewski To: Pavan Kumar Kondeti Cc: Sebastian Reichel Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: linux-arm-msm@vger.kernel.org --- drivers/power/reset/reboot-mode.c | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/drivers/power/reset/reboot-mode.c b/drivers/power/reset/reboot= -mode.c index d20e44db0532..af00c00eceee 100644 --- a/drivers/power/reset/reboot-mode.c +++ b/drivers/power/reset/reboot-mode.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -168,10 +169,11 @@ static int reboot_mode_create_device(struct reboot_mo= de_driver *reboot) */ int reboot_mode_register(struct reboot_mode_driver *reboot) { - struct mode_info *info; + struct mode_info *info =3D NULL; struct property *prop; struct device_node *np =3D reboot->dev->of_node; size_t len =3D strlen(PREFIX); + u32 magic; int ret; =20 INIT_LIST_HEAD(&reboot->head); @@ -180,22 +182,22 @@ int reboot_mode_register(struct reboot_mode_driver *r= eboot) if (strncmp(prop->name, PREFIX, len)) continue; =20 - info =3D devm_kzalloc(reboot->dev, sizeof(*info), GFP_KERNEL); + if (device_property_read_u32(reboot->dev, prop->name, &magic)) { + dev_dbg(reboot->dev, "reboot mode %s without magic number\n", + prop->name); + continue; + } + + info =3D kzalloc_obj(*info, GFP_KERNEL); if (!info) { ret =3D -ENOMEM; goto error; } =20 - if (of_property_read_u32(np, prop->name, &info->magic)) { - dev_err(reboot->dev, "reboot mode %s without magic number\n", - info->mode); - devm_kfree(reboot->dev, info); - continue; - } - + info->magic =3D magic; info->mode =3D kstrdup_const(prop->name + len, GFP_KERNEL); if (!info->mode) { - ret =3D -ENOMEM; + ret =3D -ENOMEM; goto error; } else if (info->mode[0] =3D=3D '\0') { kfree_const(info->mode); @@ -206,6 +208,7 @@ int reboot_mode_register(struct reboot_mode_driver *reb= oot) } =20 list_add_tail(&info->list, &reboot->head); + info =3D NULL; } =20 reboot->reboot_notifier.notifier_call =3D reboot_mode_notify; @@ -218,6 +221,7 @@ int reboot_mode_register(struct reboot_mode_driver *reb= oot) return 0; =20 error: + kfree(info); reboot_mode_unregister(reboot); return ret; } @@ -261,12 +265,16 @@ static inline void reboot_mode_unregister_device(stru= ct reboot_mode_driver *rebo int reboot_mode_unregister(struct reboot_mode_driver *reboot) { struct mode_info *info; + struct mode_info *next; =20 unregister_reboot_notifier(&reboot->reboot_notifier); reboot_mode_unregister_device(reboot); =20 - list_for_each_entry(info, &reboot->head, list) + list_for_each_entry_safe(info, next, &reboot->head, list) { + list_del(&info->list); kfree_const(info->mode); + kfree(info); + } =20 return 0; } --- base-commit: 9eebf259d5352b87080d67758f483583d9e763d7 change-id: 20250709-arm-psci-system_reset2-vendor-reboots-46c80044afcf Best regards, -- =20 Shivendra Pratap