All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] iommu: make iommu_bus_notifier return NOTIFY_DONE rather than  error code
@ 2017-04-18 12:51 ` zhichang.yuan
  0 siblings, 0 replies; 6+ messages in thread
From: zhichang.yuan @ 2017-04-18 12:51 UTC (permalink / raw)
  To: joro
  Cc: iommu, linuxarm, linux-kernel, linux-arm-kernel,
	lorenzo.pieralisi, zhichang.yuan02, yankejian, huangdaode,
	zhichang.yuan

In iommu_bus_notifier(), when action is BUS_NOTIFY_ADD_DEVICE, it will return
'ops->add_device(dev)' directly. But ops->add_device will return ERR_VAL, such
as -ENODEV. These value will make notifier_call_chain() not to traverse the
remain nodes in struct notifier_block list.

This patch revises iommu_bus_notifier() to return NOTIFY_DONE when some errors
heppened in ops->add_device().

Signed-off-by: zhichang.yuan <yuanzhichang@hisilicon.com>
---
 drivers/iommu/iommu.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
index 3b67144..2d32911 100644
--- a/drivers/iommu/iommu.c
+++ b/drivers/iommu/iommu.c
@@ -1083,8 +1083,12 @@ static int iommu_bus_notifier(struct notifier_block *nb,
 	 * result in ADD/DEL notifiers to group->notifier
 	 */
 	if (action == BUS_NOTIFY_ADD_DEVICE) {
-		if (ops->add_device)
-			return ops->add_device(dev);
+		if (ops->add_device) {
+			int ret;
+
+			ret = ops->add_device(dev);
+			return (ret) ? NOTIFY_DONE : NOTIFY_OK;
+		}
 	} else if (action == BUS_NOTIFY_REMOVED_DEVICE) {
 		if (ops->remove_device && dev->iommu_group) {
 			ops->remove_device(dev);
-- 
1.9.1

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

* [PATCH] iommu: make iommu_bus_notifier return NOTIFY_DONE rather than  error code
@ 2017-04-18 12:51 ` zhichang.yuan
  0 siblings, 0 replies; 6+ messages in thread
From: zhichang.yuan @ 2017-04-18 12:51 UTC (permalink / raw)
  To: joro
  Cc: iommu, linuxarm, linux-kernel, linux-arm-kernel,
	lorenzo.pieralisi, zhichang.yuan02, yankejian, huangdaode,
	zhichang.yuan

In iommu_bus_notifier(), when action is BUS_NOTIFY_ADD_DEVICE, it will return
'ops->add_device(dev)' directly. But ops->add_device will return ERR_VAL, such
as -ENODEV. These value will make notifier_call_chain() not to traverse the
remain nodes in struct notifier_block list.

This patch revises iommu_bus_notifier() to return NOTIFY_DONE when some errors
heppened in ops->add_device().

Signed-off-by: zhichang.yuan <yuanzhichang@hisilicon.com>
---
 drivers/iommu/iommu.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
