Skip to contentSkip to conversation

pm80xx: fix Adaptec 71605H hang

PATCH In review Hans Verkuil 3 participants 4 messages Jul 26, 2013 – Aug 21, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 pm80xx: fix Adaptec 71605H hang

The IO command size is 128 bytes for these new controllers as opposed to 64 for the old 8001 controller.

The Adaptec out-of-tree driver did this correctly. After comparing the two this turned out to be the crucial difference.

So don't hardcode the IO command size, instead use pm8001_ha->iomb_size as that is the correct value for both old and new controllers.

Cc [email protected] # for v3.10 and up
---
 drivers/scsi/pm8001/pm8001_hwi.c | 4 ++--
 drivers/scsi/pm8001/pm80xx_hwi.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/scsi/pm8001/pm8001_hwi.c +2 -2
index 69dd49c..ce3f129d 100644
@@ -221,7 +221,7 @@ static void init_default_table_values(struct pm8001_hba_info *pm8001_ha)
 	pm8001_ha->main_cfg_tbl.pm8001_tbl.fatal_err_interrupt		= 0x01;
 	for (i = 0; i < PM8001_MAX_INB_NUM; i++) {
 		pm8001_ha->inbnd_q_tbl[i].element_pri_size_cnt	=
-			PM8001_MPI_QUEUE | (64 << 16) | (0x00<<30);
+			PM8001_MPI_QUEUE | (pm8001_ha->iomb_size << 16) | (0x00<<30);
 		pm8001_ha->inbnd_q_tbl[i].upper_base_addr	=
 			pm8001_ha->memoryMap.region[IB + i].phys_addr_hi;
 		pm8001_ha->inbnd_q_tbl[i].lower_base_addr	=
@@ -247,7 +247,7 @@ static void init_default_table_values(struct pm8001_hba_info *pm8001_ha)
 	}
 	for (i = 0; i < PM8001_MAX_OUTB_NUM; i++) {
 		pm8001_ha->outbnd_q_tbl[i].element_size_cnt	=
-			PM8001_MPI_QUEUE | (64 << 16) | (0x01<<30);
+			PM8001_MPI_QUEUE | (pm8001_ha->iomb_size << 16) | (0x01<<30);
 		pm8001_ha->outbnd_q_tbl[i].upper_base_addr	=
 			pm8001_ha->memoryMap.region[OB + i].phys_addr_hi;
 		pm8001_ha->outbnd_q_tbl[i].lower_base_addr	=
drivers/scsi/pm8001/pm80xx_hwi.c +2 -2
index 302514d..e1c4896 100644
@@ -275,7 +275,7 @@ static void init_default_table_values(struct pm8001_hba_info *pm8001_ha)
 
 	for (i = 0; i < PM8001_MAX_SPCV_INB_NUM; i++) {
 		pm8001_ha->inbnd_q_tbl[i].element_pri_size_cnt	=
-			PM8001_MPI_QUEUE | (64 << 16) | (0x00<<30);
+			PM8001_MPI_QUEUE | (pm8001_ha->iomb_size << 16) | (0x00<<30);
 		pm8001_ha->inbnd_q_tbl[i].upper_base_addr	=
 			pm8001_ha->memoryMap.region[IB + i].phys_addr_hi;
 		pm8001_ha->inbnd_q_tbl[i].lower_base_addr	=
@@ -301,7 +301,7 @@ static void init_default_table_values(struct pm8001_hba_info *pm8001_ha)
 	}
 	for (i = 0; i < PM8001_MAX_SPCV_OUTB_NUM; i++) {
 		pm8001_ha->outbnd_q_tbl[i].element_size_cnt	=
-			PM8001_MPI_QUEUE | (64 << 16) | (0x01<<30);
+			PM8001_MPI_QUEUE | (pm8001_ha->iomb_size << 16) | (0x01<<30);
 		pm8001_ha->outbnd_q_tbl[i].upper_base_addr	=
 			pm8001_ha->memoryMap.region[OB + i].phys_addr_hi;
 		pm8001_ha->outbnd_q_tbl[i].lower_base_addr	=
Signature · 1 line
1.8.3.2
Acked-by on v2 1/1
#1 lore raw

Hi Hans,

Thanks for addressing the comment.

Regards
Anand

-----Original Message-----
From: Hans Verkuil [mailto:[email protected]]
Sent: Friday, July 26, 2013 10:14 PM
To: [email protected]
Cc: Anand Kumar Santhanam; [email protected]; Sangeetha Gnanasekaran; [email protected]
Subject: [PATCHv2] pm80xx: fix Adaptec 71605H hang

The IO command size is 128 bytes for these new controllers as opposed to 64 for the old 8001 controller.

The Adaptec out-of-tree driver did this correctly. After comparing the two this turned out to be the crucial difference.

So don't hardcode the IO command size, instead use pm8001_ha->iomb_size as that is the correct value for both old and new controllers.

Cc [email protected] # for v3.10 and up
---
 drivers/scsi/pm8001/pm8001_hwi.c | 4 ++--
drivers/scsi/pm8001/pm80xx_hwi.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
(quoted diff) +0 -0

b/drivers/scsi/pm8001/pm8001_hwi.c
index 69dd49c..ce3f129d 100644

drivers/scsi/pm8001/pm8001_hwi.c +0 -0
@@ -221,7 +221,7 @@ static void init_default_table_values(struct

pm8001_hba_info *pm8001_ha)
pm8001_ha->main_cfg_tbl.pm8001_tbl.fatal_err_interrupt
= 0x01;
for (i = 0; i < PM8001_MAX_INB_NUM; i++) {
pm8001_ha->inbnd_q_tbl[i].element_pri_size_cnt =
- PM8001_MPI_QUEUE | (64 << 16) | (0x00<<30);
+ PM8001_MPI_QUEUE | (pm8001_ha->iomb_size << 16)
| (0x00<<30);
pm8001_ha->inbnd_q_tbl[i].upper_base_addr =
pm8001_ha->memoryMap.region[IB +
i].phys_addr_hi;
pm8001_ha->inbnd_q_tbl[i].lower_base_addr =
@@ -247,7 +247,7 @@ static void init_default_table_values(struct pm8001_hba_info *pm8001_ha)
}
for (i = 0; i < PM8001_MAX_OUTB_NUM; i++) {
pm8001_ha->outbnd_q_tbl[i].element_size_cnt =
- PM8001_MPI_QUEUE | (64 << 16) | (0x01<<30);
+ PM8001_MPI_QUEUE | (pm8001_ha->iomb_size << 16)
| (0x01<<30);
pm8001_ha->outbnd_q_tbl[i].upper_base_addr =
pm8001_ha->memoryMap.region[OB +
i].phys_addr_hi;
pm8001_ha->outbnd_q_tbl[i].lower_base_addr =

(quoted diff) +0 -0

b/drivers/scsi/pm8001/pm80xx_hwi.c
index 302514d..e1c4896 100644

drivers/scsi/pm8001/pm80xx_hwi.c +0 -0
@@ -275,7 +275,7 @@ static void init_default_table_values(struct

pm8001_hba_info *pm8001_ha)

for (i = 0; i < PM8001_MAX_SPCV_INB_NUM; i++) {
pm8001_ha->inbnd_q_tbl[i].element_pri_size_cnt =
- PM8001_MPI_QUEUE | (64 << 16) | (0x00<<30);
+ PM8001_MPI_QUEUE | (pm8001_ha->iomb_size << 16)
| (0x00<<30);
pm8001_ha->inbnd_q_tbl[i].upper_base_addr =
pm8001_ha->memoryMap.region[IB +
i].phys_addr_hi;
pm8001_ha->inbnd_q_tbl[i].lower_base_addr =
@@ -301,7 +301,7 @@ static void init_default_table_values(struct pm8001_hba_info *pm8001_ha)
}
for (i = 0; i < PM8001_MAX_SPCV_OUTB_NUM; i++) {
pm8001_ha->outbnd_q_tbl[i].element_size_cnt =
- PM8001_MPI_QUEUE | (64 << 16) | (0x01<<30);
+ PM8001_MPI_QUEUE | (pm8001_ha->iomb_size << 16)
| (0x01<<30);
pm8001_ha->outbnd_q_tbl[i].upper_base_addr =
pm8001_ha->memoryMap.region[OB +
i].phys_addr_hi;
pm8001_ha->outbnd_q_tbl[i].lower_base_addr =
--
1.8.3.2

Acked-by on v2 1/1
#2 lore raw
In reply to Hans Verkuil
Quoted 11 lines · Hans Verkuil

The IO command size is 128 bytes for these new controllers as opposed to 64 for the old 8001 controller.

The Adaptec out-of-tree driver did this correctly. After comparing the two this turned out to be the crucial difference.

So don't hardcode the IO command size, instead use pm8001_ha->iomb_size as that is the correct value for both old and new controllers.

Cc [email protected] # for v3.10 and up

snip

Thanks Hans.
Looks good now.

James,

Could you consider to include this fix into your fixes tree, without this fix new Adaptec controller support is broken, sorry for that.

Jack

#3 lore raw
Quoted 19 lines · Jack Wang
Quoted 11 lines · Hans Verkuil

The IO command size is 128 bytes for these new controllers as opposed to 64 for the old 8001 controller.

The Adaptec out-of-tree driver did this correctly. After comparing the two this turned out to be the crucial difference.

So don't hardcode the IO command size, instead use pm8001_ha->iomb_size as that is the correct value for both old and new controllers.

Cc [email protected] # for v3.10 and up

snip

Thanks Hans.
Looks good now.

Quoted 8 lines

James,

Could you consider to include this fix into your fixes tree, without this fix new Adaptec controller support is broken, sorry for that.

Jack

Hi, James,

Could you include this patch, or you need we resend?

KR
Jack