All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/9] backports: enable DRM_NOUVEAU for 3.2
@ 2013-04-07  2:21 Luis R. Rodriguez
  2013-04-07  2:21 ` [PATCH 2/9] compat: backport dev_level_ratelimited() Luis R. Rodriguez
                   ` (7 more replies)
  0 siblings, 8 replies; 11+ messages in thread
From: Luis R. Rodriguez @ 2013-04-07  2:21 UTC (permalink / raw)
  To: johannes; +Cc: backports, Luis R. Rodriguez

From: "Luis R. Rodriguez" <mcgrof@do-not-panic.com>

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
---
 dependencies |    1 -
 1 file changed, 1 deletion(-)

diff --git a/dependencies b/dependencies
index 7c79449..d001a38 100644
--- a/dependencies
+++ b/dependencies
@@ -45,7 +45,6 @@ MWIFIEX 2.6.27
 HDMI 3.2
 DRM 3.2
 DRM_TTM 3.2
-DRM_NOUVEAU 3.3
 
 # This requires proc_create(), and that doesn't exist before 2.6.24
 LIBIPW_DEBUG 2.6.25
-- 
1.7.10.4


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

* [PATCH 2/9] compat: backport dev_level_ratelimited()
  2013-04-07  2:21 [PATCH 1/9] backports: enable DRM_NOUVEAU for 3.2 Luis R. Rodriguez
@ 2013-04-07  2:21 ` Luis R. Rodriguez
  2013-04-07  2:21 ` [PATCH 3/9] compat: backport __i2c_transfer() Luis R. Rodriguez
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 11+ messages in thread
From: Luis R. Rodriguez @ 2013-04-07  2:21 UTC (permalink / raw)
  To: johannes; +Cc: backports, Luis R. Rodriguez

From: "Luis R. Rodriguez" <mcgrof@do-not-panic.com>

mcgrof@frijol ~/linux-stable (git::master)$ git describe --contains 6ca04593
v3.5-rc1~147^2~7

This is only enabled for kernels where ratelimit.h was added.

commit 6ca045930338485a8cdef117e74372aa1678009d
Author: Hiroshi DOYU <hdoyu@nvidia.com>
Date:   Mon May 14 10:47:57 2012 +0300

    driver core: Add dev_*_ratelimited() family

    Add dev_*_ratelimited() family, dev_* version of pr_*_ratelimited().

    Using Joe Perches's proposal/implementation.

    Signed-off-by: Hiroshi DOYU <hdoyu@nvidia.com>
    Cc: Joe Perches <joe@perches.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
---
 backport/include/linux/compat-3.5.h |   36 +++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)

