Re: [PATCH 2/8] pm80xx: Corrected device state changes in I_T_Nexus_Reset

2015-07-29 Thread Tomas Henzl
On 29.7.2015 08:27, viswa...@pmcs.com wrote:
 From: Viswas G viswa...@pmcs.com
 
 In Nexus reset the device state set to DS_IN_RECOVERY before doing
 phy reset and internal cleanup. Once internal cleanup finishes,
 the device state will set to DS_OPERATIONAL.
 
 Signed-off-by: Viswas G viswa...@pmcs.com
 Signed-off-by: Suresh Thiagarajan suresh.thiagara...@pmcs.com 
 ---
  drivers/scsi/pm8001/pm8001_sas.c |   14 +++---
  drivers/scsi/pm8001/pm8001_sas.h |8 
  2 files changed, 19 insertions(+), 3 deletions(-)
 
 diff --git a/drivers/scsi/pm8001/pm8001_sas.c 
 b/drivers/scsi/pm8001/pm8001_sas.c
 index b93f289..4e6955f 100644
 --- a/drivers/scsi/pm8001/pm8001_sas.c
 +++ b/drivers/scsi/pm8001/pm8001_sas.c
 @@ -980,13 +980,21 @@ int pm8001_I_T_nexus_reset(struct domain_device *dev)
   rc = 0;
   goto out;
   }
 + pm8001_dev-setds_completion = completion_setstate;
 + PM8001_CHIP_DISP-set_dev_state_req(pm8001_ha,
 + pm8001_dev, DS_IN_RECOVERY);
 + wait_for_completion(completion_setstate);
   rc = sas_phy_reset(phy, 1);
   msleep(2000);
 + if (rc) {
 + PM8001_EH_DBG(pm8001_ha,
 + pm8001_printk(phy reset failed for device %x\n
 + with rc %d\n, pm8001_dev-device_id, rc));
 + }
   rc = pm8001_exec_internal_task_abort(pm8001_ha, pm8001_dev ,
   dev, 1, 0);
 - pm8001_dev-setds_completion = completion_setstate;
 - rc = PM8001_CHIP_DISP-set_dev_state_req(pm8001_ha,
 - pm8001_dev, 0x01);
 + PM8001_CHIP_DISP-set_dev_state_req(pm8001_ha,
 + pm8001_dev, DS_OPERATIONAL);
Hi Viswas,
the set_dev_state_req can't fail any more ? Also the
pm8001_exec_internal_task_abort may fail - shouldn't
be error handling also added ?
Cheers,
Tomas
   wait_for_completion(completion_setstate);
   } else {
   rc = sas_phy_reset(phy, 1);
 diff --git a/drivers/scsi/pm8001/pm8001_sas.h 
 b/drivers/scsi/pm8001/pm8001_sas.h
 index 8dd8b78..c9736cc 100644
 --- a/drivers/scsi/pm8001/pm8001_sas.h
 +++ b/drivers/scsi/pm8001/pm8001_sas.h
 @@ -569,6 +569,14 @@ struct pm8001_fw_image_header {
  #define  NCQ_READ_LOG_FLAG   0x8000
  #define  NCQ_ABORT_ALL_FLAG  0x4000
  #define  NCQ_2ND_RLE_FLAG0x2000
 +
 +/* Device states */
 +#define DS_OPERATIONAL   0x01
 +#define DS_PORT_IN_RESET 0x02
 +#define DS_IN_RECOVERY   0x03
 +#define DS_IN_ERROR  0x04
 +#define DS_NON_OPERATIONAL   0x07
 +
  /**
   * brief param structure for firmware flash update.
   */
 

--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 3/8] pm80xx: Update For Thermal Page Code

2015-07-29 Thread Tomas Henzl
On 29.7.2015 08:27, viswa...@pmcs.com wrote:
 From: Viswas G viswa...@pmcs.com
 
 Thermal page code has been changed to 7 for the 12G controllers.
 
 Signed-off-by: Viswas G viswa...@pmcs.com
 Signed-off-by: Suresh Thiagarajan suresh.thiagara...@pmcs.com 
Reviewed-by: Tomas Henzl the...@redhat.com

Tomas

--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 4/8] pm80xx: Fix for Incorrect DMA Unmapping of SG List

2015-07-29 Thread Tomas Henzl
On 29.7.2015 08:27, viswa...@pmcs.com wrote:
 From: Viswas G viswa...@pmcs.com
 
 In pm8001_ccb_task_free(), the dma unmapping is done based on
 ccb-n_elem value. This should be initialized to zero in the
 task_abort(). Otherwise, pm8001_ccb_task_free() will try for
 dma_unmap_sg() which is invalid for task abort and can lead to
 kernel crash.
 
 Signed-off-by: Viswas G viswa...@pmcs.com
 Signed-off-by: Suresh Thiagarajan suresh.thiagara...@pmcs.com 

Reviewed-by: Tomas Henzl the...@redhat.com

Tomas

--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch] [SCSI] atp870u: 64 bit bug in probe()

2015-07-29 Thread Dan Carpenter
On 64 bit CPUs there is a memory corruption bug on probe().  It should
be a u32 pointer instead of an unsigned long pointer or we write past
the end of the setupdata[] array.

Signed-off-by: Dan Carpenter dan.carpen...@oracle.com
---
Someone reported in 2003 that probe has a NULL deref so maybe it's
related to this memory corruption?
https://bugzilla.kernel.org/show_bug.cgi?id=1118

If only we had applied this patch when I originally sent it two years
ago, then it would only be 10 years too late instead of 12!  :P

diff --git a/drivers/scsi/atp870u.c b/drivers/scsi/atp870u.c
index 05301bc..62acabd 100644
--- a/drivers/scsi/atp870u.c
+++ b/drivers/scsi/atp870u.c
@@ -2791,11 +2791,11 @@ next_fblk_885:
p-global_map[m]= 0;
for (k=0; k  4; k++) {
outw(n++,base_io + 0x3c);
-   ((unsigned long *)setupdata[m][0])[k]=inl(base_io + 
0x38);
+   ((u32 *)setupdata[m][0])[k]=inl(base_io + 0x38);
}
for (k=0; k  4; k++) {
outw(n++,base_io + 0x3c);
-   ((unsigned long *)p-sp[m][0])[k]=inl(base_io + 0x38);
+   ((u32 *)p-sp[m][0])[k]=inl(base_io + 0x38);
}
n += 8;
}
--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v2 1/3] cxlflash: Base error recovery support

2015-07-29 Thread wenxiong



Subject: [PATCH v2 1/3] cxlflash: Base error recovery support
Date: Thu, 16 Jul 2015 18:26:35 -0500
From: Matthew R. Ochs mro...@linux.vnet.ibm.com
To: linux-scsi@vger.kernel.org,  
james.bottom...@hansenpartnership.com, n...@linux-iscsi.org,  
brk...@linux.vnet.ibm.com
CC: h...@infradead.org, mi...@neuling.org, imun...@au1.ibm.com,  
d...@ozlabs.au.ibm.com, Manoj N. Kumar ma...@linux.vnet.ibm.com


Introduce support for enhanced I/O error handling.

Signed-off-by: Matthew R. Ochs mro...@linux.vnet.ibm.com
Signed-off-by: Manoj N. Kumar ma...@linux.vnet.ibm.com
---
 drivers/scsi/cxlflash/common.h |  11 +++-
 drivers/scsi/cxlflash/main.c   | 135  
++---

 2 files changed, 133 insertions(+), 13 deletions(-)




+/**
+ * cxlflash_pci_error_detected() - called when a PCI error is detected
+ * @pdev:  PCI device struct.
+ * @state: PCI channel state.
+ *
+ * Return: PCI_ERS_RESULT_NEED_RESET or PCI_ERS_RESULT_DISCONNECT
+ */
+static pci_ers_result_t cxlflash_pci_error_detected(struct pci_dev *pdev,
+   pci_channel_state_t state)
+{
+   struct cxlflash_cfg *cfg = pci_get_drvdata(pdev);
+
+   pr_debug(%s: pdev=%p state=%u\n, __func__, pdev, state);
+
+   switch (state) {
+   case pci_channel_io_frozen:
+   cfg-eeh_active = EEH_STATE_ACTIVE;
+   udelay(100);
+
+   term_mc(cfg, UNDO_START);
+   stop_afu(cfg);
+
+   return PCI_ERS_RESULT_CAN_RECOVER;
+   case pci_channel_io_perm_failure:
+   cfg-eeh_active = EEH_STATE_FAILED;
+   wake_up_all(cfg-eeh_waitq);
+   return PCI_ERS_RESULT_DISCONNECT;
+   default:
+   break;
+   }
+   return PCI_ERS_RESULT_NEED_RESET;
+}
+
+/**
+ * cxlflash_pci_slot_reset() - called when PCI slot has been reset
+ * @pdev:  PCI device struct.
+ *
+ * This routine is called by the pci error recovery code after the PCI
+ * slot has been reset, just before we should resume normal operations.
+ *
+ * Return: PCI_ERS_RESULT_RECOVERED or PCI_ERS_RESULT_DISCONNECT
+ */
+static pci_ers_result_t cxlflash_pci_slot_reset(struct pci_dev *pdev)
+{
+   int rc = 0;
+   struct cxlflash_cfg *cfg = pci_get_drvdata(pdev);
+
+   pr_debug(%s: pdev=%p\n, __func__, pdev);
+
+   rc = init_afu(cfg);
+   if (unlikely(rc)) {
+   pr_err(%s: EEH recovery failed! (%d)\n, __func__, rc);
+   return PCI_ERS_RESULT_DISCONNECT;
+   }
+
+   return PCI_ERS_RESULT_RECOVERED;
+}
+
+/**
+ * cxlflash_pci_resume() - called when normal operation can resume
+ * @pdev:  PCI device struct
+ */
+static void cxlflash_pci_resume(struct pci_dev *pdev)
+{
+   struct cxlflash_cfg *cfg = pci_get_drvdata(pdev);
+
+   pr_debug(%s: pdev=%p\n, __func__, pdev);
+
+   cfg-eeh_active = EEH_STATE_NONE;
+   wake_up_all(cfg-eeh_waitq);
+}
+


Do you need host-lock in these EEH callback functions?


