All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RESEND 0/3] drivers/scsi/ufs: Misc fixes
@ 2012-07-10 14:09 Venkatraman S
  2012-07-10 14:09 ` [PATCH RESEND 1/3] drivers/scsi/ufs: use module_pci_driver Venkatraman S
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Venkatraman S @ 2012-07-10 14:09 UTC (permalink / raw)
  To: James.Bottomley; +Cc: linux-scsi, akpm, Venkatraman S

Hi James,
  These patches have been posted to lkml and have been in linux-next
for sometime through Andrew Morton's tree.
 I think they should be taken through your tree for next merge window.

Can you please merge these ? 

Thanks and regards,
Venkat.

Namjae Jeon (1):
  drivers/scsi/ufs: fix incorrect return value about SUCCESS and FAILED

Venkatraman S (2):
  drivers/scsi/ufs: use module_pci_driver
  drivers/scsi/ufs: reverse the ufshcd_is_device_present logic

 drivers/scsi/ufs/ufshcd.c |   35 ++++++++++-------------------------
 1 files changed, 10 insertions(+), 25 deletions(-)


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH RESEND 1/3] drivers/scsi/ufs: use module_pci_driver
  2012-07-10 14:09 [PATCH RESEND 0/3] drivers/scsi/ufs: Misc fixes Venkatraman S
@ 2012-07-10 14:09 ` Venkatraman S
  2012-07-10 14:09 ` [PATCH RESEND 2/3] drivers/scsi/ufs: reverse the ufshcd_is_device_present logic Venkatraman S
  2012-07-10 14:09 ` [PATCH RESEND 3/3] drivers/scsi/ufs: fix incorrect return value about SUCCESS and FAILED Venkatraman S
  2 siblings, 0 replies; 8+ messages in thread
From: Venkatraman S @ 2012-07-10 14:09 UTC (permalink / raw)
  To: James.Bottomley; +Cc: linux-scsi, akpm, Venkatraman S, James E.J. Bottomley

Use macro module_pci_driver and get rid of boilerplate code.  No
functional changes.

Signed-off-by: Venkatraman S <svenkatr@ti.com>
Acked-by: Santosh Y <santoshsy@gmail.com>
Cc: "James E.J. Bottomley" <JBottomley@parallels.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
 drivers/scsi/ufs/ufshcd.c |   19 +------------------
 1 files changed, 1 insertions(+), 18 deletions(-)

diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index 6a4fd00..40c43bf 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -1953,24 +1953,7 @@ static struct pci_driver ufshcd_pci_driver = {
 #endif
 };
 
