From nobody Thu Aug 17 22:11:30 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4RRfNg04q6z4qDlf; Thu, 17 Aug 2023 22:11:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RRfNf6Y7bz4ZRm; Thu, 17 Aug 2023 22:11:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1692310290; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AWIkz1CLZ5tAK1a7IWsrLFx+z11kJvB6L6ee0cZQB4c=; b=tgifz7Sp2yFPSQaGX1MQW0V0gkmpISGZuHMxf2P6FYsWvoCMYNL0aDlZDFcriZF7z4z+A2 xPlXCbWTSr3nI1bIgGoBiTwsL+q8YMPJtOfkHGJikDS1DyMNFryGdw49GXqe6m4gHZHlIG O8EHXzdJPpcazyHbBIA/PIlWIbKzcaZH4PAKGrQwxwprk5D0+5oivQedZUFp0w45sFqIn2 W6bHA2FJcELXR0wDSB+7AxjYq6fZ/Kbf95vcLhKwoijF13T4rOBGefXTUet8LN/OzJUncp LpuAROm4cy6c/YGQUa5Z1VY/EgHHLM3p1p/FUvmA3uNZwpAAnL72+TL/KBm52A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1692310290; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=AWIkz1CLZ5tAK1a7IWsrLFx+z11kJvB6L6ee0cZQB4c=; b=XLPHFdpd6TZp7H6leoh+pQAaoGkRNIK17ogn3MdWo8XScAn4fLL1LNEf5lazOljDzMQ71Q 9RSa7Y4cowsVqvZD4YhiWHxycSPiWco8xr1GJc+v8moG3cNZ9oDA2NZ9seZgAnnsO8Ndtv S7UekW6nbybY32mP1nKMnXx/n3QHsXb7CxnCPSnmCt3CnmqRrdFwmPOjCkTefcz5CmU/cd 3ZAnKS2GNsT/1lPG1vl/2fP3+Ei3m6BUMiExVE2TrECNt4y2zIbyb/fuoFYOBX6uSgqMbt 1+8uvc1lwBlO3g4hfcyAGnGTYKEeXqTAU+xwEFWmPP6lIR4Pb4AfZ3zf254Z+A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1692310290; a=rsa-sha256; cv=none; b=OMNRXULTRYDPE2r7i5N1xu7SInN2gNVgyoEsIEV6SgymKjRpOdJ0x/uGjeyh4KYGgYlG6v OxlMPKVjLZO/MtWDq3Cg83oOUhXxCdE4EENmgqMa1dhG4uRRoNldJVn28ZQExarwDxYYCd Yd/h34+ZKYuVxcbOs4ysvq7cAa4aH4zgMk02XjCG+DjOMH2TiV+LaF3yFvXLXBoEFS9FkY 3cw9TOx1Fw6ekeCcvz9C/CUWYUF6qTd2Yi/LZKJ3aiKI8vw1eQ7iz2dwAFBKCH5Mm6Yr7I fad8OTBteY0rloL8ucpf24dpYoKpc8pAPlY/m3i32Zy7hNEe3v8b2w12dzbKTQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4RRfNf5bhpzrbT; Thu, 17 Aug 2023 22:11:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 37HMBU6B011757; Thu, 17 Aug 2023 22:11:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 37HMBU8b011754; Thu, 17 Aug 2023 22:11:30 GMT (envelope-from git) Date: Thu, 17 Aug 2023 22:11:30 GMT Message-Id: <202308172211.37HMBU8b011754@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: d8099e33c79b - main - intr: move MAX_STRAY_LOG to interrupt.h List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d8099e33c79b98666232c73d9ceee62fff853fad Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=d8099e33c79b98666232c73d9ceee62fff853fad commit d8099e33c79b98666232c73d9ceee62fff853fad Author: Elliott Mitchell AuthorDate: 2022-06-19 15:05:20 +0000 Commit: Mark Johnston CommitDate: 2023-08-17 22:10:02 +0000 intr: move MAX_STRAY_LOG to interrupt.h The two interrupt controllers which implement squelching of reports after a maximum use the same limit. Move the limit to interrupt.h, the better to encourage other interrupt controllers to implement the same. Reviewed by: markj MFC after: 2 weks Differential Revision: https://reviews.freebsd.org/D35527 --- sys/powerpc/powerpc/intr_machdep.c | 8 +++----- sys/sys/interrupt.h | 3 +++ sys/x86/x86/intr_machdep.c | 6 ++---- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/sys/powerpc/powerpc/intr_machdep.c b/sys/powerpc/powerpc/intr_machdep.c index 605f436804d4..d64d15775ab5 100644 --- a/sys/powerpc/powerpc/intr_machdep.c +++ b/sys/powerpc/powerpc/intr_machdep.c @@ -87,8 +87,6 @@ #include "pic_if.h" -#define MAX_STRAY_LOG 5 - static MALLOC_DEFINE(M_INTR, "intr", "interrupt handler data"); struct powerpc_intr { @@ -660,11 +658,11 @@ powerpc_dispatch_intr(u_int vector, struct trapframe *tf) stray: stray_count++; - if (stray_count <= MAX_STRAY_LOG) { + if (stray_count <= INTR_STRAY_LOG_MAX) { printf("stray irq %d\n", i ? i->irq : -1); - if (stray_count >= MAX_STRAY_LOG) { + if (stray_count >= INTR_STRAY_LOG_MAX) { printf("got %d stray interrupts, not logging anymore\n", - MAX_STRAY_LOG); + INTR_STRAY_LOG_MAX); } } if (i != NULL) diff --git a/sys/sys/interrupt.h b/sys/sys/interrupt.h index 9eeda4a3ed16..9fa0adf9139f 100644 --- a/sys/sys/interrupt.h +++ b/sys/sys/interrupt.h @@ -148,6 +148,9 @@ struct intr_event { #define SWI_TQ 6 #define SWI_TQ_GIANT 6 +/* Maximum number of stray interrupts to log */ +#define INTR_STRAY_LOG_MAX 5 + struct proc; extern struct intr_event *clk_intr_event; diff --git a/sys/x86/x86/intr_machdep.c b/sys/x86/x86/intr_machdep.c index e53d86a8cef8..4a1bc942234a 100644 --- a/sys/x86/x86/intr_machdep.c +++ b/sys/x86/x86/intr_machdep.c @@ -72,8 +72,6 @@ #include -#define MAX_STRAY_LOG 5 - typedef void (*mask_fn)(void *); static int intrcnt_index; @@ -355,9 +353,9 @@ intr_execute_handlers(struct intsrc *isrc, struct trapframe *frame) if (intr_event_handle(ie, frame) != 0) { isrc->is_pic->pic_disable_source(isrc, PIC_EOI); (*isrc->is_straycount)++; - if (*isrc->is_straycount < MAX_STRAY_LOG) + if (*isrc->is_straycount < INTR_STRAY_LOG_MAX) log(LOG_ERR, "stray irq%d\n", vector); - else if (*isrc->is_straycount == MAX_STRAY_LOG) + else if (*isrc->is_straycount == INTR_STRAY_LOG_MAX) log(LOG_CRIT, "too many stray irq %d's: not logging anymore\n", vector);