diff --git a/backport/include/linux/compat-3.5.h b/backport/include/linux/compat-3.5.h
index 57b06b0..7e1d9b3 100644
--- a/backport/include/linux/compat-3.5.h
+++ b/backport/include/linux/compat-3.5.h
@@ -10,6 +10,42 @@
 
 #include <net/netlink.h>
 
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27))
+#include <linux/ratelimit.h>
+#define dev_level_ratelimited(dev_level, dev, fmt, ...)			\
+do {									\
+	static DEFINE_RATELIMIT_STATE(_rs,				\
+				      DEFAULT_RATELIMIT_INTERVAL,	\
+				      DEFAULT_RATELIMIT_BURST);		\
+	if (__ratelimit(&_rs))						\
+		dev_level(dev, fmt, ##__VA_ARGS__);			\
+} while (0)
+
+#define dev_emerg_ratelimited(dev, fmt, ...)				\
+	dev_level_ratelimited(dev_emerg, dev, fmt, ##__VA_ARGS__)
+#define dev_alert_ratelimited(dev, fmt, ...)				\
+	dev_level_ratelimited(dev_alert, dev, fmt, ##__VA_ARGS__)
+
+
+#if defined(CONFIG_DYNAMIC_DEBUG) || defined(DEBUG)
+#define dev_dbg_ratelimited(dev, fmt, ...)				\
+do {									\
+	static DEFINE_RATELIMIT_STATE(_rs,				\
+				      DEFAULT_RATELIMIT_INTERVAL,	\
+				      DEFAULT_RATELIMIT_BURST);		\
+	DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, fmt);			\
+	if (unlikely(descriptor.flags & _DPRINTK_FLAGS_PRINT) &&	\
+	    __ratelimit(&_rs))						\
+		__dynamic_pr_debug(&descriptor, pr_fmt(fmt),		\
+				   ##__VA_ARGS__);			\
+} while (0)
+#else
+#define dev_dbg_ratelimited(dev, fmt, ...)			\
+	no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
+#endif
+
+#endif
+
 /*
  * This backports:
  * commit 569a8fc38367dfafd87454f27ac646c8e6b54bca
-- 
1.7.10.4


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

* [PATCH 3/9] compat: backport __i2c_transfer()
  2013-04-07  2:21 [PATCH 1/9] backports: enable DRM_NOUVEAU for 3.2 Luis R. Rodriguez
  2013-04-07  2:21 ` [PATCH 2/9] compat: backport dev_level_ratelimited() Luis R. Rodriguez
@ 2013-04-07  2:21 ` Luis R. Rodriguez
  2013-04-07  2:21 ` [PATCH 4/9] compat: backport EPROBE_DEFER value Luis R. Rodriguez
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 11+ messages in thread
From: Luis R. Rodriguez @ 2013-04-07  2:21 UTC (permalink / raw)
  To: johannes; +Cc: backports, Luis R. Rodriguez

From: "Luis R. Rodriguez" <mcgrof@do-not-panic.com>

mcgrof@frijol ~/linux-stable (git::master)$ git describe --contains b37d2a3a
v3.6-rc1~28^2~265

commit b37d2a3a75cb0e72e18c29336cb2095b63dabfc8
Author: Jean Delvare <khali@linux-fr.org>
Date:   Fri Jun 29 07:47:19 2012 -0300

    [media] i2c: Export an unlocked flavor of i2c_transfer

    Some drivers (in particular for TV cards) need exclusive access to
    their I2C buses for specific operations. Export an unlocked flavor
    of i2c_transfer to give them full control.

    The unlocked flavor has the following limitations:
    * Obviously, caller must hold the i2c adapter lock.
    * No debug messages are logged. We don't want to log messages while
      holding a rt_mutex.
    * No check is done on the existence of adap->algo->master_xfer. It
      is thus the caller's responsibility to ensure that the function is
      OK to call.

    Signed-off-by: Jean Delvare <khali@linux-fr.org>
    Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
---
 backport/compat/compat-3.6.c        |   34 ++++++++++++++++++++++++++++++++++
 backport/include/linux/compat-3.6.h |    9 +++++++++
 2 files changed, 43 insertions(+)

diff --git a/backport/compat/compat-3.6.c b/backport/compat/compat-3.6.c
index a50fc98..05954d4 100644
--- a/backport/compat/compat-3.6.c
+++ b/backport/compat/compat-3.6.c
@@ -13,6 +13,40 @@
 #include <linux/export.h>
 #include <linux/bug.h>
 #include <linux/bitmap.h>
+#include <linux/i2c.h>
+
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0))
+/**
+ * __i2c_transfer - unlocked flavor of i2c_transfer
+ * @adap: Handle to I2C bus
+ * @msgs: One or more messages to execute before STOP is issued to
+ *     terminate the operation; each message begins with a START.
+ * @num: Number of messages to be executed.
+ *
+ * Returns negative errno, else the number of messages executed.
+ *
+ * Adapter lock must be held when calling this function. No debug logging
+ * takes place. adap->algo->master_xfer existence isn't checked.
+ */
+int __i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
+{
+	unsigned long orig_jiffies;
+	int ret, try;
+
+	/* Retry automatically on arbitration loss */
+	orig_jiffies = jiffies;
+	for (ret = 0, try = 0; try <= adap->retries; try++) {
+		ret = adap->algo->master_xfer(adap, msgs, num);
+		if (ret != -EAGAIN)
+			break;
+		if (time_after(jiffies, orig_jiffies + adap->timeout))
+			break;
+	}
+
+	return ret;
+}
+EXPORT_SYMBOL(__i2c_transfer);
+#endif
 
 /**
  * memweight - count the total number of bits set in memory area
diff --git a/backport/include/linux/compat-3.6.h b/backport/include/linux/compat-3.6.h
index bef0503..8fddd31 100644
--- a/backport/include/linux/compat-3.6.h
+++ b/backport/include/linux/compat-3.6.h
@@ -7,6 +7,15 @@
 
 #include <linux/scatterlist.h>
 
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0))
+#include <linux/i2c.h>
+/* Unlocked flavor */
+#define __i2c_transfer LINUX_BACKPORT(__i2c_transfer)
+extern int __i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs,
+			  int num);
+#endif
+
+
 #define memweight LINUX_BACKPORT(memweight)
 extern size_t memweight(const void *ptr, size_t bytes);
 
-- 
1.7.10.4


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

* [PATCH 4/9] compat: backport EPROBE_DEFER value
  2013-04-07  2:21 [PATCH 1/9] backports: enable DRM_NOUVEAU for 3.2 Luis R. Rodriguez
  2013-04-07  2:21 ` [PATCH 2/9] compat: backport dev_level_ratelimited() Luis R. Rodriguez
  2013-04-07  2:21 ` [PATCH 3/9] compat: backport __i2c_transfer() Luis R. Rodriguez
@ 2013-04-07  2:21 ` Luis R. Rodriguez
  2013-04-07 17:22   ` Johannes Berg
  2013-04-07  2:21 ` [PATCH 5/9] compat: backport devm_regmap_init() Luis R. Rodriguez
                   ` (4 subsequent siblings)
  7 siblings, 1 reply; 11+ messages in thread
From: Luis R. Rodriguez @ 2013-04-07  2:21 UTC (permalink / raw)
  To: johannes; +Cc: backports, Luis R. Rodriguez

From: "Luis R. Rodriguez" <mcgrof@do-not-panic.com>

Grant added the ability to the driver core to return
EPROBE_DEFER at device driver probe time and for that to
trigger a later deferred probe through a workqueue. It
seems we could in theory backport this functionality but
that requires quite a bit of work. For now just pass on
the EPROBE_DEFER definition safely and for older kernels
than 3.4 the EPROBE_DEFER would be treated as a regular
probe error.

mcgrof@frijol ~/linux-stable (git::master)$ git describe --contains d1c3414c
v3.4-rc1~187^2~10

commit d1c3414c2a9d10ef7f0f7665f5d2947cd088c093
Author: Grant Likely <grant.likely@secretlab.ca>
Date:   Mon Mar 5 08:47:41 2012 -0700

    drivercore: Add driver probe deferral mechanism

    Allow drivers to report at probe time that they cannot get all the resources
    required by the device, and should be retried at a later time.

    This should completely solve the problem of getting devices
    initialized in the right order.  Right now this is mostly handled by
    mucking about with initcall ordering which is a complete hack, and
    doesn't even remotely handle the case where device drivers are in
    modules.  This approach completely sidesteps the issues by allowing
    driver registration to occur in any order, and any driver can request
    to be retried after a few more other drivers get probed.

    v4: - Integrate Manjunath's addition of a separate workqueue
        - Change -EAGAIN to -EPROBE_DEFER for drivers to trigger deferral
        - Update comment blocks to reflect how the code really works
    v3: - Hold off workqueue scheduling until late_initcall so that the bulk
          of driver probes are complete before we start retrying deferred devices.
        - Tested with simple use cases.  Still needs more testing though.
          Using it to get rid of the gpio early_initcall madness, or to replace
          the ASoC internal probe deferral code would be ideal.
    v2: - added locking so it should no longer be utterly broken in that regard
        - remove device from deferred list at device_del time.
        - Still completely untested with any real use case, but has been
          boot tested.

    Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
    Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
    Cc: Arnd Bergmann <arnd@arndb.de>
    Cc: Dilan Lee <dilee@nvidia.com>
    Cc: Manjunath GKondaiah <manjunath.gkondaiah@linaro.org>
    Cc: Alan Stern <stern@rowland.harvard.edu>
    Cc: Tony Lindgren <tony@atomide.com>
    Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
    Reviewed-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
    Acked-by: David Daney <david.daney@cavium.com>
    Reviewed-by: Arnd Bergmann <arnd@arndb.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
---
 backport/include/linux/compat-3.4.h |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/backport/include/linux/compat-3.4.h b/backport/include/linux/compat-3.4.h
index 01a72b7..2a53cef 100644
--- a/backport/include/linux/compat-3.4.h
+++ b/backport/include/linux/compat-3.4.h
@@ -11,6 +11,8 @@
 #include <linux/kconfig.h>
 #endif
 
+#define EPROBE_DEFER   517     /* Driver requests probe retry */
+
 /*
  * defined here to allow things to compile but technically
  * using this for memory regions will yield in a no-op on newer
-- 
1.7.10.4


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

* [PATCH 5/9] compat: backport devm_regmap_init()
  2013-04-07  2:21 [PATCH 1/9] backports: enable DRM_NOUVEAU for 3.2 Luis R. Rodriguez
                   ` (2 preceding siblings ...)
  2013-04-07  2:21 ` [PATCH 4/9] compat: backport EPROBE_DEFER value Luis R. Rodriguez
@ 2013-04-07  2:21 ` Luis R. Rodriguez
  2013-04-07  2:21 ` [PATCH 6/9] compat: backport GPIOF_OPEN_DRAIN definition Luis R. Rodriguez
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 11+ messages in thread
From: Luis R. Rodriguez @ 2013-04-07  2:21 UTC (permalink / raw)
  To: johannes; +Cc: backports, Luis R. Rodriguez

From: "Luis R. Rodriguez" <mcgrof@do-not-panic.com>

Backport devm_regmap_init() for I2C and SPI.

mcgrof@frijol ~/linux-stable (git::master)$ git describe --contains c0eb4676
v3.4-rc1~126^2~4^2

commit c0eb46766d395da8d62148bda2e59bad5e6ee2f2
Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
Date:   Mon Jan 30 19:56:52 2012 +0000

    regmap: Implement managed regmap_init()

    Save error handling and unwinding code in drivers by providing managed
    versions of the regmap init functions, simplifying usage.

    Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
---
 backport/compat/compat-3.4.c        |   95 +++++++++++++++++++++++++++++++++++
 backport/include/linux/compat-3.4.h |   15 ++++++
 2 files changed, 110 insertions(+)

diff --git a/backport/compat/compat-3.4.c b/backport/compat/compat-3.4.c
index f8512e4..1f3f8ec 100644
--- a/backport/compat/compat-3.4.c
+++ b/backport/compat/compat-3.4.c
@@ -12,6 +12,101 @@
 #include <linux/module.h>
 #include <linux/wait.h>
 
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0))
+#include <linux/regmap.h>
+#include <linux/i2c.h>
+#include <linux/spi/spi.h>
+#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)) */
+
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0))
+#if defined(CONFIG_REGMAP)
+static void devm_regmap_release(struct device *dev, void *res)
+{
+	regmap_exit(*(struct regmap **)res);
+}
+
+/**
+ * devm_regmap_init(): Initialise managed register map
+ *
+ * @dev: Device that will be interacted with
+ * @bus: Bus-specific callbacks to use with device
+ * @bus_context: Data passed to bus-specific callbacks
+ * @config: Configuration for register map
+ *
+ * The return value will be an ERR_PTR() on error or a valid pointer
+ * to a struct regmap.  This function should generally not be called
+ * directly, it should be called by bus-specific init functions.  The
+ * map will be automatically freed by the device management code.
+ */
+struct regmap *devm_regmap_init(struct device *dev,
+				const struct regmap_bus *bus,
+				void *bus_context,
+				const struct regmap_config *config)
+{
+	struct regmap **ptr, *regmap;
+
+	ptr = devres_alloc(devm_regmap_release, sizeof(*ptr), GFP_KERNEL);
+	if (!ptr)
+		return ERR_PTR(-ENOMEM);
+
+	regmap = regmap_init(dev,
+			     bus,
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,5,0))
+			     bus_context,
+#endif /* see commit 0135bbcc */
+			     config);
+	if (!IS_ERR(regmap)) {
+		*ptr = regmap;
+		devres_add(dev, ptr);
+	} else {
+		devres_free(ptr);
+	}
+
+	return regmap;
+}
+EXPORT_SYMBOL_GPL(devm_regmap_init);
+
+#if defined(CONFIG_REGMAP_I2C)
+/**
+ * devm_regmap_init_i2c(): Initialise managed register map
+ *
+ * @i2c: Device that will be interacted with
+ * @config: Configuration for register map
+ *
+ * The return value will be an ERR_PTR() on error or a valid pointer
+ * to a struct regmap.  The regmap will be automatically freed by the
+ * device management code.
+ */
+struct regmap *devm_regmap_init_i2c(struct i2c_client *i2c,
+				    const struct regmap_config *config)
+{
+	return devm_regmap_init(&i2c->dev, &regmap_i2c, config);
+}
+EXPORT_SYMBOL_GPL(devm_regmap_init_i2c);
+#endif /* defined(CONFIG_REGMAP_I2C) */
+
+#if defined(CONFIG_REGMAP_I2C)
+/**
+ * devm_regmap_init_spi(): Initialise register map
+ *
+ * @spi: Device that will be interacted with
+ * @config: Configuration for register map
+ *
+ * The return value will be an ERR_PTR() on error or a valid pointer
+ * to a struct regmap.  The map will be automatically freed by the
+ * device management code.
+ */
+struct regmap *devm_regmap_init_spi(struct spi_device *spi,
+				    const struct regmap_config *config)
+{
+	return devm_regmap_init(&spi->dev, &regmap_spi, config);
+}
+EXPORT_SYMBOL_GPL(devm_regmap_init_spi);
+#endif /* defined(CONFIG_REGMAP_SPI) */
+
+#endif /* defined(CONFIG_REGMAP) */
+#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)) */
+
 /* __wake_up_common was declared as part of the wait.h until
  * 2.6.31 in which they made it private to the scheduler. Prefix it with
  * compat to avoid double declaration issues.
diff --git a/backport/include/linux/compat-3.4.h b/backport/include/linux/compat-3.4.h
index 2a53cef..0636499 100644
--- a/backport/include/linux/compat-3.4.h
+++ b/backport/include/linux/compat-3.4.h
@@ -13,6 +13,21 @@
 
 #define EPROBE_DEFER   517     /* Driver requests probe retry */
 
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0))
+#include <linux/regmap.h>
+#define devm_regmap_init LINUX_BACKPORT(devm_regmap_init)
+struct regmap *devm_regmap_init(struct device *dev,
+				const struct regmap_bus *bus,
+				void *bus_context,
+				const struct regmap_config *config);
+#define devm_regmap_init_i2c LINUX_BACKPORT(devm_regmap_init_i2c)
+struct regmap *devm_regmap_init_i2c(struct i2c_client *i2c,
+				    const struct regmap_config *config);
+#define devm_regmap_init_spi LINUX_BACKPORT(devm_regmap_init_spi)
+struct regmap *devm_regmap_init_spi(struct spi_device *dev,
+				    const struct regmap_config *config);
+#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)) */
+
 /*
  * defined here to allow things to compile but technically
  * using this for memory regions will yield in a no-op on newer
-- 
1.7.10.4


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

* [PATCH 6/9] compat: backport GPIOF_OPEN_DRAIN definition
  2013-04-07  2:21 [PATCH 1/9] backports: enable DRM_NOUVEAU for 3.2 Luis R. Rodriguez
                   ` (3 preceding siblings ...)
  2013-04-07  2:21 ` [PATCH 5/9] compat: backport devm_regmap_init() Luis R. Rodriguez
@ 2013-04-07  2:21 ` Luis R. Rodriguez
  2013-04-07  2:22 ` [PATCH 7/9] compat: backport ASYNC_DOMAIN_EXCLUSIVE() Luis R. Rodriguez
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 11+ messages in thread
From: Luis R. Rodriguez @ 2013-04-07  2:21 UTC (permalink / raw)
  To: johannes; +Cc: backports, Luis R. Rodriguez

From: "Luis R. Rodriguez" <mcgrof@do-not-panic.com>

This functionality will just be ignored, later we'll
just port the full gpiolib.

mcgrof@frijol ~/linux-stable (git::master)$ git describe --contains  aca5ce14
v3.4-rc1~65^2~20

commit aca5ce14eb773a75e5d935968b2e390dc5bd29c3
Author: Laxman Dewangan <ldewangan@nvidia.com>
Date:   Fri Feb 17 20:26:21 2012 +0530

    gpio: gpiolib: Support for open drain/collector gpios

    Adding support for the open drain gpio on which client
    can specify the open drain property through GPIO flag
    GPIOF_OPEN_DRAIN at the time of gpio request.
    The open drain pins are normally pulled high and it
    cannot be driven to output with value of 1 and so
    when client request for setting the pin to HIGH, the
    gpio will be set to input direction to make pin in tristate
    and hence PULL-UP on pins will make the state to HIGH.
    The open drain pin can be driven to LOW by setting output
    with value of 0.

    Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
    Reviwed-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
    Acked-by: Linus Walleij <linus.walleij@linaro.org>
    Signed-off-by: Grant Likely <grant.likely@secretlab.ca>

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
---
 backport/include/linux/compat-3.4.h |    1 +
 1 file changed, 1 insertion(+)

diff --git a/backport/include/linux/compat-3.4.h b/backport/include/linux/compat-3.4.h
index 0636499..eb557d9 100644
--- a/backport/include/linux/compat-3.4.h
+++ b/backport/include/linux/compat-3.4.h
@@ -12,6 +12,7 @@
 #endif
 
 #define EPROBE_DEFER   517     /* Driver requests probe retry */
