From nobody Mon Dec 27 06:55:05 2021 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 A0ED11927D1F; Mon, 27 Dec 2021 06:55:06 +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 4JMpMG0w3hz4TH2; Mon, 27 Dec 2021 06:55:06 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 F38A11974E; Mon, 27 Dec 2021 06:55:05 +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 1BR6t5UN049727; Mon, 27 Dec 2021 06:55:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1BR6t5mr049726; Mon, 27 Dec 2021 06:55:05 GMT (envelope-from git) Date: Mon, 27 Dec 2021 06:55:05 GMT Message-Id: <202112270655.1BR6t5mr049726@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Xin LI Subject: git: a6f70ce9fca7 - stable/13 - sys/dev/arcmsr: Update Areca RAID driver to fix some issues on ARC-1886. 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: delphij X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: a6f70ce9fca731beabd3b0987bcb62ebeef70eaa Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1640588106; 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=bPEI5iKsMxuu4Fc7H01faZDHlEa/QQUfZK9olXuN7zY=; b=wYrhd605Z3id5PNBOOl2/+6uaCW3VYn0ylLEUQY0VKeY5r8IjCnrdx+HVLEMpwjY+bJ0Re zEUYXe6AQMvU1dfe7yQcxxx5Fw52TgpmwXoZdakgKCF9I1f8rZ79049csIpbFbKgfnMVlW GldFcx+2vRtepONDkwmTtFguS4FrpbRYnDU1e3x0GbFymM75inJP+3V/T/BbJ9fqDSaXFa RiOgfvq+7buIpl7moDr25DAnSGeFckxc6vi6tgBIYQJU/8cpE6If6Ov3exiyeQNyDARNIx IdmU2bzbc/aQX1Y9fOZKbTPd9tjvqY/iarmzf8Gn/v8EWEyzCcIQpASHJqNsrQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1640588106; a=rsa-sha256; cv=none; b=qwdH7+ebCaaijs5egrypsLcsghetyd7xoREQeuFT2+Hyf96YgBAxmnyUuhrf7uZdpGZCNp 6k5gxjAK8JppCNQyyRIBvYQ1t+uy/Qire9lCKr12GPTL8z3JUPLDiYNFCb9IVsASlX+8ba IzaMjEyXjIhrbcU/vEpk13SY2A0X8cYSGWME991z06VIFtVAwrQoJvGOIxoE9nvzJ1F/Y0 zUZmx1a6a1VyuOQ+yXY3OCjg+2SUedlGS82ohke44dSc2RuWmusU4zT7aA9XHAbP3QCt/F vk1k1it6GDI7gRAvEie8Fq0KGP5UbLOT/Fela6sFPThB6udBZEpNTXqcEVElAA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=a6f70ce9fca731beabd3b0987bcb62ebeef70eaa commit a6f70ce9fca731beabd3b0987bcb62ebeef70eaa Author: 黃清隆 AuthorDate: 2021-12-13 16:09:15 +0000 Commit: Xin LI CommitDate: 2021-12-27 06:54:48 +0000 sys/dev/arcmsr: Update Areca RAID driver to fix some issues on ARC-1886. 1. Doorbell interrupt status may arrive lately when doorbell interrupt on ARC-1886. 2. System boot up hung when ARC-1886 with no volume created or no device attached. Many thanks to Areca for continuing to support FreeBSD. (cherry picked from commit 6964b77e598597789764ab6949a8031c14075a25) --- sys/dev/arcmsr/arcmsr.c | 41 ++++++++++++++++++++++++++++++++++++++--- 1 file changed, 38 insertions(+), 3 deletions(-) diff --git a/sys/dev/arcmsr/arcmsr.c b/sys/dev/arcmsr/arcmsr.c index f7f913de89af..f91877f92e02 100644 --- a/sys/dev/arcmsr/arcmsr.c +++ b/sys/dev/arcmsr/arcmsr.c @@ -85,6 +85,8 @@ ** 1.50.00.01 02/26/2021 Ching Huang Fixed no action of hot plugging device on type_F adapter ** 1.50.00.02 04/16/2021 Ching Huang Fixed scsi command timeout on ARC-1886 when ** scatter-gather count large than some number +** 1.50.00.03 05/04/2021 Ching Huang Fixed doorbell status arrived late on ARC-1886 +** 1.50.00.04 12/08/2021 Ching Huang Fixed boot up hung under ARC-1886 with no volume created ****************************************************************************************** */ @@ -142,7 +144,7 @@ __FBSDID("$FreeBSD$"); #define arcmsr_callout_init(a) callout_init(a, /*mpsafe*/1); -#define ARCMSR_DRIVER_VERSION "arcmsr version 1.50.00.02 2021-04-16" +#define ARCMSR_DRIVER_VERSION "arcmsr version 1.50.00.04 2021-12-08" #include /* ************************************************************************** @@ -2033,6 +2035,39 @@ static void arcmsr_hbe_doorbell_isr(struct AdapterControlBlock *acb) ************************************************************************** ************************************************************************** */ +static void arcmsr_hbf_doorbell_isr(struct AdapterControlBlock *acb) +{ + u_int32_t doorbell_status, in_doorbell; + + /* + ******************************************************************* + ** Maybe here we need to check wrqbuffer_lock is lock or not + ** DOORBELL: din! don! + ** check if there are any mail need to pack from firmware + ******************************************************************* + */ + while(1) { + in_doorbell = CHIP_REG_READ32(HBE_MessageUnit, 0, iobound_doorbell); + if ((in_doorbell != 0) && (in_doorbell != 0xFFFFFFFF)) + break; + } + CHIP_REG_WRITE32(HBE_MessageUnit, 0, host_int_status, 0); /* clear doorbell interrupt */ + doorbell_status = in_doorbell ^ acb->in_doorbell; + if(doorbell_status & ARCMSR_HBEMU_IOP2DRV_DATA_WRITE_OK) { + arcmsr_iop2drv_data_wrote_handle(acb); + } + if(doorbell_status & ARCMSR_HBEMU_IOP2DRV_DATA_READ_OK) { + arcmsr_iop2drv_data_read_handle(acb); + } + if(doorbell_status & ARCMSR_HBEMU_IOP2DRV_MESSAGE_CMD_DONE) { + arcmsr_hbe_message_isr(acb); /* messenger of "driver to iop commands" */ + } + acb->in_doorbell = in_doorbell; +} +/* +************************************************************************** +************************************************************************** +*/ static void arcmsr_hba_postqueue_isr(struct AdapterControlBlock *acb) { u_int32_t flag_srb; @@ -2406,7 +2441,7 @@ static void arcmsr_handle_hbf_isr( struct AdapterControlBlock *acb) do { /* MU doorbell interrupts*/ if(host_interrupt_status & ARCMSR_HBEMU_OUTBOUND_DOORBELL_ISR) { - arcmsr_hbe_doorbell_isr(acb); + arcmsr_hbf_doorbell_isr(acb); } /* MU post queue interrupts*/ if(host_interrupt_status & ARCMSR_HBEMU_OUTBOUND_POSTQUEUE_ISR) { @@ -4832,9 +4867,9 @@ static u_int32_t arcmsr_initialize(device_t dev) acb->in_doorbell = 0; acb->out_doorbell = 0; acb->rid[0] = rid0; - arcmsr_wait_firmware_ready(acb); CHIP_REG_WRITE32(HBF_MessageUnit, 0, host_int_status, 0); /*clear interrupt*/ CHIP_REG_WRITE32(HBF_MessageUnit, 0, iobound_doorbell, ARCMSR_HBEMU_DOORBELL_SYNC); /* synchronize doorbell to 0 */ + arcmsr_wait_firmware_ready(acb); host_buffer_dma = acb->completeQ_phys + COMPLETION_Q_POOL_SIZE; CHIP_REG_WRITE32(HBF_MessageUnit, 0, inbound_msgaddr0, (u_int32_t)(host_buffer_dma | 1)); /* host buffer low addr, bit0:1 all buffer active */ CHIP_REG_WRITE32(HBF_MessageUnit, 0, inbound_msgaddr1, (u_int32_t)((host_buffer_dma >> 16) >> 16));/* host buffer high addr */