Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp5303058rwb; Wed, 9 Aug 2023 01:48:08 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGeRY2B99P7T06BANP3kZWaRFBoUVb5Sd0B1YPEQd3UQ56/RGsmAaOxHwsu9GrJrM34fYUO X-Received: by 2002:a17:906:3099:b0:991:e458:d14 with SMTP id 25-20020a170906309900b00991e4580d14mr1550467ejv.34.1691570887974; Wed, 09 Aug 2023 01:48:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691570887; cv=none; d=google.com; s=arc-20160816; b=EmPdwTFAnNai/5WOX6aFfn0llABoPjRAtf2nA5xZgofU3NwLRap/0a/unNZln+/mqi wBe5eCA3mftMcuk9wOpsx1lY7xBy0MUnEu+Lp6fhdx+QI4m6E0GO4KB/+p0VolBVXnps Yht8I8ZQYT39tr4/baWB2oWcy2y9NRfE1iPbRsma8AaLiDjtZJJ73LW8EyGyX4i7INQr pF27wjC3SVBS6yY0+2g5qPUVMY13zoWorKXKUWAnNlkiRGCOistZVk93vj6ro+l3Pqr0 KQRZkwdvWeTk0NxaJc90rbvp/Lgg7TRNJAXfu+jf7ucYZHYaLZ4/qHA6rPjsbcj1CXc2 HqAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=vZaXbPgnXsVJZIZF76FR/fB0IrGJfjaJQqrFMYTLiXU=; fh=3Xa+Ca9QE4oHBLojfhmHw+QI2cJx6cXgOgG4DAxRTgs=; b=Ncbb+qG9ux29whdZOxSkxZoI9XloJA5cH1TwopAJfvSDxR6BYBnqpPpnKyzth5vTiq 82BF+MATjEOJ/hIZRGRdpLANR/1H9ZMr2P3qIZ7W0c3rNBJPetQish56MAXgJ7W8cRYq AMT1TX+WGarQtOLnQBAnTZggbVXjz2XV8CGHy1CwRnWawGQGRY26Vv+Q5I+UC7gOdNzn akhCQHxEaWB+zAPV3KFiPvMbFvI4HsVv3w6nNWT3nndec0a4Wa61kRVXgBHYkdJcAEuc o/qit87hKFrZoiO0aGP9BC1vJjV/mzvQ1EkPXuDdyXpZECI/qtwLV5Vbg7+nsAgZbuz/ MBDg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b24-20020aa7cd18000000b0052302f59862si7371056edw.227.2023.08.09.01.47.44; Wed, 09 Aug 2023 01:48:07 -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; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229669AbjHIIUr (ORCPT + 99 others); Wed, 9 Aug 2023 04:20:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36260 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230081AbjHIIUm (ORCPT ); Wed, 9 Aug 2023 04:20:42 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 25EE41703; Wed, 9 Aug 2023 01:20:42 -0700 (PDT) Received: from canpemm500009.china.huawei.com (unknown [172.30.72.54]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4RLNFf5Jtmz9tjF; Wed, 9 Aug 2023 16:17:10 +0800 (CST) Received: from localhost.localdomain (10.50.163.32) by canpemm500009.china.huawei.com (7.192.105.203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Wed, 9 Aug 2023 16:20:39 +0800 From: Yicong Yang To: , , , CC: , , , , , , Subject: [PATCH 2/5] hwtracing: hisi_ptt: Handle the interrupt in hardirq context Date: Wed, 9 Aug 2023 16:18:22 +0800 Message-ID: <20230809081825.11518-3-yangyicong@huawei.com> X-Mailer: git-send-email 2.31.0 In-Reply-To: <20230809081825.11518-1-yangyicong@huawei.com> References: <20230809081825.11518-1-yangyicong@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.50.163.32] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To canpemm500009.china.huawei.com (7.192.105.203) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS 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 From: Yicong Yang Handle the trace interrupt in the hardirq context, make sure the irq core won't threaded it by declaring IRQF_NO_THREAD and userspace won't balance it by declaring IRQF_NOBALANCING. Otherwise we may violate the synchronization requirements of the perf core, referenced to the change of arm-ccn PMU commit 0811ef7e2f54 ("bus: arm-ccn: fix PMU interrupt flags"). In the interrupt handler we mainly doing 2 things: - Copy the data from the local DMA buffer to the AUX buffer - Commit the data in the AUX buffer Signed-off-by: Yicong Yang --- drivers/hwtracing/ptt/hisi_ptt.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/hwtracing/ptt/hisi_ptt.c b/drivers/hwtracing/ptt/hisi_ptt.c index 5f0a8e653ae8..89638ed96cf9 100644 --- a/drivers/hwtracing/ptt/hisi_ptt.c +++ b/drivers/hwtracing/ptt/hisi_ptt.c @@ -346,9 +346,9 @@ static int hisi_ptt_register_irq(struct hisi_ptt *hisi_ptt) return ret; hisi_ptt->trace_irq = pci_irq_vector(pdev, HISI_PTT_TRACE_DMA_IRQ); - ret = devm_request_threaded_irq(&pdev->dev, hisi_ptt->trace_irq, - NULL, hisi_ptt_isr, 0, - DRV_NAME, hisi_ptt); + ret = devm_request_irq(&pdev->dev, hisi_ptt->trace_irq, hisi_ptt_isr, + IRQF_NOBALANCING | IRQF_NO_THREAD, DRV_NAME, + hisi_ptt); if (ret) { pci_err(pdev, "failed to request irq %d, ret = %d\n", hisi_ptt->trace_irq, ret); -- 2.24.0