+#define GPIOF_OPEN_DRAIN       (1 << 2)
 
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0))
 #include <linux/regmap.h>
-- 
1.7.10.4


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

* [PATCH 7/9] compat: backport ASYNC_DOMAIN_EXCLUSIVE()
  2013-04-07  2:21 [PATCH 1/9] backports: enable DRM_NOUVEAU for 3.2 Luis R. Rodriguez
                   ` (4 preceding siblings ...)
  2013-04-07  2:21 ` [PATCH 6/9] compat: backport GPIOF_OPEN_DRAIN definition Luis R. Rodriguez
@ 2013-04-07  2:22 ` Luis R. Rodriguez
  2013-04-07  2:22 ` [PATCH 8/9] compat: backport devres_release() Luis R. Rodriguez
  2013-04-07  2:22 ` [PATCH 9/9] compat: backport dev_get_regmap() Luis R. Rodriguez
  7 siblings, 0 replies; 11+ messages in thread
From: Luis R. Rodriguez @ 2013-04-07  2:22 UTC (permalink / raw)
  To: johannes; +Cc: backports, Luis R. Rodriguez

From: "Luis R. Rodriguez" <mcgrof@do-not-panic.com>

For older kernels this is simply a matter of using
LIST_HEAD.

mcgrof@frijol ~/linux-stable (git::master)$ git describe --contains 2955b47d
v3.6-rc1~103^2~4

commit 2955b47d2c1983998a8c5915cb96884e67f7cb53
Author: Dan Williams <dan.j.williams@intel.com>
Date:   Mon Jul 9 19:33:25 2012 -0700

    [SCSI] async: introduce 'async_domain' type

    This is in preparation for teaching async_synchronize_full() to sync all
    pending async work, and not just on the async_running domain.  This
    conversion is functionally equivalent, just embedding the existing list
    in a new async_domain type.

    The .registered attribute is used in a later patch to distinguish
    between domains that want to be flushed by async_synchronize_full()
    versus those that only expect async_synchronize_{full|cookie}_domain to
    be used for flushing.

    [jejb: add async.h to scsi_priv.h for struct async_domain]
    Signed-off-by: Dan Williams <dan.j.williams@intel.com>
    Acked-by: Arjan van de Ven <arjan@linux.intel.com>
    Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
    Tested-by: Eldad Zack <eldad@fogrefinery.com>
    Signed-off-by: James Bottomley <JBottomley@Parallels.com>

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
---
 backport/include/linux/compat-3.6.h |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/backport/include/linux/compat-3.6.h b/backport/include/linux/compat-3.6.h
index 8fddd31..49f4d3b 100644
--- a/backport/include/linux/compat-3.6.h
+++ b/backport/include/linux/compat-3.6.h
@@ -9,6 +9,9 @@
 
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0))
 #include <linux/i2c.h>
+
+#define ASYNC_DOMAIN_EXCLUSIVE(_domain) LIST_HEAD(_domain)
+
 /* Unlocked flavor */
 #define __i2c_transfer LINUX_BACKPORT(__i2c_transfer)
 extern int __i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs,
-- 
1.7.10.4


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

* [PATCH 8/9] compat: backport devres_release()
  2013-04-07  2:21 [PATCH 1/9] backports: enable DRM_NOUVEAU for 3.2 Luis R. Rodriguez
                   ` (5 preceding siblings ...)
  2013-04-07  2:22 ` [PATCH 7/9] compat: backport ASYNC_DOMAIN_EXCLUSIVE() Luis R. Rodriguez
@ 2013-04-07  2:22 ` Luis R. Rodriguez
  2013-04-07  2:22 ` [PATCH 9/9] compat: backport dev_get_regmap() Luis R. Rodriguez
  7 siblings, 0 replies; 11+ messages in thread
From: Luis R. Rodriguez @ 2013-04-07  2:22 UTC (permalink / raw)
  To: johannes; +Cc: backports, Luis R. Rodriguez

From: "Luis R. Rodriguez" <mcgrof@do-not-panic.com>

commit d926d0e4c74cfcb42a05e91d1cdf698b41e1e118
Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
Date:   Thu May 3 18:15:13 2012 +0100

    devres: Add devres_release()

    APIs using devres frequently want to implement a "remove and free the
    resource" operation so it seems sensible that they should be able to
    just have devres do the freeing for them since that's a big part of what
    devres is all about.

    Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
---
 backport/compat/compat-3.5.c        |   34 ++++++++++++++++++++++++++++++++++
 backport/include/linux/compat-3.5.h |    6 ++++++
 2 files changed, 40 insertions(+)

diff --git a/backport/compat/compat-3.5.c b/backport/compat/compat-3.5.c
index d7f1c27..9cc8456 100644
--- a/backport/compat/compat-3.5.c
+++ b/backport/compat/compat-3.5.c
@@ -12,6 +12,40 @@
 #include <linux/highuid.h>
 #include <linux/ktime.h>
 
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0))
+#include <linux/device.h>
+
+/**
+ * devres_release - Find a device resource and destroy it, calling release
+ * @dev: Device to find resource from
+ * @release: Look for resources associated with this release function
+ * @match: Match function (optional)
+ * @match_data: Data for the match function
+ *
+ * Find the latest devres of @dev associated with @release and for
+ * which @match returns 1.  If @match is NULL, it's considered to
+ * match all.  If found, the resource is removed atomically, the
+ * release function called and the resource freed.
+ *
+ * RETURNS:
+ * 0 if devres is found and freed, -ENOENT if not found.
+ */
+int devres_release(struct device *dev, dr_release_t release,
+		   dr_match_t match, void *match_data)
+{
+	void *res;
+
+	res = devres_remove(dev, release, match, match_data);
+	if (unlikely(!res))
+		return -ENOENT;
+
+	(*release)(dev, res);
+	devres_free(res);
+	return 0;
+}
+EXPORT_SYMBOL_GPL(devres_release);
+#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0)) */
+
 /*
  * Commit 7a4e7408c5cadb240e068a662251754a562355e3
  * exported overflowuid and overflowgid for all
diff --git a/backport/include/linux/compat-3.5.h b/backport/include/linux/compat-3.5.h
index 7e1d9b3..70ba227 100644
--- a/backport/include/linux/compat-3.5.h
+++ b/backport/include/linux/compat-3.5.h
@@ -10,6 +10,12 @@
 
 #include <net/netlink.h>
 
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0))
+#define devres_release LINUX_BACKPORT(devres_release)
+extern int devres_release(struct device *dev, dr_release_t release,
+			  dr_match_t match, void *match_data);
+#endif
+
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27))
 #include <linux/ratelimit.h>
 #define dev_level_ratelimited(dev_level, dev, fmt, ...)			\
-- 
1.7.10.4


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

* [PATCH 9/9] compat: backport dev_get_regmap()
  2013-04-07  2:21 [PATCH 1/9] backports: enable DRM_NOUVEAU for 3.2 Luis R. Rodriguez
                   ` (6 preceding siblings ...)
  2013-04-07  2:22 ` [PATCH 8/9] compat: backport devres_release() Luis R. Rodriguez
@ 2013-04-07  2:22 ` Luis R. Rodriguez
  7 siblings, 0 replies; 11+ messages in thread
