From patchwork Thu Sep 14 11:22:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yicong Yang X-Patchwork-Id: 139512 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp278861vqi; Thu, 14 Sep 2023 04:32:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGrTb+xc9BUVQ9K27ciGUBEr21ACJtGoaqgadAdvfr5cAV53RQEV2QdYKIcj7GkIJ2iK/s0 X-Received: by 2002:a17:902:db0e:b0:1c0:cbaf:6954 with SMTP id m14-20020a170902db0e00b001c0cbaf6954mr2727314plx.25.1694691123878; Thu, 14 Sep 2023 04:32:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694691123; cv=none; d=google.com; s=arc-20160816; b=MOThgiaJu3o0kq1LhyQ9hGhZp2hK8bxBrh8DSiySedJcAmfRgFLCyeRAuI8cx0xghR xzgxrbD7KEr5kOJ8aGJmKxEU+jKBSVAoX03EseZBxAD1j3LlT7slfVsxFumW7J80MSRp 2DUWY4qHSS5Z6eo5T71grXmnD+RrlYPyu6oblAyXATvxQZEZF0uajUhIUpwQ03cPuvYa ACZQzqQgyFYbOIkxpsrRG4OSsNxnzl4Kmxo3uuLW22yvo5mFk1ZsBmizRRu1gI1Ogyqe 8LN1966kBwZMCRAa/XqEXLMeHYxm3KlMJjiF8c0KQJtc/fQPWuw8vGE2NF4x4si6fmBy Nd5A== 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=S/aSbHmj4LnlvbBGj39ZBWiaaC2Vhr28DaEcCWQcV6Q=; fh=ko8w2iEBByNlWLnAg6bNI5pex73wZFG+4jwxERcD8TA=; b=ZE2OAtBuzLf8e0m+4BtzdPeUUTydOshg8h3dp0noBQYZjfjCNFk4kKXpMmgQm0ivmW jxAV5/wUbeiYImiOxe8bzx3aBVINLqmhkuHPejiYUSwgWAkp2dLoo9/6XGdT1clSIzmy 5N0cWd0GQrqn1FfBjVUgFNDya/SCzcJoOnqoqt5Z556IcfYI4LKPMZyvAGBNAmuWtXtY BpOQkcYn2/ppdwS0bi0DcSoEPIqbITfN6WkQcRP8LrFCsgYk3L3VERVspYU75RpPnuxR wep0iogAchIOqwGfzqi0IDgUCM7FTgSrJMUlzFEwWExPDagx69IS0BPq9hFmJAhm9KXe MwtA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id b12-20020a170902650c00b001c3f601b6besi1391960plk.642.2023.09.14.04.32.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Sep 2023 04:32:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 2668F803984E; Thu, 14 Sep 2023 04:26:05 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235307AbjINLZ6 (ORCPT + 35 others); Thu, 14 Sep 2023 07:25:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49906 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234742AbjINLZz (ORCPT ); Thu, 14 Sep 2023 07:25:55 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ADA441A5; Thu, 14 Sep 2023 04:25:25 -0700 (PDT) Received: from canpemm500009.china.huawei.com (unknown [172.30.72.57]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4RmZgX1ZwGzgZgH; Thu, 14 Sep 2023 19:23:04 +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.31; Thu, 14 Sep 2023 19:25:02 +0800 From: Yicong Yang To: , , , CC: , , , , , , Subject: [PATCH v2 2/5] hwtracing: hisi_ptt: Handle the interrupt in hardirq context Date: Thu, 14 Sep 2023 19:22:20 +0800 Message-ID: <20230914112223.27165-3-yangyicong@huawei.com> X-Mailer: git-send-email 2.31.0 In-Reply-To: <20230914112223.27165-1-yangyicong@huawei.com> References: <20230914112223.27165-1-yangyicong@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.50.163.32] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To canpemm500009.china.huawei.com (7.192.105.203) X-CFilter-Loop: Reflected 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 (howler.vger.email [0.0.0.0]); Thu, 14 Sep 2023 04:26:05 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777012440004660399 X-GMAIL-MSGID: 1777012440004660399 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 Acked-by: Jonathan Cameron --- 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 428cca54217e..3041238a6e54 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);