+static const struct pci_error_handlers cxlflash_err_handler = {
+   .error_detected = cxlflash_pci_error_detected,
+   .slot_reset = cxlflash_pci_slot_reset,
+   .resume = cxlflash_pci_resume,
+};
+
 /*
  * PCI device structure
  */
@@ -2267,6 +2381,7 @@ static struct pci_driver cxlflash_driver = {
.id_table = cxlflash_pci_table,
.probe = cxlflash_probe,
.remove = cxlflash_remove,
+   .err_handler = cxlflash_err_handler,
 };

 /**
--
2.1.0


Thanks,
Wendy

--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] scsi: a100u2w: trivial typo in printk

2015-07-29 Thread Colin King
From: Colin Ian King colin.k...@canonical.com

Trivial typo fix, \b should be \n

Signed-off-by: Colin Ian King colin.k...@canonical.com
---
 drivers/scsi/a100u2w.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/a100u2w.c b/drivers/scsi/a100u2w.c
index cac6b37..8086bd0 100644
--- a/drivers/scsi/a100u2w.c
+++ b/drivers/scsi/a100u2w.c
@@ -888,7 +888,7 @@ static int inia100_build_scb(struct orc_host * host, struct 
orc_scb * scb, struc
scb-sense_len = SENSE_SIZE;
scb-cdb_len = cmd-cmd_len;
if (scb-cdb_len = IMAX_CDB) {
-   printk(max cdb length= %x\b, cmd-cmd_len);
+   printk(max cdb length= %x\n, cmd-cmd_len);
scb-cdb_len = IMAX_CDB;
}
scb-ident = (u8)(cmd-device-lun  0xff) | DISC_ALLOW;
-- 
2.4.6

--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] scsi: pmcraid: trivial typo in printk

2015-07-29 Thread Joe Perches
Trivial typo fixes:

o \b should be \n
o coalesce format to avoid excess spaces

Signed-off-by: Joe Perches j...@perches.com
---
And another here:

 drivers/scsi/pmcraid.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/pmcraid.c b/drivers/scsi/pmcraid.c
index ed31d8c..b421de2 100644
--- a/drivers/scsi/pmcraid.c
+++ b/drivers/scsi/pmcraid.c
@@ -1558,8 +1558,7 @@ static void pmcraid_handle_config_change(struct 
pmcraid_instance *pinstance)
cfg_entry = ccn_hcam-cfg_entry;
fw_version = be16_to_cpu(pinstance-inq_data-fw_version);
 
-   pmcraid_info(CCN(%x): %x timestamp: %llx type: %x lost: %x flags: %x \
-res: %x:%x:%x:%x\n,
+   pmcraid_info(CCN(%x): %x timestamp: %llx type: %x lost: %x flags: %x 
res: %x:%x:%x:%x\n,
 pinstance-ccn.hcam-ilid,
 pinstance-ccn.hcam-op_code,
((pinstance-ccn.hcam-timestamp1) |
@@ -1583,7 +1582,7 @@ static void pmcraid_handle_config_change(struct 
pmcraid_instance *pinstance)
if (pinstance-ccn.hcam-notification_lost) {
cfgcmd = pmcraid_get_free_cmd(pinstance);
if (cfgcmd) {
-   pmcraid_info(lost CCN, reading config table\b);
+   pmcraid_info(lost CCN, reading config table\n);
pinstance-reinit_cfg_table = 1;
pmcraid_querycfg(cfgcmd);
} else {


--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/8] pm80xx: Corrected device state changes in I_T_Nexus_Reset

2015-07-29 Thread Hannes Reinecke
On 07/29/2015 08:27 AM, viswa...@pmcs.com wrote:
 From: Viswas G viswa...@pmcs.com
 
 In Nexus reset the device state set to DS_IN_RECOVERY before doing
 phy reset and internal cleanup. Once internal cleanup finishes,
 the device state will set to DS_OPERATIONAL.
 
 Signed-off-by: Viswas G viswa...@pmcs.com
 Signed-off-by: Suresh Thiagarajan suresh.thiagara...@pmcs.com 
 ---
Reviewed-by: Hannes Reinecke h...@suse.com

Cheers,

Hannes
-- 
Dr. Hannes ReineckezSeries  Storage
h...@suse.de   +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)
--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/8] pm80xx: Updated link rate

2015-07-29 Thread Hannes Reinecke
On 07/29/2015 08:27 AM, viswa...@pmcs.com wrote:
 From: Viswas G viswa...@pmcs.com
 
 
 Updated 12G linkrate to libsas.
 
 Signed-off-by: Viswas G viswa...@pmcs.com
 Signed-off-by: Suresh Thiagarajan suresh.thiagara...@pmcs.com 
 
Reviewed-by: Hannes Reinecke h...@suse.com

Cheers,

Hannes
-- 
Dr. Hannes ReineckezSeries  Storage
h...@suse.de   +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)
--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [PATCH] pm80xx: Added pm8006 controller support

2015-07-29 Thread Suresh Thiagarajan
Hi James,

This patch is not pulled in yet.

Regards,
Suresh

-Original Message-
From: Jack Wang [mailto:xjtu...@gmail.com] 
Sent: Tuesday, February 24, 2015 2:07 PM
To: Suresh Thiagarajan
Cc: linux-scsi@vger.kernel.org; James Bottomley; Viswas G; pmc...@pmcs.com
Subject: Re: [PATCH] pm80xx: Added pm8006 controller support

Sorry for delay, I missed this patch.

Acked-by: Jack Wang xjtu...@gmail.com

2015-02-12 7:34 GMT+01:00 Suresh Thiagarajan suresh.thiagara...@pmcs.com:
 Added the pm8006 controller id in pci table

 Signed-off-by: Suresh Thiagarajan suresh.thiagara...@pmcs.com
 Signed-off-by: Viswas G viswa...@pmcs.com
 ---
  drivers/scsi/pm8001/pm8001_defs.h |3 ++-
  drivers/scsi/pm8001/pm8001_init.c |5 -
  2 files changed, 6 insertions(+), 2 deletions(-)

 diff --git a/drivers/scsi/pm8001/pm8001_defs.h 
 b/drivers/scsi/pm8001/pm8001_defs.h
 index 74a4bb9..dc4233b 100644
 --- a/drivers/scsi/pm8001/pm8001_defs.h
 +++ b/drivers/scsi/pm8001/pm8001_defs.h
 @@ -49,7 +49,8 @@ enum chip_flavors {
 chip_8019,
 chip_8074,
 chip_8076,
 -   chip_8077
 +   chip_8077,
 +   chip_8006,
  };

  enum phy_speed {
 diff --git a/drivers/scsi/pm8001/pm8001_init.c 
 b/drivers/scsi/pm8001/pm8001_init.c
 index 691..e1aee58 100644
 --- a/drivers/scsi/pm8001/pm8001_init.c
 +++ b/drivers/scsi/pm8001/pm8001_init.c
 @@ -57,6 +57,7 @@ static const struct pm8001_chip_info pm8001_chips[] = {
 [chip_8074] = {0,  8, pm8001_80xx_dispatch,},
 [chip_8076] = {0,  16, pm8001_80xx_dispatch,},
 [chip_8077] = {0,  16, pm8001_80xx_dispatch,},
 +   [chip_8006] = {0,  16, pm8001_80xx_dispatch,},
  };
  static int pm8001_id;

 @@ -1108,6 +1109,8 @@ err_out_enable:
   */
  static struct pci_device_id pm8001_pci_table[] = {
 { PCI_VDEVICE(PMC_Sierra, 0x8001), chip_8001 },
 +   { PCI_VDEVICE(PMC_Sierra, 0x8006), chip_8006 },
 +   { PCI_VDEVICE(ADAPTEC2, 0x8006), chip_8006 },
 { PCI_VDEVICE(ATTO, 0x0042), chip_8001 },
 /* Support for SPC/SPCv/SPCve controllers */
 { PCI_VDEVICE(ADAPTEC2, 0x8001), chip_8001 }, @@ -1218,7 
 +1221,7 @@ MODULE_AUTHOR(Anand Kumar Santhanam 
 anandkumar.santha...@pmcs.com);
  MODULE_AUTHOR(Sangeetha Gnanasekaran 
 sangeetha.gnanaseka...@pmcs.com);
  MODULE_AUTHOR(Nikith Ganigarakoppal 
 nikith.ganigarakop...@pmcs.com);
  MODULE_DESCRIPTION(
 -   PMC-Sierra PM8001/8081/8088/8089/8074/8076/8077 
 +   PMC-Sierra PM8001/8006/8081/8088/8089/8074/8076/8077 
 SAS/SATA controller driver);  
 MODULE_VERSION(DRV_VERSION);  MODULE_LICENSE(GPL);
 --
 1.7.1

N�r��yb�X��ǧv�^�)޺{.n�+{{ay�ʇڙ�,j��f���h���z��w���
���j:+v���w�j�mzZ+�ݢj��!�i

Re: [PATCH 4/8] pm80xx: Fix for Incorrect DMA Unmapping of SG List

2015-07-29 Thread Hannes Reinecke
On 07/29/2015 08:27 AM, viswa...@pmcs.com wrote:
 From: Viswas G viswa...@pmcs.com
 
 In pm8001_ccb_task_free(), the dma unmapping is done based on
 ccb-n_elem value. This should be initialized to zero in the
 task_abort(). Otherwise, pm8001_ccb_task_free() will try for
 dma_unmap_sg() which is invalid for task abort and can lead to
 kernel crash.
 
 Signed-off-by: Viswas G viswa...@pmcs.com
 Signed-off-by: Suresh Thiagarajan suresh.thiagara...@pmcs.com 
 ---
  drivers/scsi/pm8001/pm8001_sas.c |1 +
  1 files changed, 1 insertions(+), 0 deletions(-)
 
 diff --git a/drivers/scsi/pm8001/pm8001_sas.c 
 b/drivers/scsi/pm8001/pm8001_sas.c
 index 4e6955f..b1c5fb9 100644
 --- a/drivers/scsi/pm8001/pm8001_sas.c
 +++ b/drivers/scsi/pm8001/pm8001_sas.c
 @@ -790,6 +790,7 @@ pm8001_exec_internal_task_abort(struct pm8001_hba_info 
 *pm8001_ha,
   ccb-device = pm8001_dev;
   ccb-ccb_tag = ccb_tag;
   ccb-task = task;
 + ccb-n_elem = 0;
  
   res = PM8001_CHIP_DISP-task_abort(pm8001_ha,
   pm8001_dev, flag, task_tag, ccb_tag);
 
Reviewed-by: Hannes Reinecke h...@suse.com

Cheers,

Hannes
-- 
Dr. Hannes ReineckezSeries  Storage
h...@suse.de   +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)
--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 3/8] pm80xx: Update For Thermal Page Code

2015-07-29 Thread Hannes Reinecke
On 07/29/2015 08:27 AM, viswa...@pmcs.com wrote:
 From: Viswas G viswa...@pmcs.com
 
 Thermal page code has been changed to 7 for the 12G controllers.
 
 Signed-off-by: Viswas G viswa...@pmcs.com
 Signed-off-by: Suresh Thiagarajan suresh.thiagara...@pmcs.com 
 ---
Reviewed-by: Hannes Reinecke h...@suse.com

Cheers,

Hannes
-- 
Dr. Hannes ReineckezSeries  Storage
h...@suse.de   +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)
--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 0/8] pm80xx: Driver updates