-/**
- * ufshcd_init - Driver registration routine
- */
-static int __init ufshcd_init(void)
-{
-	return pci_register_driver(&ufshcd_pci_driver);
-}
-module_init(ufshcd_init);
-
-/**
- * ufshcd_exit - Driver exit clean-up routine
- */
-static void __exit ufshcd_exit(void)
-{
-	pci_unregister_driver(&ufshcd_pci_driver);
-}
-module_exit(ufshcd_exit);
-
+module_pci_driver(ufshcd_pci_driver);
 
 MODULE_AUTHOR("Santosh Yaragnavi <santosh.sy@samsung.com>, "
 	      "Vinayak Holikatti <h.vinayak@samsung.com>");
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH RESEND 2/3] drivers/scsi/ufs: reverse the ufshcd_is_device_present logic
  2012-07-10 14:09 [PATCH RESEND 0/3] drivers/scsi/ufs: Misc fixes Venkatraman S
  2012-07-10 14:09 ` [PATCH RESEND 1/3] drivers/scsi/ufs: use module_pci_driver Venkatraman S
@ 2012-07-10 14:09 ` Venkatraman S
  2012-07-10 14:09 ` [PATCH RESEND 3/3] drivers/scsi/ufs: fix incorrect return value about SUCCESS and FAILED Venkatraman S
  2 siblings, 0 replies; 8+ messages in thread
From: Venkatraman S @ 2012-07-10 14:09 UTC (permalink / raw)
  Cc: linux-scsi, akpm, Venkatraman S, James Bottomley

Otherwise it counter intuitively returns 0 if device is present.

Signed-off-by: Venkatraman S <svenkatr@ti.com>
Reviewed-by: Namjae Jeon <linkinjeon@gmail.com>
Acked-by: Santosh Y <santoshsy@gmail.com>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
 drivers/scsi/ufs/ufshcd.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index 40c43bf..48b01fe 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -232,11 +232,11 @@ static inline u32 ufshcd_get_ufs_version(struct ufs_hba *hba)
  *			      the host controller
  * @reg_hcs - host controller status register value
  *
- * Returns 0 if device present, non-zero if no device detected
+ * Returns 1 if device present, 0 if no device detected
  */
 static inline int ufshcd_is_device_present(u32 reg_hcs)
 {
-	return (DEVICE_PRESENT & reg_hcs) ? 0 : -1;
+	return (DEVICE_PRESENT & reg_hcs) ? 1 : 0;
 }
 
 /**
@@ -911,7 +911,7 @@ static int ufshcd_make_hba_operational(struct ufs_hba *hba)
 
 	/* check if device present */
 	reg = readl((hba->mmio_base + REG_CONTROLLER_STATUS));
-	if (ufshcd_is_device_present(reg)) {
+	if (!ufshcd_is_device_present(reg)) {
 		dev_err(&hba->pdev->dev, "cc: Device not present\n");
 		err = -ENXIO;
 		goto out;
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH RESEND 3/3] drivers/scsi/ufs: fix incorrect return value about SUCCESS and FAILED
  2012-07-10 14:09 [PATCH RESEND 0/3] drivers/scsi/ufs: Misc fixes Venkatraman S
  2012-07-10 14:09 ` [PATCH RESEND 1/3] drivers/scsi/ufs: use module_pci_driver Venkatraman S
  2012-07-10 14:09 ` [PATCH RESEND 2/3] drivers/scsi/ufs: reverse the ufshcd_is_device_present logic Venkatraman S
@ 2012-07-10 14:09 ` Venkatraman S
  2012-07-10 14:42   ` James Bottomley
  2 siblings, 1 reply; 8+ messages in thread
From: Venkatraman S @ 2012-07-10 14:09 UTC (permalink / raw)
  Cc: linux-scsi, akpm, Namjae Jeon, James Bottomley

From: Namjae Jeon <linkinjeon@gmail.com>

Currently the UFS host driver has returned incorrect values for SUCCESS
and FAILED.  Fix it to return the correct value to the upper layer.

Signed-off-by: Namjae Jeon <linkinjeon@gmail.com>
Acked-by: Santosh Y <santoshsy@gmail.com>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
 drivers/scsi/ufs/ufshcd.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index 48b01fe..58f4ba6 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -1163,6 +1163,8 @@ static int ufshcd_task_req_compl(struct ufs_hba *hba, u32 index)
 		if (task_result != UPIU_TASK_MANAGEMENT_FUNC_COMPL &&
 		    task_result != UPIU_TASK_MANAGEMENT_FUNC_SUCCEEDED)
 			task_result = FAILED;
+		else
+			task_result = SUCCESS;
 	} else {
 		task_result = FAILED;
 		dev_err(&hba->pdev->dev,
@@ -1556,7 +1558,7 @@ ufshcd_issue_tm_cmd(struct ufs_hba *hba,
 		goto out;
 	}
 	clear_bit(free_slot, &hba->tm_condition);
-	return ufshcd_task_req_compl(hba, free_slot);
+	err = ufshcd_task_req_compl(hba, free_slot);
 out:
 	return err;
 }
@@ -1580,7 +1582,7 @@ static int ufshcd_device_reset(struct scsi_cmnd *cmd)
 	tag = cmd->request->tag;
 
 	err = ufshcd_issue_tm_cmd(hba, &hba->lrb[tag], UFS_LOGICAL_RESET);
-	if (err)
+	if (err == FAILED)
 		goto out;
 
 	for (pos = 0; pos < hba->nutrs; pos++) {
@@ -1620,7 +1622,7 @@ static int ufshcd_host_reset(struct scsi_cmnd *cmd)
 	if (hba->ufshcd_state == UFSHCD_STATE_RESET)
 		return SUCCESS;
 
-	return (ufshcd_do_reset(hba) == SUCCESS) ? SUCCESS : FAILED;
+	return ufshcd_do_reset(hba);
 }
 
 /**
@@ -1652,7 +1654,7 @@ static int ufshcd_abort(struct scsi_cmnd *cmd)
 	spin_unlock_irqrestore(host->host_lock, flags);
 
 	err = ufshcd_issue_tm_cmd(hba, &hba->lrb[tag], UFS_ABORT_TASK);
-	if (err)
+	if (err == FAILED)
 		goto out;
 
 	scsi_dma_unmap(cmd);
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH RESEND 3/3] drivers/scsi/ufs: fix incorrect return value about SUCCESS and FAILED
  2012-07-10 14:09 ` [PATCH RESEND 3/3] drivers/scsi/ufs: fix incorrect return value about SUCCESS and FAILED Venkatraman S
