From owner-svn-src-head@freebsd.org Mon Mar 9 19:01:18 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1289626A391; Mon, 9 Mar 2020 19:01:18 +0000 (UTC) (envelope-from luporl@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) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48bncs6qN5z4V32; Mon, 9 Mar 2020 19:01:17 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E5803F661; Mon, 9 Mar 2020 19:01:17 +0000 (UTC) (envelope-from luporl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 029J1Hc9009104; Mon, 9 Mar 2020 19:01:17 GMT (envelope-from luporl@FreeBSD.org) Received: (from luporl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 029J1Ha3009103; Mon, 9 Mar 2020 19:01:17 GMT (envelope-from luporl@FreeBSD.org) Message-Id: <202003091901.029J1Ha3009103@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: luporl set sender to luporl@FreeBSD.org using -f From: Leandro Lupori Date: Mon, 9 Mar 2020 19:01:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r358814 - head/sys/dev/aacraid X-SVN-Group: head X-SVN-Commit-Author: luporl X-SVN-Commit-Paths: head/sys/dev/aacraid X-SVN-Commit-Revision: 358814 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Mar 2020 19:01:18 -0000 Author: luporl Date: Mon Mar 9 19:01:17 2020 New Revision: 358814 URL: https://svnweb.freebsd.org/changeset/base/358814 Log: [aacraid] Handle both AIF and SYNC interrupts Without this change, if an AIF interrupt comes at the same time a SYNC command is finished, the SYNC interrupt will be lost. This happens because all interrupt bits (bellbits) are cleared, but only one of them is handled. Debugging shows that, (at least) when !sc->msi_enabled and (sc->flags & AAC_FLAGS_SYNC_MODE) is true (sync mode), both bits may be set at the same time. PR: 237463 Reviewed by: scottl Sponsored by: Eldorado Research Institute (eldorado.org.br) Differential Revision: https://reviews.freebsd.org/D23859 Modified: head/sys/dev/aacraid/aacraid.c Modified: head/sys/dev/aacraid/aacraid.c ============================================================================== --- head/sys/dev/aacraid/aacraid.c Mon Mar 9 16:02:54 2020 (r358813) +++ head/sys/dev/aacraid/aacraid.c Mon Mar 9 19:01:17 2020 (r358814) @@ -899,7 +899,7 @@ aacraid_new_intr_type1(void *arg) AAC_MEM0_SETREG4(sc, AAC_SRC_ODBR_C, bellbits); if (bellbits_shifted & AAC_DB_AIF_PENDING) mode |= AAC_INT_MODE_AIF; - else if (bellbits_shifted & AAC_DB_SYNC_COMMAND) + if (bellbits_shifted & AAC_DB_SYNC_COMMAND) mode |= AAC_INT_MODE_SYNC; } /* ODR readback, Prep #238630 */ @@ -923,7 +923,10 @@ aacraid_new_intr_type1(void *arg) sc->flags &= ~AAC_QUEUE_FRZN; sc->aac_sync_cm = NULL; } - mode = 0; + if (mode & AAC_INT_MODE_INTX) + mode &= ~AAC_INT_MODE_SYNC; + else + mode = 0; } if (mode & AAC_INT_MODE_AIF) { @@ -932,6 +935,9 @@ aacraid_new_intr_type1(void *arg) mode = 0; } } + + if (sc->flags & AAC_FLAGS_SYNC_MODE) + mode = 0; if (mode) { /* handle async. status */