Bug#826004: linux: Update arcmsr to include support for newer controller types (ARC1203)
Source: linux
Version: 3.16.7-ckt7-1
Severity: important
Control: fixed -1 4.5~rc4-1~exp1
Hi,
This is a request to update drivers/scsi/arcmsr to include commits up
to the 4.5-rc1 commits and include support Areca's new PCIe to SATA
RAID adapter ARC1203.
Initial proposed patchset/debdiff for the jessie brach is attached,
and review welcome.
Regards,
Salvatore
>From 1d2a1d2899d92577e12b7b4e5839059d580a0c49 Mon Sep 17 00:00:00 2001
From: Salvatore Bonaccorso <carnil@debian.org>
Date: Wed, 1 Jun 2016 07:20:44 +0200
Subject: [PATCH] arcmsr: Backport changes up to Linux 4.5
---
debian/changelog | 3 +
...cmsr-fix-command-timeout-under-heavy-load.patch | 5 +-
...d-code-to-support-msi-x-and-msi-interrupt.patch | 7 +-
...03-arcmsr-add-code-to-support-hibernation.patch | 7 +-
...limit-max.-number-of-scsi-command-request.patch | 5 +-
...005-arcmsr-return-status-of-abort-command.patch | 2 +-
...arcmsr-store-adapter-type-in-pci-id-table.patch | 5 +-
...se-message_isr_bh_fn-to-remove-duplicate-.patch | 5 +-
...ove-calling-arcmsr_hbb_enable_driver_mode.patch | 5 +-
...fy-printing-adapter-model-number-and-f-w-.patch | 5 +-
...clear-outbound-doorbell-buffer-completely.patch | 5 +-
...011-arcmsr-rename-functions-and-variables.patch | 5 +-
...se-allocation-of-second-dma_coherent_hand.patch | 5 +-
...ioctl-data-read-write-error-for-adapter-t.patch | 5 +-
...014-arcmsr-fix-sparse-warnings-and-errors.patch | 5 +-
...0015-arcmsr-modify-some-character-strings.patch | 5 +-
...sr-add-support-new-adapter-arc12x4-series.patch | 5 +-
...-scsi_scan_host-at-the-end-of-host-initia.patch | 5 +-
...lify-of-updating-doneq_index-and-postq_in.patch | 5 +-
...019-arcmsr-simplify-ioctl-data-read-write.patch | 5 +-
...sr-fixed-getting-wrong-configuration-data.patch | 64 +++++
...cmsr-fixes-not-release-allocated-resource.patch | 43 ++++
.../0022-arcmsr-make-code-more-readable.patch | 58 +++++
...-code-to-support-new-Areca-adapter-ARC120.patch | 113 +++++++++
...0024-arcmsr-changes-driver-version-number.patch | 31 +++
...0025-arcmsr-more-readability-improvements.patch | 99 ++++++++
...t-dma-resource-allocation-to-a-new-functi.patch | 261 +++++++++++++++++++++
...ge-driver-version-to-v1.30.00.22-20151126.patch | 30 +++
debian/patches/series | 10 +-
29 files changed, 786 insertions(+), 22 deletions(-)
create mode 100644 debian/patches/features/all/arcmsr/0020-arcmsr-fixed-getting-wrong-configuration-data.patch
create mode 100644 debian/patches/features/all/arcmsr/0021-arcmsr-fixes-not-release-allocated-resource.patch
create mode 100644 debian/patches/features/all/arcmsr/0022-arcmsr-make-code-more-readable.patch
create mode 100644 debian/patches/features/all/arcmsr/0023-arcmsr-adds-code-to-support-new-Areca-adapter-ARC120.patch
create mode 100644 debian/patches/features/all/arcmsr/0024-arcmsr-changes-driver-version-number.patch
create mode 100644 debian/patches/features/all/arcmsr/0025-arcmsr-more-readability-improvements.patch
create mode 100644 debian/patches/features/all/arcmsr/0026-arcmsr-Split-dma-resource-allocation-to-a-new-functi.patch
create mode 100644 debian/patches/features/all/arcmsr/0027-arcmsr-change-driver-version-to-v1.30.00.22-20151126.patch
diff --git a/debian/changelog b/debian/changelog
index 98964b3..7b444b7 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -327,6 +327,9 @@ linux (3.16.35-1) UNRELEASED; urgency=medium
[ Aurelien Jarno ]
* [mips*] Emulate unaligned LDXC1 and SDXC1 instructions.
+ [ Salvatore Bonaccorso ]
+ * arcmsr: Backport changes up to Linux 4.5
+
-- Ben Hutchings <ben@decadent.org.uk> Sat, 30 Apr 2016 22:07:22 +0200
linux (3.16.7-ckt25-2) jessie; urgency=medium
diff --git a/debian/patches/features/all/arcmsr/0001-arcmsr-fix-command-timeout-under-heavy-load.patch b/debian/patches/features/all/arcmsr/0001-arcmsr-fix-command-timeout-under-heavy-load.patch
index 0a3cd49..37b2c93 100644
--- a/debian/patches/features/all/arcmsr/0001-arcmsr-fix-command-timeout-under-heavy-load.patch
+++ b/debian/patches/features/all/arcmsr/0001-arcmsr-fix-command-timeout-under-heavy-load.patch
@@ -1,6 +1,6 @@
From: Ching Huang <ching2048@areca.com.tw>
Date: Tue, 19 Aug 2014 14:18:24 +0800
-Subject: [01/19] arcmsr: fix command timeout under heavy load
+Subject: [01/27] arcmsr: fix command timeout under heavy load
Origin: https://git.kernel.org/linus/6b3937227479e50032112faf74bd913f36dba2c6
Bug-Debian: https://bugs.debian.org/698821
@@ -279,3 +279,6 @@ index b13764c..506fe7b 100644
}
static void arcmsr_iop_parking(struct AdapterControlBlock *acb)
+--
+2.8.1
+
diff --git a/debian/patches/features/all/arcmsr/0002-arcmsr-add-code-to-support-msi-x-and-msi-interrupt.patch b/debian/patches/features/all/arcmsr/0002-arcmsr-add-code-to-support-msi-x-and-msi-interrupt.patch
index ffcebf1..31c46c2 100644
--- a/debian/patches/features/all/arcmsr/0002-arcmsr-add-code-to-support-msi-x-and-msi-interrupt.patch
+++ b/debian/patches/features/all/arcmsr/0002-arcmsr-add-code-to-support-msi-x-and-msi-interrupt.patch
@@ -1,6 +1,6 @@
From: Ching Huang <ching2048@areca.com.tw>
Date: Tue, 19 Aug 2014 14:23:31 +0800
-Subject: [02/19] arcmsr: add code to support MSI-X and MSI interrupt
+Subject: [02/27] arcmsr: add code to support MSI-X and MSI interrupt
Origin: https://git.kernel.org/linus/1d1166ea16ac7047a1b01f20dcbcc6f7754c3c23
Bug-Debian: https://bugs.debian.org/698821
@@ -52,7 +52,7 @@ index 8f35793..1c64b60 100644
/*
*******************************************************************************
diff --git a/drivers/scsi/arcmsr/arcmsr_hba.c b/drivers/scsi/arcmsr/arcmsr_hba.c
-index 506fe7b..60227d56 100644
+index 506fe7b..60227d5 100644
--- a/drivers/scsi/arcmsr/arcmsr_hba.c
+++ b/drivers/scsi/arcmsr/arcmsr_hba.c
@@ -603,6 +603,56 @@ static void arcmsr_message_isr_bh_fn(struct work_struct *work)
@@ -213,3 +213,6 @@ index 506fe7b..60227d56 100644
}
break;
case ACB_ADAPTER_TYPE_C: {
+--
+2.8.1
+
diff --git a/debian/patches/features/all/arcmsr/0003-arcmsr-add-code-to-support-hibernation.patch b/debian/patches/features/all/arcmsr/0003-arcmsr-add-code-to-support-hibernation.patch
index bb54dcc..904119d 100644
--- a/debian/patches/features/all/arcmsr/0003-arcmsr-add-code-to-support-hibernation.patch
+++ b/debian/patches/features/all/arcmsr/0003-arcmsr-add-code-to-support-hibernation.patch
@@ -1,6 +1,6 @@
From: Ching Huang <ching2048@areca.com.tw>
Date: Tue, 19 Aug 2014 14:26:09 +0800
-Subject: [03/19] arcmsr: add code to support hibernation
+Subject: [03/27] arcmsr: add code to support hibernation
Origin: https://git.kernel.org/linus/61cda87f33be22828c3b52863da1c456ba108d37
Bug-Debian: https://bugs.debian.org/698821
@@ -14,7 +14,7 @@ Signed-off-by: Christoph Hellwig <hch@lst.de>
1 file changed, 76 insertions(+)
diff --git a/drivers/scsi/arcmsr/arcmsr_hba.c b/drivers/scsi/arcmsr/arcmsr_hba.c
-index 60227d56..b338a3b 100644
+index 60227d5..b338a3b 100644
--- a/drivers/scsi/arcmsr/arcmsr_hba.c
+++ b/drivers/scsi/arcmsr/arcmsr_hba.c
@@ -89,11 +89,15 @@ static int arcmsr_bios_param(struct scsi_device *sdev,
@@ -119,3 +119,6 @@ index 60227d56..b338a3b 100644
static uint8_t arcmsr_abort_hba_allcmd(struct AdapterControlBlock *acb)
{
struct MessageUnit_A __iomem *reg = acb->pmuA;
+--
+2.8.1
+
diff --git a/debian/patches/features/all/arcmsr/0004-arcmsr-limit-max.-number-of-scsi-command-request.patch b/debian/patches/features/all/arcmsr/0004-arcmsr-limit-max.-number-of-scsi-command-request.patch
index 88a9251..5096907 100644
--- a/debian/patches/features/all/arcmsr/0004-arcmsr-limit-max.-number-of-scsi-command-request.patch
+++ b/debian/patches/features/all/arcmsr/0004-arcmsr-limit-max.-number-of-scsi-command-request.patch
@@ -1,6 +1,6 @@
From: Ching Huang <ching2048@areca.com.tw>
Date: Tue, 19 Aug 2014 14:29:41 +0800
-Subject: [04/19] arcmsr: limit max. number of SCSI command request
+Subject: [04/27] arcmsr: limit max. number of SCSI command request
Origin: https://git.kernel.org/linus/3df824aff935444601101cc329ebe3f52e126a4e
Bug-Debian: https://bugs.debian.org/698821
@@ -106,3 +106,6 @@ index b338a3b..ed61ee2 100644
}
static int arcmsr_polling_hba_ccbdone(struct AdapterControlBlock *acb,
+--
+2.8.1
+
diff --git a/debian/patches/features/all/arcmsr/0005-arcmsr-return-status-of-abort-command.patch b/debian/patches/features/all/arcmsr/0005-arcmsr-return-status-of-abort-command.patch
index c21b190..93596af 100644
--- a/debian/patches/features/all/arcmsr/0005-arcmsr-return-status-of-abort-command.patch
+++ b/debian/patches/features/all/arcmsr/0005-arcmsr-return-status-of-abort-command.patch
@@ -1,6 +1,6 @@
From: Ching Huang <ching2048@areca.com.tw>
Date: Tue, 19 Aug 2014 14:47:16 +0800
-Subject: [05/19] arcmsr: return status of abort command
+Subject: [05/27] arcmsr: return status of abort command
Origin: https://git.kernel.org/linus/cab5aecee60a7930ca208ee723c18be7b400cfaf
Bug-Debian: https://bugs.debian.org/698821
diff --git a/debian/patches/features/all/arcmsr/0006-arcmsr-store-adapter-type-in-pci-id-table.patch b/debian/patches/features/all/arcmsr/0006-arcmsr-store-adapter-type-in-pci-id-table.patch
index 402de8b..8b0e505 100644
--- a/debian/patches/features/all/arcmsr/0006-arcmsr-store-adapter-type-in-pci-id-table.patch
+++ b/debian/patches/features/all/arcmsr/0006-arcmsr-store-adapter-type-in-pci-id-table.patch
@@ -1,6 +1,6 @@
From: Ching Huang <ching2048@areca.com.tw>
Date: Tue, 19 Aug 2014 14:55:57 +0800
-Subject: [06/19] arcmsr: store adapter type in PCI id table
+Subject: [06/27] arcmsr: store adapter type in PCI id table
Origin: https://git.kernel.org/linus/8b7c994298d7a18f45a9cec2e9b496d9784b1135
Bug-Debian: https://bugs.debian.org/698821
@@ -121,3 +121,6 @@ index 87f3882..30b378c 100644
error = arcmsr_remap_pciregion(acb);
if(!error){
goto pci_release_regs;
+--
+2.8.1
+
diff --git a/debian/patches/features/all/arcmsr/0007-arcmsr-revise-message_isr_bh_fn-to-remove-duplicate-.patch b/debian/patches/features/all/arcmsr/0007-arcmsr-revise-message_isr_bh_fn-to-remove-duplicate-.patch
index f42c9bd..b8f3940 100644
--- a/debian/patches/features/all/arcmsr/0007-arcmsr-revise-message_isr_bh_fn-to-remove-duplicate-.patch
+++ b/debian/patches/features/all/arcmsr/0007-arcmsr-revise-message_isr_bh_fn-to-remove-duplicate-.patch
@@ -1,6 +1,6 @@
From: Ching Huang <ching2048@areca.com.tw>
Date: Tue, 19 Aug 2014 14:59:00 +0800
-Subject: [07/19] arcmsr: revise message_isr_bh_fn to remove duplicate code
+Subject: [07/27] arcmsr: revise message_isr_bh_fn to remove duplicate code
Origin: https://git.kernel.org/linus/12aad94792718c6a79bbd395a650caff85f76ae4
Bug-Debian: https://bugs.debian.org/698821
@@ -192,3 +192,6 @@ index 30b378c..bfe2ac4 100644
}
}
+--
+2.8.1
+
diff --git a/debian/patches/features/all/arcmsr/0008-arcmsr-remove-calling-arcmsr_hbb_enable_driver_mode.patch b/debian/patches/features/all/arcmsr/0008-arcmsr-remove-calling-arcmsr_hbb_enable_driver_mode.patch
index 10aa0e8..d9c2eea 100644
--- a/debian/patches/features/all/arcmsr/0008-arcmsr-remove-calling-arcmsr_hbb_enable_driver_mode.patch
+++ b/debian/patches/features/all/arcmsr/0008-arcmsr-remove-calling-arcmsr_hbb_enable_driver_mode.patch
@@ -1,6 +1,6 @@
From: Ching Huang <ching2048@areca.com.tw>
Date: Tue, 19 Aug 2014 15:01:28 +0800
-Subject: [08/19] arcmsr: remove calling arcmsr_hbb_enable_driver_mode
+Subject: [08/27] arcmsr: remove calling arcmsr_hbb_enable_driver_mode
Origin: https://git.kernel.org/linus/a5849726bc88506e84e5754d6bfde81ba091f24d
Bug-Debian: https://bugs.debian.org/698821
@@ -50,3 +50,6 @@ index bfe2ac4..5dd520b 100644
}
break;
case ACB_ADAPTER_TYPE_C: {
+--
+2.8.1
+
diff --git a/debian/patches/features/all/arcmsr/0009-arcmsr-modify-printing-adapter-model-number-and-f-w-.patch b/debian/patches/features/all/arcmsr/0009-arcmsr-modify-printing-adapter-model-number-and-f-w-.patch
index 5702964..05ffd29 100644
--- a/debian/patches/features/all/arcmsr/0009-arcmsr-modify-printing-adapter-model-number-and-f-w-.patch
+++ b/debian/patches/features/all/arcmsr/0009-arcmsr-modify-printing-adapter-model-number-and-f-w-.patch
@@ -1,6 +1,6 @@
From: Ching Huang <ching2048@areca.com.tw>
Date: Tue, 19 Aug 2014 15:03:55 +0800
-Subject: [09/19] arcmsr: modify printing adapter model number and F/W messages
+Subject: [09/27] arcmsr: modify printing adapter model number and F/W messages
Origin: https://git.kernel.org/linus/a2c89bbccac476d42a8526c0c59d081d9e56d0a8
Bug-Debian: https://bugs.debian.org/698821
@@ -59,3 +59,6 @@ index 5dd520b..0707677 100644
pACB->firm_request_len = readl(®->msgcode_rwbuffer[1]); /*firm_request_len,1,04-07*/
pACB->firm_numbers_queue = readl(®->msgcode_rwbuffer[2]); /*firm_numbers_queue,2,08-11*/
pACB->firm_sdram_size = readl(®->msgcode_rwbuffer[3]); /*firm_sdram_size,3,12-15*/
+--
+2.8.1
+
diff --git a/debian/patches/features/all/arcmsr/0010-arcmsr-clear-outbound-doorbell-buffer-completely.patch b/debian/patches/features/all/arcmsr/0010-arcmsr-clear-outbound-doorbell-buffer-completely.patch
index 18c6b34..a2027be 100644
--- a/debian/patches/features/all/arcmsr/0010-arcmsr-clear-outbound-doorbell-buffer-completely.patch
+++ b/debian/patches/features/all/arcmsr/0010-arcmsr-clear-outbound-doorbell-buffer-completely.patch
@@ -1,6 +1,6 @@
From: Ching Huang <ching2048@areca.com.tw>
Date: Tue, 19 Aug 2014 15:07:35 +0800
-Subject: [10/19] arcmsr: clear outbound doorbell buffer completely
+Subject: [10/27] arcmsr: clear outbound doorbell buffer completely
Origin: https://git.kernel.org/linus/5eb6bfa02a9dfecbb1f644a0b13b16cd3d23770b
Bug-Debian: https://bugs.debian.org/698821
@@ -55,3 +55,6 @@ index 0707677..3363c31 100644
/* enable outbound Post Queue,outbound doorbell Interrupt */
arcmsr_enable_outbound_ints(acb, intmask_org);
atomic_set(&acb->rq_map_token, 16);
+--
+2.8.1
+
diff --git a/debian/patches/features/all/arcmsr/0011-arcmsr-rename-functions-and-variables.patch b/debian/patches/features/all/arcmsr/0011-arcmsr-rename-functions-and-variables.patch
index c2b18f4..0af319d 100644
--- a/debian/patches/features/all/arcmsr/0011-arcmsr-rename-functions-and-variables.patch
+++ b/debian/patches/features/all/arcmsr/0011-arcmsr-rename-functions-and-variables.patch
@@ -1,6 +1,6 @@
From: Ching Huang <ching2048@areca.com.tw>
Date: Tue, 19 Aug 2014 15:10:12 +0800
-Subject: [11/19] arcmsr: rename functions and variables
+Subject: [11/27] arcmsr: rename functions and variables
Origin: https://git.kernel.org/linus/626fa32c801ed583594831051ff9fd56f2e6d261
Bug-Debian: https://bugs.debian.org/698821
@@ -855,3 +855,6 @@ index 3363c31..7253323 100644
printk(KERN_NOTICE "ARCMSR IOP enables EOI_MODE TIMEOUT");
return;
}
+--
+2.8.1
+
diff --git a/debian/patches/features/all/arcmsr/0012-arcmsr-revise-allocation-of-second-dma_coherent_hand.patch b/debian/patches/features/all/arcmsr/0012-arcmsr-revise-allocation-of-second-dma_coherent_hand.patch
index b5aeee9..af4724b 100644
--- a/debian/patches/features/all/arcmsr/0012-arcmsr-revise-allocation-of-second-dma_coherent_hand.patch
+++ b/debian/patches/features/all/arcmsr/0012-arcmsr-revise-allocation-of-second-dma_coherent_hand.patch
@@ -1,6 +1,6 @@
From: Ching Huang <ching2048@areca.com.tw>
Date: Tue, 19 Aug 2014 15:14:14 +0800
-Subject: [12/19] arcmsr: revise allocation of second dma_coherent_handle for
+Subject: [12/27] arcmsr: revise allocation of second dma_coherent_handle for
type B
Origin: https://git.kernel.org/linus/6e38adfc58406e7ea6f6701c49abaf046ce076a8
Bug-Debian: https://bugs.debian.org/698821
@@ -132,3 +132,6 @@ index 7253323..fc0dfbc 100644
/* ccb maxQ size must be --> [(256 + 8)*4]*/
writel(1056, rwbuffer);
+--
+2.8.1
+
diff --git a/debian/patches/features/all/arcmsr/0013-arcmsr-fix-ioctl-data-read-write-error-for-adapter-t.patch b/debian/patches/features/all/arcmsr/0013-arcmsr-fix-ioctl-data-read-write-error-for-adapter-t.patch
index 426a6ff..3244dd4 100644
--- a/debian/patches/features/all/arcmsr/0013-arcmsr-fix-ioctl-data-read-write-error-for-adapter-t.patch
+++ b/debian/patches/features/all/arcmsr/0013-arcmsr-fix-ioctl-data-read-write-error-for-adapter-t.patch
@@ -1,6 +1,6 @@
From: Ching Huang <ching2048@areca.com.tw>
Date: Tue, 19 Aug 2014 15:17:45 +0800
-Subject: [13/19] arcmsr: fix ioctl data read/write error for adapter type C
+Subject: [13/27] arcmsr: fix ioctl data read/write error for adapter type C
Origin: https://git.kernel.org/linus/bb263c4ecbb186fe394c6c9acc32d8c59b6a7bdd
Bug-Debian: https://bugs.debian.org/698821
@@ -960,3 +960,6 @@ index fc0dfbc..1576805 100644
return retvalue;
}
+--
+2.8.1
+
diff --git a/debian/patches/features/all/arcmsr/0014-arcmsr-fix-sparse-warnings-and-errors.patch b/debian/patches/features/all/arcmsr/0014-arcmsr-fix-sparse-warnings-and-errors.patch
index 100c1fd..9c2c8cd 100644
--- a/debian/patches/features/all/arcmsr/0014-arcmsr-fix-sparse-warnings-and-errors.patch
+++ b/debian/patches/features/all/arcmsr/0014-arcmsr-fix-sparse-warnings-and-errors.patch
@@ -1,6 +1,6 @@
From: Ching Huang <ching2048@areca.com.tw>
Date: Tue, 19 Aug 2014 15:20:31 +0800
-Subject: [14/19] arcmsr: fix sparse warnings and errors
+Subject: [14/27] arcmsr: fix sparse warnings and errors
Origin: https://git.kernel.org/linus/c10b1d544aaaf98ab1792845c106471ee1ee0c05
Bug-Debian: https://bugs.debian.org/698821
@@ -314,3 +314,6 @@ index 1576805..34a43ed 100644
uint32_t outbound_doorbell, i;
/* empty doorbell Qbuffer if door bell ringed */
outbound_doorbell = readl(®->outbound_doorbell);
+--
+2.8.1
+
diff --git a/debian/patches/features/all/arcmsr/0015-arcmsr-modify-some-character-strings.patch b/debian/patches/features/all/arcmsr/0015-arcmsr-modify-some-character-strings.patch
index b974084..a7cb680 100644
--- a/debian/patches/features/all/arcmsr/0015-arcmsr-modify-some-character-strings.patch
+++ b/debian/patches/features/all/arcmsr/0015-arcmsr-modify-some-character-strings.patch
@@ -1,6 +1,6 @@
From: Ching Huang <ching2048@areca.com.tw>
Date: Tue, 19 Aug 2014 15:22:45 +0800
-Subject: [15/19] arcmsr: modify some character strings
+Subject: [15/27] arcmsr: modify some character strings
Origin: https://git.kernel.org/linus/aaa64f69480bcde4e203584dfc77d7e4ffb737d6
Bug-Debian: https://bugs.debian.org/698821
@@ -73,3 +73,6 @@ index 34a43ed..26bcdc0 100644
+ type, raid6 ? "(RAID6 capable)" : "", ARCMSR_DRIVER_VERSION);
return buf;
}
+--
+2.8.1
+
diff --git a/debian/patches/features/all/arcmsr/0016-arcmsr-add-support-new-adapter-arc12x4-series.patch b/debian/patches/features/all/arcmsr/0016-arcmsr-add-support-new-adapter-arc12x4-series.patch
index 3d83fe8..80b0834 100644
--- a/debian/patches/features/all/arcmsr/0016-arcmsr-add-support-new-adapter-arc12x4-series.patch
+++ b/debian/patches/features/all/arcmsr/0016-arcmsr-add-support-new-adapter-arc12x4-series.patch
@@ -1,6 +1,6 @@
From: Ching Huang <ching2048@areca.com.tw>
Date: Tue, 19 Aug 2014 15:25:22 +0800
-Subject: [16/19] arcmsr: add support new adapter ARC12x4 series
+Subject: [16/27] arcmsr: add support new adapter ARC12x4 series
Origin: https://git.kernel.org/linus/5b37479adee7164b17b6e2030b9a30d04583eb61
Bug-Debian: https://bugs.debian.org/698821
@@ -1255,3 +1255,6 @@ index 26bcdc0..b3cb969 100644
case PCI_DEVICE_ID_ARECA_1380:
case PCI_DEVICE_ID_ARECA_1381:
case PCI_DEVICE_ID_ARECA_1680:
+--
+2.8.1
+
diff --git a/debian/patches/features/all/arcmsr/0017-arcmsr-call-scsi_scan_host-at-the-end-of-host-initia.patch b/debian/patches/features/all/arcmsr/0017-arcmsr-call-scsi_scan_host-at-the-end-of-host-initia.patch
index a38b6bd..9cc20ee 100644
--- a/debian/patches/features/all/arcmsr/0017-arcmsr-call-scsi_scan_host-at-the-end-of-host-initia.patch
+++ b/debian/patches/features/all/arcmsr/0017-arcmsr-call-scsi_scan_host-at-the-end-of-host-initia.patch
@@ -1,6 +1,6 @@
From: Ching Huang <ching2048@areca.com.tw>
Date: Tue, 19 Aug 2014 15:28:36 +0800
-Subject: [17/19] arcmsr: call scsi_scan_host at the end of host initialization
+Subject: [17/27] arcmsr: call scsi_scan_host at the end of host initialization
Origin: https://git.kernel.org/linus/b4eb6ae9075a958ffe24620f985f6bd729a1b138
Bug-Debian: https://bugs.debian.org/698821
@@ -61,3 +61,6 @@ index b3cb969..3d3cdfe 100644
arcmsr_free_ccb_pool(acb);
free_hbb_mu:
arcmsr_free_mu(acb);
+--
+2.8.1
+
diff --git a/debian/patches/features/all/arcmsr/0018-arcmsr-simplify-of-updating-doneq_index-and-postq_in.patch b/debian/patches/features/all/arcmsr/0018-arcmsr-simplify-of-updating-doneq_index-and-postq_in.patch
index bd6743e..e096f7e 100644
--- a/debian/patches/features/all/arcmsr/0018-arcmsr-simplify-of-updating-doneq_index-and-postq_in.patch
+++ b/debian/patches/features/all/arcmsr/0018-arcmsr-simplify-of-updating-doneq_index-and-postq_in.patch
@@ -1,6 +1,6 @@
From: Ching Huang <ching2048@areca.com.tw>
Date: Mon, 15 Sep 2014 19:05:33 +0800
-Subject: [18/19] arcmsr: simplify of updating doneq_index and postq_index
+Subject: [18/27] arcmsr: simplify of updating doneq_index and postq_index
Origin: https://git.kernel.org/linus/3b8155d582968f79a62c79358d5e137f99f04407
Bug-Debian: https://bugs.debian.org/698821
@@ -230,3 +230,6 @@ index 3d3cdfe..0dd38cc 100644
flag_ccb = pmu->done_qbuffer[doneq_index & 0xFFF].addressLow;
ccb_cdb_phy = (flag_ccb & 0xFFFFFFF0);
arcmsr_cdb = (struct ARCMSR_CDB *)(acb->vir2phy_offset +
+--
+2.8.1
+
diff --git a/debian/patches/features/all/arcmsr/0019-arcmsr-simplify-ioctl-data-read-write.patch b/debian/patches/features/all/arcmsr/0019-arcmsr-simplify-ioctl-data-read-write.patch
index bbc0834..1e08001 100644
--- a/debian/patches/features/all/arcmsr/0019-arcmsr-simplify-ioctl-data-read-write.patch
+++ b/debian/patches/features/all/arcmsr/0019-arcmsr-simplify-ioctl-data-read-write.patch
@@ -1,6 +1,6 @@
From: Ching Huang <ching2048@areca.com.tw>
Date: Wed, 24 Sep 2014 17:33:34 +0800
-Subject: [19/19] arcmsr: simplify ioctl data read/write
+Subject: [19/27] arcmsr: simplify ioctl data read/write
Origin: https://git.kernel.org/linus/2e9feb434a66311f30bde2430a5609e9e24df62b
Bug-Debian: https://bugs.debian.org/698821
@@ -604,3 +604,6 @@ index 0dd38cc..0b44fb5 100644
pQbuffer = acb->wqbuffer;
memset(pQbuffer, 0, sizeof(struct QBUFFER));
spin_unlock_irqrestore(&acb->wqbuffer_lock, flags);
+--
+2.8.1
+
diff --git a/debian/patches/features/all/arcmsr/0020-arcmsr-fixed-getting-wrong-configuration-data.patch b/debian/patches/features/all/arcmsr/0020-arcmsr-fixed-getting-wrong-configuration-data.patch
new file mode 100644
index 0000000..8541f12
--- /dev/null
+++ b/debian/patches/features/all/arcmsr/0020-arcmsr-fixed-getting-wrong-configuration-data.patch
@@ -0,0 +1,64 @@
+From: Ching Huang <ching2048@areca.com.tw>
+Date: Wed, 25 Nov 2015 19:36:02 +0800
+Subject: [20/27] arcmsr: fixed getting wrong configuration data
+Origin: https://git.kernel.org/linus/251e2d25bfb72b69edd414abfa42a41191d9657a
+
+Fixed getting wrong configuration data of adapter type B and type D.
+
+Signed-off-by: Ching Huang <ching2048@areca.com.tw>
+Reviewed-by: Hannes Reinicke <hare@suse.de>
+Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
+Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
+---
+ drivers/scsi/arcmsr/arcmsr_hba.c | 20 ++++++++++----------
+ 1 file changed, 10 insertions(+), 10 deletions(-)
+
+diff --git a/drivers/scsi/arcmsr/arcmsr_hba.c b/drivers/scsi/arcmsr/arcmsr_hba.c
+index 333db59..397cdd5 100644
+--- a/drivers/scsi/arcmsr/arcmsr_hba.c
++++ b/drivers/scsi/arcmsr/arcmsr_hba.c
+@@ -2694,15 +2694,15 @@ static bool arcmsr_hbaB_get_config(struct AdapterControlBlock *acb)
+ acb->firm_model,
+ acb->firm_version);
+
+- acb->signature = readl(®->message_rwbuffer[1]);
++ acb->signature = readl(®->message_rwbuffer[0]);
+ /*firm_signature,1,00-03*/
+- acb->firm_request_len = readl(®->message_rwbuffer[2]);
++ acb->firm_request_len = readl(®->message_rwbuffer[1]);
+ /*firm_request_len,1,04-07*/
+- acb->firm_numbers_queue = readl(®->message_rwbuffer[3]);
++ acb->firm_numbers_queue = readl(®->message_rwbuffer[2]);
+ /*firm_numbers_queue,2,08-11*/
+- acb->firm_sdram_size = readl(®->message_rwbuffer[4]);
++ acb->firm_sdram_size = readl(®->message_rwbuffer[3]);
+ /*firm_sdram_size,3,12-15*/
+- acb->firm_hd_channels = readl(®->message_rwbuffer[5]);
++ acb->firm_hd_channels = readl(®->message_rwbuffer[4]);
+ /*firm_ide_channels,4,16-19*/
+ acb->firm_cfg_version = readl(®->message_rwbuffer[25]); /*firm_cfg_version,25,100-103*/
+ /*firm_ide_channels,4,16-19*/
+@@ -2880,15 +2880,15 @@ static bool arcmsr_hbaD_get_config(struct AdapterControlBlock *acb)
+ iop_device_map++;
+ count--;
+ }
+- acb->signature = readl(®->msgcode_rwbuffer[1]);
++ acb->signature = readl(®->msgcode_rwbuffer[0]);
+ /*firm_signature,1,00-03*/
+- acb->firm_request_len = readl(®->msgcode_rwbuffer[2]);
++ acb->firm_request_len = readl(®->msgcode_rwbuffer[1]);
+ /*firm_request_len,1,04-07*/
+- acb->firm_numbers_queue = readl(®->msgcode_rwbuffer[3]);
++ acb->firm_numbers_queue = readl(®->msgcode_rwbuffer[2]);
+ /*firm_numbers_queue,2,08-11*/
+- acb->firm_sdram_size = readl(®->msgcode_rwbuffer[4]);
++ acb->firm_sdram_size = readl(®->msgcode_rwbuffer[3]);
+ /*firm_sdram_size,3,12-15*/
+- acb->firm_hd_channels = readl(®->msgcode_rwbuffer[5]);
++ acb->firm_hd_channels = readl(®->msgcode_rwbuffer[4]);
+ /*firm_hd_channels,4,16-19*/
+ acb->firm_cfg_version = readl(®->msgcode_rwbuffer[25]);
+ pr_notice("Areca RAID Controller%d: Model %s, F/W %s\n",
+--
+2.8.1
+
diff --git a/debian/patches/features/all/arcmsr/0021-arcmsr-fixes-not-release-allocated-resource.patch b/debian/patches/features/all/arcmsr/0021-arcmsr-fixes-not-release-allocated-resource.patch
new file mode 100644
index 0000000..f4348d5
--- /dev/null
+++ b/debian/patches/features/all/arcmsr/0021-arcmsr-fixes-not-release-allocated-resource.patch
@@ -0,0 +1,43 @@
+From: Ching Huang <ching2048@areca.com.tw>
+Date: Wed, 25 Nov 2015 19:41:23 +0800
+Subject: [21/27] arcmsr: fixes not release allocated resource
+Origin: https://git.kernel.org/linus/98f90debc2b64a40a416dd9794ac2d8de6b43af2
+
+Releasing allocated resource if get configuration data failed.
+
+Signed-off-by: Ching Huang <ching2048@areca.com.tw>
+Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
+Reviewed-by: Hannes Reinicke <hare@suse.de>
+Reviewed-by: Tomas Henzl <thenzl@redhat.com>
+Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
+---
+ drivers/scsi/arcmsr/arcmsr_hba.c | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/scsi/arcmsr/arcmsr_hba.c b/drivers/scsi/arcmsr/arcmsr_hba.c
+index 397cdd5..41f9a00 100644
+--- a/drivers/scsi/arcmsr/arcmsr_hba.c
++++ b/drivers/scsi/arcmsr/arcmsr_hba.c
+@@ -2664,7 +2664,7 @@ static bool arcmsr_hbaB_get_config(struct AdapterControlBlock *acb)
+ if (!arcmsr_hbaB_wait_msgint_ready(acb)) {
+ printk(KERN_NOTICE "arcmsr%d: wait 'get adapter firmware \
+ miscellaneous data' timeout \n", acb->host->host_no);
+- return false;
++ goto err_free_dma;
+ }
+ count = 8;
+ while (count){
+@@ -2707,6 +2707,10 @@ static bool arcmsr_hbaB_get_config(struct AdapterControlBlock *acb)
+ acb->firm_cfg_version = readl(®->message_rwbuffer[25]); /*firm_cfg_version,25,100-103*/
+ /*firm_ide_channels,4,16-19*/
+ return true;
++err_free_dma:
++ dma_free_coherent(&acb->pdev->dev, acb->roundup_ccbsize,
++ acb->dma_coherent2, acb->dma_coherent_handle2);
++ return false;
+ }
+
+ static bool arcmsr_hbaC_get_config(struct AdapterControlBlock *pACB)
+--
+2.8.1
+
diff --git a/debian/patches/features/all/arcmsr/0022-arcmsr-make-code-more-readable.patch b/debian/patches/features/all/arcmsr/0022-arcmsr-make-code-more-readable.patch
new file mode 100644
index 0000000..fb23cb8
--- /dev/null
+++ b/debian/patches/features/all/arcmsr/0022-arcmsr-make-code-more-readable.patch
@@ -0,0 +1,58 @@
+From: Ching Huang <ching2048@areca.com.tw>
+Date: Wed, 25 Nov 2015 19:45:16 +0800
+Subject: [22/27] arcmsr: make code more readable
+Origin: https://git.kernel.org/linus/d662ad246256e33eb9b25c8e801f4487527f2bfe
+
+[mkp: Fixed checkpatch whitespace warning]
+
+Signed-off-by: Ching Huang <ching2048@areca.com.tw>
+Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
+Reviewed-by: Hannes Reinicke <hare@suse.de>
+Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
+---
+ drivers/scsi/arcmsr/arcmsr.h | 3 +++
+ drivers/scsi/arcmsr/arcmsr_hba.c | 14 +++++++-------
+ 2 files changed, 10 insertions(+), 7 deletions(-)
+
+diff --git a/drivers/scsi/arcmsr/arcmsr.h b/drivers/scsi/arcmsr/arcmsr.h
+index 3bcaaac..48931bd 100644
+--- a/drivers/scsi/arcmsr/arcmsr.h
++++ b/drivers/scsi/arcmsr/arcmsr.h
+@@ -288,6 +288,9 @@ struct FIRMWARE_INFO
+ #define ARCMSR_MESSAGE_RBUFFER 0x0000ff00
+ /* iop message_rwbuffer for message command */
+ #define ARCMSR_MESSAGE_RWBUFFER 0x0000fa00
++
++#define MEM_BASE0(x) (u32 __iomem *)((unsigned long)acb->mem_base0 + x)
++#define MEM_BASE1(x) (u32 __iomem *)((unsigned long)acb->mem_base1 + x)
+ /*
+ ************************************************************************
+ ** SPEC. for Areca HBC adapter
+diff --git a/drivers/scsi/arcmsr/arcmsr_hba.c b/drivers/scsi/arcmsr/arcmsr_hba.c
+index 41f9a00..077c3ec 100644
+--- a/drivers/scsi/arcmsr/arcmsr_hba.c
++++ b/drivers/scsi/arcmsr/arcmsr_hba.c
+@@ -2649,13 +2649,13 @@ static bool arcmsr_hbaB_get_config(struct AdapterControlBlock *acb)
+ acb->dma_coherent2 = dma_coherent;
+ reg = (struct MessageUnit_B *)dma_coherent;
+ acb->pmuB = reg;
+- reg->drv2iop_doorbell= (uint32_t __iomem *)((unsigned long)acb->mem_base0 + ARCMSR_DRV2IOP_DOORBELL);
+- reg->drv2iop_doorbell_mask = (uint32_t __iomem *)((unsigned long)acb->mem_base0 + ARCMSR_DRV2IOP_DOORBELL_MASK);
+- reg->iop2drv_doorbell = (uint32_t __iomem *)((unsigned long)acb->mem_base0 + ARCMSR_IOP2DRV_DOORBELL);
+- reg->iop2drv_doorbell_mask = (uint32_t __iomem *)((unsigned long)acb->mem_base0 + ARCMSR_IOP2DRV_DOORBELL_MASK);
+- reg->message_wbuffer = (uint32_t __iomem *)((unsigned long)acb->mem_base1 + ARCMSR_MESSAGE_WBUFFER);
+- reg->message_rbuffer = (uint32_t __iomem *)((unsigned long)acb->mem_base1 + ARCMSR_MESSAGE_RBUFFER);
+- reg->message_rwbuffer = (uint32_t __iomem *)((unsigned long)acb->mem_base1 + ARCMSR_MESSAGE_RWBUFFER);
++ reg->drv2iop_doorbell = MEM_BASE0(ARCMSR_DRV2IOP_DOORBELL);
++ reg->drv2iop_doorbell_mask = MEM_BASE0(ARCMSR_DRV2IOP_DOORBELL_MASK);
++ reg->iop2drv_doorbell = MEM_BASE0(ARCMSR_IOP2DRV_DOORBELL);
++ reg->iop2drv_doorbell_mask = MEM_BASE0(ARCMSR_IOP2DRV_DOORBELL_MASK);
++ reg->message_wbuffer = MEM_BASE1(ARCMSR_MESSAGE_WBUFFER);
++ reg->message_rbuffer = MEM_BASE1(ARCMSR_MESSAGE_RBUFFER);
++ reg->message_rwbuffer = MEM_BASE1(ARCMSR_MESSAGE_RWBUFFER);
+ iop_firm_model = (char __iomem *)(®->message_rwbuffer[15]); /*firm_model,15,60-67*/
+ iop_firm_version = (char __iomem *)(®->message_rwbuffer[17]); /*firm_version,17,68-83*/
+ iop_device_map = (char __iomem *)(®->message_rwbuffer[21]); /*firm_version,21,84-99*/
+--
+2.8.1
+
diff --git a/debian/patches/features/all/arcmsr/0023-arcmsr-adds-code-to-support-new-Areca-adapter-ARC120.patch b/debian/patches/features/all/arcmsr/0023-arcmsr-adds-code-to-support-new-Areca-adapter-ARC120.patch
new file mode 100644
index 0000000..01ed61d
--- /dev/null
+++ b/debian/patches/features/all/arcmsr/0023-arcmsr-adds-code-to-support-new-Areca-adapter-ARC120.patch
@@ -0,0 +1,113 @@
+From: Ching Huang <ching2048@areca.com.tw>
+Date: Wed, 25 Nov 2015 19:49:33 +0800
+Subject: [23/27] arcmsr: adds code to support new Areca adapter ARC1203
+Origin: https://git.kernel.org/linus/7e315ffd49b906fc545b8e0312eedeed738796c9
+
+Support Areca's new PCIe to SATA RAID adapter ARC1203.
+
+Signed-off-by: Ching Huang <ching2048@areca.com.tw>
+Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
+Reviewed-by: Hannes Reinicke <hare@suse.de>
+Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
+[carnil: adjust context for 3.16]
+---
+ drivers/scsi/arcmsr/arcmsr.h | 9 +++++++++
+ drivers/scsi/arcmsr/arcmsr_hba.c | 27 ++++++++++++++++++++++-----
+ 2 files changed, 31 insertions(+), 5 deletions(-)
+
+--- a/drivers/scsi/arcmsr/arcmsr.h
++++ b/drivers/scsi/arcmsr/arcmsr.h
+@@ -74,6 +74,9 @@ struct device_attribute;
+ #ifndef PCI_DEVICE_ID_ARECA_1214
+ #define PCI_DEVICE_ID_ARECA_1214 0x1214
+ #endif
++#ifndef PCI_DEVICE_ID_ARECA_1203
++ #define PCI_DEVICE_ID_ARECA_1203 0x1203
++#endif
+ /*
+ **********************************************************************************
+ **
+@@ -245,6 +248,12 @@ struct FIRMWARE_INFO
+ /* window of "instruction flags" from iop to driver */
+ #define ARCMSR_IOP2DRV_DOORBELL 0x00020408
+ #define ARCMSR_IOP2DRV_DOORBELL_MASK 0x0002040C
++/* window of "instruction flags" from iop to driver */
++#define ARCMSR_IOP2DRV_DOORBELL_1203 0x00021870
++#define ARCMSR_IOP2DRV_DOORBELL_MASK_1203 0x00021874
++/* window of "instruction flags" from driver to iop */
++#define ARCMSR_DRV2IOP_DOORBELL_1203 0x00021878
++#define ARCMSR_DRV2IOP_DOORBELL_MASK_1203 0x0002187C
+ /* ARECA FLAG LANGUAGE */
+ /* ioctl transfer */
+ #define ARCMSR_IOP2DRV_DATA_WRITE_OK 0x00000001
+--- a/drivers/scsi/arcmsr/arcmsr_hba.c
++++ b/drivers/scsi/arcmsr/arcmsr_hba.c
+@@ -114,6 +114,7 @@ static void arcmsr_hardware_reset(struct
+ static const char *arcmsr_info(struct Scsi_Host *);
+ static irqreturn_t arcmsr_interrupt(struct AdapterControlBlock *acb);
+ static void arcmsr_free_irq(struct pci_dev *, struct AdapterControlBlock *);
++static void arcmsr_wait_firmware_ready(struct AdapterControlBlock *acb);
+ static int arcmsr_adjust_disk_queue_depth(struct scsi_device *sdev,
+ int queue_depth, int reason)
+ {
+@@ -162,6 +163,8 @@ static struct pci_device_id arcmsr_devic
+ .driver_data = ACB_ADAPTER_TYPE_B},
+ {PCI_DEVICE(PCI_VENDOR_ID_ARECA, PCI_DEVICE_ID_ARECA_1202),
+ .driver_data = ACB_ADAPTER_TYPE_B},
++ {PCI_DEVICE(PCI_VENDOR_ID_ARECA, PCI_DEVICE_ID_ARECA_1203),
++ .driver_data = ACB_ADAPTER_TYPE_B},
+ {PCI_DEVICE(PCI_VENDOR_ID_ARECA, PCI_DEVICE_ID_ARECA_1210),
+ .driver_data = ACB_ADAPTER_TYPE_A},
+ {PCI_DEVICE(PCI_VENDOR_ID_ARECA, PCI_DEVICE_ID_ARECA_1214),
+@@ -2629,7 +2632,7 @@ static bool arcmsr_hbaA_get_config(struc
+ }
+ static bool arcmsr_hbaB_get_config(struct AdapterControlBlock *acb)
+ {
+- struct MessageUnit_B *reg = acb->pmuB;
++ struct MessageUnit_B *reg;
+ struct pci_dev *pdev = acb->pdev;
+ void *dma_coherent;
+ dma_addr_t dma_coherent_handle;
+@@ -2657,10 +2660,17 @@ static bool arcmsr_hbaB_get_config(struc
+ acb->dma_coherent2 = dma_coherent;
+ reg = (struct MessageUnit_B *)dma_coherent;
+ acb->pmuB = reg;
+- reg->drv2iop_doorbell = MEM_BASE0(ARCMSR_DRV2IOP_DOORBELL);
+- reg->drv2iop_doorbell_mask = MEM_BASE0(ARCMSR_DRV2IOP_DOORBELL_MASK);
+- reg->iop2drv_doorbell = MEM_BASE0(ARCMSR_IOP2DRV_DOORBELL);
+- reg->iop2drv_doorbell_mask = MEM_BASE0(ARCMSR_IOP2DRV_DOORBELL_MASK);
++ if (acb->pdev->device == PCI_DEVICE_ID_ARECA_1203) {
++ reg->drv2iop_doorbell = MEM_BASE0(ARCMSR_DRV2IOP_DOORBELL_1203);
++ reg->drv2iop_doorbell_mask = MEM_BASE0(ARCMSR_DRV2IOP_DOORBELL_MASK_1203);
++ reg->iop2drv_doorbell = MEM_BASE0(ARCMSR_IOP2DRV_DOORBELL_1203);
++ reg->iop2drv_doorbell_mask = MEM_BASE0(ARCMSR_IOP2DRV_DOORBELL_MASK_1203);
++ } else {
++ reg->drv2iop_doorbell = MEM_BASE0(ARCMSR_DRV2IOP_DOORBELL);
++ reg->drv2iop_doorbell_mask = MEM_BASE0(ARCMSR_DRV2IOP_DOORBELL_MASK);
++ reg->iop2drv_doorbell = MEM_BASE0(ARCMSR_IOP2DRV_DOORBELL);
++ reg->iop2drv_doorbell_mask = MEM_BASE0(ARCMSR_IOP2DRV_DOORBELL_MASK);
++ }
+ reg->message_wbuffer = MEM_BASE1(ARCMSR_MESSAGE_WBUFFER);
+ reg->message_rbuffer = MEM_BASE1(ARCMSR_MESSAGE_RBUFFER);
+ reg->message_rwbuffer = MEM_BASE1(ARCMSR_MESSAGE_RWBUFFER);
+@@ -2668,6 +2678,12 @@ static bool arcmsr_hbaB_get_config(struc
+ iop_firm_version = (char __iomem *)(®->message_rwbuffer[17]); /*firm_version,17,68-83*/
+ iop_device_map = (char __iomem *)(®->message_rwbuffer[21]); /*firm_version,21,84-99*/
+
++ arcmsr_wait_firmware_ready(acb);
++ writel(ARCMSR_MESSAGE_START_DRIVER_MODE, reg->drv2iop_doorbell);
++ if (!arcmsr_hbaB_wait_msgint_ready(acb)) {
++ printk(KERN_ERR "arcmsr%d: can't set driver mode.\n", acb->host->host_no);
++ goto err_free_dma;
++ }
+ writel(ARCMSR_MESSAGE_GET_CONFIG, reg->drv2iop_doorbell);
+ if (!arcmsr_hbaB_wait_msgint_ready(acb)) {
+ printk(KERN_NOTICE "arcmsr%d: wait 'get adapter firmware \
+@@ -4010,6 +4026,7 @@ static const char *arcmsr_info(struct Sc
+ case PCI_DEVICE_ID_ARECA_1160:
+ case PCI_DEVICE_ID_ARECA_1170:
+ case PCI_DEVICE_ID_ARECA_1201:
++ case PCI_DEVICE_ID_ARECA_1203:
+ case PCI_DEVICE_ID_ARECA_1220:
+ case PCI_DEVICE_ID_ARECA_1230:
+ case PCI_DEVICE_ID_ARECA_1260:
diff --git a/debian/patches/features/all/arcmsr/0024-arcmsr-changes-driver-version-number.patch b/debian/patches/features/all/arcmsr/0024-arcmsr-changes-driver-version-number.patch
new file mode 100644
index 0000000..618ab0f
--- /dev/null
+++ b/debian/patches/features/all/arcmsr/0024-arcmsr-changes-driver-version-number.patch
@@ -0,0 +1,31 @@
+From: Ching Huang <ching2048@areca.com.tw>
+Date: Wed, 25 Nov 2015 19:52:15 +0800
+Subject: [24/27] arcmsr: changes driver version number
+Origin: https://git.kernel.org/linus/d15dd55d049ccae9a1061e08ad377f9c799b8a3a
+
+Changes driver version number.
+
+Signed-off-by: Ching Huang <ching2048@areca.com.tw>
+Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
+Reviewed-by: Hannes Reinicke <hare@suse.de>
+Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
+---
+ drivers/scsi/arcmsr/arcmsr.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/scsi/arcmsr/arcmsr.h b/drivers/scsi/arcmsr/arcmsr.h
+index 9c5a2a8..2356777 100644
+--- a/drivers/scsi/arcmsr/arcmsr.h
++++ b/drivers/scsi/arcmsr/arcmsr.h
+@@ -52,7 +52,7 @@ struct device_attribute;
+ #define ARCMSR_MAX_FREECCB_NUM 320
+ #define ARCMSR_MAX_OUTSTANDING_CMD 255
+ #endif
+-#define ARCMSR_DRIVER_VERSION "v1.30.00.04-20140919"
++#define ARCMSR_DRIVER_VERSION "v1.30.00.21-20151019"
+ #define ARCMSR_SCSI_INITIATOR_ID 255
+ #define ARCMSR_MAX_XFER_SECTORS 512
+ #define ARCMSR_MAX_XFER_SECTORS_B 4096
+--
+2.8.1
+
diff --git a/debian/patches/features/all/arcmsr/0025-arcmsr-more-readability-improvements.patch b/debian/patches/features/all/arcmsr/0025-arcmsr-more-readability-improvements.patch
new file mode 100644
index 0000000..0503392
--- /dev/null
+++ b/debian/patches/features/all/arcmsr/0025-arcmsr-more-readability-improvements.patch
@@ -0,0 +1,99 @@
+From: Ching Huang <ching2048@areca.com.tw>
+Date: Thu, 26 Nov 2015 19:33:56 +0800
+Subject: [25/27] arcmsr: more readability improvements
+Origin: https://git.kernel.org/linus/f75ab39a4be08b996ca19002bd7b54df8fdb8d10
+
+Signed-off-by: Ching Huang <ching2048@areca.com.tw>
+Reviewed-by: Tomas Henzl <thenzl@redhat.com>
+Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
+---
+ drivers/scsi/arcmsr/arcmsr_hba.c | 73 ++++++++++++++--------------------------
+ 1 file changed, 26 insertions(+), 47 deletions(-)
+
+diff --git a/drivers/scsi/arcmsr/arcmsr_hba.c b/drivers/scsi/arcmsr/arcmsr_hba.c
+index 881be34..a0c98bf 100644
+--- a/drivers/scsi/arcmsr/arcmsr_hba.c
++++ b/drivers/scsi/arcmsr/arcmsr_hba.c
+@@ -2814,53 +2814,32 @@ static bool arcmsr_hbaD_get_config(struct AdapterControlBlock *acb)
+ acb->dma_coherent2 = dma_coherent2;
+ reg = (struct MessageUnit_D *)dma_coherent2;
+ acb->pmuD = reg;
+- reg->chip_id = acb->mem_base0 + ARCMSR_ARC1214_CHIP_ID;
+- reg->cpu_mem_config = acb->mem_base0 +
+- ARCMSR_ARC1214_CPU_MEMORY_CONFIGURATION;
+- reg->i2o_host_interrupt_mask = acb->mem_base0 +
+- ARCMSR_ARC1214_I2_HOST_INTERRUPT_MASK;
+- reg->sample_at_reset = acb->mem_base0 + ARCMSR_ARC1214_SAMPLE_RESET;
+- reg->reset_request = acb->mem_base0 + ARCMSR_ARC1214_RESET_REQUEST;
+- reg->host_int_status = acb->mem_base0 +
+- ARCMSR_ARC1214_MAIN_INTERRUPT_STATUS;
+- reg->pcief0_int_enable = acb->mem_base0 +
+- ARCMSR_ARC1214_PCIE_F0_INTERRUPT_ENABLE;
+- reg->inbound_msgaddr0 = acb->mem_base0 +
+- ARCMSR_ARC1214_INBOUND_MESSAGE0;
+- reg->inbound_msgaddr1 = acb->mem_base0 +
+- ARCMSR_ARC1214_INBOUND_MESSAGE1;
+- reg->outbound_msgaddr0 = acb->mem_base0 +
+- ARCMSR_ARC1214_OUTBOUND_MESSAGE0;
+- reg->outbound_msgaddr1 = acb->mem_base0 +
+- ARCMSR_ARC1214_OUTBOUND_MESSAGE1;
+- reg->inbound_doorbell = acb->mem_base0 +
+- ARCMSR_ARC1214_INBOUND_DOORBELL;
+- reg->outbound_doorbell = acb->mem_base0 +
+- ARCMSR_ARC1214_OUTBOUND_DOORBELL;
+- reg->outbound_doorbell_enable = acb->mem_base0 +
+- ARCMSR_ARC1214_OUTBOUND_DOORBELL_ENABLE;
+- reg->inboundlist_base_low = acb->mem_base0 +
+- ARCMSR_ARC1214_INBOUND_LIST_BASE_LOW;
+- reg->inboundlist_base_high = acb->mem_base0 +
+- ARCMSR_ARC1214_INBOUND_LIST_BASE_HIGH;
+- reg->inboundlist_write_pointer = acb->mem_base0 +
+- ARCMSR_ARC1214_INBOUND_LIST_WRITE_POINTER;
+- reg->outboundlist_base_low = acb->mem_base0 +
+- ARCMSR_ARC1214_OUTBOUND_LIST_BASE_LOW;
+- reg->outboundlist_base_high = acb->mem_base0 +
+- ARCMSR_ARC1214_OUTBOUND_LIST_BASE_HIGH;
+- reg->outboundlist_copy_pointer = acb->mem_base0 +
+- ARCMSR_ARC1214_OUTBOUND_LIST_COPY_POINTER;
+- reg->outboundlist_read_pointer = acb->mem_base0 +
+- ARCMSR_ARC1214_OUTBOUND_LIST_READ_POINTER;
+- reg->outboundlist_interrupt_cause = acb->mem_base0 +
+- ARCMSR_ARC1214_OUTBOUND_INTERRUPT_CAUSE;
+- reg->outboundlist_interrupt_enable = acb->mem_base0 +
+- ARCMSR_ARC1214_OUTBOUND_INTERRUPT_ENABLE;
+- reg->message_wbuffer = acb->mem_base0 + ARCMSR_ARC1214_MESSAGE_WBUFFER;
+- reg->message_rbuffer = acb->mem_base0 + ARCMSR_ARC1214_MESSAGE_RBUFFER;
+- reg->msgcode_rwbuffer = acb->mem_base0 +
+- ARCMSR_ARC1214_MESSAGE_RWBUFFER;
++ reg->chip_id = MEM_BASE0(ARCMSR_ARC1214_CHIP_ID);
++ reg->cpu_mem_config = MEM_BASE0(ARCMSR_ARC1214_CPU_MEMORY_CONFIGURATION);
++ reg->i2o_host_interrupt_mask = MEM_BASE0(ARCMSR_ARC1214_I2_HOST_INTERRUPT_MASK);
++ reg->sample_at_reset = MEM_BASE0(ARCMSR_ARC1214_SAMPLE_RESET);
++ reg->reset_request = MEM_BASE0(ARCMSR_ARC1214_RESET_REQUEST);
++ reg->host_int_status = MEM_BASE0(ARCMSR_ARC1214_MAIN_INTERRUPT_STATUS);
++ reg->pcief0_int_enable = MEM_BASE0(ARCMSR_ARC1214_PCIE_F0_INTERRUPT_ENABLE);
++ reg->inbound_msgaddr0 = MEM_BASE0(ARCMSR_ARC1214_INBOUND_MESSAGE0);
++ reg->inbound_msgaddr1 = MEM_BASE0(ARCMSR_ARC1214_INBOUND_MESSAGE1);
++ reg->outbound_msgaddr0 = MEM_BASE0(ARCMSR_ARC1214_OUTBOUND_MESSAGE0);
++ reg->outbound_msgaddr1 = MEM_BASE0(ARCMSR_ARC1214_OUTBOUND_MESSAGE1);
++ reg->inbound_doorbell = MEM_BASE0(ARCMSR_ARC1214_INBOUND_DOORBELL);
++ reg->outbound_doorbell = MEM_BASE0(ARCMSR_ARC1214_OUTBOUND_DOORBELL);
++ reg->outbound_doorbell_enable = MEM_BASE0(ARCMSR_ARC1214_OUTBOUND_DOORBELL_ENABLE);
++ reg->inboundlist_base_low = MEM_BASE0(ARCMSR_ARC1214_INBOUND_LIST_BASE_LOW);
++ reg->inboundlist_base_high = MEM_BASE0(ARCMSR_ARC1214_INBOUND_LIST_BASE_HIGH);
++ reg->inboundlist_write_pointer = MEM_BASE0(ARCMSR_ARC1214_INBOUND_LIST_WRITE_POINTER);
++ reg->outboundlist_base_low = MEM_BASE0(ARCMSR_ARC1214_OUTBOUND_LIST_BASE_LOW);
++ reg->outboundlist_base_high = MEM_BASE0(ARCMSR_ARC1214_OUTBOUND_LIST_BASE_HIGH);
++ reg->outboundlist_copy_pointer = MEM_BASE0(ARCMSR_ARC1214_OUTBOUND_LIST_COPY_POINTER);
++ reg->outboundlist_read_pointer = MEM_BASE0(ARCMSR_ARC1214_OUTBOUND_LIST_READ_POINTER);
++ reg->outboundlist_interrupt_cause = MEM_BASE0(ARCMSR_ARC1214_OUTBOUND_INTERRUPT_CAUSE);
++ reg->outboundlist_interrupt_enable = MEM_BASE0(ARCMSR_ARC1214_OUTBOUND_INTERRUPT_ENABLE);
++ reg->message_wbuffer = MEM_BASE0(ARCMSR_ARC1214_MESSAGE_WBUFFER);
++ reg->message_rbuffer = MEM_BASE0(ARCMSR_ARC1214_MESSAGE_RBUFFER);
++ reg->msgcode_rwbuffer = MEM_BASE0(ARCMSR_ARC1214_MESSAGE_RWBUFFER);
+ iop_firm_model = (char __iomem *)(®->msgcode_rwbuffer[15]);
+ iop_firm_version = (char __iomem *)(®->msgcode_rwbuffer[17]);
+ iop_device_map = (char __iomem *)(®->msgcode_rwbuffer[21]);
+--
+2.8.1
+
diff --git a/debian/patches/features/all/arcmsr/0026-arcmsr-Split-dma-resource-allocation-to-a-new-functi.patch b/debian/patches/features/all/arcmsr/0026-arcmsr-Split-dma-resource-allocation-to-a-new-functi.patch
new file mode 100644
index 0000000..a923a59
--- /dev/null
+++ b/debian/patches/features/all/arcmsr/0026-arcmsr-Split-dma-resource-allocation-to-a-new-functi.patch
@@ -0,0 +1,261 @@
+From: Ching Huang <ching2048@areca.com.tw>
+Date: Thu, 26 Nov 2015 19:41:15 +0800
+Subject: [26/27] arcmsr: Split dma resource allocation to a new function
+Origin: https://git.kernel.org/linus/02040670aaa0f125259ad8f9f5f30e4d138a65ae
+
+Split dma resource allocation and io register assignment from get_config
+to a new function arcmsr_alloc_io_queue.
+
+Signed-off-by: Ching Huang <ching2048@areca.com.tw>
+Reviewed-by: Tomas Henzl <thenzl@redhat.com>
+Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
+---
+ drivers/scsi/arcmsr/arcmsr_hba.c | 175 +++++++++++++++++++++------------------
+ 1 file changed, 93 insertions(+), 82 deletions(-)
+
+diff --git a/drivers/scsi/arcmsr/arcmsr_hba.c b/drivers/scsi/arcmsr/arcmsr_hba.c
+index a0c98bf..7640498 100644
+--- a/drivers/scsi/arcmsr/arcmsr_hba.c
++++ b/drivers/scsi/arcmsr/arcmsr_hba.c
+@@ -498,6 +498,91 @@ static void arcmsr_flush_adapter_cache(struct AdapterControlBlock *acb)
+ }
+ }
+
++static bool arcmsr_alloc_io_queue(struct AdapterControlBlock *acb)
++{
++ bool rtn = true;
++ void *dma_coherent;
++ dma_addr_t dma_coherent_handle;
++ struct pci_dev *pdev = acb->pdev;
++
++ switch (acb->adapter_type) {
++ case ACB_ADAPTER_TYPE_B: {
++ struct MessageUnit_B *reg;
++ acb->roundup_ccbsize = roundup(sizeof(struct MessageUnit_B), 32);
++ dma_coherent = dma_zalloc_coherent(&pdev->dev, acb->roundup_ccbsize,
++ &dma_coherent_handle, GFP_KERNEL);
++ if (!dma_coherent) {
++ pr_notice("arcmsr%d: DMA allocation failed\n", acb->host->host_no);
++ return false;
++ }
++ acb->dma_coherent_handle2 = dma_coherent_handle;
++ acb->dma_coherent2 = dma_coherent;
++ reg = (struct MessageUnit_B *)dma_coherent;
++ acb->pmuB = reg;
++ if (acb->pdev->device == PCI_DEVICE_ID_ARECA_1203) {
++ reg->drv2iop_doorbell = MEM_BASE0(ARCMSR_DRV2IOP_DOORBELL_1203);
++ reg->drv2iop_doorbell_mask = MEM_BASE0(ARCMSR_DRV2IOP_DOORBELL_MASK_1203);
++ reg->iop2drv_doorbell = MEM_BASE0(ARCMSR_IOP2DRV_DOORBELL_1203);
++ reg->iop2drv_doorbell_mask = MEM_BASE0(ARCMSR_IOP2DRV_DOORBELL_MASK_1203);
++ } else {
++ reg->drv2iop_doorbell = MEM_BASE0(ARCMSR_DRV2IOP_DOORBELL);
++ reg->drv2iop_doorbell_mask = MEM_BASE0(ARCMSR_DRV2IOP_DOORBELL_MASK);
++ reg->iop2drv_doorbell = MEM_BASE0(ARCMSR_IOP2DRV_DOORBELL);
++ reg->iop2drv_doorbell_mask = MEM_BASE0(ARCMSR_IOP2DRV_DOORBELL_MASK);
++ }
++ reg->message_wbuffer = MEM_BASE1(ARCMSR_MESSAGE_WBUFFER);
++ reg->message_rbuffer = MEM_BASE1(ARCMSR_MESSAGE_RBUFFER);
++ reg->message_rwbuffer = MEM_BASE1(ARCMSR_MESSAGE_RWBUFFER);
++ }
++ break;
++ case ACB_ADAPTER_TYPE_D: {
++ struct MessageUnit_D *reg;
++
++ acb->roundup_ccbsize = roundup(sizeof(struct MessageUnit_D), 32);
++ dma_coherent = dma_zalloc_coherent(&pdev->dev, acb->roundup_ccbsize,
++ &dma_coherent_handle, GFP_KERNEL);
++ if (!dma_coherent) {
++ pr_notice("arcmsr%d: DMA allocation failed\n", acb->host->host_no);
++ return false;
++ }
++ acb->dma_coherent_handle2 = dma_coherent_handle;
++ acb->dma_coherent2 = dma_coherent;
++ reg = (struct MessageUnit_D *)dma_coherent;
++ acb->pmuD = reg;
++ reg->chip_id = MEM_BASE0(ARCMSR_ARC1214_CHIP_ID);
++ reg->cpu_mem_config = MEM_BASE0(ARCMSR_ARC1214_CPU_MEMORY_CONFIGURATION);
++ reg->i2o_host_interrupt_mask = MEM_BASE0(ARCMSR_ARC1214_I2_HOST_INTERRUPT_MASK);
++ reg->sample_at_reset = MEM_BASE0(ARCMSR_ARC1214_SAMPLE_RESET);
++ reg->reset_request = MEM_BASE0(ARCMSR_ARC1214_RESET_REQUEST);
++ reg->host_int_status = MEM_BASE0(ARCMSR_ARC1214_MAIN_INTERRUPT_STATUS);
++ reg->pcief0_int_enable = MEM_BASE0(ARCMSR_ARC1214_PCIE_F0_INTERRUPT_ENABLE);
++ reg->inbound_msgaddr0 = MEM_BASE0(ARCMSR_ARC1214_INBOUND_MESSAGE0);
++ reg->inbound_msgaddr1 = MEM_BASE0(ARCMSR_ARC1214_INBOUND_MESSAGE1);
++ reg->outbound_msgaddr0 = MEM_BASE0(ARCMSR_ARC1214_OUTBOUND_MESSAGE0);
++ reg->outbound_msgaddr1 = MEM_BASE0(ARCMSR_ARC1214_OUTBOUND_MESSAGE1);
++ reg->inbound_doorbell = MEM_BASE0(ARCMSR_ARC1214_INBOUND_DOORBELL);
++ reg->outbound_doorbell = MEM_BASE0(ARCMSR_ARC1214_OUTBOUND_DOORBELL);
++ reg->outbound_doorbell_enable = MEM_BASE0(ARCMSR_ARC1214_OUTBOUND_DOORBELL_ENABLE);
++ reg->inboundlist_base_low = MEM_BASE0(ARCMSR_ARC1214_INBOUND_LIST_BASE_LOW);
++ reg->inboundlist_base_high = MEM_BASE0(ARCMSR_ARC1214_INBOUND_LIST_BASE_HIGH);
++ reg->inboundlist_write_pointer = MEM_BASE0(ARCMSR_ARC1214_INBOUND_LIST_WRITE_POINTER);
++ reg->outboundlist_base_low = MEM_BASE0(ARCMSR_ARC1214_OUTBOUND_LIST_BASE_LOW);
++ reg->outboundlist_base_high = MEM_BASE0(ARCMSR_ARC1214_OUTBOUND_LIST_BASE_HIGH);
++ reg->outboundlist_copy_pointer = MEM_BASE0(ARCMSR_ARC1214_OUTBOUND_LIST_COPY_POINTER);
++ reg->outboundlist_read_pointer = MEM_BASE0(ARCMSR_ARC1214_OUTBOUND_LIST_READ_POINTER);
++ reg->outboundlist_interrupt_cause = MEM_BASE0(ARCMSR_ARC1214_OUTBOUND_INTERRUPT_CAUSE);
++ reg->outboundlist_interrupt_enable = MEM_BASE0(ARCMSR_ARC1214_OUTBOUND_INTERRUPT_ENABLE);
++ reg->message_wbuffer = MEM_BASE0(ARCMSR_ARC1214_MESSAGE_WBUFFER);
++ reg->message_rbuffer = MEM_BASE0(ARCMSR_ARC1214_MESSAGE_RBUFFER);
++ reg->msgcode_rwbuffer = MEM_BASE0(ARCMSR_ARC1214_MESSAGE_RWBUFFER);
++ }
++ break;
++ default:
++ break;
++ }
++ return rtn;
++}
++
+ static int arcmsr_alloc_ccb_pool(struct AdapterControlBlock *acb)
+ {
+ struct pci_dev *pdev = acb->pdev;
+@@ -742,9 +827,12 @@ static int arcmsr_probe(struct pci_dev *pdev, const struct pci_device_id *id)
+ if(!error){
+ goto pci_release_regs;
+ }
++ error = arcmsr_alloc_io_queue(acb);
++ if (!error)
++ goto unmap_pci_region;
+ error = arcmsr_get_firmware_spec(acb);
+ if(!error){
+- goto unmap_pci_region;
++ goto free_hbb_mu;
+ }
+ error = arcmsr_alloc_ccb_pool(acb);
+ if(error){
+@@ -2624,10 +2712,7 @@ static bool arcmsr_hbaA_get_config(struct AdapterControlBlock *acb)
+ }
+ static bool arcmsr_hbaB_get_config(struct AdapterControlBlock *acb)
+ {
+- struct MessageUnit_B *reg;
+- struct pci_dev *pdev = acb->pdev;
+- void *dma_coherent;
+- dma_addr_t dma_coherent_handle;
++ struct MessageUnit_B *reg = acb->pmuB;
+ char *acb_firm_model = acb->firm_model;
+ char *acb_firm_version = acb->firm_version;
+ char *acb_device_map = acb->device_map;
+@@ -2639,33 +2724,6 @@ static bool arcmsr_hbaB_get_config(struct AdapterControlBlock *acb)
+ /*firm_version,21,84-99*/
+ int count;
+
+- acb->roundup_ccbsize = roundup(sizeof(struct MessageUnit_B), 32);
+- dma_coherent = dma_alloc_coherent(&pdev->dev, acb->roundup_ccbsize,
+- &dma_coherent_handle, GFP_KERNEL);
+- if (!dma_coherent){
+- printk(KERN_NOTICE
+- "arcmsr%d: dma_alloc_coherent got error for hbb mu\n",
+- acb->host->host_no);
+- return false;
+- }
+- acb->dma_coherent_handle2 = dma_coherent_handle;
+- acb->dma_coherent2 = dma_coherent;
+- reg = (struct MessageUnit_B *)dma_coherent;
+- acb->pmuB = reg;
+- if (acb->pdev->device == PCI_DEVICE_ID_ARECA_1203) {
+- reg->drv2iop_doorbell = MEM_BASE0(ARCMSR_DRV2IOP_DOORBELL_1203);
+- reg->drv2iop_doorbell_mask = MEM_BASE0(ARCMSR_DRV2IOP_DOORBELL_MASK_1203);
+- reg->iop2drv_doorbell = MEM_BASE0(ARCMSR_IOP2DRV_DOORBELL_1203);
+- reg->iop2drv_doorbell_mask = MEM_BASE0(ARCMSR_IOP2DRV_DOORBELL_MASK_1203);
+- } else {
+- reg->drv2iop_doorbell = MEM_BASE0(ARCMSR_DRV2IOP_DOORBELL);
+- reg->drv2iop_doorbell_mask = MEM_BASE0(ARCMSR_DRV2IOP_DOORBELL_MASK);
+- reg->iop2drv_doorbell = MEM_BASE0(ARCMSR_IOP2DRV_DOORBELL);
+- reg->iop2drv_doorbell_mask = MEM_BASE0(ARCMSR_IOP2DRV_DOORBELL_MASK);
+- }
+- reg->message_wbuffer = MEM_BASE1(ARCMSR_MESSAGE_WBUFFER);
+- reg->message_rbuffer = MEM_BASE1(ARCMSR_MESSAGE_RBUFFER);
+- reg->message_rwbuffer = MEM_BASE1(ARCMSR_MESSAGE_RWBUFFER);
+ iop_firm_model = (char __iomem *)(®->message_rwbuffer[15]); /*firm_model,15,60-67*/
+ iop_firm_version = (char __iomem *)(®->message_rwbuffer[17]); /*firm_version,17,68-83*/
+ iop_device_map = (char __iomem *)(®->message_rwbuffer[21]); /*firm_version,21,84-99*/
+@@ -2674,13 +2732,13 @@ static bool arcmsr_hbaB_get_config(struct AdapterControlBlock *acb)
+ writel(ARCMSR_MESSAGE_START_DRIVER_MODE, reg->drv2iop_doorbell);
+ if (!arcmsr_hbaB_wait_msgint_ready(acb)) {
+ printk(KERN_ERR "arcmsr%d: can't set driver mode.\n", acb->host->host_no);
+- goto err_free_dma;
++ return false;
+ }
+ writel(ARCMSR_MESSAGE_GET_CONFIG, reg->drv2iop_doorbell);
+ if (!arcmsr_hbaB_wait_msgint_ready(acb)) {
+ printk(KERN_NOTICE "arcmsr%d: wait 'get adapter firmware \
+ miscellaneous data' timeout \n", acb->host->host_no);
+- goto err_free_dma;
++ return false;
+ }
+ count = 8;
+ while (count){
+@@ -2723,10 +2781,6 @@ static bool arcmsr_hbaB_get_config(struct AdapterControlBlock *acb)
+ acb->firm_cfg_version = readl(®->message_rwbuffer[25]); /*firm_cfg_version,25,100-103*/
+ /*firm_ide_channels,4,16-19*/
+ return true;
+-err_free_dma:
+- dma_free_coherent(&acb->pdev->dev, acb->roundup_ccbsize,
+- acb->dma_coherent2, acb->dma_coherent_handle2);
+- return false;
+ }
+
+ static bool arcmsr_hbaC_get_config(struct AdapterControlBlock *pACB)
+@@ -2797,49 +2851,8 @@ static bool arcmsr_hbaD_get_config(struct AdapterControlBlock *acb)
+ char __iomem *iop_firm_version;
+ char __iomem *iop_device_map;
+ u32 count;
+- struct MessageUnit_D *reg;
+- void *dma_coherent2;
+- dma_addr_t dma_coherent_handle2;
+- struct pci_dev *pdev = acb->pdev;
++ struct MessageUnit_D *reg = acb->pmuD;
+
+- acb->roundup_ccbsize = roundup(sizeof(struct MessageUnit_D), 32);
+- dma_coherent2 = dma_alloc_coherent(&pdev->dev, acb->roundup_ccbsize,
+- &dma_coherent_handle2, GFP_KERNEL);
+- if (!dma_coherent2) {
+- pr_notice("DMA allocation failed...\n");
+- return false;
+- }
+- memset(dma_coherent2, 0, acb->roundup_ccbsize);
+- acb->dma_coherent_handle2 = dma_coherent_handle2;
+- acb->dma_coherent2 = dma_coherent2;
+- reg = (struct MessageUnit_D *)dma_coherent2;
+- acb->pmuD = reg;
+- reg->chip_id = MEM_BASE0(ARCMSR_ARC1214_CHIP_ID);
+- reg->cpu_mem_config = MEM_BASE0(ARCMSR_ARC1214_CPU_MEMORY_CONFIGURATION);
+- reg->i2o_host_interrupt_mask = MEM_BASE0(ARCMSR_ARC1214_I2_HOST_INTERRUPT_MASK);
+- reg->sample_at_reset = MEM_BASE0(ARCMSR_ARC1214_SAMPLE_RESET);
+- reg->reset_request = MEM_BASE0(ARCMSR_ARC1214_RESET_REQUEST);
+- reg->host_int_status = MEM_BASE0(ARCMSR_ARC1214_MAIN_INTERRUPT_STATUS);
+- reg->pcief0_int_enable = MEM_BASE0(ARCMSR_ARC1214_PCIE_F0_INTERRUPT_ENABLE);
+- reg->inbound_msgaddr0 = MEM_BASE0(ARCMSR_ARC1214_INBOUND_MESSAGE0);
+- reg->inbound_msgaddr1 = MEM_BASE0(ARCMSR_ARC1214_INBOUND_MESSAGE1);
+- reg->outbound_msgaddr0 = MEM_BASE0(ARCMSR_ARC1214_OUTBOUND_MESSAGE0);
+- reg->outbound_msgaddr1 = MEM_BASE0(ARCMSR_ARC1214_OUTBOUND_MESSAGE1);
+- reg->inbound_doorbell = MEM_BASE0(ARCMSR_ARC1214_INBOUND_DOORBELL);
+- reg->outbound_doorbell = MEM_BASE0(ARCMSR_ARC1214_OUTBOUND_DOORBELL);
+- reg->outbound_doorbell_enable = MEM_BASE0(ARCMSR_ARC1214_OUTBOUND_DOORBELL_ENABLE);
+- reg->inboundlist_base_low = MEM_BASE0(ARCMSR_ARC1214_INBOUND_LIST_BASE_LOW);
+- reg->inboundlist_base_high = MEM_BASE0(ARCMSR_ARC1214_INBOUND_LIST_BASE_HIGH);
+- reg->inboundlist_write_pointer = MEM_BASE0(ARCMSR_ARC1214_INBOUND_LIST_WRITE_POINTER);
+- reg->outboundlist_base_low = MEM_BASE0(ARCMSR_ARC1214_OUTBOUND_LIST_BASE_LOW);
+- reg->outboundlist_base_high = MEM_BASE0(ARCMSR_ARC1214_OUTBOUND_LIST_BASE_HIGH);
+- reg->outboundlist_copy_pointer = MEM_BASE0(ARCMSR_ARC1214_OUTBOUND_LIST_COPY_POINTER);
+- reg->outboundlist_read_pointer = MEM_BASE0(ARCMSR_ARC1214_OUTBOUND_LIST_READ_POINTER);
+- reg->outboundlist_interrupt_cause = MEM_BASE0(ARCMSR_ARC1214_OUTBOUND_INTERRUPT_CAUSE);
+- reg->outboundlist_interrupt_enable = MEM_BASE0(ARCMSR_ARC1214_OUTBOUND_INTERRUPT_ENABLE);
+- reg->message_wbuffer = MEM_BASE0(ARCMSR_ARC1214_MESSAGE_WBUFFER);
+- reg->message_rbuffer = MEM_BASE0(ARCMSR_ARC1214_MESSAGE_RBUFFER);
+- reg->msgcode_rwbuffer = MEM_BASE0(ARCMSR_ARC1214_MESSAGE_RWBUFFER);
+ iop_firm_model = (char __iomem *)(®->msgcode_rwbuffer[15]);
+ iop_firm_version = (char __iomem *)(®->msgcode_rwbuffer[17]);
+ iop_device_map = (char __iomem *)(®->msgcode_rwbuffer[21]);
+@@ -2854,8 +2867,6 @@ static bool arcmsr_hbaD_get_config(struct AdapterControlBlock *acb)
+ if (!arcmsr_hbaD_wait_msgint_ready(acb)) {
+ pr_notice("arcmsr%d: wait get adapter firmware "
+ "miscellaneous data timeout\n", acb->host->host_no);
+- dma_free_coherent(&acb->pdev->dev, acb->roundup_ccbsize,
+- acb->dma_coherent2, acb->dma_coherent_handle2);
+ return false;
+ }
+ count = 8;
+--
+2.8.1
+
diff --git a/debian/patches/features/all/arcmsr/0027-arcmsr-change-driver-version-to-v1.30.00.22-20151126.patch b/debian/patches/features/all/arcmsr/0027-arcmsr-change-driver-version-to-v1.30.00.22-20151126.patch
new file mode 100644
index 0000000..5d267f2
--- /dev/null
+++ b/debian/patches/features/all/arcmsr/0027-arcmsr-change-driver-version-to-v1.30.00.22-20151126.patch
@@ -0,0 +1,30 @@
+From: Ching Huang <ching2048@areca.com.tw>
+Date: Thu, 26 Nov 2015 19:44:55 +0800
+Subject: [27/27] arcmsr: change driver version to v1.30.00.22-20151126
+Origin: https://git.kernel.org/linus/15d2639704b828db0506a416eda010178e1fd816
+
+Change driver version to v1.30.00.22-20151126
+
+Signed-off-by: Ching Huang <ching2048@areca.com.tw>
+Reviewed-by: Tomas Henzl <thenzl@redhat.com>
+Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
+---
+ drivers/scsi/arcmsr/arcmsr.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/scsi/arcmsr/arcmsr.h b/drivers/scsi/arcmsr/arcmsr.h
+index 2356777..cf99f8c 100644
+--- a/drivers/scsi/arcmsr/arcmsr.h
++++ b/drivers/scsi/arcmsr/arcmsr.h
+@@ -52,7 +52,7 @@ struct device_attribute;
+ #define ARCMSR_MAX_FREECCB_NUM 320
+ #define ARCMSR_MAX_OUTSTANDING_CMD 255
+ #endif
+-#define ARCMSR_DRIVER_VERSION "v1.30.00.21-20151019"
++#define ARCMSR_DRIVER_VERSION "v1.30.00.22-20151126"
+ #define ARCMSR_SCSI_INITIATOR_ID 255
+ #define ARCMSR_MAX_XFER_SECTORS 512
+ #define ARCMSR_MAX_XFER_SECTORS_B 4096
+--
+2.8.1
+
diff --git a/debian/patches/series b/debian/patches/series
index d2381a8..5277757 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -576,7 +576,7 @@ features/all/iwlwifi-debug/iwlwifi-mvm-don-t-collect-logs-in-the-interrupt-threa
features/all/iwlwifi-debug/iwlwifi-mvm-kill-iwl_mvm_fw_error_rxf_dump.patch
features/all/iwlwifi-debug/iwlwifi-mvm-update-layout-of-firmware-error-dump.patch
-# Update arcmsr to 3.18
+# Update arcmsr to 4.5
features/all/arcmsr/0001-arcmsr-fix-command-timeout-under-heavy-load.patch
features/all/arcmsr/0002-arcmsr-add-code-to-support-msi-x-and-msi-interrupt.patch
features/all/arcmsr/0003-arcmsr-add-code-to-support-hibernation.patch
@@ -596,6 +596,14 @@ features/all/arcmsr/0016-arcmsr-add-support-new-adapter-arc12x4-series.patch
features/all/arcmsr/0017-arcmsr-call-scsi_scan_host-at-the-end-of-host-initia.patch
features/all/arcmsr/0018-arcmsr-simplify-of-updating-doneq_index-and-postq_in.patch
features/all/arcmsr/0019-arcmsr-simplify-ioctl-data-read-write.patch
+features/all/arcmsr/0020-arcmsr-fixed-getting-wrong-configuration-data.patch
+features/all/arcmsr/0021-arcmsr-fixes-not-release-allocated-resource.patch
+features/all/arcmsr/0022-arcmsr-make-code-more-readable.patch
+features/all/arcmsr/0023-arcmsr-adds-code-to-support-new-Areca-adapter-ARC120.patch
+features/all/arcmsr/0024-arcmsr-changes-driver-version-number.patch
+features/all/arcmsr/0025-arcmsr-more-readability-improvements.patch
+features/all/arcmsr/0026-arcmsr-Split-dma-resource-allocation-to-a-new-functi.patch
+features/all/arcmsr/0027-arcmsr-change-driver-version-to-v1.30.00.22-20151126.patch
# Add FocalTech support to psmouse
features/all/psmouse/input-i8042-also-set-the-firmware-id-for-muxed-ports.patch
--
2.8.1
Reply to: