Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp4664519pxu; Tue, 13 Oct 2020 04:19:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwqIUasIg6+T8iEh1U1egksxwDdmHIKhXrjcyxn+wEdjPJXePkwhR04b40wiO84c1W0ivJU X-Received: by 2002:a17:906:2b5b:: with SMTP id b27mr3554046ejg.400.1602587977149; Tue, 13 Oct 2020 04:19:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602587977; cv=none; d=google.com; s=arc-20160816; b=Z0y+xO5DUPaVsrMY7nmpbQf7uvvk7J5PpyfLIB8Ag9HvaLbx5tTE536BeX8EvvBk/J mbm8Pu9oU0JpGEIIZXUrcc1HQsIHiBWust3qabS+5pEXUH+DvgALeN8N+YLovn9zMViU OF3il1aMHSobDC6AUHwGQ5Gps6FceLYLRc+IxZLQjsqhOPvG0hdQrDMUrVyMcKqvDesp UOLKDtiTZeZSfbd+bfaEy1CoTg8SB5BCI1qXGcGo9176wNH77n3Ld39nlBkp2ZqX69gJ zpv3xVNTSk08DE2PSygVRwkyDoiKJrX2M9IARvFYWFuM6VLQi9rFYFN9kYCcIU099c/F Hj2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=WIy5fiPokcGBTb669dKYioOHdQtOuruA9morm1Mzcrk=; b=FA+Bo66ExuyZrx7JRoAGH3lIoMgwTSOmx3gINswRco4qRYfgXqjbt6IySe4AuFRour NTsS/Pq6l/uIyh2oqRwKmcOLnSPCEYvDAoOU5fWRpP3TuFibgbkc60IGfOPAS0sTZegb TLsvWtGj2EL6ZvMrAmp87tiVqg3RkW+b9RcjL4X3sNd5RoYlirQTvsAjXs7jk/0Li1u8 L5CoEvaxSCkUptj3nUeXmVLT08TsR5ILAfdS7vlD7SX8i+RhZczRQBdWb1UXwET0qNuU d6cpsIzyxK//Ob7IW4Fjf5sEtMeKs69N6I2jw746KQv+3rVeSBNZVQI1/YjnMhKzm7b2 FUYQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x19si13236850edq.122.2020.10.13.04.19.15; Tue, 13 Oct 2020 04:19:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728500AbgJMCAW (ORCPT + 99 others); Mon, 12 Oct 2020 22:00:22 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:15205 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728492AbgJMCAV (ORCPT ); Mon, 12 Oct 2020 22:00:21 -0400 Received: from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 6723A2474EE92E0AD1B6; Tue, 13 Oct 2020 10:00:18 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS408-HUB.china.huawei.com (10.3.19.208) with Microsoft SMTP Server id 14.3.487.0; Tue, 13 Oct 2020 10:00:10 +0800 From: Tian Tao To: , , , , , CC: Subject: [PATCH] vfio/platform: Replace spin_lock_irqsave by spin_lock in hard IRQ Date: Tue, 13 Oct 2020 10:00:58 +0800 Message-ID: <1602554458-26927-1-git-send-email-tiantao6@hisilicon.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org It is redundant to do irqsave and irqrestore in hardIRQ context. Signed-off-by: Tian Tao --- drivers/vfio/platform/vfio_platform_irq.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/vfio/platform/vfio_platform_irq.c b/drivers/vfio/platform/vfio_platform_irq.c index c5b09ec..24fd6c5 100644 --- a/drivers/vfio/platform/vfio_platform_irq.c +++ b/drivers/vfio/platform/vfio_platform_irq.c @@ -139,10 +139,9 @@ static int vfio_platform_set_irq_unmask(struct vfio_platform_device *vdev, static irqreturn_t vfio_automasked_irq_handler(int irq, void *dev_id) { struct vfio_platform_irq *irq_ctx = dev_id; - unsigned long flags; int ret = IRQ_NONE; - spin_lock_irqsave(&irq_ctx->lock, flags); + spin_lock(&irq_ctx->lock); if (!irq_ctx->masked) { ret = IRQ_HANDLED; @@ -152,7 +151,7 @@ static irqreturn_t vfio_automasked_irq_handler(int irq, void *dev_id) irq_ctx->masked = true; } - spin_unlock_irqrestore(&irq_ctx->lock, flags); + spin_unlock(&irq_ctx->lock); if (ret == IRQ_HANDLED) eventfd_signal(irq_ctx->trigger, 1); -- 2.7.4