From: Luis R. Rodriguez @ 2013-04-07  2:22 UTC (permalink / raw)
  To: johannes; +Cc: backports, Luis R. Rodriguez

From: "Luis R. Rodriguez" <mcgrof@do-not-panic.com>

We can't backport dev_get_regmap() unless we backport regmap
fully onto compat, but users typically try to get the regmap in
other ways first:

        if (config->regmap)
                rdev->regmap = config->regmap;
        else if (dev_get_regmap(dev, NULL))
                rdev->regmap = dev_get_regmap(dev, NULL);
        else if (dev->parent)
                rdev->regmap = dev_get_regmap(dev->parent, NULL);

So this would option would just not be available for.

mcgrof@frijol ~/linux-stable (git::master)$ git describe --contains 72b39f6f
v3.5-rc1~117^2~7^3

commit 72b39f6f2b5a6b0beff14b80bed9756f151218a9
Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
Date:   Tue May 8 17:44:40 2012 +0100

    regmap: Implement dev_get_regmap()

    Use devres to implement dev_get_regmap(). This should mean that in almost
    all cases devices wishing to take advantage of framework features based on
    regmap shouldn't need to explicitly pass the regmap into the framework.
    This simplifies device setup a bit.

    Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
---
 backport/include/linux/compat-3.5.h |    9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/backport/include/linux/compat-3.5.h b/backport/include/linux/compat-3.5.h
