From nobody Wed Jun 28 17:03:34 2023 X-Original-To: dev-commits-src-all@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 4QrnwQ3Vwfz4kxBm; Wed, 28 Jun 2023 17:03:34 +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 4QrnwQ2fVSz3QtH; Wed, 28 Jun 2023 17:03:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1687971814; 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=nkj+qE2SYxU/6xiNVGQg6q5mr98XUhE9FUNeWaMol4c=; b=PV4Hyqr35JmdvjODi0gN3FnNJUufA4UCOT7qISe6m6hgscWaPr0pA3rxqNLM1kDtMZPKDf nH0Kf0fywAoqqxjJ4LRoEaoBrFGVKKNw5ounurphE8xGu+wp49/IVspJd/nbOY4VdnGjeJ ZPlOIaogjBF48hCi80CfSw06ZnChRwgqdR9fi12woyT0ijT2hTJqWB0wa66dj2QUkZz7Cb TdCyWGYAifdBWnYih+HRK72rQ+w7J1lkX1qlyiYL4Gs0zxXOQU94DUQjdWmbNCFrFB+Mq6 L9NK03cn8P+YI3xStyoNo1cnksM4F0xSkXimvhPvYrojHeq7+IkDorrr1Skoxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1687971814; 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=nkj+qE2SYxU/6xiNVGQg6q5mr98XUhE9FUNeWaMol4c=; b=q9lD+xs66cSz93UK3honrwmdaOugI8WRhYY8qYUkunqp+/d2GjnX2800TXQFxAN8nh+LOq ygWZXrFkvm4VuY/lSjrsIght1tqEpK8OM65bpULLS20rZp8M1/ecdpCnuQc8KMiAbXY3nx gYQ7HYLkL8lU6MtMnuT8nZK7TZDSZjHHzD3xTf0YNY0dmabJJKhqG2hDt97OouTSrDWTV+ u9K4B0X5M15OHOAPpg7fi6H2IsM6g2MinA7FWM39cuwL5K3R51pS1GWFA5bthRdyB64WPU QYIkdCod2Sb7WDHHxXaJAlxgoIAWKkRzufRxGSfJ83yF4ULFUa+q/gb5lo+KKQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1687971814; a=rsa-sha256; cv=none; b=OvEaGLW8ZU/Lq6tLDxmgLrI6fAhoWC/N8RyxDqf+HXhWB9n0lfcSUPd1120lKeJPRkJ3Af o9UG8FFvmCrfAuVuO172gT4ltVBbg4WsK8DDCo61/p3VQS3rKZ4l/m+0k5DTglLWHg4vOu R/xCDomX80i1xrcx4vSrogsfQRCKxHza0F14CYOmlpnrPBf7Vk+aPwUYsYUBX+y99Cv4tN EPbWgNbnn6BRx9wrdvLaaG5NZtQ0W0KMJytsSBmc1Plps2nGAYluNLvVf3F56rQI7C6I6a EmH9z84x1DCoWcqPtoQyVA0qonTAka6ChVN0Au7H1y4mYO62TP+OyXl3Txm53w== 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 4QrnwQ1cm5zhlb; Wed, 28 Jun 2023 17:03:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 35SH3YZ3091870; Wed, 28 Jun 2023 17:03:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 35SH3YHA091869; Wed, 28 Jun 2023 17:03:34 GMT (envelope-from git) Date: Wed, 28 Jun 2023 17:03:34 GMT Message-Id: <202306281703.35SH3YHA091869@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 9beb195fd9fd - main - Continue searching for an irq map from the start List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9beb195fd9fdc4beb7d5bca865cf5b19ccd7449b Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=9beb195fd9fdc4beb7d5bca865cf5b19ccd7449b commit 9beb195fd9fdc4beb7d5bca865cf5b19ccd7449b Author: Andrew Turner AuthorDate: 2023-06-27 08:32:12 +0000 Commit: Andrew Turner CommitDate: 2023-06-28 17:03:08 +0000 Continue searching for an irq map from the start When searching for a free irq map location continue the search from the beginning of the list. There may be holes in the map before irq_map_first_free_idx, e.g. when removing an entries in order will increase the index past the current free entry. PR: 271990 Reviewed by: mhorne Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D40768 --- sys/kern/subr_intr.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sys/kern/subr_intr.c b/sys/kern/subr_intr.c index 5c7c99f458c1..ab882209c1e3 100644 --- a/sys/kern/subr_intr.c +++ b/sys/kern/subr_intr.c @@ -1720,6 +1720,14 @@ intr_map_irq(device_t dev, intptr_t xref, struct intr_map_data *data) return (i); } } + for (i = 0; i < irq_map_first_free_idx; i++) { + if (irq_map[i] == NULL) { + irq_map[i] = entry; + irq_map_first_free_idx = i + 1; + mtx_unlock(&irq_map_lock); + return (i); + } + } mtx_unlock(&irq_map_lock); /* XXX Expand irq_map table */