2015-07-29 Thread Jack Wang
2015-07-29 8:27 GMT+02:00  viswa...@pmcs.com:
 From: Viswas G viswa...@pmcs.com

 This patch set contains bug fixes for pm80xx driver.
 Please consider these patches for next kernel release.

 Viswas G (8):
   pm80xx: Updated link rate
   pm80xx: Corrected device state changes in I_T_Nexus_Reset
   pm80xx: Update For Thermal Page Code
   pm80xx: Fix for Incorrect DMA Unmapping of SG List
   pm80xx: Remove unnecessary phy disconnect while link error
   pm80xx: Add PORT RECOVERY TIMEOUT support
   pm80xx: Handling Invalid SSP Response frame
   pm80xx: Bump pm80xx driver version to 0.1.38

  drivers/scsi/pm8001/pm8001_defs.h |1 +
  drivers/scsi/pm8001/pm8001_hwi.c  |4 +
  drivers/scsi/pm8001/pm8001_sas.c  |   15 -
  drivers/scsi/pm8001/pm8001_sas.h  |   12 +++-
  drivers/scsi/pm8001/pm80xx_hwi.c  |  111 
 +++--
  drivers/scsi/pm8001/pm80xx_hwi.h  |5 +-
  6 files changed, 112 insertions(+), 36 deletions(-)

For the whole patchset:

Reviewed-by: Jack Wang jinpu.w...@profitbricks.com

PS: company policy requests to use the email address of the company,
please cc me to above address next time, I will send a patch to update
my email
in MAINTAINERS file.

Thanks
Jack
--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 8/8] pm80xx: Bump pm80xx driver version to 0.1.38

2015-07-29 Thread Hannes Reinecke
On 07/29/2015 08:27 AM, viswa...@pmcs.com wrote:
 From: Viswas G viswa...@pmcs.com
 
 Bump pm80xx driver version to 0.1.38.
 
 Signed-off-by: Viswas G viswa...@pmcs.com
 Signed-off-by: Suresh Thiagarajan suresh.thiagara...@pmcs.com 
 ---
  drivers/scsi/pm8001/pm8001_sas.h |2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)
 
 diff --git a/drivers/scsi/pm8001/pm8001_sas.h 
 b/drivers/scsi/pm8001/pm8001_sas.h
 index 2788026..e2e97db 100644
 --- a/drivers/scsi/pm8001/pm8001_sas.h
 +++ b/drivers/scsi/pm8001/pm8001_sas.h
 @@ -58,7 +58,7 @@
  #include pm8001_defs.h
  
  #define DRV_NAME pm80xx
 -#define DRV_VERSION  0.1.37
 +#define DRV_VERSION  0.1.38
  #define PM8001_FAIL_LOGGING  0x01 /* Error message logging */
  #define PM8001_INIT_LOGGING  0x02 /* driver init logging */
  #define PM8001_DISC_LOGGING  0x04 /* discovery layer logging */
 
Reviewed-by: Hannes Reinecke h...@suse.com

Cheers,

Hannes
-- 
Dr. Hannes ReineckezSeries  Storage
h...@suse.de   +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)
--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 5/8] pm80xx: Remove unnecessary phy disconnect while link error

2015-07-29 Thread Hannes Reinecke
On 07/29/2015 08:27 AM, viswa...@pmcs.com wrote:
 From: Viswas G viswa...@pmcs.com
 
 If the link error happens, we don't need to disconnect the phy,
 which will remove the drive. Instead acknowledging the controller
 and logging the error will be enough.
 
 Signed-off-by: Viswas G viswa...@pmcs.com
 Signed-off-by: Suresh Thiagarajan suresh.thiagara...@pmcs.com 
 ---
  drivers/scsi/pm8001/pm80xx_hwi.c |   12 
  1 files changed, 0 insertions(+), 12 deletions(-)
 
 diff --git a/drivers/scsi/pm8001/pm80xx_hwi.c 
 b/drivers/scsi/pm8001/pm80xx_hwi.c
 index dced9f7..3d8b4ae 100644
 --- a/drivers/scsi/pm8001/pm80xx_hwi.c
 +++ b/drivers/scsi/pm8001/pm80xx_hwi.c
 @@ -3176,9 +3176,6 @@ static int mpi_hw_event(struct pm8001_hba_info 
 *pm8001_ha, void *piomb)
   pm8001_printk(HW_EVENT_LINK_ERR_INVALID_DWORD\n));
   pm80xx_hw_event_ack_req(pm8001_ha, 0,
   HW_EVENT_LINK_ERR_INVALID_DWORD, port_id, phy_id, 0, 0);
 - sas_phy_disconnected(sas_phy);
 - phy-phy_attached = 0;
 - sas_ha-notify_port_event(sas_phy, PORTE_LINK_RESET_ERR);
   break;
   case HW_EVENT_LINK_ERR_DISPARITY_ERROR:
   PM8001_MSG_DBG(pm8001_ha,
 @@ -3186,9 +3183,6 @@ static int mpi_hw_event(struct pm8001_hba_info 
 *pm8001_ha, void *piomb)
   pm80xx_hw_event_ack_req(pm8001_ha, 0,
   HW_EVENT_LINK_ERR_DISPARITY_ERROR,
   port_id, phy_id, 0, 0);
 - sas_phy_disconnected(sas_phy);
 - phy-phy_attached = 0;
 - sas_ha-notify_port_event(sas_phy, PORTE_LINK_RESET_ERR);
   break;
   case HW_EVENT_LINK_ERR_CODE_VIOLATION:
   PM8001_MSG_DBG(pm8001_ha,
 @@ -3196,9 +3190,6 @@ static int mpi_hw_event(struct pm8001_hba_info 
 *pm8001_ha, void *piomb)
   pm80xx_hw_event_ack_req(pm8001_ha, 0,
   HW_EVENT_LINK_ERR_CODE_VIOLATION,
   port_id, phy_id, 0, 0);
 - sas_phy_disconnected(sas_phy);
 - phy-phy_attached = 0;
 - sas_ha-notify_port_event(sas_phy, PORTE_LINK_RESET_ERR);
   break;
   case HW_EVENT_LINK_ERR_LOSS_OF_DWORD_SYNCH:
   PM8001_MSG_DBG(pm8001_ha, pm8001_printk(
 @@ -3206,9 +3197,6 @@ static int mpi_hw_event(struct pm8001_hba_info 
 *pm8001_ha, void *piomb)
   pm80xx_hw_event_ack_req(pm8001_ha, 0,
   HW_EVENT_LINK_ERR_LOSS_OF_DWORD_SYNCH,
   port_id, phy_id, 0, 0);
 - sas_phy_disconnected(sas_phy);
 - phy-phy_attached = 0;
 - sas_ha-notify_port_event(sas_phy, PORTE_LINK_RESET_ERR);
   break;
   case HW_EVENT_MALFUNCTION:
   PM8001_MSG_DBG(pm8001_ha,
 
So what happens with the port, then?
Will you be getting another event when the port finally disconnects?
If not, how to you remove the port after a link failure?

Cheers,

Hannes
-- 
Dr. Hannes ReineckezSeries  Storage
h...@suse.de   +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)
--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 6/8] pm80xx: Add PORT RECOVERY TIMEOUT support

2015-07-29 Thread Hannes Reinecke
On 07/29/2015 08:27 AM, viswa...@pmcs.com wrote:
 From: Viswas G viswa...@pmcs.com
 
 PORT RECOVERY TIMEOUT is the maximum time between the controller's
 detection of the PHY down until the receipt of the ID_Frame (from the
 same remote SAS port). If the time expires before the ID_FRAME is
 received, the port is considered INVALID and can be removed. The
 IOP_EVENT_PORT_RECOVERY_TIMER_TMO event is reported following the
 IOP_EVENT_ PHY_DOWN event when the PHY/port does not recover after
 Port Recovery Time.
 
 Signed-off-by: Viswas G viswa...@pmcs.com
 Signed-off-by: Suresh Thiagarajan suresh.thiagara...@pmcs.com 
 ---
Ah. Here is the link down handling.
Maybe you should indicate this in the previous patch.

Reviewed-by: Hannes Reinecke h...@suse.com

Cheers,

Hannes
-- 
Dr. Hannes ReineckezSeries  Storage
h...@suse.de   +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)
--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 7/8] pm80xx: Handling Invalid SSP Response frame

2015-07-29 Thread Hannes Reinecke
On 07/29/2015 08:27 AM, viswa...@pmcs.com wrote:
 From: Viswas G viswa...@pmcs.com
 
 The request has to be retried incase if the length of the SSP
 Response IU is invalid.
 
 Signed-off-by: Viswas G viswa...@pmcs.com
 Signed-off-by: Suresh Thiagarajan suresh.thiagara...@pmcs.com 
 ---
Reviewed-by: Hannes Reinecke h...@suse.com

Cheers,

Hannes
-- 
Dr. Hannes ReineckezSeries  Storage
h...@suse.de   +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)
--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 5/8] pm80xx: Remove unnecessary phy disconnect while link error