index 3b67144..2d32911 100644
--- a/drivers/iommu/iommu.c
+++ b/drivers/iommu/iommu.c
@@ -1083,8 +1083,12 @@ static int iommu_bus_notifier(struct notifier_block *nb,
 	 * result in ADD/DEL notifiers to group->notifier
 	 */
 	if (action == BUS_NOTIFY_ADD_DEVICE) {
-		if (ops->add_device)
-			return ops->add_device(dev);
+		if (ops->add_device) {
+			int ret;
+
+			ret = ops->add_device(dev);
+			return (ret) ? NOTIFY_DONE : NOTIFY_OK;
+		}
 	} else if (action == BUS_NOTIFY_REMOVED_DEVICE) {
 		if (ops->remove_device && dev->iommu_group) {
 			ops->remove_device(dev);
-- 
1.9.1

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

* [PATCH] iommu: make iommu_bus_notifier return NOTIFY_DONE rather than error code
@ 2017-04-18 12:51 ` zhichang.yuan
  0 siblings, 0 replies; 6+ messages in thread
From: zhichang.yuan @ 2017-04-18 12:51 UTC (permalink / raw)
  To: linux-arm-kernel

In iommu_bus_notifier(), when action is BUS_NOTIFY_ADD_DEVICE, it will return
'ops->add_device(dev)' directly. But ops->add_device will return ERR_VAL, such
as -ENODEV. These value will make notifier_call_chain() not to traverse the
remain nodes in struct notifier_block list.

This patch revises iommu_bus_notifier() to return NOTIFY_DONE when some errors
heppened in ops->add_device().

Signed-off-by: zhichang.yuan <yuanzhichang@hisilicon.com>
---
 drivers/iommu/iommu.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
index 3b67144..2d32911 100644
--- a/drivers/iommu/iommu.c
+++ b/drivers/iommu/iommu.c
@@ -1083,8 +1083,12 @@ static int iommu_bus_notifier(struct notifier_block *nb,
 	 * result in ADD/DEL notifiers to group->notifier
 	 */
 	if (action == BUS_NOTIFY_ADD_DEVICE) {
-		if (ops->add_device)
-			return ops->add_device(dev);
+		if (ops->add_device) {
+			int ret;
+
+			ret = ops->add_device(dev);
+			return (ret) ? NOTIFY_DONE : NOTIFY_OK;
+		}
 	} else if (action == BUS_NOTIFY_REMOVED_DEVICE) {
 		if (ops->remove_device && dev->iommu_group) {
 			ops->remove_device(dev);
-- 
1.9.1

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

* Re: [PATCH] iommu: make iommu_bus_notifier return NOTIFY_DONE rather than  error code
@ 2017-04-20 14:43   ` Joerg Roedel
  0 siblings, 0 replies; 6+ messages in thread
From: Joerg Roedel @ 2017-04-20 14:43 UTC (permalink / raw)
  To: zhichang.yuan
  Cc: iommu, linuxarm, linux-kernel, linux-arm-kernel,
	lorenzo.pieralisi, zhichang.yuan02, yankejian, huangdaode

On Tue, Apr 18, 2017 at 08:51:48PM +0800, zhichang.yuan wrote:
> In iommu_bus_notifier(), when action is BUS_NOTIFY_ADD_DEVICE, it will return
> 'ops->add_device(dev)' directly. But ops->add_device will return ERR_VAL, such
> as -ENODEV. These value will make notifier_call_chain() not to traverse the
> remain nodes in struct notifier_block list.
> 
> This patch revises iommu_bus_notifier() to return NOTIFY_DONE when some errors
> heppened in ops->add_device().
> 
> Signed-off-by: zhichang.yuan <yuanzhichang@hisilicon.com>

Applied, thanks.

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

* Re: [PATCH] iommu: make iommu_bus_notifier return NOTIFY_DONE rather than  error code
@ 2017-04-20 14:43   ` Joerg Roedel
  0 siblings, 0 replies; 6+ messages in thread
From: Joerg Roedel @ 2017-04-20 14:43 UTC (permalink / raw)
  To: zhichang.yuan
  Cc: yankejian-hv44wF8Li93QT0dZR+AlfA,
	linuxarm-hv44wF8Li93QT0dZR+AlfA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA,
	huangdaode-C8/M+/jPZTeaMJb+Lgu22Q,
	zhichang.yuan02-Re5JQEeQqe8AvxtiuMwx3w,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r

On Tue, Apr 18, 2017 at 08:51:48PM +0800, zhichang.yuan wrote:
> In iommu_bus_notifier(), when action is BUS_NOTIFY_ADD_DEVICE, it will return
> 'ops->add_device(dev)' directly. But ops->add_device will return ERR_VAL, such
> as -ENODEV. These value will make notifier_call_chain() not to traverse the
> remain nodes in struct notifier_block list.
> 
> This patch revises iommu_bus_notifier() to return NOTIFY_DONE when some errors
> heppened in ops->add_device().
> 
> Signed-off-by: zhichang.yuan <yuanzhichang-C8/M+/jPZTeaMJb+Lgu22Q@public.gmane.org>

Applied, thanks.

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

* [PATCH] iommu: make iommu_bus_notifier return NOTIFY_DONE rather than  error code
@ 2017-04-20 14:43   ` Joerg Roedel
  0 siblings, 0 replies; 6+ messages in thread
From: Joerg Roedel @ 2017-04-20 14:43 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Apr 18, 2017 at 08:51:48PM +0800, zhichang.yuan wrote:
> In iommu_bus_notifier(), when action is BUS_NOTIFY_ADD_DEVICE, it will return
> 'ops->add_device(dev)' directly. But ops->add_device will return ERR_VAL, such
> as -ENODEV. These value will make notifier_call_chain() not to traverse the
> remain nodes in struct notifier_block list.
> 
> This patch revises iommu_bus_notifier() to return NOTIFY_DONE when some errors
> heppened in ops->add_device().
> 
> Signed-off-by: zhichang.yuan <yuanzhichang@hisilicon.com>

Applied, thanks.

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

end of thread, other threads:[~2017-04-20 14:44 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-18 12:51 [PATCH] iommu: make iommu_bus_notifier return NOTIFY_DONE rather than error code zhichang.yuan
2017-04-18 12:51 ` zhichang.yuan
2017-04-18 12:51 ` zhichang.yuan
2017-04-20 14:43 ` Joerg Roedel
2017-04-20 14:43   ` Joerg Roedel
2017-04-20 14:43   ` Joerg Roedel

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.