Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp606793lqt; Fri, 19 Apr 2024 05:39:48 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWZgX53Mb/KyE8D9CuKk6XqdX9NiR3LDdf3zkp8fhIORRt3NX2Rmp4yiVAha8IpBuD7vKw0bYHogS666yoho+D2u99aa3bCN5qGowMD+A== X-Google-Smtp-Source: AGHT+IEVGcjiGzLTEf9whMA1HYj7fzez6qepedVOkSAUoi+TiddzRjvXgfsr5ZYePIgYZymdL/Wb X-Received: by 2002:a17:906:f1d6:b0:a55:5c04:89a4 with SMTP id gx22-20020a170906f1d600b00a555c0489a4mr1451907ejb.21.1713530388522; Fri, 19 Apr 2024 05:39:48 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713530388; cv=pass; d=google.com; s=arc-20160816; b=XTTMcVRZQvsxJJOcVsTJhtq35iaE8dqj5d9f5PP2F0eCb4cKcCifHfCPz3BDFoMsra 94IZKKhaKncDdHnPzvumordfwYf1NFWTH8VEVQ37oKx7kCRAXhigmIyEVUxW3hxfMYUc xS6EcbWDMCoFBDNLDn8Bgm2APDb5WewSTdMgGnhFfG5NATV+IgB6QwTogssO0UyxU7pD 5jvBiINL1+HJ0AFvTrnCOj8KnLVYjKuoubymjJxdjvifniAqaqa0QaZnoY+GbH4sckfL jZEaOD3sg59wWgoSVUH6Mdedg2qw4PFPxVvoVwSZ43Xsrjy3K7utEEFWcVK7H10ziuhu 0o0Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date; bh=6c4g+/06gQCstLfzuVhVmJ7KExrdz67CYKZTprqbHuk=; fh=8kOEYX4x4ntDoEgKAWcz+GZ5CMBmqyaSEx/zovsvI/I=; b=N4+bZJpF7ydlNzRW1/ROXQ87kNE4d6257kwiwXM8Ecl1duab0t6noIU56pJR1xxhCz dZIB1T2c1hCSxy1/CrvPJhuvniCsBhDzpqcmDE7uaRHM+v3JHe9y6oXMGSv2dTOD9cMX dVGtyBhLua0PvsKZnQojmAdgtb2Kl70RHAwyK2gVr6YMjYiI+NkTjmOmiBtCatoNERkZ 6RsmescgCHHDOJvEP4H1j0qT5YeoGNUxvyrFRJ5t3iYwrA0C2CZci7ISJ6fid+6dUWuo CEfCDKuS2ievSFS3hKwK8mhxpX38j0Udks7cqQn8GDWQS185u8ZmwCb3/mctGuoAyf/G zdeQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-151425-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-151425-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id m7-20020a17090679c700b00a522e9112f5si2058867ejo.264.2024.04.19.05.39.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Apr 2024 05:39:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-151425-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-151425-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-151425-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 413FE1F22687 for ; Fri, 19 Apr 2024 12:39:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BF6AD8624B; Fri, 19 Apr 2024 12:38:56 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1B03185943; Fri, 19 Apr 2024 12:38:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713530336; cv=none; b=l0ogdbnm+50WAWGtHVvp+d6IEbClSfN5JUUZOQrqf4Bhj9Iubgxu7rCuYdClIu4+DLUWWMdl/wT3WpHCSXuIqB6o2zuimru9z2MBVxrZ9z4nxY4+pMixnNzPSxD+AHv372wdl8r2M/uKSd+PZZn4ntDhzt8HK5PEkSv+J+ODEL4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713530336; c=relaxed/simple; bh=6c4g+/06gQCstLfzuVhVmJ7KExrdz67CYKZTprqbHuk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=hod9qIm+tAbT2RLRNLbHs+Af+HmDtj/mnhnso/kJYhdkSV7qNe04COHi92yMPApsg9ZiCQuTfunRJRy8l0efBbTIrssNNB0inCv/dit8346iymXkk9H8Z+cDtACdfzRTKYZD4qBA02P//PzAJ+cQK+eBLNIe0vijlXCxJyF0GsM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 69E772F; Fri, 19 Apr 2024 05:39:21 -0700 (PDT) Received: from bogus (e103737-lin.cambridge.arm.com [10.1.197.49]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 1A9ED3F64C; Fri, 19 Apr 2024 05:38:49 -0700 (PDT) Date: Fri, 19 Apr 2024 13:38:47 +0100 From: Sudeep Holla To: Florian Fainelli Cc: Elliot Berman , Bjorn Andersson , Sudeep Holla , Konrad Dybcio , Sebastian Reichel , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Vinod Koul , Andy Yan , Lorenzo Pieralisi , Mark Rutland , Bartosz Golaszewski , Satya Durga Srinivasu Prabhala , Melody Olvera , Shivendra Pratap , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-pm@vger.kernel.org, linux-arm-msm@vger.kernel.org Subject: Re: [PATCH v2 0/4] Implement vendor resets for PSCI SYSTEM_RESET2 Message-ID: <20240419123847.ica22nft3sejqnm7@bogus> References: <20240414-arm-psci-system_reset2-vendor-reboots-v2-0-da9a055a648f@quicinc.com> <48f366f5-4a17-474c-a8e3-6d79c9092d62@broadcom.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: <48f366f5-4a17-474c-a8e3-6d79c9092d62@broadcom.com> On Wed, Apr 17, 2024 at 10:50:07AM -0700, Florian Fainelli wrote: > On 4/16/24 02:35, Sudeep Holla wrote: > > On Sun, Apr 14, 2024 at 12:30:23PM -0700, Elliot Berman wrote: > > > The PSCI SYSTEM_RESET2 call allows vendor firmware to define additional > > > reset types which could be mapped to the reboot argument. > > > > > > Setting up reboot on Qualcomm devices can be inconsistent from chipset > > > to chipset. > > > > That doesn't sound good. Do you mean PSCI SYSTEM_RESET doesn't work as > > expected ? Does it mean it is not conformant to the specification ? > > > > > Generally, there is a PMIC register that gets written to > > > decide the reboot type. There is also sometimes a cookie that can be > > > written to indicate that the bootloader should behave differently than a > > > regular boot. These knobs evolve over product generations and require > > > more drivers. Qualcomm firmwares are beginning to expose vendor > > > SYSTEM_RESET2 types to simplify driver requirements from Linux. > > > > > > > Why can't this be fully userspace driven ? What is the need to keep the > > cookie in the DT ? > > > > > > Using the second example in the Device Tree: > > mode-bootloader = <1 2>; > > are you suggesting that within psci_vendor_sys_reset2() we would look at the > data argument and assume that we have something like this in memory: > > const char *cmd = data; > > cmd[] = "bootloader 2" > > where "bootloader" is the reboot command, and "2" is the cookie? From an > util-linux, busybox, toybox, etc. we would have to concatenate those > arguments with a space, but I suppose that would be doable. > Yes that was my thought when I wrote the email. But since I have looked at existing bindings and support in the kernel in little more detail I would say. So I am not sure what would be the better choice for PSCI SYSTEM_RESET2 especially when there is some ground support to build. So I am open for alternatives including this approach. -- Regards, Sudeep