@ 2012-07-10 14:42   ` James Bottomley
  2012-07-10 15:09     ` S, Venkatraman
  2012-07-10 15:11     ` Venkatraman S
  0 siblings, 2 replies; 8+ messages in thread
From: James Bottomley @ 2012-07-10 14:42 UTC (permalink / raw)
  To: Venkatraman S; +Cc: linux-scsi, akpm, Namjae Jeon

On Tue, 2012-07-10 at 19:39 +0530, Venkatraman S wrote:
> From: Namjae Jeon <linkinjeon@gmail.com>
> 
> Currently the UFS host driver has returned incorrect values for SUCCESS
> and FAILED.  Fix it to return the correct value to the upper layer.
> 
> Signed-off-by: Namjae Jeon <linkinjeon@gmail.com>
> Acked-by: Santosh Y <santoshsy@gmail.com>
> Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

The signoff chain here doesn't make sense.  It needs to be signed off by
you, not by Andrew since you're the one sending the patches.  Signoffs
follow the way the patch is transmitted, so it needs author (it has)
followed by maintainer ack (it has) followed by signoff of the person
sending the patch to the list (that's you) which is missing.

James



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH RESEND 3/3] drivers/scsi/ufs: fix incorrect return value about SUCCESS and FAILED
  2012-07-10 14:42   ` James Bottomley
@ 2012-07-10 15:09     ` S, Venkatraman
  2012-07-10 15:11     ` Venkatraman S
  1 sibling, 0 replies; 8+ messages in thread
From: S, Venkatraman @ 2012-07-10 15:09 UTC (permalink / raw)
  To: James Bottomley; +Cc: linux-scsi, akpm, Namjae Jeon

