Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp1744550iof; Tue, 7 Jun 2022 10:39:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwN9kIZ3NYmx8Tq0kiib5DTjtHgCXJMQLlLP8EojIx/6w7XIVcnlTKDLulyX/glX1JNd38u X-Received: by 2002:a17:907:c21:b0:70b:735f:55aa with SMTP id ga33-20020a1709070c2100b0070b735f55aamr25708823ejc.332.1654623566426; Tue, 07 Jun 2022 10:39:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654623566; cv=none; d=google.com; s=arc-20160816; b=biJkbKFOuWJ8TjMXVDhNh4lONFFnX7gRKJL2+PGpaFX0DmKq5lfcyAze9Fq7r06qz5 RTt1L9JQdU1F3CG8KVDrz56JXYS+XY8l9fadqqS8TazRJDpynlEUjd9bwr6dRWee5/V/ GgP/Kb9nWw3DNqWHgHn/4MoEioV7uoCg9qwJKlzmF2XqVICLagI+KsKsv/uX0ZyMKhH3 R6NvB5BvZk15YQDsgxkw2RBAzVwlbLn27crNdyBfX7L1uYWQg+Icwy/5U4NgBFSTh6xY WaV9Wsashv1g3gPNetepwvTD2xhrLkrCqpWuav3N2kmGn0ts56ZySYCKxp36/JL6mU2n Xzzw== 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 :message-id:date:subject:cc:to:from; bh=5nHO6QLVovF2NCuA5v97DsZuEDDtxN9OUksoaxRfBuM=; b=rxCuItn7lXjNgFaQwEydbAdjjBv5wVhqZPMMbReHAjA86lkUrw3KetLiOmmY/1yN8M fAFYoqRP+6SjcqgtSVGvEQXrS6ArKRQh0qwTD7ghYlFzShh11t+9Oqim1iXH3yKsL8AI /LRBLjSUww3ImT+dFyPi7ftOtcp4mt/zXgoakPP+f9cdmOGFH60xJasI4Pcs96hvYYB7 riotgjRCsSABzuSC4Can66q7LmMNRZ62ZbXYqS8geG7rgoCZDS4PHhpsQhioprA3jMaU pgWRV3KFIbxM7jn7vd5Fwk1MwF2oAHE6XXYs6aD0TZ7tQ9w09EvTnzrSyqRv0ZmIlkt/ FQKg== 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=NONE sp=NONE dis=NONE) header.from=zbhlos.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mp12-20020a1709071b0c00b006ff1a60c3ebsi10320294ejc.821.2022.06.07.10.38.57; Tue, 07 Jun 2022 10:39:26 -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=NONE sp=NONE dis=NONE) header.from=zbhlos.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238045AbiFGIL0 (ORCPT + 99 others); Tue, 7 Jun 2022 04:11:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53908 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232035AbiFGILY (ORCPT ); Tue, 7 Jun 2022 04:11:24 -0400 Received: from mail-m17635.qiye.163.com (mail-m17635.qiye.163.com [59.111.176.35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 306C1B0A76 for ; Tue, 7 Jun 2022 01:11:22 -0700 (PDT) Received: from localhost.localdomain (unknown [IPV6:240e:36a:1490:f100:dfad:59db:22ac:33c8]) by mail-m17635.qiye.163.com (Hmail) with ESMTPA id DF55740063E; Tue, 7 Jun 2022 16:11:18 +0800 (CST) From: Yupeng Li To: chenhc@lemote.com, ralf@linux-mips.org, paul.burton@mips.com, jhogan@kernel.org Cc: linux-kernel@vger.kernel.org, linux-mips@linux-mips.org, caizp2008@163.com, Yupeng Li Subject: [PATCH 1/1] MIPS: Replace setup_irq() by request_irq() Date: Tue, 7 Jun 2022 16:11:06 +0800 Message-Id: <20220607081106.3999978-1-liyupeng@zbhlos.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-HM-Spam-Status: e1kfGhgUHx5ZQUtXWQgPGg8OCBgUHx5ZQUlOS1dZCBgUCR5ZQVlLVUtZV1 kWDxoPAgseWUFZKDYvK1lXWShZQUhPN1dZLVlBSVdZDwkaFQgSH1lBWRkdSkNWGhpJH0JMHU8dQk wZVRMBExYaEhckFA4PWVdZFhoPEhUdFFlBWU9LSFVKSktITUpVS1kG X-HM-Sender-Digest: e1kMHhlZQR0aFwgeV1kSHx4VD1lBWUc6MAg6Lxw5GT0yVhBRHzAaKDQt HxwKCTRVSlVKTU5PTkNCT0NLTkpMVTMWGhIXVRcSAg4LHhUcOwEZExcUCFUYFBZFWVdZEgtZQVlJ T0seQUhNGkFKT0JLQR1KS0tBHx0aH0FOQh8ZQUlJGhhBSEgYQ1lXWQgBWUFIS09JNwY+ X-HM-Tid: 0a813d37dccdd991kuwsdf55740063e X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 commit ac8fd122e070 ("MIPS: Replace setup_irq() by request_irq()") request_irq() is preferred over setup_irq(). Invocations of setup_irq() occur after memory allocators are ready. Per tglx[1], setup_irq() existed in olden days when allocators were not ready by the time early interrupts were initialized. Hence replace setup_irq() by request_irq(). remove_irq() has been replaced by free_irq() as well. There were build error's during previous version, couple of which was reported by kbuild test robot of which one was reported by Thomas Bogendoerfer as well. There were a few more issues including build errors, those also have been fixed. [1] https://lkml.kernel.org/r/alpine.DEB.2.20.1710191609480.1971@nanos Signed-off-by: Yupeng Li --- arch/mips/loongson64/loongson-3/hpet.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/arch/mips/loongson64/loongson-3/hpet.c b/arch/mips/loongson64/loongson-3/hpet.c index ed15430ad64f..e4282592575b 100644 --- a/arch/mips/loongson64/loongson-3/hpet.c +++ b/arch/mips/loongson64/loongson-3/hpet.c @@ -187,12 +187,6 @@ static irqreturn_t hpet_irq_handler(int irq, void *data) return IRQ_NONE; } -static struct irqaction hpet_irq = { - .handler = hpet_irq_handler, - .flags = IRQF_NOBALANCING | IRQF_TIMER, - .name = "hpet", -}; - /* * hpet address assignation and irq setting should be done in bios. * but pmon don't do this, we just setup here directly. @@ -224,6 +218,7 @@ static void hpet_setup(void) void __init setup_hpet_timer(void) { + unsigned long flags = IRQF_NOBALANCING | IRQF_TIMER; unsigned int cpu = smp_processor_id(); struct clock_event_device *cd; @@ -247,7 +242,8 @@ void __init setup_hpet_timer(void) cd->min_delta_ticks = HPET_MIN_PROG_DELTA; clockevents_register_device(cd); - setup_irq(HPET_T0_IRQ, &hpet_irq); + if (request_irq(HPET_T0_IRQ, hpet_irq_handler, flags, "hpet", NULL)) + pr_err("Failed to request irq %d (hpet)\n", HPET_T0_IRQ); pr_info("hpet clock event device register\n"); } -- 2.34.1