From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2D3D5C3DA4A for ; Fri, 9 Aug 2024 13:31:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=AeqQIkTNORlNuaX7BQ3AEmVUr0x+zPbbk1ZWU8Fooj0=; b=NbXH2SjNHB8tUt41X66b+Ln56A LZa3HVkpg32kOS+j/jlzrPBZDUtN27LyZC/E7X1DIWAByfKC7JNUx2g7WlRWRJ/GYJk+vU92hoe1t Mr48/ICPNsjyTFtnX1+Sa5RNUnwAVKYbYfcGDUlK8JrW6chLMi0qjRNk/NEeWbGMBa6kK3KjjjRQA 9ZQWgNMEu7W9Ah1jd6xxZajGngC9medZWszc3/q3bGHOaZqbtKZyvJilTIbmP8VpS9/XL3dAYfEgF un82gEYcjgA0RYkGNSb33a3uWel0z6E/0AOJcq9FRfKNh5AIi9l3wVvfVWZvUMPSsrK1qe9sSwIGq L41tFRnw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1scPiL-0000000BLob-2ZdM; Fri, 09 Aug 2024 13:31:29 +0000 Received: from sin.source.kernel.org ([145.40.73.55]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1scPhh-0000000BLWp-3TRd for linux-arm-kernel@lists.infradead.org; Fri, 09 Aug 2024 13:30:51 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 058E1CE1787; Fri, 9 Aug 2024 13:30:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 703FEC32782; Fri, 9 Aug 2024 13:30:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1723210246; bh=oARMjVvZYD+OyPOCWbo7ArhDj/Qls8CZ9DQ8yb3NHM8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=csOv73yLZ90h0Ejrvv6XpOOvcK8g+XMHhrjYGOHERFKIumDe7R+ByH7iHTyja5jtq YfC77YOM5ktGxTbaliJW2j/StCrJEBd9brmXZG/99u0Wutgfe9hMyu0tR6a1+l+GIe 5MUWjBm/w4rbrkQxO5dZD3o3AU5kYrbQ7i0LwkLDoDm2qve77cVPw8OHgYEZuDIR9d QlqTNqdZLUVl0nSM1BOid3+Chtug26gyyxLcExtFZUZs12LjLlo8as1Lr5YN4YBTkD Am8Mb6kLxtT+uMDDwuicnohHJLoQXIQ6PYXmswv4MbQU5Ve5a/hYn4dzITmXfEq98s T7kbNS+GxTUfA== Date: Fri, 9 Aug 2024 15:30:38 +0200 From: Lorenzo Pieralisi To: Elliot Berman Cc: Bjorn Andersson , Konrad Dybcio , Sebastian Reichel , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Vinod Koul , Andy Yan , 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, Florian Fainelli , linux-pm@vger.kernel.org, linux-arm-msm@vger.kernel.org Subject: Re: [PATCH v5 3/4] firmware: psci: Read and use vendor reset types Message-ID: References: <20240617-arm-psci-system_reset2-vendor-reboots-v5-0-086950f650c8@quicinc.com> <20240617-arm-psci-system_reset2-vendor-reboots-v5-3-086950f650c8@quicinc.com> <20240807103245593-0700.eberman@hu-eberman-lv.qualcomm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240807103245593-0700.eberman@hu-eberman-lv.qualcomm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240809_063050_354669_928A6D2B X-CRM114-Status: GOOD ( 26.03 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Aug 07, 2024 at 11:10:50AM -0700, Elliot Berman wrote: [...] > > > +static void psci_vendor_sys_reset2(unsigned long action, void *data) > > > > 'action' is unused and therefore it is not really needed. > > > > > +{ > > > + const char *cmd = data; > > > + unsigned long ret; > > > + size_t i; > > > + > > > + for (i = 0; i < num_psci_reset_params; i++) { > > > + if (!strcmp(psci_reset_params[i].mode, cmd)) { > > > + ret = invoke_psci_fn(PSCI_FN_NATIVE(1_1, SYSTEM_RESET2), > > > + psci_reset_params[i].reset_type, > > > + psci_reset_params[i].cookie, 0); > > > + pr_err("failed to perform reset \"%s\": %ld\n", > > > + cmd, (long)ret); > > > + } > > > + } > > > +} > > > + > > > static int psci_sys_reset(struct notifier_block *nb, unsigned long action, > > > void *data) > > > { > > > + if (data && num_psci_reset_params) > > > > So, reboot_mode here is basically ignored; if there is a vendor defined > > reset, we fire it off. > > > > I think Mark mentioned his concerns earlier related to REBOOT_* mode and > > reset type (granted, the context was different): > > > > https://lore.kernel.org/all/20200320120105.GA36658@C02TD0UTHF1T.local/ > > > > I would like to understand if this is the right thing to do before > > accepting this patchset. > > > > I don't have any concerns to move this part below checking reboot_mode. > Or, I could add reboot_mode == REBOOT_COLD check. The question is how can we map vendor specific reboot magic to Linux reboot modes sensibly in generic PSCI code - that's by definition vendor specific. Thanks, Lorenzo > I'm not sure how best to define the behavior if user sets > reboot_mode = REBOOT_WARM and then user does "reboot bootloader". IMO, > "REBOOT_WARM" is at odds with the "bootloader" command. We can have one > take precedence over the other. I chose for the vendor resets to take > priority, since if userspace is providing specific command at reboot > time, that's probably what they want. > > Let me know your thoughts and I'm happy to change the behavior around. > > > Thanks, > Elliot