On Tue, Jul 10, 2012 at 8:12 PM, James Bottomley
<James.Bottomley@hansenpartnership.com> wrote:
> On Tue, 2012-07-10 at 19:39 +0530, Venkatraman S wrote:
>> From: Namjae Jeon <linkinjeon@gmail.com>
>>
>> Currently the UFS host driver has returned incorrect values for SUCCESS
>> and FAILED.  Fix it to return the correct value to the upper layer.
>>
>> Signed-off-by: Namjae Jeon <linkinjeon@gmail.com>
>> Acked-by: Santosh Y <santoshsy@gmail.com>
>> Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
>> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
>
> The signoff chain here doesn't make sense.  It needs to be signed off by
> you, not by Andrew since you're the one sending the patches.  Signoffs
> follow the way the patch is transmitted, so it needs author (it has)
> followed by maintainer ack (it has) followed by signoff of the person
> sending the patch to the list (that's you) which is missing.
>
Apologies - I took these patches from linux-next directly.
I'll send again with my Sign-Off.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH RESEND 3/3] drivers/scsi/ufs: fix incorrect return value about SUCCESS and FAILED
  2012-07-10 14:42   ` James Bottomley
  2012-07-10 15:09     ` S, Venkatraman
@ 2012-07-10 15:11     ` Venkatraman S
  2012-07-11  4:12       ` Namjae Jeon
  1 sibling, 1 reply; 8+ messages in thread
From: Venkatraman S @ 2012-07-10 15:11 UTC (permalink / raw)
  Cc: linux-scsi, akpm, Namjae Jeon, Venkatraman S, James Bottomley

From: Namjae Jeon <linkinjeon@gmail.com>

Currently the UFS host driver has returned incorrect values for SUCCESS
and FAILED.  Fix it to return the correct value to the upper layer.

Signed-off-by: Namjae Jeon <linkinjeon@gmail.com>
Acked-by: Santosh Y <santoshsy@gmail.com>
Signed-off-by: Venkatraman S <svenkatr@ti.com>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
---
 drivers/scsi/ufs/ufshcd.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index 48b01fe..58f4ba6 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -1163,6 +1163,8 @@ static int ufshcd_task_req_compl(struct ufs_hba *hba, u32 index)
 		if (task_result != UPIU_TASK_MANAGEMENT_FUNC_COMPL &&
 		    task_result != UPIU_TASK_MANAGEMENT_FUNC_SUCCEEDED)
 			task_result = FAILED;
+		else
+			task_result = SUCCESS;
 	} else {
 		task_result = FAILED;
 		dev_err(&hba->pdev->dev,
@@ -1556,7 +1558,7 @@ ufshcd_issue_tm_cmd(struct ufs_hba *hba,
 		goto out;
 	}
 	clear_bit(free_slot, &hba->tm_condition);
-	return ufshcd_task_req_compl(hba, free_slot);
+	err = ufshcd_task_req_compl(hba, free_slot);
 out:
 	return err;
 }
@@ -1580,7 +1582,7 @@ static int ufshcd_device_reset(struct scsi_cmnd *cmd)
 	tag = cmd->request->tag;
 
 	err = ufshcd_issue_tm_cmd(hba, &hba->lrb[tag], UFS_LOGICAL_RESET);
-	if (err)
+	if (err == FAILED)
 		goto out;
 
 	for (pos = 0; pos < hba->nutrs; pos++) {
@@ -1620,7 +1622,7 @@ static int ufshcd_host_reset(struct scsi_cmnd *cmd)
 	if (hba->ufshcd_state == UFSHCD_STATE_RESET)
 		return SUCCESS;
 
-	return (ufshcd_do_reset(hba) == SUCCESS) ? SUCCESS : FAILED;
+	return ufshcd_do_reset(hba);
 }
 
 /**
@@ -1652,7 +1654,7 @@ static int ufshcd_abort(struct scsi_cmnd *cmd)
 	spin_unlock_irqrestore(host->host_lock, flags);
 
 	err = ufshcd_issue_tm_cmd(hba, &hba->lrb[tag], UFS_ABORT_TASK);
-	if (err)
+	if (err == FAILED)
 		goto out;
 
 	scsi_dma_unmap(cmd);
-- 
1.7.0.4


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH RESEND 3/3] drivers/scsi/ufs: fix incorrect return value about SUCCESS and FAILED
  2012-07-10 15:11     ` Venkatraman S
@ 2012-07-11  4:12       ` Namjae Jeon
  0 siblings, 0 replies; 8+ messages in thread
From: Namjae Jeon @ 2012-07-11  4:12 UTC (permalink / raw)
  To: Venkatraman S; +Cc: James.Bottomley, linux-scsi, akpm

Thanks Venkat !

2012/7/11, Venkatraman S <svenkatr@ti.com>:
> From: Namjae Jeon <linkinjeon@gmail.com>
>
> Currently the UFS host driver has returned incorrect values for SUCCESS
> and FAILED.  Fix it to return the correct value to the upper layer.
>
> Signed-off-by: Namjae Jeon <linkinjeon@gmail.com>
> Acked-by: Santosh Y <santoshsy@gmail.com>
> Signed-off-by: Venkatraman S <svenkatr@ti.com>
> Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
> ---

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-07-11  4:12 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-10 14:09 [PATCH RESEND 0/3] drivers/scsi/ufs: Misc fixes Venkatraman S
2012-07-10 14:09 ` [PATCH RESEND 1/3] drivers/scsi/ufs: use module_pci_driver Venkatraman S
2012-07-10 14:09 ` [PATCH RESEND 2/3] drivers/scsi/ufs: reverse the ufshcd_is_device_present logic Venkatraman S
2012-07-10 14:09 ` [PATCH RESEND 3/3] drivers/scsi/ufs: fix incorrect return value about SUCCESS and FAILED Venkatraman S
2012-07-10 14:42   ` James Bottomley
2012-07-10 15:09     ` S, Venkatraman
2012-07-10 15:11     ` Venkatraman S
2012-07-11  4:12       ` Namjae Jeon

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.