From patchwork Fri Sep 29 07:00:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ekansh Gupta X-Patchwork-Id: 146445 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp3845152vqu; Fri, 29 Sep 2023 00:37:29 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHffg9OIzAyDl4qnLkqoexhtTHt/XoX7vyhVMLuRkhHZ0yfSafL6RsfOR86oGliKoLJTCXH X-Received: by 2002:a05:6a21:32a3:b0:15e:10e:2cc3 with SMTP id yt35-20020a056a2132a300b0015e010e2cc3mr3748159pzb.60.1695973049120; Fri, 29 Sep 2023 00:37:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695973049; cv=none; d=google.com; s=arc-20160816; b=wN6hVOZy3l7XC5DS619C/3igy7vo6xLTM4oSRtknfdNZX7pnYEZFZsXLpfO09RmmU7 0KPsHOJl96vn8qZSFn+jUqKyQYrs9hpeelIVcdkCeiCeE0RMrliCd5AyIgxRXQnw9GS4 EY6PPCAVb2t4+5xkIl8PP6gkpFkA38XoSiiKCSuDSfUcA/wqH59NdoylvRXNBaj89Nqx NOYBFWqgTZx8ClXvQhRjuUNl0MzSGSjIKnilFadFkGcwOqgtzmQC3oNZOWHHa2tp8XHd ETk9iXoapVjXo1wj88EoVv6FxWsKPPqiaJot2ZqrI8ykuq3yBrazq2ntgkIMxdbeslt1 NFhw== 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=z6OvOJkU2QmX7U+VT65MGN7ENiR2GR4q+lji8If0JzI=; fh=IQ68kbvYFCSlyXdHKXkbdUfoRSl+ok1hAWwFRWAAo5U=; b=TFXqmUU+HihJtwVf6WFKyCbb9Q+u5mp/TtGrjmjfqT5zslmAq+z+jojwQHkutRjrXc 55sET1RuK1WJ9Ej+sVi3WUjR8tZHxEmzLsqEMxgbOMP2FnVL16Q9880WX/+hCtjr15Gr +8g7E9p4ZSwaKxdc+4887+4RYXs00lBZ7jgeevc7YLZHQH/lfz8Nj+1AFjvnSXMizF3b S7FuLiIKTRDjP76IHvwtTro/Jo8tj2BGZRRczFpnqPgHYWNiaetDC/+Z7OvhZcxmdudZ 1sG/j6csvVOFpUZ8eYlyVwcjaR4oNoCyZC6MZHh1OojfsrYxuVL7yiZrTizyU0tLON9s yldA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=nuOKLSXP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id b8-20020a17090ae38800b0026b09e2e3eesi999077pjz.47.2023.09.29.00.37.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Sep 2023 00:37:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=nuOKLSXP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 59F2F83CD5B5; Fri, 29 Sep 2023 00:01:25 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232801AbjI2HBN (ORCPT + 20 others); Fri, 29 Sep 2023 03:01:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55004 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232758AbjI2HBE (ORCPT ); Fri, 29 Sep 2023 03:01:04 -0400 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 75CC41BF; Fri, 29 Sep 2023 00:01:02 -0700 (PDT) Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 38T6dSvf002216; Fri, 29 Sep 2023 07:01:00 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=z6OvOJkU2QmX7U+VT65MGN7ENiR2GR4q+lji8If0JzI=; b=nuOKLSXP6UeILLhfp6RzmzEtDaQF9a86vuZBRJF46YROPDKvaJSI+dFnxbwt7HXccVrD s9FQwQycaARapSNZiyDIUs6Z0HHaWq9txQF4cYxDai+lhbcvll/Y1ApJObOw2cIQH7Il K9Z0BpBijqWUZjEadWKLtE+m9IaQoY3h8dXpd1Lp4j5pl609e/Z0KBcPZ3BkLLfa5Ucp MKo9LUkH/ap/GuNk/TdaBezZwxRn+PZPkFlOxwcm4/fVUEvaUdG+WqxwUUwn8RIesZ6R VFKf7LCCHaifm4/S9jOqVWU1jZyCUDKk9ZnEF19aDlYMKnSYk5D9sOgi/rugPhzkRyhA GA== Received: from nalasppmta02.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3td24uaqvb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 29 Sep 2023 07:01:00 +0000 Received: from nalasex01b.na.qualcomm.com (nalasex01b.na.qualcomm.com [10.47.209.197]) by NALASPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 38T70x6m027435 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 29 Sep 2023 07:00:59 GMT Received: from ekangupt-linux.qualcomm.com (10.80.80.8) by nalasex01b.na.qualcomm.com (10.47.209.197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.36; Fri, 29 Sep 2023 00:00:56 -0700 From: Ekansh Gupta To: , CC: Ekansh Gupta , , , , Subject: [PATCH v1 4/4] misc: fastrpc: Add support for users to clean up DSP user PD Date: Fri, 29 Sep 2023 12:30:30 +0530 Message-ID: <1695970830-12331-5-git-send-email-quic_ekangupt@quicinc.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1695970830-12331-1-git-send-email-quic_ekangupt@quicinc.com> References: <1695970830-12331-1-git-send-email-quic_ekangupt@quicinc.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01b.na.qualcomm.com (10.47.209.197) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: XGEnaBTaYHrmh1UH1OkcBJ2_4-fl6eAl X-Proofpoint-ORIG-GUID: XGEnaBTaYHrmh1UH1OkcBJ2_4-fl6eAl X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-09-29_04,2023-09-28_03,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 malwarescore=0 suspectscore=0 impostorscore=0 lowpriorityscore=0 spamscore=0 priorityscore=1501 mlxscore=0 mlxlogscore=791 adultscore=0 bulkscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2309180000 definitions=main-2309290059 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Fri, 29 Sep 2023 00:01:25 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778356635660143410 X-GMAIL-MSGID: 1778356635660143410 Add a control mechanism for users to clean up DSP user PD. This method can be used by users for handling any unexpected hang scenarios on DSP PD. User can clean up DSP PD and restart the user PD again. Signed-off-by: Ekansh Gupta --- drivers/misc/fastrpc.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c index 40cb867..55f5286 100644 --- a/drivers/misc/fastrpc.c +++ b/drivers/misc/fastrpc.c @@ -2253,6 +2253,11 @@ static int fastrpc_internal_control(struct fastrpc_user *fl, case FASTRPC_CONTROL_RPC_POLL: err = fastrpc_manage_poll_mode(fl, cp->lp.enable, cp->lp.latency); break; + case FASTRPC_CONTROL_DSPPROCESS_CLEAN: + err = fastrpc_release_current_dsp_process(fl); + if (!err) + fastrpc_queue_pd_status(fl, fl->cctx->domain_id, FASTRPC_USERPD_FORCE_KILL); + break; default: err = -EBADRQC; break;