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 DA4E0C3DA4A for ; Fri, 9 Aug 2024 16:59:27 +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=h9DRBCCxu+e57buH42hiurbXS7WfhL8DeR+9AHOx9JE=; b=v6I65T01S/sOLS494SjOaDGvdL Gj6d2FI/kLlLedyabA33GimcLdCl90t71HsBEENJjmroeF/C81Lvs5vsgX0UIcEgryJ+fLx8BRq9K OvnfF7dKiNfapL+O4AExtBiEqphP1rrHFy65W8WYrZIEFS2yMn53r+DR55Qtah9Rd4gnG3Ki/SIZv bvyL5UXUmYKldCp1qyxdhRP06TaIOdDtl52XHNhAPa1aYfSP2zrP2R9aipfD29Hi4N+26XyEQSzWX tkOAA2is6DrsSHyK+pw3c2KnXHVfcHhtZ+70fg34vzIOejgt+nD12dDg0WaJ7+VRoD/gJs23jX/RT baw/55eQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1scSxR-0000000C0dr-44aa; Fri, 09 Aug 2024 16:59:17 +0000 Received: from mx0b-0031df01.pphosted.com ([205.220.180.131]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1scSws-0000000C0ZL-1Vuj for linux-arm-kernel@lists.infradead.org; Fri, 09 Aug 2024 16:58:44 +0000 Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4799VXUC022485; Fri, 9 Aug 2024 16:58:34 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to; s=qcppdkim1; bh=h9DRBCCxu+e57buH42hiurbX S7WfhL8DeR+9AHOx9JE=; b=dxAT5BANsZpHl90PVQIh5C3WtTdrUL65Tyw7Uiwi IpYNwsceqv0TQvozbpTWXDrAEzhgx6vEEp+zXlFd59QHHOzisyQuMsdFbgeqz5zz 5u8VNpZeWUj4aPMZPmfnROqaEziaYj3H8hVJOqGYCMvBF+vT9Mw3+Qvlsp90Ght9 RuYwdmx7OAA3m9vROSMLgDrYNSoKARUJ5wF+V3PhlYC8yXyYeTZGOw5Zn7evQut1 /uDPJTB4bdeNrpezGkbIChKigUntun5S5RpQYBUYe7vyX1893ZQ5kHe8NskwTF41 ID9BXke3o0mtCu0WbL15iMgBiiNT3DxJiSQQAofn3nYASA== Received: from nasanppmta05.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 40vtbcvj64-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 09 Aug 2024 16:58:33 +0000 (GMT) Received: from nasanex01b.na.qualcomm.com (nasanex01b.na.qualcomm.com [10.46.141.250]) by NASANPPMTA05.qualcomm.com (8.17.1.19/8.17.1.19) with ESMTPS id 479GwWVc004409 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 9 Aug 2024 16:58:32 GMT Received: from hu-eberman-lv.qualcomm.com (10.49.16.6) by nasanex01b.na.qualcomm.com (10.46.141.250) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Fri, 9 Aug 2024 09:58:31 -0700 Date: Fri, 9 Aug 2024 09:58:31 -0700 From: Elliot Berman To: Lorenzo Pieralisi 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 , , , , Florian Fainelli , , Subject: Re: [PATCH v5 3/4] firmware: psci: Read and use vendor reset types Message-ID: <20240809090339647-0700.eberman@hu-eberman-lv.qualcomm.com> 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: X-Originating-IP: [10.49.16.6] X-ClientProxiedBy: nalasex01a.na.qualcomm.com (10.47.209.196) To nasanex01b.na.qualcomm.com (10.46.141.250) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: llwYJ0vMFu-vntO1KVctchycT4UnaPa_ X-Proofpoint-ORIG-GUID: llwYJ0vMFu-vntO1KVctchycT4UnaPa_ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-08-09_13,2024-08-07_01,2024-05-17_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 suspectscore=0 mlxscore=0 mlxlogscore=999 clxscore=1015 impostorscore=0 adultscore=0 bulkscore=0 priorityscore=1501 phishscore=0 spamscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2407110000 definitions=main-2408090121 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240809_095842_557305_3DD5128C X-CRM114-Status: GOOD ( 27.65 ) 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 Fri, Aug 09, 2024 at 03:30:38PM +0200, Lorenzo Pieralisi wrote: > 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. > I don't think it's a reasonable thing to do. "reboot bootloader" or "reboot edl" don't make sense to the Linux reboot modes. I believe the Linux reboot modes enum is oriented to perspective of Linux itself and the vendor resets are oriented towards behavior of the SoC. Thanks, Elliot