From patchwork Fri Mar 17 16:28:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mukesh Ojha X-Patchwork-Id: 71357 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp437296wrt; Fri, 17 Mar 2023 09:31:16 -0700 (PDT) X-Google-Smtp-Source: AK7set+R9v5gB7uoHDTrppLLj8YUZN9b6I4Q+cQ6CXU9iFxZdhqxPSYK5u8V8O4tL5OiOsp37Zyg X-Received: by 2002:a05:6a20:7f8c:b0:c7:af88:3dd8 with SMTP id d12-20020a056a207f8c00b000c7af883dd8mr10228141pzj.6.1679070675836; Fri, 17 Mar 2023 09:31:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679070675; cv=none; d=google.com; s=arc-20160816; b=Ko4Ksvs1MHZr1dV6XScfD8SMmxpGJFaJYVAvfzSqcKU3OP8uGU9WSwaMGrS8OqlTKg hY7Dgv6E1t4x9RtkPCDgubLJsVq9WbFY2QU/VgaIsiEO0E6T25Myn3N8efmcCum75BI0 WiHpgZjcj/YHQk5o4S4ZH8UIWRSQcT3yu4mcDyjV4R8QKRH2HTOsz87K8/fvTiKy2OsK stHfpGEExgjlAqdAeIB51MKwYCvhzYQ9ZejR8OUOtD+6dvtgHV4fubE0WieFiiL0bkkZ 0gccxMVMUX2W+NAHyMWvCaNGLgp621vhkUxgEjCJK2+MTDpqs4TQJaLmb4AzAshHvaFw MPEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=t+Z+MrnYr72Co07tsgrY5M8Wiff1XxqQ/2tXmPmW51A=; b=lqQNzu+Dz9LQRxVU1LPBpXEMj4LKuoxlLKKOUTQDMx1LJj+H5MXvPzxt2AYH3VVv62 7YtuZ/c1A/68g2wzEHObFL/NogPXjBOoK77DXV0qn4yKFRcBPqXzUnaM42888UO4nNIn dWx4Sdw6ohnTtb4MqXMp0PR+7GmNCjiVFV5hvYfymNNGTSKImzihcyPkLVPlicAovGpi MZ79CmSKM1KscOyvcMLqgC5xjzx4gDAxUREevYV5b3zZpSb1fLbNJomfHNaKOlusIR7q scCZnSZOCVH3T70EMnWkBfpBc+kcZJWcknGVNEYx7xnc+ds1tWn7p9eQeXXEl9lCfLBS XoBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=fNwKQQZL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u11-20020a63454b000000b004fc264c3a43si2701805pgk.397.2023.03.17.09.31.02; Fri, 17 Mar 2023 09:31:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=fNwKQQZL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230102AbjCQQ3J (ORCPT + 99 others); Fri, 17 Mar 2023 12:29:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42482 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229780AbjCQQ2t (ORCPT ); Fri, 17 Mar 2023 12:28:49 -0400 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C42E723312; Fri, 17 Mar 2023 09:28:43 -0700 (PDT) Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 32H7WuYs006738; Fri, 17 Mar 2023 16:28:41 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=qcppdkim1; bh=t+Z+MrnYr72Co07tsgrY5M8Wiff1XxqQ/2tXmPmW51A=; b=fNwKQQZLF5OVD/QuImaXtR9kN1OL+K2VyAQUuHTfQTlJlYTniMV8hTViAc8YXdj5ik2w 1KLLx/pdb5E65AJh1XFVghtwfFdYNHMybS+ufBZChNwxNtM9jqVz9aXPCHmox2zWMTXi SRp8exNDy4vQTStK6/WjgBInMXP6XAiyy18tRILxvLVxMLQ34iQXlZQ4CipzWaoTv3dF rnIzAq/rpGpyxNUoQCINaQ0UcxRDciH3sDt2T3C+vUGGhtKDSZU3CiQ9sm0ZUTrW23lW XnAPSsm3sIqI1FsMxya44r5pdkuaOa+vVHrgwCGe1LHwokn+p1P6oLwUICXNDIPu1MYW jw== Received: from nasanppmta04.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3pcayeb5f1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 17 Mar 2023 16:28:41 +0000 Received: from nasanex01c.na.qualcomm.com (nasanex01c.na.qualcomm.com [10.45.79.139]) by NASANPPMTA04.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 32HGSeIR012912 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 17 Mar 2023 16:28:40 GMT Received: from hu-mojha-hyd.qualcomm.com (10.80.80.8) by nasanex01c.na.qualcomm.com (10.45.79.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Fri, 17 Mar 2023 09:28:37 -0700 From: Mukesh Ojha To: , , , CC: , , , Mukesh Ojha Subject: [PATCH v3 5/5] firmware: qcom_scm: Add multiple download mode support Date: Fri, 17 Mar 2023 21:58:02 +0530 Message-ID: <1679070482-8391-6-git-send-email-quic_mojha@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1679070482-8391-1-git-send-email-quic_mojha@quicinc.com> References: <1679070482-8391-1-git-send-email-quic_mojha@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nasanex01c.na.qualcomm.com (10.45.79.139) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: MOLy7SARonMfhfwe0sU_6ImegC-IEAGE X-Proofpoint-GUID: MOLy7SARonMfhfwe0sU_6ImegC-IEAGE X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-03-17_10,2023-03-16_02,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 lowpriorityscore=0 phishscore=0 clxscore=1015 bulkscore=0 mlxlogscore=999 mlxscore=0 spamscore=0 adultscore=0 malwarescore=0 priorityscore=1501 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303150002 definitions=main-2303170110 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760633212899431908?= X-GMAIL-MSGID: =?utf-8?q?1760633212899431908?= Currently, scm driver only supports full dump when download mode is selected. Add support to enable minidump as well both dump(full dump + minidump). Signed-off-by: Mukesh Ojha --- drivers/firmware/qcom_scm.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/drivers/firmware/qcom_scm.c b/drivers/firmware/qcom_scm.c index 69f864d..ba3eefc 100644 --- a/drivers/firmware/qcom_scm.c +++ b/drivers/firmware/qcom_scm.c @@ -32,6 +32,9 @@ static u32 download_mode; #define QCOM_DOWNLOAD_MODE_MASK 0x30 #define QCOM_DOWNLOAD_FULLDUMP 0x10 +#define QCOM_DOWNLOAD_MINIDUMP 0x20 +#define QCOM_DOWNLOAD_BOTHDUMP (QCOM_DOWNLOAD_FULLDUMP | QCOM_DOWNLOAD_MINIDUMP) + #define QCOM_DOWNLOAD_NODUMP 0x0 struct qcom_scm { @@ -1421,15 +1424,19 @@ static irqreturn_t qcom_scm_irq_handler(int irq, void *data) return IRQ_HANDLED; } - static int get_download_mode(char *buffer, const struct kernel_param *kp) { - int len; + int len = 0; - if (download_mode == QCOM_DOWNLOAD_FULLDUMP) + if (download_mode == QCOM_DOWNLOAD_FULLDUMP) { len = sysfs_emit(buffer, "full\n"); - else if (download_mode == QCOM_DOWNLOAD_NODUMP) + } else if (download_mode == QCOM_DOWNLOAD_MINIDUMP) { + len = sysfs_emit(buffer, "mini\n"); + } else if (download_mode == QCOM_DOWNLOAD_BOTHDUMP) { + len = sysfs_emit(buffer, "both\n"); + } else if (download_mode == QCOM_DOWNLOAD_NODUMP) { len = sysfs_emit(buffer, "off\n"); + } return len; } @@ -1438,6 +1445,10 @@ static int set_download_mode(const char *val, const struct kernel_param *kp) { if (!strncmp(val, "full", strlen("full"))) { download_mode = QCOM_DOWNLOAD_FULLDUMP; + } else if (!strncmp(val, "mini", strlen("mini"))) { + download_mode = QCOM_DOWNLOAD_MINIDUMP; + } else if (!strncmp(val, "both", strlen("both"))) { + download_mode = QCOM_DOWNLOAD_BOTHDUMP; } else if (!strncmp(val, "off", strlen("off"))) { download_mode = QCOM_DOWNLOAD_NODUMP; } else if (kstrtouint(val, 0, &download_mode) || @@ -1459,7 +1470,7 @@ static const struct kernel_param_ops download_mode_param_ops = { module_param_cb(download_mode, &download_mode_param_ops, NULL, 0644); MODULE_PARM_DESC(download_mode, - "Download mode: off/full or 0/1 for existing users"); + "download mode: off/full/mini/both(full+mini) or 0/1 for existing users"); static int qcom_scm_probe(struct platform_device *pdev) {