* [PATCH 2/5] pm80xx: IButton feature support and Indirect SMP fix.
@ 2013-09-16 15:53 Anand
2013-09-16 16:04 ` Jack Wang
0 siblings, 1 reply; 2+ messages in thread
From: Anand @ 2013-09-16 15:53 UTC (permalink / raw)
To: linux-scsi
Cc: Viswas.G, Sangeetha.Gnanasekaran, Nikith.Ganigarakoppal, xjtuwjp
>From db345f70bef0b07655d887f2d0398faf666f4a48 Mon Sep 17 00:00:00 2001
From: Anand Kumar Santhanam <AnandKumar.Santhanam@pmcs.com>
Date: Tue, 3 Sep 2013 15:21:29 +0530
Subject: [PATCH 2/5] pm80xx: IButton feature support and Indirect SMP fix.
IButton security feature support for motherboard controllers.
Fix for indirect data transfer mode in case of SMP request.
Signed-off-by: Anandkumar.Santhanam@pmcs.com
---
drivers/scsi/pm8001/pm80xx_hwi.c | 26 ++++++++++++++++++++++----
1 files changed, 22 insertions(+), 4 deletions(-)
diff --git a/drivers/scsi/pm8001/pm80xx_hwi.c b/drivers/scsi/pm8001/pm80xx_hwi.c
index be0b394..158e91d 100644
--- a/drivers/scsi/pm8001/pm80xx_hwi.c
+++ b/drivers/scsi/pm8001/pm80xx_hwi.c
@@ -967,6 +967,7 @@ pm80xx_chip_soft_rst(struct pm8001_hba_info *pm8001_ha)
{
u32 regval;
u32 bootloader_state;
+ u32 ibutton0, ibutton1;
/* Check if MPI is in ready state to reset */
if (mpi_uninit_check(pm8001_ha) != 0) {
@@ -1025,7 +1026,26 @@ pm80xx_chip_soft_rst(struct pm8001_hba_info *pm8001_ha)
if (-1 == check_fw_ready(pm8001_ha)) {
PM8001_FAIL_DBG(pm8001_ha,
pm8001_printk("Firmware is not ready!\n"));
- return -EBUSY;
+ /* check iButton feature support for motherboard controller */
+ if (pm8001_ha->pdev->subsystem_vendor !=
+ PCI_VENDOR_ID_ADAPTEC2) {
+ ibutton0 = pm8001_cr32(pm8001_ha, 0,
+ MSGU_HOST_SCRATCH_PAD_6);
+ ibutton1 = pm8001_cr32(pm8001_ha, 0,
+ MSGU_HOST_SCRATCH_PAD_7);
+ if (!ibutton0 && !ibutton1) {
+ PM8001_FAIL_DBG(pm8001_ha,
+ pm8001_printk("iButton Feature is"
+ " not Available!!!\n"));
+ return -EBUSY;
+ }
+ if (ibutton0 == 0xdeadbeef && ibutton1 == 0xdeadbeef) {
+ PM8001_FAIL_DBG(pm8001_ha,
+ pm8001_printk("CRC Check for iButton"
+ " Feature Failed!!!\n"));
+ return -EBUSY;
+ }
+ }
}
PM8001_INIT_DBG(pm8001_ha,
pm8001_printk("SPCv soft reset Complete\n"));
@@ -3492,8 +3512,6 @@ static int pm80xx_chip_smp_req(struct pm8001_hba_info *pm8001_ha,
else
pm8001_ha->smp_exp_mode = SMP_INDIRECT;
- /* DIRECT MODE support only in spcv/ve */
- pm8001_ha->smp_exp_mode = SMP_DIRECT;
tmp_addr = cpu_to_le64((u64)sg_dma_address(&task->smp_task.smp_req));
preq_dma_addr = (char *)phys_to_virt(tmp_addr);
@@ -3509,7 +3527,7 @@ static int pm80xx_chip_smp_req(struct pm8001_hba_info *pm8001_ha,
/* exclude top 4 bytes for SMP req header */
smp_cmd.long_smp_req.long_req_addr =
cpu_to_le64((u64)sg_dma_address
- (&task->smp_task.smp_req) - 4);
+ (&task->smp_task.smp_req) + 4);
/* exclude 4 bytes for SMP req header and CRC */
smp_cmd.long_smp_req.long_req_size =
cpu_to_le32((u32)sg_dma_len(&task->smp_task.smp_req)-8);
--
1.7.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 2/5] pm80xx: IButton feature support and Indirect SMP fix.
2013-09-16 15:53 [PATCH 2/5] pm80xx: IButton feature support and Indirect SMP fix Anand
@ 2013-09-16 16:04 ` Jack Wang
0 siblings, 0 replies; 2+ messages in thread
From: Jack Wang @ 2013-09-16 16:04 UTC (permalink / raw)
To: Anand; +Cc: linux-scsi, Viswas.G, Sangeetha.Gnanasekaran,
Nikith.Ganigarakoppal
On 09/16/2013 05:53 PM, Anand wrote:
> From db345f70bef0b07655d887f2d0398faf666f4a48 Mon Sep 17 00:00:00 2001
> From: Anand Kumar Santhanam <AnandKumar.Santhanam@pmcs.com>
> Date: Tue, 3 Sep 2013 15:21:29 +0530
> Subject: [PATCH 2/5] pm80xx: IButton feature support and Indirect SMP fix.
>
> IButton security feature support for motherboard controllers.
> Fix for indirect data transfer mode in case of SMP request.
>
You'd better split this into two patches for bisect-able.
Jack
> Signed-off-by: Anandkumar.Santhanam@pmcs.com
>
> ---
> drivers/scsi/pm8001/pm80xx_hwi.c | 26 ++++++++++++++++++++++----
> 1 files changed, 22 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/scsi/pm8001/pm80xx_hwi.c b/drivers/scsi/pm8001/pm80xx_hwi.c
> index be0b394..158e91d 100644
> --- a/drivers/scsi/pm8001/pm80xx_hwi.c
> +++ b/drivers/scsi/pm8001/pm80xx_hwi.c
> @@ -967,6 +967,7 @@ pm80xx_chip_soft_rst(struct pm8001_hba_info *pm8001_ha)
> {
> u32 regval;
> u32 bootloader_state;
> + u32 ibutton0, ibutton1;
>
> /* Check if MPI is in ready state to reset */
> if (mpi_uninit_check(pm8001_ha) != 0) {
> @@ -1025,7 +1026,26 @@ pm80xx_chip_soft_rst(struct pm8001_hba_info *pm8001_ha)
> if (-1 == check_fw_ready(pm8001_ha)) {
> PM8001_FAIL_DBG(pm8001_ha,
> pm8001_printk("Firmware is not ready!\n"));
> - return -EBUSY;
> + /* check iButton feature support for motherboard controller */
> + if (pm8001_ha->pdev->subsystem_vendor !=
> + PCI_VENDOR_ID_ADAPTEC2) {
> + ibutton0 = pm8001_cr32(pm8001_ha, 0,
> + MSGU_HOST_SCRATCH_PAD_6);
> + ibutton1 = pm8001_cr32(pm8001_ha, 0,
> + MSGU_HOST_SCRATCH_PAD_7);
> + if (!ibutton0 && !ibutton1) {
> + PM8001_FAIL_DBG(pm8001_ha,
> + pm8001_printk("iButton Feature is"
> + " not Available!!!\n"));
> + return -EBUSY;
> + }
> + if (ibutton0 == 0xdeadbeef && ibutton1 == 0xdeadbeef) {
> + PM8001_FAIL_DBG(pm8001_ha,
> + pm8001_printk("CRC Check for iButton"
> + " Feature Failed!!!\n"));
> + return -EBUSY;
> + }
> + }
> }
> PM8001_INIT_DBG(pm8001_ha,
> pm8001_printk("SPCv soft reset Complete\n"));
> @@ -3492,8 +3512,6 @@ static int pm80xx_chip_smp_req(struct pm8001_hba_info *pm8001_ha,
> else
> pm8001_ha->smp_exp_mode = SMP_INDIRECT;
>
> - /* DIRECT MODE support only in spcv/ve */
> - pm8001_ha->smp_exp_mode = SMP_DIRECT;
>
> tmp_addr = cpu_to_le64((u64)sg_dma_address(&task->smp_task.smp_req));
> preq_dma_addr = (char *)phys_to_virt(tmp_addr);
> @@ -3509,7 +3527,7 @@ static int pm80xx_chip_smp_req(struct pm8001_hba_info *pm8001_ha,
> /* exclude top 4 bytes for SMP req header */
> smp_cmd.long_smp_req.long_req_addr =
> cpu_to_le64((u64)sg_dma_address
> - (&task->smp_task.smp_req) - 4);
> + (&task->smp_task.smp_req) + 4);
> /* exclude 4 bytes for SMP req header and CRC */
> smp_cmd.long_smp_req.long_req_size =
> cpu_to_le32((u32)sg_dma_len(&task->smp_task.smp_req)-8);
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-09-16 16:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-16 15:53 [PATCH 2/5] pm80xx: IButton feature support and Indirect SMP fix Anand
2013-09-16 16:04 ` Jack Wang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).