index 70ba227..4c6f182 100644
--- a/backport/include/linux/compat-3.5.h
+++ b/backport/include/linux/compat-3.5.h
@@ -11,6 +11,15 @@
 #include <net/netlink.h>
 
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0))
+#include <linux/regmap.h>
+
+#define dev_get_regmap LINUX_BACKPORT(dev_get_regmap)
+static inline
+struct regmap *dev_get_regmap(struct device *dev, const char *name)
+{
+	return NULL;
+}
+
 #define devres_release LINUX_BACKPORT(devres_release)
 extern int devres_release(struct device *dev, dr_release_t release,
 			  dr_match_t match, void *match_data);
-- 
1.7.10.4


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

* Re: [PATCH 4/9] compat: backport EPROBE_DEFER value
  2013-04-07  2:21 ` [PATCH 4/9] compat: backport EPROBE_DEFER value Luis R. Rodriguez
@ 2013-04-07 17:22   ` Johannes Berg
  2013-04-07 17:38     ` Luis R. Rodriguez
  0 siblings, 1 reply; 11+ messages in thread
From: Johannes Berg @ 2013-04-07 17:22 UTC (permalink / raw)
  To: Luis R. Rodriguez; +Cc: backports

On Sat, 2013-04-06 at 19:21 -0700, Luis R. Rodriguez wrote:
> From: "Luis R. Rodriguez" <mcgrof@do-not-panic.com>
> 
> Grant added the ability to the driver core to return
> EPROBE_DEFER at device driver probe time and for that to
> trigger a later deferred probe through a workqueue. It
> seems we could in theory backport this functionality but
> that requires quite a bit of work. For now just pass on
> the EPROBE_DEFER definition safely and for older kernels
> than 3.4 the EPROBE_DEFER would be treated as a regular
> probe error.

> +#define EPROBE_DEFER   517     /* Driver requests probe retry */

I'm not convinced this is useful, particularly not with that error
number?

If a driver returns -EPROBE_DEFER it will not work correctly, so why not
just require it to be disabled (via the dependencies list) for kernels
before 3.4?

Also, if you return -517 userspace might get somewhat confused?

johannes


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

* Re: [PATCH 4/9] compat: backport EPROBE_DEFER value
  2013-04-07 17:22   ` Johannes Berg