2015-07-29 Thread Hannes Reinecke
On 07/29/2015 11:20 AM, Viswas G wrote:
 
 On Wed, Jul 29, 2015 at 2:26 PM, Hannes Reinecke h...@suse.de wrote:
 On 07/29/2015 08:27 AM, viswa...@pmcs.com wrote:
 From: Viswas G viswa...@pmcs.com

 If the link error happens, we don't need to disconnect the phy,
 which will remove the drive. Instead acknowledging the controller
 and logging the error will be enough.

 Signed-off-by: Viswas G viswa...@pmcs.com
 Signed-off-by: Suresh Thiagarajan suresh.thiagara...@pmcs.com
 ---
  drivers/scsi/pm8001/pm80xx_hwi.c |   12 
  1 files changed, 0 insertions(+), 12 deletions(-)

 diff --git a/drivers/scsi/pm8001/pm80xx_hwi.c 
 b/drivers/scsi/pm8001/pm80xx_hwi.c
 index dced9f7..3d8b4ae 100644
 --- a/drivers/scsi/pm8001/pm80xx_hwi.c
 +++ b/drivers/scsi/pm8001/pm80xx_hwi.c
 @@ -3176,9 +3176,6 @@ static int mpi_hw_event(struct pm8001_hba_info 
 *pm8001_ha, void *piomb)
   pm8001_printk(HW_EVENT_LINK_ERR_INVALID_DWORD\n));
   pm80xx_hw_event_ack_req(pm8001_ha, 0,
   HW_EVENT_LINK_ERR_INVALID_DWORD, port_id, phy_id, 0, 
 0);
 - sas_phy_disconnected(sas_phy);
 - phy-phy_attached = 0;
 - sas_ha-notify_port_event(sas_phy, PORTE_LINK_RESET_ERR);
   break;
   case HW_EVENT_LINK_ERR_DISPARITY_ERROR:
   PM8001_MSG_DBG(pm8001_ha,
 @@ -3186,9 +3183,6 @@ static int mpi_hw_event(struct pm8001_hba_info 
 *pm8001_ha, void *piomb)
   pm80xx_hw_event_ack_req(pm8001_ha, 0,
   HW_EVENT_LINK_ERR_DISPARITY_ERROR,
   port_id, phy_id, 0, 0);
 - sas_phy_disconnected(sas_phy);
 - phy-phy_attached = 0;
 - sas_ha-notify_port_event(sas_phy, PORTE_LINK_RESET_ERR);
   break;
   case HW_EVENT_LINK_ERR_CODE_VIOLATION:
   PM8001_MSG_DBG(pm8001_ha,
 @@ -3196,9 +3190,6 @@ static int mpi_hw_event(struct pm8001_hba_info 
 *pm8001_ha, void *piomb)
   pm80xx_hw_event_ack_req(pm8001_ha, 0,
   HW_EVENT_LINK_ERR_CODE_VIOLATION,
   port_id, phy_id, 0, 0);
 - sas_phy_disconnected(sas_phy);
 - phy-phy_attached = 0;
 - sas_ha-notify_port_event(sas_phy, PORTE_LINK_RESET_ERR);
   break;
   case HW_EVENT_LINK_ERR_LOSS_OF_DWORD_SYNCH:
   PM8001_MSG_DBG(pm8001_ha, pm8001_printk(
 @@ -3206,9 +3197,6 @@ static int mpi_hw_event(struct pm8001_hba_info 
 *pm8001_ha, void *piomb)
   pm80xx_hw_event_ack_req(pm8001_ha, 0,
   HW_EVENT_LINK_ERR_LOSS_OF_DWORD_SYNCH,
   port_id, phy_id, 0, 0);
 - sas_phy_disconnected(sas_phy);
 - phy-phy_attached = 0;
 - sas_ha-notify_port_event(sas_phy, PORTE_LINK_RESET_ERR);
   break;
   case HW_EVENT_MALFUNCTION:
   PM8001_MSG_DBG(pm8001_ha,

 So what happens with the port, then?
 Will you be getting another event when the port finally disconnects?
 If not, how to you remove the port after a link failure?

 
 When the Phy disconnects, we will be getting the PHY DOWN events for 
 the phys in that port and we will remove that port. 
 
Okay, thanks.

Reviewed-by: Hannes Reinecke h...@suse.com

Cheers,

Hannes
-- 
Dr. Hannes ReineckezSeries  Storage
h...@suse.de   +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)
--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [PATCH 5/8] pm80xx: Remove unnecessary phy disconnect while link error

2015-07-29 Thread Viswas G

On Wed, Jul 29, 2015 at 2:26 PM, Hannes Reinecke h...@suse.de wrote:
 On 07/29/2015 08:27 AM, viswa...@pmcs.com wrote:
 From: Viswas G viswa...@pmcs.com

 If the link error happens, we don't need to disconnect the phy,
 which will remove the drive. Instead acknowledging the controller
 and logging the error will be enough.

 Signed-off-by: Viswas G viswa...@pmcs.com
 Signed-off-by: Suresh Thiagarajan suresh.thiagara...@pmcs.com
 ---
  drivers/scsi/pm8001/pm80xx_hwi.c |   12 
  1 files changed, 0 insertions(+), 12 deletions(-)

 diff --git a/drivers/scsi/pm8001/pm80xx_hwi.c 
 b/drivers/scsi/pm8001/pm80xx_hwi.c
 index dced9f7..3d8b4ae 100644
 --- a/drivers/scsi/pm8001/pm80xx_hwi.c
 +++ b/drivers/scsi/pm8001/pm80xx_hwi.c
 @@ -3176,9 +3176,6 @@ static int mpi_hw_event(struct pm8001_hba_info 
 *pm8001_ha, void *piomb)
   pm8001_printk(HW_EVENT_LINK_ERR_INVALID_DWORD\n));
   pm80xx_hw_event_ack_req(pm8001_ha, 0,
   HW_EVENT_LINK_ERR_INVALID_DWORD, port_id, phy_id, 0, 
 0);
 - sas_phy_disconnected(sas_phy);
 - phy-phy_attached = 0;
 - sas_ha-notify_port_event(sas_phy, PORTE_LINK_RESET_ERR);
   break;
   case HW_EVENT_LINK_ERR_DISPARITY_ERROR:
   PM8001_MSG_DBG(pm8001_ha,
 @@ -3186,9 +3183,6 @@ static int mpi_hw_event(struct pm8001_hba_info 
 *pm8001_ha, void *piomb)
   pm80xx_hw_event_ack_req(pm8001_ha, 0,
   HW_EVENT_LINK_ERR_DISPARITY_ERROR,
   port_id, phy_id, 0, 0);
 - sas_phy_disconnected(sas_phy);
 - phy-phy_attached = 0;
 - sas_ha-notify_port_event(sas_phy, PORTE_LINK_RESET_ERR);
   break;
   case HW_EVENT_LINK_ERR_CODE_VIOLATION:
   PM8001_MSG_DBG(pm8001_ha,
 @@ -3196,9 +3190,6 @@ static int mpi_hw_event(struct pm8001_hba_info 
 *pm8001_ha, void *piomb)
   pm80xx_hw_event_ack_req(pm8001_ha, 0,
   HW_EVENT_LINK_ERR_CODE_VIOLATION,
   port_id, phy_id, 0, 0);
 - sas_phy_disconnected(sas_phy);
 - phy-phy_attached = 0;
 - sas_ha-notify_port_event(sas_phy, PORTE_LINK_RESET_ERR);
   break;
   case HW_EVENT_LINK_ERR_LOSS_OF_DWORD_SYNCH:
   PM8001_MSG_DBG(pm8001_ha, pm8001_printk(
 @@ -3206,9 +3197,6 @@ static int mpi_hw_event(struct pm8001_hba_info 
 *pm8001_ha, void *piomb)
   pm80xx_hw_event_ack_req(pm8001_ha, 0,
   HW_EVENT_LINK_ERR_LOSS_OF_DWORD_SYNCH,
   port_id, phy_id, 0, 0);
 - sas_phy_disconnected(sas_phy);
 - phy-phy_attached = 0;
 - sas_ha-notify_port_event(sas_phy, PORTE_LINK_RESET_ERR);
   break;
   case HW_EVENT_MALFUNCTION:
   PM8001_MSG_DBG(pm8001_ha,

 So what happens with the port, then?
 Will you be getting another event when the port finally disconnects?
 If not, how to you remove the port after a link failure?


When the Phy disconnects, we will be getting the PHY DOWN events for 
the phys in that port and we will remove that port. 

 Cheers,

 Hannes
 --
 Dr. Hannes ReineckezSeries  Storage
 h...@suse.de   +49 911 74053 688
 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
 GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
 HRB 21284 (AG Nürnberg)
 --
 To unsubscribe from this list: send the line unsubscribe linux-scsi in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/8] pm80xx: Corrected device state changes in I_T_Nexus_Reset

2015-07-29 Thread Viswas.G
From: Viswas G viswa...@pmcs.com

In Nexus reset the device state set to DS_IN_RECOVERY before doing
phy reset and internal cleanup. Once internal cleanup finishes,
the device state will set to DS_OPERATIONAL.

Signed-off-by: Viswas G viswa...@pmcs.com
Signed-off-by: Suresh Thiagarajan suresh.thiagara...@pmcs.com 
---
 drivers/scsi/pm8001/pm8001_sas.c |   14 +++---
 drivers/scsi/pm8001/pm8001_sas.h |8 
 2 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/pm8001/pm8001_sas.c b/drivers/scsi/pm8001/pm8001_sas.c
index b93f289..4e6955f 100644
--- a/drivers/scsi/pm8001/pm8001_sas.c
+++ b/drivers/scsi/pm8001/pm8001_sas.c
@@ -980,13 +980,21 @@ int pm8001_I_T_nexus_reset(struct domain_device *dev)
rc = 0;
goto out;
}
+   pm8001_dev-setds_completion = completion_setstate;
+   PM8001_CHIP_DISP-set_dev_state_req(pm8001_ha,
+   pm8001_dev, DS_IN_RECOVERY);
+   wait_for_completion(completion_setstate);
rc = sas_phy_reset(phy, 1);
msleep(2000);
+   if (rc) {
+   PM8001_EH_DBG(pm8001_ha,
+   pm8001_printk(phy reset failed for device %x\n
+   with rc %d\n, pm8001_dev-device_id, rc));
+   }
rc = pm8001_exec_internal_task_abort(pm8001_ha, pm8001_dev ,
dev, 1, 0);
-   pm8001_dev-setds_completion = completion_setstate;
-   rc = PM8001_CHIP_DISP-set_dev_state_req(pm8001_ha,
-   pm8001_dev, 0x01);
+   PM8001_CHIP_DISP-set_dev_state_req(pm8001_ha,
+   pm8001_dev, DS_OPERATIONAL);
wait_for_completion(completion_setstate);
} else {
rc = sas_phy_reset(phy, 1);
diff --git a/drivers/scsi/pm8001/pm8001_sas.h b/drivers/scsi/pm8001/pm8001_sas.h
index 8dd8b78..c9736cc 100644
--- a/drivers/scsi/pm8001/pm8001_sas.h
+++ b/drivers/scsi/pm8001/pm8001_sas.h
@@ -569,6 +569,14 @@ struct pm8001_fw_image_header {
 #defineNCQ_READ_LOG_FLAG   0x8000
 #defineNCQ_ABORT_ALL_FLAG  0x4000
 #defineNCQ_2ND_RLE_FLAG0x2000
+
+/* Device states */
+#define DS_OPERATIONAL 0x01
+#define DS_PORT_IN_RESET   0x02
+#define DS_IN_RECOVERY 0x03
+#define DS_IN_ERROR0x04
+#define DS_NON_OPERATIONAL 0x07
+
 /**
  * brief param structure for firmware flash update.
  */
-- 
1.7.1

--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 6/8] pm80xx: Add PORT RECOVERY TIMEOUT support

2015-07-29 Thread Viswas.G
From: Viswas G viswa...@pmcs.com

PORT RECOVERY TIMEOUT is the maximum time between the controller's
detection of the PHY down until the receipt of the ID_Frame (from the
same remote SAS port). If the time expires before the ID_FRAME is
received, the port is considered INVALID and can be removed. The
IOP_EVENT_PORT_RECOVERY_TIMER_TMO event is reported following the
IOP_EVENT_ PHY_DOWN event when the PHY/port does not recover after
Port Recovery Time.

Signed-off-by: Viswas G viswa...@pmcs.com
Signed-off-by: Suresh Thiagarajan suresh.thiagara...@pmcs.com 
---
 drivers/scsi/pm8001/pm8001_sas.h |2 +-
 drivers/scsi/pm8001/pm80xx_hwi.c |   83 ++---
 2 files changed, 68 insertions(+), 17 deletions(-)

diff --git a/drivers/scsi/pm8001/pm8001_sas.h b/drivers/scsi/pm8001/pm8001_sas.h
index c9736cc..2788026 100644
--- a/drivers/scsi/pm8001/pm8001_sas.h
+++ b/drivers/scsi/pm8001/pm8001_sas.h
@@ -241,7 +241,7 @@ struct pm8001_chip_info {
 struct pm8001_port {
struct asd_sas_port sas_port;
u8  port_attached;
-   u8  wide_port_phymap;
+   u16 wide_port_phymap;
u8  port_state;
struct list_headlist;
 };
diff --git a/drivers/scsi/pm8001/pm80xx_hwi.c b/drivers/scsi/pm8001/pm80xx_hwi.c
index 3d8b4ae..8817ce6 100644
--- a/drivers/scsi/pm8001/pm80xx_hwi.c
+++ b/drivers/scsi/pm8001/pm80xx_hwi.c
@@ -309,6 +309,9 @@ static void read_main_config_table(struct pm8001_hba_info 
*pm8001_ha)
pm8001_mr32(address, MAIN_INT_VECTOR_TABLE_OFFSET);
pm8001_ha-main_cfg_tbl.pm80xx_tbl.phy_attr_table_offset =
pm8001_mr32(address, MAIN_SAS_PHY_ATTR_TABLE_OFFSET);
+   /* read port recover and reset timeout */
+   pm8001_ha-main_cfg_tbl.pm80xx_tbl.port_recovery_timer =
+   pm8001_mr32(address, MAIN_PORT_RECOVERY_TIMER);
 }
 
 /**
@@ -585,6 +588,12 @@ static void update_main_config_table(struct 
pm8001_hba_info *pm8001_ha)
pm8001_ha-main_cfg_tbl.pm80xx_tbl.port_recovery_timer);
pm8001_mw32(address, MAIN_INT_REASSERTION_DELAY,
pm8001_ha-main_cfg_tbl.pm80xx_tbl.interrupt_reassertion_delay);
+
+   pm8001_ha-main_cfg_tbl.pm80xx_tbl.port_recovery_timer = 0x;
+   pm8001_ha-main_cfg_tbl.pm80xx_tbl.port_recovery_timer |=
+   PORT_RECOVERY_TIMEOUT;
+   pm8001_mw32(address, MAIN_PORT_RECOVERY_TIMER,
+   pm8001_ha-main_cfg_tbl.pm80xx_tbl.port_recovery_timer);
 }
 
 /**
@@ -2836,6 +2845,32 @@ static void pm80xx_hw_event_ack_req(struct 
pm8001_hba_info *pm8001_ha,
 static int pm80xx_chip_phy_ctl_req(struct pm8001_hba_info *pm8001_ha,
u32 phyId, u32 phy_op);
 
+static void hw_event_port_recover(struct pm8001_hba_info *pm8001_ha,
+   void *piomb)
+{
+   struct hw_event_resp *pPayload = (struct hw_event_resp *)(piomb + 4);
+   u32 phyid_npip_portstate = le32_to_cpu(pPayload-phyid_npip_portstate);
+   u8 phy_id = (u8)((phyid_npip_portstate  0xFF)  16);
+   u32 lr_status_evt_portid =
+   le32_to_cpu(pPayload-lr_status_evt_portid);
+   u8 deviceType = pPayload-sas_identify.dev_type;
+   u8 link_rate = (u8)((lr_status_evt_portid  0xF000)  28);
+   struct pm8001_phy *phy = pm8001_ha-phy[phy_id];
+   u8 port_id = (u8)(lr_status_evt_portid  0x00FF);
+   struct pm8001_port *port = pm8001_ha-port[port_id];
+
+   if (deviceType == SAS_END_DEVICE) {
+   pm80xx_chip_phy_ctl_req(pm8001_ha, phy_id,
+   PHY_NOTIFY_ENABLE_SPINUP);
+   }
+
+   port-wide_port_phymap |= (1U  phy_id);
+   pm8001_get_lrate_mode(phy, link_rate);
+   phy-sas_phy.oob_mode = SAS_OOB_MODE;
+   phy-phy_state = PHY_STATE_LINK_UP_SPCV;
+   phy-phy_attached = 1;
+}
+
 /**
  * hw_event_sas_phy_up -FW tells me a SAS phy up event.
  * @pm8001_ha: our hba card information
@@ -2863,6 +2898,7 @@ hw_event_sas_phy_up(struct pm8001_hba_info *pm8001_ha, 
void *piomb)
unsigned long flags;
u8 deviceType = pPayload-sas_identify.dev_type;
port-port_state = portstate;
+   port-wide_port_phymap |= (1U  phy_id);
phy-phy_state = PHY_STATE_LINK_UP_SPCV;
PM8001_MSG_DBG(pm8001_ha, pm8001_printk(
portid:%d; phyid:%d; linkrate:%d; 
@@ -2988,7 +3024,6 @@ hw_event_phy_down(struct pm8001_hba_info *pm8001_ha, void 
*piomb)
struct pm8001_port *port = pm8001_ha-port[port_id];
struct pm8001_phy *phy = pm8001_ha-phy[phy_id];
port-port_state = portstate;
-   phy-phy_type = 0;
phy-identify.device_type = 0;
phy-phy_attached = 0;
memset(phy-dev_sas_addr, 0, SAS_ADDR_SIZE);
@@ -3000,9 +3035,13 @@ hw_event_phy_down(struct pm8001_hba_info *pm8001_ha, 
void *piomb)
pm8001_printk( 

[PATCH 7/8] pm80xx: Handling Invalid SSP Response frame

2015-07-29 Thread Viswas.G
From: Viswas G viswa...@pmcs.com

The request has to be retried incase if the length of the SSP
Response IU is invalid.

Signed-off-by: Viswas G viswa...@pmcs.com
Signed-off-by: Suresh Thiagarajan suresh.thiagara...@pmcs.com 
---
 drivers/scsi/pm8001/pm80xx_hwi.c |7 +++
 drivers/scsi/pm8001/pm80xx_hwi.h |2 +-
 2 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/pm8001/pm80xx_hwi.c b/drivers/scsi/pm8001/pm80xx_hwi.c
index 8817ce6..0e1628f 100644
--- a/drivers/scsi/pm8001/pm80xx_hwi.c
+++ b/drivers/scsi/pm8001/pm80xx_hwi.c
@@ -1609,6 +1609,13 @@ mpi_ssp_completion(struct pm8001_hba_info *pm8001_ha , 
void *piomb)
ts-stat = SAS_OPEN_REJECT;
ts-open_rej_reason = SAS_OREJ_RSVD_RETRY;
break;
+   case IO_XFER_ERROR_INVALID_SSP_RSP_FRAME:
+   PM8001_IO_DBG(pm8001_ha,
+   pm8001_printk(IO_XFER_ERROR_INVALID_SSP_RSP_FRAME\n));
+   ts-resp = SAS_TASK_COMPLETE;
+   ts-stat = SAS_OPEN_REJECT;
+   ts-open_rej_reason = SAS_OREJ_RSVD_RETRY;
+   break;
case IO_OPEN_CNX_ERROR_PROTOCOL_NOT_SUPPORTED:
PM8001_IO_DBG(pm8001_ha,
pm8001_printk(IO_OPEN_CNX_ERROR_PROTOCOL_NOT_SUPPORTED\n));
diff --git a/drivers/scsi/pm8001/pm80xx_hwi.h b/drivers/scsi/pm8001/pm80xx_hwi.h
index a083cc6..7a443ba 100644
--- a/drivers/scsi/pm8001/pm80xx_hwi.h
+++ b/drivers/scsi/pm8001/pm80xx_hwi.h
@@ -1175,7 +1175,7 @@ typedef struct SASProtocolTimerConfig 
SASProtocolTimerConfig_t;
 #define IO_XFER_ERROR_INTERNAL_CRC_ERROR   0x54
 #define MPI_IO_RQE_BUSY_FULL   0x55
 #define IO_XFER_ERR_EOB_DATA_OVERRUN   0x56
-#define IO_XFR_ERROR_INVALID_SSP_RSP_FRAME 0x57
+#define IO_XFER_ERROR_INVALID_SSP_RSP_FRAME0x57
 #define IO_OPEN_CNX_ERROR_OPEN_PREEMPTED   0x58
 
 #define MPI_ERR_IO_RESOURCE_UNAVAILABLE0x1004
-- 
1.7.1

--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 8/8] pm80xx: Bump pm80xx driver version to 0.1.38

2015-07-29 Thread Viswas.G
From: Viswas G viswa...@pmcs.com

Bump pm80xx driver version to 0.1.38.

Signed-off-by: Viswas G viswa...@pmcs.com
Signed-off-by: Suresh Thiagarajan suresh.thiagara...@pmcs.com 
---
 drivers/scsi/pm8001/pm8001_sas.h |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/pm8001/pm8001_sas.h b/drivers/scsi/pm8001/pm8001_sas.h
index 2788026..e2e97db 100644
--- a/drivers/scsi/pm8001/pm8001_sas.h
+++ b/drivers/scsi/pm8001/pm8001_sas.h
@@ -58,7 +58,7 @@
 #include pm8001_defs.h
 
 #define DRV_NAME   pm80xx
-#define DRV_VERSION0.1.37
+#define DRV_VERSION0.1.38
 #define PM8001_FAIL_LOGGING0x01 /* Error message logging */
 #define PM8001_INIT_LOGGING0x02 /* driver init logging */
 #define PM8001_DISC_LOGGING0x04 /* discovery layer logging */
-- 
1.7.1

--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 3/8] pm80xx: Update For Thermal Page Code

2015-07-29 Thread Viswas.G
From: Viswas G viswa...@pmcs.com

Thermal page code has been changed to 7 for the 12G controllers.

Signed-off-by: Viswas G viswa...@pmcs.com
Signed-off-by: Suresh Thiagarajan suresh.thiagara...@pmcs.com 
---
 drivers/scsi/pm8001/pm80xx_hwi.c |9 -
 drivers/scsi/pm8001/pm80xx_hwi.h |3 ++-
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/pm8001/pm80xx_hwi.c b/drivers/scsi/pm8001/pm80xx_hwi.c
index 05cce46..dced9f7 100644
--- a/drivers/scsi/pm8001/pm80xx_hwi.c
+++ b/drivers/scsi/pm8001/pm80xx_hwi.c
@@ -843,6 +843,7 @@ pm80xx_set_thermal_config(struct pm8001_hba_info *pm8001_ha)
int rc;
u32 tag;
u32 opc = OPC_INB_SET_CONTROLLER_CONFIG;
+   u32 page_code;
 
memset(payload, 0, sizeof(struct set_ctrl_cfg_req));
rc = pm8001_tag_alloc(pm8001_ha, tag);
@@ -851,8 +852,14 @@ pm80xx_set_thermal_config(struct pm8001_hba_info 
*pm8001_ha)
 
circularQ = pm8001_ha-inbnd_q_tbl[0];
payload.tag = cpu_to_le32(tag);
+
+   if (IS_SPCV_12G(pm8001_ha-pdev))
+   page_code = THERMAL_PAGE_CODE_7H;
+   else
+   page_code = THERMAL_PAGE_CODE_8H;
+
payload.cfg_pg[0] = (THERMAL_LOG_ENABLE  9) |
-   (THERMAL_ENABLE  8) | THERMAL_OP_CODE;
+   (THERMAL_ENABLE  8) | page_code;
payload.cfg_pg[1] = (LTEMPHIL  24) | (RTEMPHIL  8);
 
rc = pm8001_mpi_build_cmd(pm8001_ha, circularQ, opc, payload, 0);
diff --git a/drivers/scsi/pm8001/pm80xx_hwi.h b/drivers/scsi/pm8001/pm80xx_hwi.h
index 9970a38..a083cc6 100644
--- a/drivers/scsi/pm8001/pm80xx_hwi.h
+++ b/drivers/scsi/pm8001/pm80xx_hwi.h
@@ -177,7 +177,8 @@
 /* Thermal related */
 #defineTHERMAL_ENABLE  0x1
 #defineTHERMAL_LOG_ENABLE  0x1
-#define THERMAL_OP_CODE0x6
+#define THERMAL_PAGE_CODE_7H   0x6
+#define THERMAL_PAGE_CODE_8H   0x7
 #define LTEMPHIL70
 #define RTEMPHIL   100
 
-- 
1.7.1

--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 5/8] pm80xx: Remove unnecessary phy disconnect while link error

2015-07-29 Thread Viswas.G
From: Viswas G viswa...@pmcs.com

If the link error happens, we don't need to disconnect the phy,
which will remove the drive. Instead acknowledging the controller
and logging the error will be enough.

Signed-off-by: Viswas G viswa...@pmcs.com
Signed-off-by: Suresh Thiagarajan suresh.thiagara...@pmcs.com 
---
 drivers/scsi/pm8001/pm80xx_hwi.c |   12 
 1 files changed, 0 insertions(+), 12 deletions(-)

diff --git a/drivers/scsi/pm8001/pm80xx_hwi.c b/drivers/scsi/pm8001/pm80xx_hwi.c
index dced9f7..3d8b4ae 100644
--- a/drivers/scsi/pm8001/pm80xx_hwi.c
+++ b/drivers/scsi/pm8001/pm80xx_hwi.c
@@ -3176,9 +3176,6 @@ static int mpi_hw_event(struct pm8001_hba_info 
*pm8001_ha, void *piomb)
pm8001_printk(HW_EVENT_LINK_ERR_INVALID_DWORD\n));
pm80xx_hw_event_ack_req(pm8001_ha, 0,
HW_EVENT_LINK_ERR_INVALID_DWORD, port_id, phy_id, 0, 0);
-   sas_phy_disconnected(sas_phy);
-   phy-phy_attached = 0;
-   sas_ha-notify_port_event(sas_phy, PORTE_LINK_RESET_ERR);
break;
case HW_EVENT_LINK_ERR_DISPARITY_ERROR:
PM8001_MSG_DBG(pm8001_ha,
@@ -3186,9 +3183,6 @@ static int mpi_hw_event(struct pm8001_hba_info 
*pm8001_ha, void *piomb)
pm80xx_hw_event_ack_req(pm8001_ha, 0,
HW_EVENT_LINK_ERR_DISPARITY_ERROR,
port_id, phy_id, 0, 0);
-   sas_phy_disconnected(sas_phy);
-   phy-phy_attached = 0;
-   sas_ha-notify_port_event(sas_phy, PORTE_LINK_RESET_ERR);
break;
case HW_EVENT_LINK_ERR_CODE_VIOLATION:
PM8001_MSG_DBG(pm8001_ha,
@@ -3196,9 +3190,6 @@ static int mpi_hw_event(struct pm8001_hba_info 
*pm8001_ha, void *piomb)
pm80xx_hw_event_ack_req(pm8001_ha, 0,
HW_EVENT_LINK_ERR_CODE_VIOLATION,
port_id, phy_id, 0, 0);
-   sas_phy_disconnected(sas_phy);
-   phy-phy_attached = 0;
-   sas_ha-notify_port_event(sas_phy, PORTE_LINK_RESET_ERR);
break;
case HW_EVENT_LINK_ERR_LOSS_OF_DWORD_SYNCH:
PM8001_MSG_DBG(pm8001_ha, pm8001_printk(
@@ -3206,9 +3197,6 @@ static int mpi_hw_event(struct pm8001_hba_info 
*pm8001_ha, void *piomb)
pm80xx_hw_event_ack_req(pm8001_ha, 0,
HW_EVENT_LINK_ERR_LOSS_OF_DWORD_SYNCH,
port_id, phy_id, 0, 0);
-   sas_phy_disconnected(sas_phy);
-   phy-phy_attached = 0;
-   sas_ha-notify_port_event(sas_phy, PORTE_LINK_RESET_ERR);
break;
case HW_EVENT_MALFUNCTION:
PM8001_MSG_DBG(pm8001_ha,
-- 
1.7.1

--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 4/8] pm80xx: Fix for Incorrect DMA Unmapping of SG List

2015-07-29 Thread Viswas.G
From: Viswas G viswa...@pmcs.com

In pm8001_ccb_task_free(), the dma unmapping is done based on
ccb-n_elem value. This should be initialized to zero in the
task_abort(). Otherwise, pm8001_ccb_task_free() will try for
dma_unmap_sg() which is invalid for task abort and can lead to
kernel crash.

Signed-off-by: Viswas G viswa...@pmcs.com
Signed-off-by: Suresh Thiagarajan suresh.thiagara...@pmcs.com 
---
 drivers/scsi/pm8001/pm8001_sas.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/scsi/pm8001/pm8001_sas.c b/drivers/scsi/pm8001/pm8001_sas.c
index 4e6955f..b1c5fb9 100644
--- a/drivers/scsi/pm8001/pm8001_sas.c
+++ b/drivers/scsi/pm8001/pm8001_sas.c
@@ -790,6 +790,7 @@ pm8001_exec_internal_task_abort(struct pm8001_hba_info 
*pm8001_ha,
ccb-device = pm8001_dev;
ccb-ccb_tag = ccb_tag;
ccb-task = task;
+   ccb-n_elem = 0;
 
res = PM8001_CHIP_DISP-task_abort(pm8001_ha,
pm8001_dev, flag, task_tag, ccb_tag);
-- 
1.7.1

--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/8] pm80xx: Updated link rate

2015-07-29 Thread Viswas.G
From: Viswas G viswa...@pmcs.com


Updated 12G linkrate to libsas.

Signed-off-by: Viswas G viswa...@pmcs.com
Signed-off-by: Suresh Thiagarajan suresh.thiagara...@pmcs.com 

---
 drivers/scsi/pm8001/pm8001_defs.h |1 +
 drivers/scsi/pm8001/pm8001_hwi.c  |4 
 2 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/scsi/pm8001/pm8001_defs.h 
b/drivers/scsi/pm8001/pm8001_defs.h
index 74a4bb9..d4d20cc 100644
--- a/drivers/scsi/pm8001/pm8001_defs.h
+++ b/drivers/scsi/pm8001/pm8001_defs.h
@@ -56,6 +56,7 @@ enum phy_speed {
PHY_SPEED_15 = 0x01,
PHY_SPEED_30 = 0x02,
PHY_SPEED_60 = 0x04,
+   PHY_SPEED_120 = 0x08,
 };
 
 enum data_direction {
diff --git a/drivers/scsi/pm8001/pm8001_hwi.c b/drivers/scsi/pm8001/pm8001_hwi.c
index 96dcc09..39306b1 100644
--- a/drivers/scsi/pm8001/pm8001_hwi.c
+++ b/drivers/scsi/pm8001/pm8001_hwi.c
@@ -3263,6 +3263,10 @@ void pm8001_get_lrate_mode(struct pm8001_phy *phy, u8 
link_rate)
struct sas_phy *sas_phy = phy-sas_phy.phy;
 
switch (link_rate) {
+   case PHY_SPEED_120:
+   phy-sas_phy.linkrate = SAS_LINK_RATE_12_0_GBPS;
+   phy-sas_phy.phy-negotiated_linkrate = SAS_LINK_RATE_12_0_GBPS;
+   break;
case PHY_SPEED_60:
phy-sas_phy.linkrate = SAS_LINK_RATE_6_0_GBPS;
phy-sas_phy.phy-negotiated_linkrate = SAS_LINK_RATE_6_0_GBPS;
-- 
1.7.1

--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 0/8] pm80xx: Driver updates

2015-07-29 Thread Viswas.G
From: Viswas G viswa...@pmcs.com

This patch set contains bug fixes for pm80xx driver.
Please consider these patches for next kernel release.

Viswas G (8):
  pm80xx: Updated link rate
  pm80xx: Corrected device state changes in I_T_Nexus_Reset
  pm80xx: Update For Thermal Page Code
  pm80xx: Fix for Incorrect DMA Unmapping of SG List
  pm80xx: Remove unnecessary phy disconnect while link error
  pm80xx: Add PORT RECOVERY TIMEOUT support
  pm80xx: Handling Invalid SSP Response frame
  pm80xx: Bump pm80xx driver version to 0.1.38

 drivers/scsi/pm8001/pm8001_defs.h |1 +
 drivers/scsi/pm8001/pm8001_hwi.c  |4 +
 drivers/scsi/pm8001/pm8001_sas.c  |   15 -
 drivers/scsi/pm8001/pm8001_sas.h  |   12 +++-
 drivers/scsi/pm8001/pm80xx_hwi.c  |  111 +++--
 drivers/scsi/pm8001/pm80xx_hwi.h  |5 +-
 6 files changed, 112 insertions(+), 36 deletions(-)

--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [Xen-devel] [PATCH 4/8] xen: Use the correctly the Xen memory terminologies

2015-07-29 Thread Julien Grall
On 28/07/15 18:16, David Vrabel wrote:
 On 28/07/15 16:02, Julien Grall wrote:
 Based on include/xen/mm.h [1], Linux is mistakenly using MFN when GFN
 is meant, I suspect this is because the first support for Xen was for
 PV. This brough some misimplementation of helpers on ARM and make the
 developper confused the expected behavior.
 
 For the benefit of other subsystem maintainers, this is a purely
 mechanical change in Xen-specific terminology.  It doesn't need reviews
 or acks from non-Xen people (IMO).
 
 For instance, with pfn_to_mfn, we expect to get an MFN based on the name.
 Although, if we look at the implementation on x86, it's returning a GFN.

 For clarity and avoid new confusion, replace any reference of mfn into
 gnf in any helpers used by PV drivers.

 Take also the opportunity to simplify simple construction such
 as pfn_to_mfn(page_to_pfn(page)) into page_to_gfn. More complex clean up
 will come in follow-up patches.

 I think it may be possible to do further clean up in the x86 code to
 ensure that helpers returning machine address (such as virt_address) is
 not used by no auto-translated guests. I will let x86 xen expert doing
 it.
 
 Reviewed-by: David Vrabel david.vra...@citrix.com
 
 It looks a bit odd to use GFN in some of the PV code where the
 hypervisor API uses MFN but overall I think using the correct
 terminology where possible is best.  But I'd like to have Boris's or
 Konrad's opinion on this.

I was thinking to introduce mfn_to_pfn  co which would be used only for
PV-guest (a BUG_ON would be here to ensure it) and hypercall related.

I didn't do it as I haven't much knowledge on x86 Xen and was able to
decide where I have to use pfn_to_mfn.

Regards,

-- 
Julien Grall
--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 4/8] xen: Use the correctly the Xen memory terminologies

2015-07-29 Thread Julien Grall
Hi Boris,

On 28/07/15 20:12, Boris Ostrovsky wrote:
 On 07/28/2015 11:02 AM, Julien Grall wrote:
 Based on include/xen/mm.h [1], Linux is mistakenly using MFN when GFN
 is meant, I suspect this is because the first support for Xen was for
 PV. This brough some misimplementation of helpers on ARM and make the
 developper confused the expected behavior.

 For instance, with pfn_to_mfn, we expect to get an MFN based on the name.
 Although, if we look at the implementation on x86, it's returning a GFN.

 For clarity and avoid new confusion, replace any reference of mfn into
 gnf in any helpers used by PV drivers.
 
 
 
 
 @@ -730,7 +730,7 @@ static void xen_do_pin(unsigned level, unsigned
 long pfn)
   struct mmuext_op op;

   op.cmd = level;
 -op.arg1.mfn = pfn_to_mfn(pfn);
 +op.arg1.mfn = pfn_to_gfn(pfn);
 
 
 This looks slightly odd. It is correct but given that purpose of this
 series is to make things more clear perhaps we can add another union
 member (gfn) to mmuext_op.arg1?
 
 (Of course, the hypervisor will continue referring to mfn which could
 still be confusing)

This operation is only used for PV guests, right?

IHMO re-introducing pfn_to_mfn for PV-guests only (i.e with a BUG_ON to
ensure no usage for auto-translated guest) would be the best solution.
It would avoid to have different name than the hypersivor one in the
hypercall interface. It will also make clear that virt_to_machine  co
is only PV specific.

I though doing this but I preferred to defer it to x86 expert as my
knowledge for x86 Xen is very limited. I don't know where it's more
suitable to use MFN or GFN. I guess this file (mmu.c) is mostly PV specific?

Would something like below fine for you?

static inline unsigned long pfn_to_mfn(unsigned long pfn)
{
unsigned long mfn;

BUG_ON(xen_feature(XENFEAT_auto_translated_physmap));

mfn = __pfn_to_mfn(pfn);
if (mfn != INVALID_P2M_ENTRY)
mfn = ~(FOREIGN_FRAME_BIT | IDENTITY_FRAME_BIT);

return mfn;
}

static inline unsigned long pfn_to_gfn(unsigned long pfn)
{
if (xen_feature(XENFEAT_autotranslated_physmap))
return pfn;
else
return pfn_to_mfn(pfn);
}

Similar splitting would be done for gfn_to_pfn and mfn_to_pfn.

Regards,

-- 
Julien Grall
--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [Xen-devel] [PATCH 4/8] xen: Use the correctly the Xen memory terminologies

2015-07-29 Thread Julien Grall
Hi Chris,

On 28/07/15 20:39, Chris (Christopher) Brand wrote:
 Based on include/xen/mm.h [1], Linux is mistakenly using MFN when GFN is 
 meant,
 I suspect this is because the first support for Xen was for PV. This brough 
 some
 Typo : brought
 Perhaps resulted in would be better ?
 
 misimplementation of helpers on ARM and make the developper confused the 
 expected behavior.
 Typo: developer.
 I'd also suggest ...and confused developers about the
 
 [...]
 
 For clarity and avoid new confusion, replace any reference of mfn into gnf 
 in any helpers used by PV drivers.
 Typo : gfn
 I'd suggest ...replace any reference to mfn with gfn...
 
 [...]

Thanks for telling me the typoes. I will fix it in the next version of
this series.

Regards,

-- 
Julien Grall
--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [Xen-devel] [PATCH 4/8] xen: Use the correctly the Xen memory terminologies

2015-07-29 Thread Wei Liu
On Wed, Jul 29, 2015 at 12:35:54PM +0100, Julien Grall wrote:
 Hi Wei,
 
 On 29/07/15 11:13, Wei Liu wrote:
  On Tue, Jul 28, 2015 at 04:02:45PM +0100, Julien Grall wrote:
  [...]
  diff --git a/drivers/net/xen-netback/netback.c 
  b/drivers/net/xen-netback/netback.c
  index 7d50711..3b7b7c3 100644
  --- a/drivers/net/xen-netback/netback.c
  +++ b/drivers/net/xen-netback/netback.c
  @@ -314,7 +314,7 @@ static void xenvif_gop_frag_copy(struct xenvif_queue 
  *queue, struct sk_buff *skb
 } else {
 copy_gop-source.domid = DOMID_SELF;
 copy_gop-source.u.gmfn =
  -  virt_to_mfn(page_address(page));
  +  virt_to_gfn(page_address(page));
 }
 copy_gop-source.offset = offset;
   
  @@ -1284,7 +1284,7 @@ static void xenvif_tx_build_gops(struct xenvif_queue 
  *queue,
 queue-tx_copy_ops[*copy_ops].source.offset = txreq.offset;
   
 queue-tx_copy_ops[*copy_ops].dest.u.gmfn =
  -  virt_to_mfn(skb-data);
  +  virt_to_gfn(skb-data);
 queue-tx_copy_ops[*copy_ops].dest.domid = DOMID_SELF;
 queue-tx_copy_ops[*copy_ops].dest.offset =
 offset_in_page(skb-data);
  
  Reviewed-by: Wei Liu wei.l...@citrix.com
  
  One possible improvement is to change gmfn in copy_gop to gfn as well.
  But that's outside of netback code.
 
 The structure gnttab_copy is part of the hypervisor interface. Is it
 fine to differ on the naming between Xen and Linux?
 
 Or maybe we could do the change in the public headers in Xen repo too.
 Is it fine to do field renaming in public headers?
 

Oh well. Never mind then. I mistook that structure as internal to Linux.

Wei.

 Regards,
 
 -- 
 Julien Grall
--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [Xen-devel] [PATCH 4/8] xen: Use the correctly the Xen memory terminologies

2015-07-29 Thread David Vrabel
On 29/07/15 12:35, Julien Grall wrote:
 Hi Wei,
 
 On 29/07/15 11:13, Wei Liu wrote:
 On Tue, Jul 28, 2015 at 04:02:45PM +0100, Julien Grall wrote:
 [...]
 diff --git a/drivers/net/xen-netback/netback.c 
 b/drivers/net/xen-netback/netback.c
 index 7d50711..3b7b7c3 100644
 --- a/drivers/net/xen-netback/netback.c
 +++ b/drivers/net/xen-netback/netback.c
 @@ -314,7 +314,7 @@ static void xenvif_gop_frag_copy(struct xenvif_queue 
 *queue, struct sk_buff *skb
 } else {
 copy_gop-source.domid = DOMID_SELF;
 copy_gop-source.u.gmfn =
 -   virt_to_mfn(page_address(page));
 +   virt_to_gfn(page_address(page));
 }
 copy_gop-source.offset = offset;
  
 @@ -1284,7 +1284,7 @@ static void xenvif_tx_build_gops(struct xenvif_queue 
 *queue,
 queue-tx_copy_ops[*copy_ops].source.offset = txreq.offset;
  
 queue-tx_copy_ops[*copy_ops].dest.u.gmfn =
 -   virt_to_mfn(skb-data);
 +   virt_to_gfn(skb-data);
 queue-tx_copy_ops[*copy_ops].dest.domid = DOMID_SELF;
 queue-tx_copy_ops[*copy_ops].dest.offset =
 offset_in_page(skb-data);

 Reviewed-by: Wei Liu wei.l...@citrix.com

 One possible improvement is to change gmfn in copy_gop to gfn as well.
 But that's outside of netback code.
 
 The structure gnttab_copy is part of the hypervisor interface. Is it
 fine to differ on the naming between Xen and Linux?
 
 Or maybe we could do the change in the public headers in Xen repo too.
 Is it fine to do field renaming in public headers?

I think this series should not alter than Xen API.

David
--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [Xen-devel] [PATCH 4/8] xen: Use the correctly the Xen memory terminologies

2015-07-29 Thread Julien Grall
Hi Wei,

On 29/07/15 11:13, Wei Liu wrote:
 On Tue, Jul 28, 2015 at 04:02:45PM +0100, Julien Grall wrote:
 [...]
 diff --git a/drivers/net/xen-netback/netback.c 
 b/drivers/net/xen-netback/netback.c
 index 7d50711..3b7b7c3 100644
 --- a/drivers/net/xen-netback/netback.c
 +++ b/drivers/net/xen-netback/netback.c
 @@ -314,7 +314,7 @@ static void xenvif_gop_frag_copy(struct xenvif_queue 
 *queue, struct sk_buff *skb
  } else {
  copy_gop-source.domid = DOMID_SELF;
  copy_gop-source.u.gmfn =
 -virt_to_mfn(page_address(page));
 +virt_to_gfn(page_address(page));
  }
  copy_gop-source.offset = offset;
  
 @@ -1284,7 +1284,7 @@ static void xenvif_tx_build_gops(struct xenvif_queue 
 *queue,
  queue-tx_copy_ops[*copy_ops].source.offset = txreq.offset;
  
  queue-tx_copy_ops[*copy_ops].dest.u.gmfn =
 -virt_to_mfn(skb-data);
 +virt_to_gfn(skb-data);
  queue-tx_copy_ops[*copy_ops].dest.domid = DOMID_SELF;
  queue-tx_copy_ops[*copy_ops].dest.offset =
  offset_in_page(skb-data);
 
 Reviewed-by: Wei Liu wei.l...@citrix.com
 
 One possible improvement is to change gmfn in copy_gop to gfn as well.
 But that's outside of netback code.

The structure gnttab_copy is part of the hypervisor interface. Is it
fine to differ on the naming between Xen and Linux?

Or maybe we could do the change in the public headers in Xen repo too.
Is it fine to do field renaming in public headers?

Regards,

-- 
Julien Grall
--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [PATCH 0/8] pm80xx: Driver updates

2015-07-29 Thread Suresh Thiagarajan

On Wed, Jul 29, 2015 at 2:40 PM, Jack Wang xjtu...@gmail.com wrote:
 2015-07-29 8:27 GMT+02:00  viswa...@pmcs.com:
 From: Viswas G viswa...@pmcs.com

 This patch set contains bug fixes for pm80xx driver.
 Please consider these patches for next kernel release.

 Viswas G (8):
   pm80xx: Updated link rate
   pm80xx: Corrected device state changes in I_T_Nexus_Reset
   pm80xx: Update For Thermal Page Code
   pm80xx: Fix for Incorrect DMA Unmapping of SG List
   pm80xx: Remove unnecessary phy disconnect while link error
   pm80xx: Add PORT RECOVERY TIMEOUT support
   pm80xx: Handling Invalid SSP Response frame
   pm80xx: Bump pm80xx driver version to 0.1.38

  drivers/scsi/pm8001/pm8001_defs.h |1 +
  drivers/scsi/pm8001/pm8001_hwi.c  |4 +
  drivers/scsi/pm8001/pm8001_sas.c  |   15 -
  drivers/scsi/pm8001/pm8001_sas.h  |   12 +++-
  drivers/scsi/pm8001/pm80xx_hwi.c  |  111 
 +++--
  drivers/scsi/pm8001/pm80xx_hwi.h  |5 +-
  6 files changed, 112 insertions(+), 36 deletions(-)

 For the whole patchset:

 Reviewed-by: Jack Wang jinpu.w...@profitbricks.com

For the whole patchset again:
Reviewed-by: Suresh Thiagarajan suresh.thiagara...@pmcs.com

-Suresh

 PS: company policy requests to use the email address of the company,
 please cc me to above address next time, I will send a patch to update
 my email
 in MAINTAINERS file.

 Thanks
 Jack


Re: [PATCH 4/8] xen: Use the correctly the Xen memory terminologies

2015-07-29 Thread Boris Ostrovsky

On 07/29/2015 07:25 AM, Julien Grall wrote:

Hi Boris,

On 28/07/15 20:12, Boris Ostrovsky wrote:

On 07/28/2015 11:02 AM, Julien Grall wrote:

Based on include/xen/mm.h [1], Linux is mistakenly using MFN when GFN
is meant, I suspect this is because the first support for Xen was for
PV. This brough some misimplementation of helpers on ARM and make the
developper confused the expected behavior.

For instance, with pfn_to_mfn, we expect to get an MFN based on the name.
Although, if we look at the implementation on x86, it's returning a GFN.

For clarity and avoid new confusion, replace any reference of mfn into
gnf in any helpers used by PV drivers.






@@ -730,7 +730,7 @@ static void xen_do_pin(unsigned level, unsigned
long pfn)
   struct mmuext_op op;

   op.cmd = level;
-op.arg1.mfn = pfn_to_mfn(pfn);
+op.arg1.mfn = pfn_to_gfn(pfn);



This looks slightly odd. It is correct but given that purpose of this
series is to make things more clear perhaps we can add another union
member (gfn) to mmuext_op.arg1?

(Of course, the hypervisor will continue referring to mfn which could
still be confusing)


This operation is only used for PV guests, right?

IHMO re-introducing pfn_to_mfn for PV-guests only (i.e with a BUG_ON to
ensure no usage for auto-translated guest) would be the best solution.
It would avoid to have different name than the hypersivor one in the
hypercall interface. It will also make clear that virt_to_machine  co
is only PV specific.

I though doing this but I preferred to defer it to x86 expert as my
knowledge for x86 Xen is very limited. I don't know where it's more
suitable to use MFN or GFN. I guess this file (mmu.c) is mostly PV specific?

Would something like below fine for you?

static inline unsigned long pfn_to_mfn(unsigned long pfn)
{
unsigned long mfn;

BUG_ON(xen_feature(XENFEAT_auto_translated_physmap));

mfn = __pfn_to_mfn(pfn);
if (mfn != INVALID_P2M_ENTRY)
mfn = ~(FOREIGN_FRAME_BIT | IDENTITY_FRAME_BIT);

return mfn;
}

static inline unsigned long pfn_to_gfn(unsigned long pfn)
{
if (xen_feature(XENFEAT_autotranslated_physmap))
return pfn;
else
return pfn_to_mfn(pfn);
}



But you'd still say 'op.arg1.mfn = pfn_to_gfn(pfn);' in xen_do_pin() 
i.e. assign GFN to MFN, right? That's what I was referring to.


(In general, I am not sure a guest should ever use 'mfn' as it is purely 
a hypervisor construct. Including p2m, which I think should really be 
p2g as this is what we use to figure out what to stick into page tables)


-boris




Similar splitting would be done for gfn_to_pfn and mfn_to_pfn.

Regards,



--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 4/8] xen: Use the correctly the Xen memory terminologies

2015-07-29 Thread Julien Grall
On 29/07/15 15:14, Boris Ostrovsky wrote:
 static inline unsigned long pfn_to_gfn(unsigned long pfn)
 {
 if (xen_feature(XENFEAT_autotranslated_physmap))
 return pfn;
 else
 return pfn_to_mfn(pfn);
 }
 
 
 But you'd still say 'op.arg1.mfn = pfn_to_gfn(pfn);' in xen_do_pin()
 i.e. assign GFN to MFN, right? That's what I was referring to.

Well no. I would use op.arg1.mfn = pfn_to_mfn(pfn) given that the code,
if I'm right, is only executed for PV.

mfn = pfn_to_gfn(...) was valid too because on PV is always an MFN. The
suggestion of pfn_to_mfn was just for more readability,

 (In general, I am not sure a guest should ever use 'mfn' as it is purely
 a hypervisor construct. Including p2m, which I think should really be
 p2g as this is what we use to figure out what to stick into page tables)

I think avoid to use mfn in the hypervisor interface is out-of-scope for
this series. If we ever want to modify the Xen API in Linux, we should
do in sync with Xen to avoid inconsistency on naming.

Anyway, the oddity of mfn = pfn_to_gfn(...) is mostly contained in the
x86 specific code. I don't mind to either add pfn_to_mfn and use it or
add a comment /* PV-specific so mfn == gfn */ for every use of mfn =
pfn_to_gfn(...).

Regards,

-- 
Julien Grall
--
To unsubscribe from this list: send the line unsubscribe linux-scsi in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html