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 B2078302779 for ; Fri, 6 Feb 2026 16:25:57 +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=1770395157; cv=none; b=srhjZQcJUGcqLwsVIaToqiLhBC2vaFEfxOIvLuxnG5+zGe9wQVlq/O4+kqvCwQecvn8YiPNIX5cQ7uGkWcer3fN4gNxhev1yLl1bTJ1aiX4rWICDIpNyCHYyvIJcJ5KTdFpYZax7q1Yd/X2/AA5JgrcovaM1LvhKTxLYYQvSYys= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770395157; c=relaxed/simple; bh=L+RyLh8sBuu8YvmjWfQRyVyQbZu3CDhKF5N07Ql1q9k=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=js/5Jrl/6NlDiKmC0pI3YGyuu5ItGiE+7sDkMUE13S1beeLyMW7EU8yEFKokWvBSk8OWJA8KDXFkuFkjHb3qsRVrOrm/QYosqk2nGgxBTJWtu/1oj9b28Wr6IWSA2pxO4fUS7gyKi2eJlnujGKIgaPlTm7XcMjvl2qziftgXj7g= 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=bMjvYDAM; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=Y1HJgzr8; 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="bMjvYDAM"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="Y1HJgzr8" 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 616B4f6M3764965 for ; Fri, 6 Feb 2026 16:25:56 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= QPJ/rmJU5BtYs54zO7m6WgcYTCJKwZy9Y/qBdA3qDqk=; b=bMjvYDAMCjfD9Xvb GFAsnqDCIWmIoZjo73LLsRaw1dOIgH3jLDg53qv3dUtcGFJTtBf4wPc2ocUFhVb1 qPVmtcsPI/WDvgMHXPJUayyhAn4P7waHQd9o4g37NY+aBYfHmNCRMeVaL5QbrDD+ QTVeZnu9Q9+AjAGITrTD8xn56re7/qnZL5IwFGkhbBJ1+zWCuczF2l7+30UwVJwl /0t3McqYLWYs2q4QvuHo1xGrFKF2eYtE45q42jc9X1aO0C9MpLJ7+rLYowekrcSF 81QkzhR6XyWJL5klqobp5h1fIzDi30I2r/kYAKH06JcnPxlN29dpqBVq3YV3m+KR BtMeuA== Received: from mail-pf1-f199.google.com (mail-pf1-f199.google.com [209.85.210.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4c5f3wgweq-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Fri, 06 Feb 2026 16:25:56 +0000 (GMT) Received: by mail-pf1-f199.google.com with SMTP id d2e1a72fcca58-81f3ed6e935so1620045b3a.3 for ; Fri, 06 Feb 2026 08:25:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1770395155; x=1770999955; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=QPJ/rmJU5BtYs54zO7m6WgcYTCJKwZy9Y/qBdA3qDqk=; b=Y1HJgzr8u9SL73a3Tp5JIEau+hhGIRDILzif4yJgKTP98NES2ANOCBYczg29tztOe/ XAxcTz7027VzmFmlGDlqKzYx4PpoBsQB4ZWOSX+v9GYGRseKXybzqiHFGPLdFbbywteg c4oVrpGfJuum3RGLtvWKKJ2RVHhHcKCxfnwlSQvpZKuYU2XGKk02F2YGzCXFQyD/ioqr Hc9voK3iLqnJyo+eMQO+nIPz8ZjYkawvYBI+zWmGq3jgYQcgnH6FuaO8zuIkaeDZEiS7 vVnMF9saicF654qTjjORK3hrWNSX5Xk40a6DoF2xLwq0JkE2PYKtn2y1+roHG/uYguhx qeYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770395155; x=1770999955; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=QPJ/rmJU5BtYs54zO7m6WgcYTCJKwZy9Y/qBdA3qDqk=; b=wUXyErfGknuXKRL4I2+9fdv6PYFjFHAePdfDVLzJYUEQ37L2Q+u1/kPbxba1yScE1r a24C7+f1JwftwM6JzCGsvFvfatnD3Zz9qi9RUN4UyZ0XYIj5wvjVSg1kIreT7kJ948pF OMGzJsYRM4IrJpxP38soGuKdlciN3i/G1tnXv2h6rQy16JM0roFlUbks9WGczXpfw8ry bKJZoXb9vr2L0aBA4yJOKFHPpBGAWJTi4vsrLKcXNwfwz9+g38qr6utowgSckRWaSu3j K47MW0AMySNitLBRSnRVmtc5jh8wMR0FooYX8m62vvtf4ArWJuaGjifuGHLHxLqkE9Ms yXIg== X-Gm-Message-State: AOJu0YwWleBLxyR45HmTL/SfgbyLNGQ1keBGMjVe8lUWM6f577lmUS3U Scdsv7PEleRUnu/O+FQ/z4/2068+F9rBWB4jYs/wMj6ICMNSrA/lu6BDCqJmSqE3uVUPHsYDFH8 pNRPyi2vHbTJi9wZ+zPhTGsdaErUFk8/Gu+/mAtfNHQQnQn8r2u9CnMRPaJVGGZF/9v8= X-Gm-Gg: AZuq6aL2adEh6fhEhaYK/FqhJsrEqduJsU4qr6TGFFPRvCfEFb8uN4cHkdh5TKrl4W5 cyFPWW02v2oPumeaxYWA94E7arVd9siei9D5g2Qsq8kksxg3/pZ1fkqT96Q1Vzo9bqNCPCLrCGX WawWqD8q6WJCUEkBo8xRxVRgoVccl+gA3tHL6JwqXGCP+/8EU6yOK6jrxTDUrRJbDlPT2rc7xcN /1lxMrxy5JZFJc4WMeFIp04r9ywsPzfzuJm7zrr9T+HaEp+u9ODGFb2abxnGkOnucfvU2Y28Dw7 KaJHFBwF0Sw2U3xzeu0ABfSv0mT09bnKWH4XFe1iZdwyLyaIOIpRytBBRM8ij1+veUyjQOrVMhb DXSUXK0oMHmi7ms3voliBoXVGRrjnDMMz+oAh/E6spfIdWsE= X-Received: by 2002:a05:6a00:2d8a:b0:81f:3fa0:8c38 with SMTP id d2e1a72fcca58-82441632363mr3006325b3a.20.1770395155274; Fri, 06 Feb 2026 08:25:55 -0800 (PST) X-Received: by 2002:a05:6a00:2d8a:b0:81f:3fa0:8c38 with SMTP id d2e1a72fcca58-82441632363mr3006302b3a.20.1770395154793; Fri, 06 Feb 2026 08:25:54 -0800 (PST) Received: from [192.168.29.115] ([49.43.224.227]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-8244168fdf5sm2990653b3a.17.2026.02.06.08.25.51 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 06 Feb 2026 08:25:54 -0800 (PST) Message-ID: <241333dd-df8c-166a-e119-6e23cda3a876@oss.qualcomm.com> Date: Fri, 6 Feb 2026 21:55:49 +0530 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.5.1 Subject: Re: [PATCH v23 2/2] power: reset: reboot-mode: Expose sysfs for registered reboot_modes Content-Language: en-US To: Bartosz Golaszewski Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org, Bartosz Golaszewski , Sebastian Reichel , Bartosz Golaszewski , Bjorn Andersson References: <20260205-next-15nov_expose_sysfs-v23-0-b0c5bdcc9f94@oss.qualcomm.com> <20260205-next-15nov_expose_sysfs-v23-2-b0c5bdcc9f94@oss.qualcomm.com> From: Shivendra Pratap In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMjA2MDEyMCBTYWx0ZWRfX+IVhEzQ65iUz 9Jxa7nHIJSXqZoIhUbF+JtiBnMvlf0+BI1KUMEsqvGY0uqvV8iWRX/QSgja+brU2/zZGPb9J44k PWmI1gcYIoOFdoPjq8ChyngDu5oFoBsD75T08rUoe9QA5LJIZjIa9898sc5GToX3hzVxpKD/8O4 OY0EXP3eVVCTShr9X2Xdammhffp0E8nFVjyHOxuozoNeQ8xa5G6KCmwgO61h+gUC1EO0LlUttRD qRK3R+QV7kYb0DyogkibNBMonH94kFwNglaCfJfwS8fSw2hDMe4xn9R6T6DOdo88e5UbDLzp8Ft cvywfvMnXbtz5TR9PJlDTtkuXYFvkPMMpQY5muT3WI9GAQhmIWYOeLKovHB5ELgAS37nCSzRy8v oW6fmU2rEnkyeGy69L2U4FBA2xAtqzW1lFEnny7DBey5Jcyng71dWKpVBA1h/86CdnBMmZLfOY0 g4+mEtJeiIl+p5Lgf8g== X-Proofpoint-ORIG-GUID: EU7IsxyGo7JJINbveTzYdt-yKViaLhzb X-Authority-Analysis: v=2.4 cv=NajrFmD4 c=1 sm=1 tr=0 ts=69861614 cx=c_pps a=WW5sKcV1LcKqjgzy2JUPuA==:117 a=easabUhB3dF0LzbC+5H2iw==:17 a=IkcTkHD0fZMA:10 a=HzLeVaNsDn8A:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=Mpw57Om8IfrbqaoTuvik:22 a=GgsMoib0sEa3-_RKJdDe:22 a=EUspDBNiAAAA:8 a=tl4a_pDjrRj4r-21QCAA:9 a=QEXdDO2ut3YA:10 a=OpyuDcXvxspvyRM73sMx:22 X-Proofpoint-GUID: EU7IsxyGo7JJINbveTzYdt-yKViaLhzb X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-02-06_05,2026-02-05_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 suspectscore=0 priorityscore=1501 impostorscore=0 bulkscore=0 malwarescore=0 lowpriorityscore=0 clxscore=1015 spamscore=0 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2601150000 definitions=main-2602060120 On 2/6/2026 8:49 PM, Bartosz Golaszewski wrote: > On Thu, 5 Feb 2026 18:17:14 +0100, Shivendra Pratap > said: >> Currently, there is no standardized mechanism for userspace to discover >> supported reboot modes on a platform. This limits userspace scripts, to >> rely on hardcoded assumptions about the available reboot-modes. >> >> Create a class 'reboot-mode' and a device under it. Use the name of the >> registering driver as device name. Expose a sysfs interface under this >> device to show available reboot mode arguments. >> >> This results in the creation of: >> /sys/class/reboot-mode//reboot_modes >> >> This read-only sysfs file will exposes the supported reboot mode >> arguments provided by the registering driver, enabling userspace to >> query the list of arguments. >> >> Signed-off-by: Shivendra Pratap >> --- > > There are some nits from my side below but nothing serious so LGTM anyway. > > Reviewed-by: Bartosz Golaszewski > >> + >> +static inline void reboot_mode_release_list(struct list_head *head) > > I would have passed priv here as passing list_head as argument looks a bit > weird. Ack. thanks. Will pass priv here. > >> +{ >> + struct mode_info *info; >> + struct mode_info *next; >> + > > These could be on the same line. Ack. thanks. > >> + sysfs_info->mode = kstrdup_const(info->mode, GFP_KERNEL); >> + if (!sysfs_info->mode) { >> + kfree(sysfs_info); >> + ret = -ENOMEM; >> + goto error; >> + } >> + >> + list_add_tail(&sysfs_info->list, &priv->head); >> + } >> + >> + priv->reboot_mode_device = device_create(&reboot_mode_class, NULL, 0, >> + (void *)priv, reboot->dev->driver->name); >> + > > Stray newline. Ack. will remove this. > >> + if (IS_ERR(priv->reboot_mode_device)) { >> + ret = PTR_ERR(priv->reboot_mode_device); >> + goto error; >> + } >> + >> + return 0; > > As I said, these are nits so fix them or not but let's get this upstream after > v7.0-rc1. Ack. thanks, Shivendra