Re: [PATCH 1/3] megaraid_sas: Convert dev_printk to dev_

2015-10-27 Thread Weidong Wang
On 2015/10/27 18:33, Kashyap Desai wrote:
>>> +   dev_dbg(&instance->pdev->dev, "Error copying out
>>> cmd_status\n");
>>> error = -EFAULT;
>>> }
>>>
>>
>> Reviewed-by: Johannes Thumshirn 
> 
> We will consider all three patches for future submission. As of now we have
> two patch set pending to be committed.
> We are working for few more patch in megaraid_sas which will do clean up in
> driver module + proper error handling of DCMD command timeout. It will cover
> Patch posted with below subject -
> 
> [PATCH 3/3] megaraid_sas: return -ENOMEM when create DMA pool for cmd frames
> failed
> 

Ok. And that, can you add Signed-off-by with me as well?

Regards,
Weidong

> James  -  We will be resending these patch set on top of latest outstanding
> megaraid_sas driver patch, so that we can avoid any conflict in commits.
>
> 


--
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/3] megaraid_sas: Convert dev_printk to dev_

2015-10-27 Thread Weidong Wang
On 2015/10/28 3:35, Joe Perches wrote:
> On Tue, 2015-10-27 at 16:26 +0800, Weidong Wang wrote:
>> Reduce object size a little by using dev_
>> calls instead of dev_printk(KERN_.
> 
> This is also not the same output.
> 
> dev_printk(KERN_DEBUG vs dev_dbg has the same
> behavior as printk(KERN_DEBUG vs pr_debug
> 

yep, You are right.

As Kashyap said, these two patches(Covert [dev_]printk to [dev|pr]_) may
introduced conflicts to their working for megaraid_sas.
So just ignore these two patches.

Regards,
Weidong

>> diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c 
>> b/drivers/scsi/megaraid/megaraid_sas_base.c
> []
>> @@ -1884,7 +1884,7 @@ static int megasas_get_ld_vf_affiliation_111(struct 
>> megasas_instance *instance,
>>  cmd = megasas_get_cmd(instance);
>>  
>>  if (!cmd) {
>> -dev_printk(KERN_DEBUG, &instance->pdev->dev, 
>> "megasas_get_ld_vf_affiliation_111:"
>> +dev_dbg(&instance->pdev->dev, 
>> "megasas_get_ld_vf_affiliation_111:"
>> "Failed to get cmd for scsi%d\n",
>>  instance->host->host_no);
>>  return -ENOMEM;
> []
>> @@ -5243,7 +5243,7 @@ static int megasas_probe_one(struct pci_dev *pdev,
>>   &instance->consumer_h);
>>  
>>  if (!instance->producer || !instance->consumer) {
>> -dev_printk(KERN_DEBUG, &pdev->dev, "Failed to allocate"
>> +dev_dbg(&pdev->dev, "Failed to allocate"
>> "memory for producer, consumer\n");
> 
> Note the lack of a space between coalesced string segment words.
> That's one of the reasons to coalesce them.
> 
> 
> 
> .
> 


--
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/3] megaraid_sas: Convert dev_printk to dev_

2015-10-27 Thread Joe Perches
On Tue, 2015-10-27 at 16:26 +0800, Weidong Wang wrote:
> Reduce object size a little by using dev_
> calls instead of dev_printk(KERN_.

This is also not the same output.

dev_printk(KERN_DEBUG vs dev_dbg has the same
behavior as printk(KERN_DEBUG vs pr_debug

> diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c 
> b/drivers/scsi/megaraid/megaraid_sas_base.c
[]
> @@ -1884,7 +1884,7 @@ static int megasas_get_ld_vf_affiliation_111(struct 
> megasas_instance *instance,
>   cmd = megasas_get_cmd(instance);
>  
>   if (!cmd) {
> - dev_printk(KERN_DEBUG, &instance->pdev->dev, 
> "megasas_get_ld_vf_affiliation_111:"
> + dev_dbg(&instance->pdev->dev, 
> "megasas_get_ld_vf_affiliation_111:"
>  "Failed to get cmd for scsi%d\n",
>   instance->host->host_no);
>   return -ENOMEM;
[]
> @@ -5243,7 +5243,7 @@ static int megasas_probe_one(struct pci_dev *pdev,
>&instance->consumer_h);
>  
>   if (!instance->producer || !instance->consumer) {
> - dev_printk(KERN_DEBUG, &pdev->dev, "Failed to allocate"
> + dev_dbg(&pdev->dev, "Failed to allocate"
>  "memory for producer, consumer\n");

Note the lack of a space between coalesced string segment words.
That's one of the reasons to coalesce them.


--
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/3] megaraid_sas: Convert dev_printk to dev_

2015-10-27 Thread Kashyap Desai
> > +   dev_dbg(&instance->pdev->dev, "Error copying out
> > cmd_status\n");
> > error = -EFAULT;
> > }
> >
>
> Reviewed-by: Johannes Thumshirn 

We will consider all three patches for future submission. As of now we have
two patch set pending to be committed.
We are working for few more patch in megaraid_sas which will do clean up in
driver module + proper error handling of DCMD command timeout. It will cover
Patch posted with below subject -

[PATCH 3/3] megaraid_sas: return -ENOMEM when create DMA pool for cmd frames
failed

James  -  We will be resending these patch set on top of latest outstanding
megaraid_sas driver patch, so that we can avoid any conflict in commits.
--
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/3] megaraid_sas: Convert dev_printk to dev_

2015-10-27 Thread Johannes Thumshirn
On Tue, 2015-10-27 at 16:26 +0800, Weidong Wang wrote:
> Reduce object size a little by using dev_
> calls instead of dev_printk(KERN_.
> 
> Signed-off-by: Weidong Wang 
> ---
>  drivers/scsi/megaraid/megaraid_sas_base.c | 68 +++
> 
>  1 file changed, 34 insertions(+), 34 deletions(-)
> 
> diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c
> b/drivers/scsi/megaraid/megaraid_sas_base.c
> index eaa81e5..ed9846d 100644
> --- a/drivers/scsi/megaraid/megaraid_sas_base.c
> +++ b/drivers/scsi/megaraid/megaraid_sas_base.c
> @@ -1884,7 +1884,7 @@ static int
> megasas_get_ld_vf_affiliation_111(struct megasas_instance *instance,
>   cmd = megasas_get_cmd(instance);
>  
>   if (!cmd) {
> - dev_printk(KERN_DEBUG, &instance->pdev->dev,
> "megasas_get_ld_vf_affiliation_111:"
> + dev_dbg(&instance->pdev->dev,
> "megasas_get_ld_vf_affiliation_111:"
>      "Failed to get cmd for scsi%d\n",
>   instance->host->host_no);
>   return -ENOMEM;
> @@ -1908,7 +1908,7 @@ static int
> megasas_get_ld_vf_affiliation_111(struct megasas_instance *instance,
>    sizeof(struct
> MR_LD_VF_AFFILIATION_111),
>    &new_affiliation_111_h)
> ;
>   if (!new_affiliation_111) {
> - dev_printk(KERN_DEBUG, &instance->pdev->dev, 
> "SR-IOV: Couldn't allocate "
> + dev_dbg(&instance->pdev->dev, "SR-IOV:
> Couldn't allocate "
>      "memory for new affiliation for
> scsi%d\n",
>      instance->host->host_no);
>   megasas_return_cmd(instance, cmd);
> @@ -1995,7 +1995,7 @@ static int
> megasas_get_ld_vf_affiliation_12(struct megasas_instance *instance,
>   cmd = megasas_get_cmd(instance);
>  
>   if (!cmd) {
> - dev_printk(KERN_DEBUG, &instance->pdev->dev,
> "megasas_get_ld_vf_affiliation12: "
> + dev_dbg(&instance->pdev->dev,
> "megasas_get_ld_vf_affiliation12: "
>      "Failed to get cmd for scsi%d\n",
>      instance->host->host_no);
>   return -ENOMEM;
> @@ -2020,7 +2020,7 @@ static int
> megasas_get_ld_vf_affiliation_12(struct megasas_instance *instance,
>    sizeof(struct
> MR_LD_VF_AFFILIATION),
>    &new_affiliation_h);
>   if (!new_affiliation) {
> - dev_printk(KERN_DEBUG, &instance->pdev->dev, 
> "SR-IOV: Couldn't allocate "
> + dev_dbg(&instance->pdev->dev, "SR-IOV:
> Couldn't allocate "
>      "memory for new affiliation for
> scsi%d\n",
>      instance->host->host_no);
>   megasas_return_cmd(instance, cmd);
> @@ -2174,7 +2174,7 @@ int megasas_sriov_start_heartbeat(struct
> megasas_instance *instance,
>   cmd = megasas_get_cmd(instance);
>  
>   if (!cmd) {
> - dev_printk(KERN_DEBUG, &instance->pdev->dev,
> "megasas_sriov_start_heartbeat: "
> + dev_dbg(&instance->pdev->dev,
> "megasas_sriov_start_heartbeat: "
>      "Failed to get cmd for scsi%d\n",
>      instance->host->host_no);
>   return -ENOMEM;
> @@ -2188,7 +2188,7 @@ int megasas_sriov_start_heartbeat(struct
> megasas_instance *instance,
>     sizeof(struct
> MR_CTRL_HB_HOST_MEM),
>     &instance-
> >hb_host_mem_h);
>   if (!instance->hb_host_mem) {
> - dev_printk(KERN_DEBUG, &instance->pdev->dev, 
> "SR-IOV: Couldn't allocate"
> + dev_dbg(&instance->pdev->dev, "SR-IOV:
> Couldn't allocate"
>      " memory for heartbeat host memory
> for scsi%d\n",
>      instance->host->host_no);
>   retval = -ENOMEM;
> @@ -2922,7 +2922,7 @@ megasas_complete_cmd(struct megasas_instance
> *instance, struct megasas_cmd *cmd,
>   break;
>  
>   default:
> - dev_printk(KERN_DEBUG, &instance->pdev->dev, 
> "MFI FW status %#x\n",
> + dev_dbg(&instance->pdev->dev, "MFI FW status
> %#x\n",
>      hdr->cmd_status);
>   cmd->scmd->result = DID_ERROR << 16;
>   break;
> @@ -3332,7 +3332,7 @@ megasas_transition_to_ready(struct
> megasas_instance *instance, int ocr)
>   switch (fw_state) {
>  
>   case MFI_STATE_FAULT:
> - dev_printk(KERN_DEBUG, &instance->pdev->dev, 
> "FW in FAULT state!!\n");
> + dev_dbg(&instance->pdev->dev, "FW in FAULT
> state!!\n");
>   if (ocr) {
>   max_wait = MEGASAS_RESET_WAIT_TIME;
>     

[PATCH 1/3] megaraid_sas: Convert dev_printk to dev_

2015-10-27 Thread Weidong Wang
Reduce object size a little by using dev_
calls instead of dev_printk(KERN_.

Signed-off-by: Weidong Wang 
---
 drivers/scsi/megaraid/megaraid_sas_base.c | 68 +++
 1 file changed, 34 insertions(+), 34 deletions(-)

diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c 
b/drivers/scsi/megaraid/megaraid_sas_base.c
index eaa81e5..ed9846d 100644
--- a/drivers/scsi/megaraid/megaraid_sas_base.c
+++ b/drivers/scsi/megaraid/megaraid_sas_base.c
@@ -1884,7 +1884,7 @@ static int megasas_get_ld_vf_affiliation_111(struct 
megasas_instance *instance,
cmd = megasas_get_cmd(instance);
 
if (!cmd) {
-   dev_printk(KERN_DEBUG, &instance->pdev->dev, 
"megasas_get_ld_vf_affiliation_111:"
+   dev_dbg(&instance->pdev->dev, 
"megasas_get_ld_vf_affiliation_111:"
   "Failed to get cmd for scsi%d\n",
instance->host->host_no);
return -ENOMEM;
@@ -1908,7 +1908,7 @@ static int megasas_get_ld_vf_affiliation_111(struct 
megasas_instance *instance,
 sizeof(struct 
MR_LD_VF_AFFILIATION_111),
 &new_affiliation_111_h);
if (!new_affiliation_111) {
-   dev_printk(KERN_DEBUG, &instance->pdev->dev, "SR-IOV: 
Couldn't allocate "
+   dev_dbg(&instance->pdev->dev, "SR-IOV: Couldn't 
allocate "
   "memory for new affiliation for scsi%d\n",
   instance->host->host_no);
megasas_return_cmd(instance, cmd);
@@ -1995,7 +1995,7 @@ static int megasas_get_ld_vf_affiliation_12(struct 
megasas_instance *instance,
cmd = megasas_get_cmd(instance);
 
if (!cmd) {
-   dev_printk(KERN_DEBUG, &instance->pdev->dev, 
"megasas_get_ld_vf_affiliation12: "
+   dev_dbg(&instance->pdev->dev, "megasas_get_ld_vf_affiliation12: 
"
   "Failed to get cmd for scsi%d\n",
   instance->host->host_no);
return -ENOMEM;
@@ -2020,7 +2020,7 @@ static int megasas_get_ld_vf_affiliation_12(struct 
megasas_instance *instance,
 sizeof(struct 
MR_LD_VF_AFFILIATION),
 &new_affiliation_h);
if (!new_affiliation) {
-   dev_printk(KERN_DEBUG, &instance->pdev->dev, "SR-IOV: 
Couldn't allocate "
+   dev_dbg(&instance->pdev->dev, "SR-IOV: Couldn't 
allocate "
   "memory for new affiliation for scsi%d\n",
   instance->host->host_no);
megasas_return_cmd(instance, cmd);
@@ -2174,7 +2174,7 @@ int megasas_sriov_start_heartbeat(struct megasas_instance 
*instance,
cmd = megasas_get_cmd(instance);
 
if (!cmd) {
-   dev_printk(KERN_DEBUG, &instance->pdev->dev, 
"megasas_sriov_start_heartbeat: "
+   dev_dbg(&instance->pdev->dev, "megasas_sriov_start_heartbeat: "
   "Failed to get cmd for scsi%d\n",
   instance->host->host_no);
return -ENOMEM;
@@ -2188,7 +2188,7 @@ int megasas_sriov_start_heartbeat(struct megasas_instance 
*instance,
  sizeof(struct 
MR_CTRL_HB_HOST_MEM),
  &instance->hb_host_mem_h);
if (!instance->hb_host_mem) {
-   dev_printk(KERN_DEBUG, &instance->pdev->dev, "SR-IOV: 
Couldn't allocate"
+   dev_dbg(&instance->pdev->dev, "SR-IOV: Couldn't 
allocate"
   " memory for heartbeat host memory for scsi%d\n",
   instance->host->host_no);
retval = -ENOMEM;
@@ -2922,7 +2922,7 @@ megasas_complete_cmd(struct megasas_instance *instance, 
struct megasas_cmd *cmd,
break;
 
default:
-   dev_printk(KERN_DEBUG, &instance->pdev->dev, "MFI FW 
status %#x\n",
+   dev_dbg(&instance->pdev->dev, "MFI FW status %#x\n",
   hdr->cmd_status);
cmd->scmd->result = DID_ERROR << 16;
break;
@@ -3332,7 +3332,7 @@ megasas_transition_to_ready(struct megasas_instance 
*instance, int ocr)
switch (fw_state) {
 
case MFI_STATE_FAULT:
-   dev_printk(KERN_DEBUG, &instance->pdev->dev, "FW in 
FAULT state!!\n");
+   dev_dbg(&instance->pdev->dev, "FW in FAULT state!!\n");
if (ocr) {
max_wait = MEGASAS_RESET_WAIT_TIME;
cur_state = MFI_STATE_FAULT;
@@ -3471,7 +3471,7 @@ megasas_transition_to_ready(struct megasas_instance 
*instance, int ocr)