Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp1017461lqg; Sat, 2 Mar 2024 11:13:49 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUyZ6CLPgf6gu+Ds5gQXPR1pG0evmc7SThknodzbS9D4M2KCrCr+YOsg/KumIJvV/HlMPvikwCEyaeY0IizvmvzRfRZVQcmeRvZZPxOCA== X-Google-Smtp-Source: AGHT+IGAIfDtA09AgiP7lxwAfueRBwinULsMtUFRPivHN6NNAwkFZSAC8GbbHi8XNLukK6dAWF1W X-Received: by 2002:a17:902:e804:b0:1dc:fcc3:7ca1 with SMTP id u4-20020a170902e80400b001dcfcc37ca1mr2151378plg.20.1709406829226; Sat, 02 Mar 2024 11:13:49 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709406829; cv=pass; d=google.com; s=arc-20160816; b=vUW4TiRJAXnQSZAyaKE1457jIpTuYUe1MQbGrlOd9w4R6LODICKjqwGHjRIUjg6KpZ xXTK8jIF2oGL3ePiaGYI+wrNYCoYUx3lwUFhzM8homtCv1GLhJmCirVZ7b8/ygBYMA2f Og/HH00r+omJwYmnk5fPOtK24eYmtaPQtdpVA7cu3+qAdvKnieqNILn3gj6ppmVy9m5L YhDS+hRDRsbpYeEDEVd+FDxbwHpSJB6+cNb7HgHmA12WnVLoGf8tuRgYlrDfyXEu6RFX ICqs+UHk1TrymkSj5dIWglZqcvL4rmTXKFgB2BENkYOFppFWvyGSJLVmHOzZ6c4Z4c4v Slgw== 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:dkim-signature; bh=Yn7skupdbe4/l5HUwmnG1A1zw7TrljVvO7S471NdnfU=; fh=lKkOdMaBp+hxLd1zRbGOs9RDDSS3b8V1K1nb9xHg3mY=; b=s9dhxabj35/hYyKKU8IuHjWkTVqVVA76i5aJzht2uGvRchTkmMD4XubqtcCQ/tXljk w9WdgEC1Uinv431vSeRnSsOZIUxGfe0QeER6kpd5VReKSw8mueolAJNdWr3FY641xEBR BGQs73rOvmtBKgIcm/eNtP3ykkGRr5BwUibbMe6hV232elmjyyeoGjUEO6zwtW0Y6am9 VDdkRQ2VH/UCfsUicg25HMjSfqKrf1Sa9frwaNqBBWOR2GmwlbPVq9XTmLLo2zKY8wDz XJRoVEfk6slqGI8EQXbARxgG/8TeORaACYS2T43uIyFqpU6HwY2dSvxZlYc7ejL4SOg0 HAkw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=sI1hou6r; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-89559-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-89559-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id l5-20020a170902e2c500b001dccba6652fsi5378464plc.446.2024.03.02.11.13.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 Mar 2024 11:13:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-89559-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=sI1hou6r; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-89559-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-89559-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 4F290B225C0 for ; Sat, 2 Mar 2024 19:13:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3280A3FE37; Sat, 2 Mar 2024 19:13:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="sI1hou6r" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 5584E2BB1E; Sat, 2 Mar 2024 19:13:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709406814; cv=none; b=sjuwKyQBZ3bUfijQg2bS7hQhKZ3ah27ZgqlhbjKV283Bko0ip/fNGXhtN56EDQzyoDt16N2ONSrmrlFZqjyFQGdnyqmP5G0BrqpK02JQmiSeWF+gsMqE3VEWAihlzBDOgJuMGhvumlVgG7tWxrijvrkxPMPhwVoNbT/6hlzpxlg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709406814; c=relaxed/simple; bh=/ZJsIWMUy/R/fRXQvzHdLDgIj2F1D/SVsTiYDZVkl14=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Ty7lxdN25jcZS6wOW9XknQB/MiyLlT1Hd2/pIIm12I/z35O/r2Actwk21Zds7VKwaymahkHeEoAhMbVlZHyFT4Z8oP9UqVhsIQWWm45dYJI0nKYqoMTXXgOvv+eQwW/wH+L91Al3ulaEhZmK5WXjwIqtB5u3ozEB3o1aGaXmtrI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=sI1hou6r; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 48861C433C7; Sat, 2 Mar 2024 19:13:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1709406814; bh=/ZJsIWMUy/R/fRXQvzHdLDgIj2F1D/SVsTiYDZVkl14=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=sI1hou6r9k2/74DY4NtgNvhAyFsAjKla+NaPWIzYivKipJ7TmdAVvuQpCo1XdaSHP wNlwD39aJG6z/lufj5npuRBBm1fs/NPeXNgDNcnsIaUsDRV5f9BiLlBco+qcUiVADl a0ksR7jx+JyvjpinfvXEHrfWP1IpX9TZLsqDLLi3Odef+dQ0EbbykOAnzrYa6seNvc K9douC+9qi2w2jEQOjaKdiWPucKlzaSP159nIyO85x3KQVTgV5B7xohg0TS7a3Ew12 TJ8n/pIOm6xm1aKPOVfuS1fptFAMuUmUXdsmS2P2rgJu0g/UsEEVyDGO9FOw0WBEcU igicFkCf8bGSA== Date: Sat, 2 Mar 2024 13:13:31 -0600 From: Bjorn Andersson To: Mukesh Ojha Cc: konrad.dybcio@linaro.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linus.walleij@linaro.org, linux-gpio@vger.kernel.org, Poovendhan Selvaraj , Kathiravan Thirumoorthy , Dmitry Baryshkov , Elliot Berman Subject: Re: [PATCH v12 3/9] firmware: qcom: scm: Modify only the download bits in TCSR register Message-ID: References: <20240227155308.18395-1-quic_mojha@quicinc.com> <20240227155308.18395-4-quic_mojha@quicinc.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: <20240227155308.18395-4-quic_mojha@quicinc.com> On Tue, Feb 27, 2024 at 09:23:02PM +0530, Mukesh Ojha wrote: > Crashdump collection is done based on DLOAD bits of TCSR register. > To retain other bits, scm driver need to read the register and > modify only the DLOAD bits, as other bits in TCSR may have their > own significance. > > Co-developed-by: Poovendhan Selvaraj > Signed-off-by: Poovendhan Selvaraj > Signed-off-by: Mukesh Ojha > Tested-by: Kathiravan Thirumoorthy # IPQ9574 and IPQ5332 > Reviewed-by: Dmitry Baryshkov > Reviewed-by: Elliot Berman > --- > drivers/firmware/qcom/qcom_scm.c | 14 ++++++++++++-- > 1 file changed, 12 insertions(+), 2 deletions(-) > > diff --git a/drivers/firmware/qcom/qcom_scm.c b/drivers/firmware/qcom/qcom_scm.c > index 8f766fce5f7c..bd6bfdf2d828 100644 > --- a/drivers/firmware/qcom/qcom_scm.c > +++ b/drivers/firmware/qcom/qcom_scm.c > @@ -4,6 +4,8 @@ > */ > > #include > +#include > +#include > #include > #include > #include > @@ -114,6 +116,12 @@ static const u8 qcom_scm_cpu_warm_bits[QCOM_SCM_BOOT_MAX_CPUS] = { > #define QCOM_SMC_WAITQ_FLAG_WAKE_ONE BIT(0) > #define QCOM_SMC_WAITQ_FLAG_WAKE_ALL BIT(1) > > +#define QCOM_DLOAD_MASK GENMASK(5, 4) > +enum qcom_dload_mode { > + QCOM_DLOAD_NODUMP = 0, > + QCOM_DLOAD_FULLDUMP = 1, These values are not enumerations, they represent fixed/defined values in the interface. As such it's appropriate to use #define. Regards, Bjorn > +}; > + > static const char * const qcom_scm_convention_names[] = { > [SMC_CONVENTION_UNKNOWN] = "unknown", > [SMC_CONVENTION_ARM_32] = "smc arm 32", > @@ -531,6 +539,7 @@ static int __qcom_scm_set_dload_mode(struct device *dev, bool enable) > > static void qcom_scm_set_download_mode(bool enable) > { > + u32 val = enable ? QCOM_DLOAD_FULLDUMP : QCOM_DLOAD_NODUMP; > bool avail; > int ret = 0; > > @@ -540,8 +549,9 @@ static void qcom_scm_set_download_mode(bool enable) > if (avail) { > ret = __qcom_scm_set_dload_mode(__scm->dev, enable); > } else if (__scm->dload_mode_addr) { > - ret = qcom_scm_io_writel(__scm->dload_mode_addr, > - enable ? QCOM_SCM_BOOT_SET_DLOAD_MODE : 0); > + ret = qcom_scm_io_rmw(__scm->dload_mode_addr, > + QCOM_DLOAD_MASK, > + FIELD_PREP(QCOM_DLOAD_MASK, val)); > } else { > dev_err(__scm->dev, > "No available mechanism for setting download mode\n"); > -- > 2.43.0.254.ga26002b62827 >