Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1193230 > unrolled thread

[PATCH v6 6/8] mfd: make mfd_remove_devices() iterate in reverse order

Started byAndy Shevchenko <andriy.shevchenko@linux.intel.com>
First post2015-07-27 17:10 +0200
Last post2015-07-28 09:50 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH v6 6/8] mfd: make mfd_remove_devices() iterate in reverse order Andy Shevchenko <andriy.shevchenko@linux.intel.com> - 2015-07-27 17:10 +0200
    Re: [PATCH v6 6/8] mfd: make mfd_remove_devices() iterate in reverse  order Lee Jones <lee.jones@linaro.org> - 2015-07-28 09:50 +0200

#1193230 — [PATCH v6 6/8] mfd: make mfd_remove_devices() iterate in reverse order

FromAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Date2015-07-27 17:10 +0200
Subject[PATCH v6 6/8] mfd: make mfd_remove_devices() iterate in reverse order
Message-ID<pQScq-5tI-39@gated-at.bofh.it>
The newly introduced device_for_each_child_reverse() would be used when MFD
core removes the device.

After this patch applied the devices will be removed in a reversed order. This
behaviour is useful when devices have implicit dependency on order, i.e.
consider MFD device with serial bus controller, such as SPI, and DMA IP that is
attached to serial bus controller: before remove the DMA driver we have to be
ensured that no DMA transfers is ongoing and the requested channel are unused.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/mfd/mfd-core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mfd/mfd-core.c b/drivers/mfd/mfd-core.c
index 14fd5cb..c17635d 100644
--- a/drivers/mfd/mfd-core.c
+++ b/drivers/mfd/mfd-core.c
@@ -302,7 +302,7 @@ void mfd_remove_devices(struct device *parent)
 {
 	atomic_t *cnts = NULL;
 
-	device_for_each_child(parent, &cnts, mfd_remove_devices_fn);
+	device_for_each_child_reverse(parent, &cnts, mfd_remove_devices_fn);
 	kfree(cnts);
 }
 EXPORT_SYMBOL(mfd_remove_devices);
-- 
2.4.6

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1193831 — Re: [PATCH v6 6/8] mfd: make mfd_remove_devices() iterate in reverse order

FromLee Jones <lee.jones@linaro.org>
Date2015-07-28 09:50 +0200
SubjectRe: [PATCH v6 6/8] mfd: make mfd_remove_devices() iterate in reverse order
Message-ID<pR7O9-2HP-7@gated-at.bofh.it>
In reply to#1193230
On Mon, 27 Jul 2015, Andy Shevchenko wrote:

> The newly introduced device_for_each_child_reverse() would be used when MFD
> core removes the device.
> 
> After this patch applied the devices will be removed in a reversed order. This
> behaviour is useful when devices have implicit dependency on order, i.e.
> consider MFD device with serial bus controller, such as SPI, and DMA IP that is
> attached to serial bus controller: before remove the DMA driver we have to be
> ensured that no DMA transfers is ongoing and the requested channel are unused.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  drivers/mfd/mfd-core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Applied, thanks.  Pull request to follow.

> diff --git a/drivers/mfd/mfd-core.c b/drivers/mfd/mfd-core.c
> index 14fd5cb..c17635d 100644
> --- a/drivers/mfd/mfd-core.c
> +++ b/drivers/mfd/mfd-core.c
> @@ -302,7 +302,7 @@ void mfd_remove_devices(struct device *parent)
>  {
>  	atomic_t *cnts = NULL;
>  
> -	device_for_each_child(parent, &cnts, mfd_remove_devices_fn);
> +	device_for_each_child_reverse(parent, &cnts, mfd_remove_devices_fn);
>  	kfree(cnts);
>  }
>  EXPORT_SYMBOL(mfd_remove_devices);

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web