From nobody Mon Dec 27 06:56:07 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 4CBE319000A9; Mon, 27 Dec 2021 06:56:08 +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 4JMpNS0NHmz4TLj; Mon, 27 Dec 2021 06:56:08 +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 E1114197F3; Mon, 27 Dec 2021 06:56:07 +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 1BR6u7ph049934; Mon, 27 Dec 2021 06:56:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1BR6u7ua049933; Mon, 27 Dec 2021 06:56:07 GMT (envelope-from git) Date: Mon, 27 Dec 2021 06:56:07 GMT Message-Id: <202112270656.1BR6u7ua049933@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: fd724d863e38 - stable/12 - 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/12 X-Git-Reftype: branch X-Git-Commit: fd724d863e388349f2d04a1d8558e5516e3eb714 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1640588168; 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=eciO3/0yaV+B9ugd/LQV48SEr/kAtMlqcuY2HEWljKs=; b=p0SOsiYlVN5BRN3udfB40e6k8S1cZDzbaVRpWlSWwmvadcgRy7OkJkxsGn0dAToeSWffEe SBSU+FQSmd6xs6TKhQ/50koL/M7kSUY9Yg4+jl1vGdDNM36CPt5w13Tg31AtZ2LvSubuQ9 qRDzCiTnIgADEQz/KQptfiM0k9Ftu+NgIT6Pnnb12/K4UD0cYBTec7KQAcuafRtFGvWAvR vahbvyUbM4Fm4Sf4OxQuJQ7fuD44+USc9nqYsHq7mmINj995wypzMlowQEUPMpicUViiv3 JEC6Yz094075X55qikz4XB68k2ROCD7k1HkDrq4yy29zH3UD8npSCGE4+C9BTw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1640588168; a=rsa-sha256; cv=none; b=UFtoNfwHsaVSi+n0rskeINuey48BqChSCqeAovgqjdZKEc5DGVxGPKvtvvW8blBXid3xkA VlrCzgdMSPDUIU4APubpgVYdT3/bA1znxqB25BetUfDMy3pDUsFWOFWK7+dE9liZOMHrGB SzQDMjbR6g0ebh5MORrLA2ygiu6/jYCUo1J1yHuc2DlRNS8meIBDe6G//fkKt46XaP5DUJ 2nqDV9UwitplJPk+28o+s/qFXw2M2S9vUT0Bx7qE+pC1c6t7u102U7ZQ/tONdGYhvYB4EB GUJL3b6oGUS9tCZRnmsSX4BDxKDhDpAUNi68IxuYmYD0xBM7nj503h1ZaG3Fhg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=fd724d863e388349f2d04a1d8558e5516e3eb714 commit fd724d863e388349f2d04a1d8558e5516e3eb714 Author: 黃清隆 AuthorDate: 2021-12-13 16:09:15 +0000 Commit: Xin LI CommitDate: 2021-12-27 06:55:50 +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 375f1f114d13..fd9dfb0b138b 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 /* ************************************************************************** @@ -2034,6 +2036,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; @@ -2407,7 +2442,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) { @@ -4833,9 +4868,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 */