@ 2013-04-07 17:38     ` Luis R. Rodriguez
  0 siblings, 0 replies; 11+ messages in thread
From: Luis R. Rodriguez @ 2013-04-07 17:38 UTC (permalink / raw)
  To: Johannes Berg; +Cc: backports

On Sun, Apr 7, 2013 at 10:22 AM, Johannes Berg
<johannes@sipsolutions.net> wrote:
> On Sat, 2013-04-06 at 19:21 -0700, Luis R. Rodriguez wrote:
>> From: "Luis R. Rodriguez" <mcgrof@do-not-panic.com>
>>
>> Grant added the ability to the driver core to return
>> EPROBE_DEFER at device driver probe time and for that to
>> trigger a later deferred probe through a workqueue. It
>> seems we could in theory backport this functionality but
>> that requires quite a bit of work. For now just pass on
>> the EPROBE_DEFER definition safely and for older kernels
>> than 3.4 the EPROBE_DEFER would be treated as a regular
>> probe error.
>
>> +#define EPROBE_DEFER   517     /* Driver requests probe retry */
>
> I'm not convinced this is useful, particularly not with that error
> number?
>
> If a driver returns -EPROBE_DEFER it will not work correctly, so why not
> just require it to be disabled (via the dependencies list) for kernels
> before 3.4?
>
> Also, if you return -517 userspace might get somewhat confused?

Sure.

  Luis

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

end of thread, other threads:[~2013-04-07 17:39 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-07  2:21 [PATCH 1/9] backports: enable DRM_NOUVEAU for 3.2 Luis R. Rodriguez
2013-04-07  2:21 ` [PATCH 2/9] compat: backport dev_level_ratelimited() Luis R. Rodriguez
2013-04-07  2:21 ` [PATCH 3/9] compat: backport __i2c_transfer() Luis R. Rodriguez
2013-04-07  2:21 ` [PATCH 4/9] compat: backport EPROBE_DEFER value Luis R. Rodriguez
2013-04-07 17:22   ` Johannes Berg
2013-04-07 17:38     ` Luis R. Rodriguez
2013-04-07  2:21 ` [PATCH 5/9] compat: backport devm_regmap_init() Luis R. Rodriguez
2013-04-07  2:21 ` [PATCH 6/9] compat: backport GPIOF_OPEN_DRAIN definition Luis R. Rodriguez
2013-04-07  2:22 ` [PATCH 7/9] compat: backport ASYNC_DOMAIN_EXCLUSIVE() Luis R. Rodriguez
2013-04-07  2:22 ` [PATCH 8/9] compat: backport devres_release() Luis R. Rodriguez
2013-04-07  2:22 ` [PATCH 9/9] compat: backport dev_get_regmap() Luis R. Rodriguez

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.