All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] compat: backport sock_recv_ts_and_drops
From: Hauke Mehrtens @ 2010-10-18 20:36 UTC (permalink / raw)
  To: lrodriguez; +Cc: linux-wireless, mcgrof, Hauke Mehrtens

This is needed for bluetooth

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 include/linux/compat-2.6.33.h |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/include/linux/compat-2.6.33.h b/include/linux/compat-2.6.33.h
index 6a7cd3e..c2dbc1b 100644
--- a/include/linux/compat-2.6.33.h
+++ b/include/linux/compat-2.6.33.h
@@ -145,6 +145,8 @@ static inline void compat_kfifo_free(struct kfifo **fifo) {
 	     prefetch(pos->member.next), &pos->member != (head);	\
 	     pos = list_entry_rcu(pos->member.next, typeof(*pos), member))
 
+#define sock_recv_ts_and_drops(msg, sk, skb) sock_recv_timestamp(msg, sk, skb)
+
 #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33)) */
 
 #endif /* LINUX_26_33_COMPAT_H */
-- 
1.7.0.4


^ permalink raw reply related

* [PATCH 2/2] x86: Remove stale TIF_DEBUG
From: Frederic Weisbecker @ 2010-10-18 20:35 UTC (permalink / raw)
  To: LKML
  Cc: LKML, Frederic Weisbecker, Ingo Molnar, H. Peter Anvin,
	Thomas Gleixner
In-Reply-To: <1287434158-24362-1-git-send-regression-fweisbec@gmail.com>

The last user was ptrace breakpoints, which doesn't use that
since 2.6.33.

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
---
 arch/x86/include/asm/thread_info.h |   15 ++++++---------
 arch/x86/kernel/process_32.c       |    2 +-
 arch/x86/kernel/process_64.c       |    2 +-
 3 files changed, 8 insertions(+), 11 deletions(-)

diff --git a/arch/x86/include/asm/thread_info.h b/arch/x86/include/asm/thread_info.h
index 0bbf6f9..445cf3c 100644
--- a/arch/x86/include/asm/thread_info.h
+++ b/arch/x86/include/asm/thread_info.h
@@ -88,13 +88,12 @@ struct thread_info {
 #define TIF_IA32		17	/* 32bit process */
 #define TIF_FORK		18	/* ret_from_fork */
 #define TIF_MEMDIE		19	/* is terminating due to OOM killer */
-#define TIF_DEBUG		20	/* uses debug registers */
-#define TIF_IO_BITMAP		21	/* uses I/O bitmap */
-#define TIF_FREEZE		22	/* is freezing for suspend */
-#define TIF_FORCED_TF		23	/* true if TF in eflags artificially */
-#define TIF_BLOCKSTEP		24	/* set when we want DEBUGCTLMSR_BTF */
-#define TIF_LAZY_MMU_UPDATES	25	/* task is updating the mmu lazily */
-#define TIF_SYSCALL_TRACEPOINT	26	/* syscall tracepoint instrumentation */
+#define TIF_IO_BITMAP		20	/* uses I/O bitmap */
+#define TIF_FREEZE		21	/* is freezing for suspend */
+#define TIF_FORCED_TF		22	/* true if TF in eflags artificially */
+#define TIF_BLOCKSTEP		23	/* set when we want DEBUGCTLMSR_BTF */
+#define TIF_LAZY_MMU_UPDATES	24	/* task is updating the mmu lazily */
+#define TIF_SYSCALL_TRACEPOINT	25	/* syscall tracepoint instrumentation */
 
 #define _TIF_SYSCALL_TRACE	(1 << TIF_SYSCALL_TRACE)
 #define _TIF_NOTIFY_RESUME	(1 << TIF_NOTIFY_RESUME)
@@ -110,7 +109,6 @@ struct thread_info {
 #define _TIF_NOTSC		(1 << TIF_NOTSC)
 #define _TIF_IA32		(1 << TIF_IA32)
 #define _TIF_FORK		(1 << TIF_FORK)
-#define _TIF_DEBUG		(1 << TIF_DEBUG)
 #define _TIF_IO_BITMAP		(1 << TIF_IO_BITMAP)
 #define _TIF_FREEZE		(1 << TIF_FREEZE)
 #define _TIF_FORCED_TF		(1 << TIF_FORCED_TF)
@@ -148,7 +146,6 @@ struct thread_info {
 	(_TIF_IO_BITMAP|_TIF_NOTSC|_TIF_BLOCKSTEP)
 
 #define _TIF_WORK_CTXSW_PREV (_TIF_WORK_CTXSW|_TIF_USER_RETURN_NOTIFY)
-#define _TIF_WORK_CTXSW_NEXT (_TIF_WORK_CTXSW|_TIF_DEBUG)
 
 #define PREEMPT_ACTIVE		0x10000000
 
diff --git a/arch/x86/kernel/process_32.c b/arch/x86/kernel/process_32.c
index 96586c3..44726fb 100644
--- a/arch/x86/kernel/process_32.c
+++ b/arch/x86/kernel/process_32.c
@@ -350,7 +350,7 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
 	 * Now maybe handle debug registers and/or IO bitmaps
 	 */
 	if (unlikely(task_thread_info(prev_p)->flags & _TIF_WORK_CTXSW_PREV ||
-		     task_thread_info(next_p)->flags & _TIF_WORK_CTXSW_NEXT))
+		     task_thread_info(next_p)->flags & _TIF_WORK_CTXSW))
 		__switch_to_xtra(prev_p, next_p, tss);
 
 	/* If we're going to preload the fpu context, make sure clts
diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c
index b3d7a3a..399760d 100644
--- a/arch/x86/kernel/process_64.c
+++ b/arch/x86/kernel/process_64.c
@@ -484,7 +484,7 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
 	/*
 	 * Now maybe reload the debug registers and handle I/O bitmaps
 	 */
-	if (unlikely(task_thread_info(next_p)->flags & _TIF_WORK_CTXSW_NEXT ||
+	if (unlikely(task_thread_info(next_p)->flags & _TIF_WORK_CTXSW ||
 		     task_thread_info(prev_p)->flags & _TIF_WORK_CTXSW_PREV))
 		__switch_to_xtra(prev_p, next_p, tss);
 
-- 
1.6.2.3


^ permalink raw reply related

* [PATCH 1/2] hwmon: add generic GPIO fan driver
From: Simon Guinot @ 2010-10-18 20:36 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20101018160830.GB9033@ericsson.com>

Hi Guenter,

Thanks for your review.

On Mon, Oct 18, 2010 at 09:08:30AM -0700, Guenter Roeck wrote:
> On Sun, Oct 17, 2010 at 11:50:11AM -0400, Simon Guinot wrote:
> > From: Simon Guinot <sguinot@lacie.com>
> > 
> > This patch adds hwmon support for the GPIO connected fan.
> > 
> > Platform specific informations as GPIO pinout and speed conversion array
> > (rpm from/to GPIO value) are passed to the driver via platform_data.
> > 
> > Signed-off-by: Simon Guinot <sguinot@lacie.com>
> 
> Hi Simon,
> 
> good start. Bunch of comments inline. Our mailer was nice enough to replace tabs
> with blanks, thanks to our friends at MicroSomething, so I could not run the patch
> through checkpatch.pl. Hope you did that.

Yes, I did.

> 
> > ---
> >  drivers/hwmon/Kconfig    |    9 +
> >  drivers/hwmon/Makefile   |    1 +
> >  drivers/hwmon/gpio-fan.c |  508 ++++++++++++++++++++++++++++++++++++++++++++++
> >  include/linux/gpio-fan.h |   43 ++++
> >  4 files changed, 561 insertions(+), 0 deletions(-)
> >  create mode 100644 drivers/hwmon/gpio-fan.c
> >  create mode 100644 include/linux/gpio-fan.h
> > 
> > diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig
> > index 4d4d09b..1dc57c1 100644
> > --- a/drivers/hwmon/Kconfig
> > +++ b/drivers/hwmon/Kconfig
> > @@ -399,6 +399,15 @@ config SENSORS_GL520SM
> >           This driver can also be built as a module.  If so, the module
> >           will be called gl520sm.
> > 
> > +config SENSORS_GPIO_FAN
> > +       tristate "GPIO fan"
> > +       depends on GENERIC_GPIO
> > +       help
> > +         If you say yes here you get support for the GPIO connected fan.
> > +
> > +         This driver can also be built as a module.  If so, the module
> > +         will be called gpio-fan.
> > +
> 
> Can you move this up a bit, ahead of SENSORS_FSCHMD ? Trying to stay in sequence.

Ok.

> 
> >  config SENSORS_CORETEMP
> >         tristate "Intel Core/Core2/Atom temperature sensor"
> >         depends on X86 && PCI && EXPERIMENTAL
> > diff --git a/drivers/hwmon/Makefile b/drivers/hwmon/Makefile
> > index e3c2484..a793e28 100644
> > --- a/drivers/hwmon/Makefile
> > +++ b/drivers/hwmon/Makefile
> > @@ -51,6 +51,7 @@ obj-$(CONFIG_SENSORS_FSCHMD)  += fschmd.o
> >  obj-$(CONFIG_SENSORS_G760A)    += g760a.o
> >  obj-$(CONFIG_SENSORS_GL518SM)  += gl518sm.o
> >  obj-$(CONFIG_SENSORS_GL520SM)  += gl520sm.o
> > +obj-$(CONFIG_SENSORS_GPIO_FAN) += gpio-fan.o
> >  obj-$(CONFIG_SENSORS_ULTRA45)  += ultra45_env.o
> >  obj-$(CONFIG_SENSORS_HDAPS)    += hdaps.o
> >  obj-$(CONFIG_SENSORS_I5K_AMB)  += i5k_amb.o
> > diff --git a/drivers/hwmon/gpio-fan.c b/drivers/hwmon/gpio-fan.c
> > new file mode 100644
> > index 0000000..6cc8205
> > --- /dev/null
> > +++ b/drivers/hwmon/gpio-fan.c
> > @@ -0,0 +1,508 @@
> > +/*
> > + * gpio-fan.c - Hwmon driver for GPIO connected fan.
> > + *
> > + * Copyright (C) 2010 LaCie
> > + *
> > + * Author: Simon Guinot <sguinot@lacie.com>
> > + *
> > + * This program is free software; you can redistribute it and/or modify
> > + * it under the terms of the GNU General Public License as published by
> > + * the Free Software Foundation; either version 2 of the License, or
> > + * (at your option) any later version.
> > + *
> > + * This program is distributed in the hope that it will be useful,
> > + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> > + * GNU General Public License for more details.
> > + *
> > + * You should have received a copy of the GNU General Public License
> > + * along with this program; if not, write to the Free Software
> > + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
> > + */
> > +
> > +#include <linux/module.h>
> > +#include <linux/init.h>
> > +#include <linux/slab.h>
> > +#include <linux/interrupt.h>
> > +#include <linux/irq.h>
> > +#include <linux/platform_device.h>
> > +#include <linux/err.h>
> > +#include <linux/mutex.h>
> > +#include <linux/hwmon.h>
> > +#include <linux/gpio.h>
> > +#include <linux/gpio-fan.h>
> > +
> > +struct gpio_fan_data {
> > +       struct platform_device  *pdev;
> > +       struct device           *hwmon_dev;
> > +       struct mutex            lock; /* lock GPIOs operations. */
> > +       int                     num_ctrl;
> > +       unsigned                *ctrl;
> > +       int                     ctrl_val;
> > +       int                     num_speed;
> > +       struct gpio_fan_speed   *speed;
> > +       int                     pwm_enable;
> > +       struct gpio_fan_alarm   *alarm;
> > +       struct work_struct      alarm_work;
> > +       void (*platform_set_ctrl)(int num_ctrl, unsigned *ctrl, int ctrl_val);
> > +};
> > +
> > +/*
> > + * Alarm GPIO.
> > + */
> > +
> > +static void fan_alarm_notify(struct work_struct *ws)
> > +{
> > +       struct gpio_fan_data *fan_data =
> > +               container_of(ws, struct gpio_fan_data, alarm_work);
> > +
> > +       sysfs_notify(&fan_data->pdev->dev.kobj, NULL, "fan1_alarm");
> > +       kobject_uevent(&fan_data->pdev->dev.kobj, KOBJ_CHANGE);
> > +}
> > +
> > +static irqreturn_t fan_alarm_irq_handler(int irq, void *dev_id)
> > +{
> > +       struct gpio_fan_data *fan_data = dev_id;
> > +
> > +       schedule_work(&fan_data->alarm_work);
> > +
> > +       return IRQ_HANDLED;
> > +}
> You are assuming that the irq does not have to be shared, and
> will always be handled. This may interfer with other drivers
> using the same IRQ for other GPIO pins.

Yes, you are right.

> 
> > +
> > +static ssize_t show_fan_alarm(struct device *dev,
> > +                             struct device_attribute *attr, char *buf)
> > +{
> > +       struct gpio_fan_data *fan_data = dev_get_drvdata(dev);
> > +       struct gpio_fan_alarm *alarm = fan_data->alarm;
> > +       int value = gpio_get_value(alarm->gpio);
> > +
> > +       if (alarm->active_low)
> > +               value = !value;
> > +
> > +       return sprintf(buf, "%d\n", value);
> > +}
> > +
> > +static DEVICE_ATTR(fan1_alarm, S_IRUGO, show_fan_alarm, NULL);
> > +
> > +static int __devinit
> > +fan_alarm_init(struct gpio_fan_data *fan_data, struct gpio_fan_alarm *alarm)
> > +{
> > +       int err;
> > +       int alarm_irq;
> > +       struct platform_device *pdev = fan_data->pdev;
> > +
> > +       fan_data->alarm = alarm;
> > +
> > +       err = gpio_request(alarm->gpio, "GPIO fan alarm");
> > +       if (err)
> > +               return err;
> > +
> > +       err = gpio_direction_input(alarm->gpio);
> > +       if (err)
> > +               goto err_free_gpio;
> > +
> > +       err = device_create_file(&pdev->dev, &dev_attr_fan1_alarm);
> > +       if (err)
> > +               goto err_free_gpio;
> > +
> > +       INIT_WORK(&fan_data->alarm_work, fan_alarm_notify);
> > +       alarm_irq = gpio_to_irq(alarm->gpio);
> 
> gpio_to_irq() can return an error. Please check (I see that other drivers
> often don't check the return value, but that may be platform specific knowledge).
 
Yes, I have to check the returned value.

> 
> Also, what happens if the gpio pin does not support interrupts in the first place ?
> Still need to be able to support alarms that case.

Good idea.

> 
> > +       set_irq_type(alarm_irq, IRQ_TYPE_EDGE_BOTH);
> > +       err = request_irq(alarm_irq, fan_alarm_irq_handler, 0,
> > +                         "GPIO fan alarm", fan_data);
> 
> Why not IRQF_SHARED ?

Simply because I have missed that. 

> 
> > +       if (err)
> > +               goto err_free_sysfs;
> > +
> > +       return 0;
> > +
> > +err_free_sysfs:
> > +       device_remove_file(&pdev->dev, &dev_attr_fan1_alarm);
> > +err_free_gpio:
> > +       gpio_free(alarm->gpio);
> > +
> > +       return err;
> > +}
> > +
> > +static void __devexit fan_alarm_free(struct gpio_fan_data *fan_data)
> > +{
> > +       struct platform_device *pdev = fan_data->pdev;
> > +
> > +       free_irq(gpio_to_irq(fan_data->alarm->gpio), fan_data);
> 
> Please check for gpio_to_irq() error return.

Yes.

> 
> > +       device_remove_file(&pdev->dev, &dev_attr_fan1_alarm);
> > +       gpio_free(fan_data->alarm->gpio);
> > +}
> > +
> > +/*
> > + * Control GPIOs.
> > + */
> > +
> > +static int __get_fan_ctrl(struct gpio_fan_data *fan_data)
> > +{
> > +       int i;
> > +       int ctrl_val = 0;
> > +
> > +       for (i = 0; i < fan_data->num_ctrl; i++) {
> > +               int value;
> > +
> > +               value = gpio_get_value(fan_data->ctrl[i]);
> > +               ctrl_val |= (value << i);
> > +       }
> > +       return ctrl_val;
> > +}
> > +
> > +static void __set_fan_ctrl(struct gpio_fan_data *fan_data, int ctrl_val)
> > +{
> > +       int i;
> > +
> > +       for (i = 0; i < fan_data->num_ctrl; i++) {
> > +               int value = !!(ctrl_val & (1 << i));
> > +
> 	value = (ctrl_val & (1 >> i));
>     would be much simpler and easier to understand.
>     Actually, you would not need 'value' in the first place.

I will simplify this function.

> 
> > +               gpio_set_value(fan_data->ctrl[i], value);
> > +       }
> > +}
> > +
> > +static void set_fan_ctrl(struct gpio_fan_data *fan_data, int ctrl_val)
> > +{
> > +       if (fan_data->platform_set_ctrl)
> > +               fan_data->platform_set_ctrl(fan_data->num_ctrl, fan_data->ctrl,
> > +                                           ctrl_val);
> > +       else
> > +               __set_fan_ctrl(fan_data, ctrl_val);
> > +
> > +       fan_data->ctrl_val = ctrl_val;
> > +}
> > +
> > +static int rpm_to_ctrl(struct gpio_fan_data *fan_data, int rpm)
> > +{
> > +       struct gpio_fan_speed *speed = fan_data->speed;
> > +       int num_speed = fan_data->num_speed;
> > +       int ctrl_val = speed[num_speed - 1].ctrl_val; /* Maximum speed */
> > +       int i;
> > +
> > +       for (i = 0; i < num_speed; i++) {
> 
> 	{ } not needed here.

Ok.

> 
> > +               if (speed[i].rpm >= rpm) {
> > +                       ctrl_val = speed[i].ctrl_val;
> > +                       break;
> > +               }
> > +       }
> > +       return ctrl_val;
> > +}
> > +
> > +static int ctrl_to_rpm(struct gpio_fan_data *fan_data, int ctrl_val, int *rpm)
> > +{
> 
> Since rpm is presumably always positive, you don't need a pointer to rpm.
> Return value can be rpm or error.

Yes.

> 
> > +       struct gpio_fan_speed *speed = fan_data->speed;
> > +       int num_speed = fan_data->num_speed;
> > +       int i;
> > +
> > +       for (i = 0; i < num_speed; i++) {
> 
> 	{ } not needed here.

Yes.

> 
> > +               if (speed[i].ctrl_val == ctrl_val) {
> > +                       *rpm = speed[i].rpm;
> > +                       return 0;
> > +               }
> > +       }
> > +       return -EINVAL;
> > +}
> > +
> > +static int pwm_to_rpm(struct gpio_fan_data *fan_data, u8 pwm)
> > +{
> > +       int rpm_min = fan_data->speed[0].rpm;
> > +       int rpm_max = fan_data->speed[fan_data->num_speed - 1].rpm;
> > +
> > +       return rpm_min + DIV_ROUND_UP((rpm_max - rpm_min), 255) * pwm;
> > +}
> > +
> > +static u8 rpm_to_pwm(struct gpio_fan_data *fan_data, int rpm)
> > +{
> > +       int rpm_min = fan_data->speed[0].rpm;
> > +       int rpm_max = fan_data->speed[fan_data->num_speed - 1].rpm;
> > +
> > +       return (rpm - rpm_min) / DIV_ROUND_UP((rpm_max - rpm_min), 255);
> > +}
> > +
> > +static ssize_t show_pwm(struct device *dev,
> > +                       struct device_attribute *attr, char *buf)
> > +{
> > +       struct gpio_fan_data *fan_data = dev_get_drvdata(dev);
> > +       int rpm;
> > +       int ret;
> > +
> > +       ret = ctrl_to_rpm(fan_data, fan_data->ctrl_val, &rpm);
> > +       if (ret)
> > +               return ret;
> > +
> > +       return sprintf(buf, "%d\n", rpm_to_pwm(fan_data, rpm));
> > +}
> > +
> I don't really understand the value of supporting pwm attributes,
> since you have to convert those to rpm anyway. Why not just stick
> with fan1_input and fan1_target ? This would simplify the code a lot.

I don't know very well the hwmon API. I have simply been fooled by the
sysfs-interface document which claim that fan[1-*]_target only make
sense for a closed-loop fan. Moreover, I was expecting gpio-fan to be
compliant with the fancontrol shell script...

But anyway, you are right. I just don't want the pwm interface.

> 
> fan1_min and fan1_max should be supported as well, especially
> since the information is provided anyway.

Yes.

> 
> > +static ssize_t set_pwm(struct device *dev, struct device_attribute *attr,
> > +                      const char *buf, size_t count)
> > +{
> > +       struct gpio_fan_data *fan_data = dev_get_drvdata(dev);
> > +       unsigned long pwm;
> > +       int ctrl_val;
> > +       int ret = count;
> > +
> > +       if (strict_strtoul(buf, 10, &pwm) || pwm > 255)
> > +               return -EINVAL;
> > +
> > +       mutex_lock(&fan_data->lock);
> > +
> > +       if (fan_data->pwm_enable != 1) {
> > +               ret = -EPERM;
> > +               goto exit_unlock;
> > +       }
> > +
> > +       ctrl_val = rpm_to_ctrl(fan_data, pwm_to_rpm(fan_data, (u8) pwm));
> > +       if (ctrl_val != fan_data->ctrl_val)
> > +               set_fan_ctrl(fan_data, ctrl_val);
> > +
> > +exit_unlock:
> > +       mutex_unlock(&fan_data->lock);
> > +
> > +       return ret;
> > +}
> > +
> > +static ssize_t show_pwm_enable(struct device *dev,
> > +                              struct device_attribute *attr, char *buf)
> > +{
> > +       struct gpio_fan_data *fan_data = dev_get_drvdata(dev);
> > +
> > +       return sprintf(buf, "%d\n", fan_data->pwm_enable);
> > +}
> > +
> > +static ssize_t set_pwm_enable(struct device *dev, struct device_attribute *attr,
> > +                             const char *buf, size_t count)
> > +{
> > +       struct gpio_fan_data *fan_data = dev_get_drvdata(dev);
> > +       unsigned long val;
> > +       int ctrl_val;
> > +
> > +       if (strict_strtoul(buf, 10, &val) || val > 1)
> > +               return -EINVAL;
> > +
> > +       if (fan_data->pwm_enable == val)
> > +               return count;
> > +
> > +       mutex_lock(&fan_data->lock);
> > +
> > +       fan_data->pwm_enable = val;
> > +
> > +       /* Disable manual control mode: set fan at full speed. */
> > +       if (val == 0) {
> > +               ctrl_val = fan_data->speed[fan_data->num_speed - 1].ctrl_val;
> > +               if (ctrl_val != fan_data->ctrl_val)
> > +                       set_fan_ctrl(fan_data, ctrl_val);
> > +       }
> > +
> > +       mutex_unlock(&fan_data->lock);
> > +
> > +       return count;
> > +}
> > +
> > +static ssize_t show_pwm_mode(struct device *dev,
> > +                            struct device_attribute *attr, char *buf)
> > +{
> > +       return sprintf(buf, "0\n");
> > +}
> > +
> > +static ssize_t show_rpm(struct device *dev,
> > +                       struct device_attribute *attr, char *buf)
> > +{
> > +       struct gpio_fan_data *fan_data = dev_get_drvdata(dev);
> > +       int ret;
> > +       int rpm;
> > +
> > +       ret = ctrl_to_rpm(fan_data, fan_data->ctrl_val, &rpm);
> > +       if (ret < 0)
> > +               return ret;
> > +
> > +       return sprintf(buf, "%d\n", rpm);
> > +}
> > +
> > +static DEVICE_ATTR(pwm1, S_IRUGO | S_IWUSR, show_pwm, set_pwm);
> > +static DEVICE_ATTR(pwm1_enable, S_IRUGO | S_IWUSR,
> > +                  show_pwm_enable, set_pwm_enable);
> > +static DEVICE_ATTR(pwm1_mode, S_IRUGO, show_pwm_mode, NULL);
> > +static DEVICE_ATTR(fan1_input, S_IRUGO, show_rpm, NULL);
> > +
> > +static struct attribute *gpio_fan_ctrl_attributes[] = {
> > +       &dev_attr_pwm1.attr,
> > +       &dev_attr_pwm1_enable.attr,
> > +       &dev_attr_pwm1_mode.attr,
> > +       &dev_attr_fan1_input.attr,
> > +       NULL
> > +};
> > +
> > +static const struct attribute_group gpio_fan_ctrl_group = {
> > +       .attrs = gpio_fan_ctrl_attributes,
> > +};
> > +
> > +static int __devinit fan_ctrl_init(struct gpio_fan_data *fan_data,
> > +                                  struct gpio_fan_platform_data *pdata)
> > +{
> > +       struct platform_device *pdev = fan_data->pdev;
> > +       int num_ctrl = pdata->num_ctrl;
> > +       unsigned *ctrl = pdata->ctrl;
> > +       int i, err;
> > +
> > +       for (i = 0; i < num_ctrl; i++) {
> > +               err = gpio_request(ctrl[i], "GPIO fan control");
> > +               if (err)
> > +                       goto err_free_gpio;
> > +
> > +               err = gpio_direction_output(ctrl[i], gpio_get_value(ctrl[i]));
> > +               if (err) {
> > +                       gpio_free(ctrl[i]);
> > +                       goto err_free_gpio;
> > +               }
> > +       }
> > +
> > +       err = sysfs_create_group(&pdev->dev.kobj, &gpio_fan_ctrl_group);
> > +       if (err)
> > +               goto err_free_gpio;
> > +
> > +       fan_data->num_ctrl = num_ctrl;
> > +       fan_data->ctrl = ctrl;
> > +       fan_data->platform_set_ctrl = pdata->set_ctrl;
> > +       fan_data->num_speed = pdata->num_speed;
> > +       fan_data->speed = pdata->speed;
> > +       fan_data->pwm_enable = 1; /* Enable manual fan speed control. */
> > +       if (pdata->get_ctrl)
> > +               fan_data->ctrl_val = pdata->get_ctrl(num_ctrl, ctrl);
> > +       else
> > +               fan_data->ctrl_val = __get_fan_ctrl(fan_data);
> > +
> > +       return 0;
> > +
> > +err_free_gpio:
> > +       for (i = i - 1; i >= 0; i--)
> > +               gpio_free(ctrl[i]);
> > +
> This misses the most recently allocated gpio pin if gpio_direction_output() failed.

The gpio is freed above while handling the gpio_direction_output() error.

> 
> > +       return err;
> > +}
> > +
> > +static void __devexit fan_ctrl_free(struct gpio_fan_data *fan_data)
> > +{
> > +       struct platform_device *pdev = fan_data->pdev;
> > +       int i;
> > +
> > +       sysfs_remove_group(&pdev->dev.kobj, &gpio_fan_ctrl_group);
> > +       for (i = 0; i < fan_data->num_ctrl; i++)
> > +               gpio_free(fan_data->ctrl[i]);
> > +}
> > +
> > +/*
> > + * Platform driver.
> > + */
> > +
> > +static ssize_t show_name(struct device *dev,
> > +                        struct device_attribute *attr, char *buf)
> > +{
> > +       return sprintf(buf, "gpio-fan\n");
> > +}
> > +
> > +static DEVICE_ATTR(name, S_IRUGO, show_name, NULL);
> > +
> > +static int __devinit gpio_fan_probe(struct platform_device *pdev)
> > +{
> > +       int err = 0;
> > +       struct gpio_fan_data *fan_data;
> > +       struct gpio_fan_platform_data *pdata = pdev->dev.platform_data;
> > +
> > +       if (!pdata)
> > +               return -EINVAL;
> > +
> > +       fan_data = kzalloc(sizeof(struct gpio_fan_data), GFP_KERNEL);
> > +       if (!fan_data)
> > +               return -ENOMEM;
> > +
> > +       fan_data->pdev = pdev;
> > +       platform_set_drvdata(pdev, fan_data);
> > +       mutex_init(&fan_data->lock);
> > +
> > +       /* Configure alarm GPIO if available. */
> > +       if (pdata->alarm) {
> > +               err = fan_alarm_init(fan_data, pdata->alarm);
> > +               if (err)
> > +                       goto err_free_data;
> > +       }
> > +
> > +       /* Configure control GPIOs if available. */
> > +       if (pdata->ctrl && pdata->num_ctrl) {
> > +               if (!pdata->num_speed || !pdata->speed) {
> > +                       err = -EINVAL;
> > +                       goto err_free_alarm;
> > +               }
> > +               err = fan_ctrl_init(fan_data, pdata);
> > +               if (err)
> > +                       goto err_free_alarm;
> > +       }
> > +
> > +       err = device_create_file(&pdev->dev, &dev_attr_name);
> > +       if (err)
> > +               goto err_free_ctrl;
> > +
> > +       /* Make this driver part of hwmon class. */
> > +       fan_data->hwmon_dev = hwmon_device_register(&pdev->dev);
> > +       if (IS_ERR(fan_data->hwmon_dev)) {
> > +               err = PTR_ERR(fan_data->hwmon_dev);
> > +               goto err_remove_name;
> > +       }
> > +
> > +       dev_info(&pdev->dev, "GPIO fan initialized\n");
> > +
> Might be a good idea to add a notion of which fan was initialized.
> After all, there could be more than one.

dev_info() don't do it for me ? anyway, I will check this too.

> 
> > +       return 0;
> > +
> > +err_remove_name:
> > +       device_remove_file(&pdev->dev, &dev_attr_name);
> > +err_free_ctrl:
> > +       fan_ctrl_free(fan_data);
> 
> Might want to check for fan_data->ctrl to be consistent with the code below.

Of course...

> 
> > +err_free_alarm:
> > +       fan_alarm_free(fan_data);
> 
> This will crash if fan_data->alarm is NULL.

...

> 
> > +err_free_data:
> > +       platform_set_drvdata(pdev, NULL);
> > +       kfree(fan_data);
> > +
> > +       return err;
> > +}
> > +
> > +static int __devexit gpio_fan_remove(struct platform_device *pdev)
> > +{
> > +       struct gpio_fan_data *fan_data = platform_get_drvdata(pdev);
> > +
> > +       hwmon_device_unregister(fan_data->hwmon_dev);
> > +       device_remove_file(&pdev->dev, &dev_attr_name);
> > +       if (fan_data->alarm)
> > +               fan_alarm_free(fan_data);
> > +       if (fan_data->ctrl)
> > +               fan_ctrl_free(fan_data);
> > +       kfree(fan_data);
> > +
> > +       return 0;
> > +}
> > +
> > +static struct platform_driver gpio_fan_driver = {
> > +       .probe  = gpio_fan_probe,
> > +       .remove = __devexit_p(gpio_fan_remove),
> > +       .driver = {
> > +               .name = "gpio-fan",
> > +       },
> > +};
> > +
> > +static int __init gpio_fan_init(void)
> > +{
> > +       return platform_driver_register(&gpio_fan_driver);
> > +}
> > +
> > +static void __exit gpio_fan_exit(void)
> > +{
> > +       platform_driver_unregister(&gpio_fan_driver);
> > +       return;
> > +}
> > +
> > +module_init(gpio_fan_init);
> > +module_exit(gpio_fan_exit);
> > +
> > +MODULE_AUTHOR("Simon Guinot <sguinot@lacie.com>");
> > +MODULE_DESCRIPTION("GPIO FAN driver");
> > +MODULE_LICENSE("GPL");
> > +MODULE_ALIAS("platform:gpio-fan");
> > diff --git a/include/linux/gpio-fan.h b/include/linux/gpio-fan.h
> > new file mode 100644
> > index 0000000..58f0930
> > --- /dev/null
> > +++ b/include/linux/gpio-fan.h
> > @@ -0,0 +1,43 @@
> > +/*
> > + * include/linux/gpio-fan.h
> > + *
> > + * Platform data structure for GPIO fan driver
> > + *
> > + * This file is licensed under the terms of the GNU General Public
> > + * License version 2.  This program is licensed "as is" without any
> > + * warranty of any kind, whether express or implied.
> > + */
> > +
> > +#ifndef __LINUX_GPIO_FAN_H
> > +#define __LINUX_GPIO_FAN_H
> > +
> > +struct gpio_fan_alarm {
> > +       unsigned        gpio;
> > +       unsigned        active_low;
> > +};
> > +
> > +struct gpio_fan_speed {
> > +       int rpm;
> > +       int ctrl_val;
> > +};
> > +
> > +struct gpio_fan_platform_data {
> > +       int                     num_ctrl;
> > +       unsigned                *ctrl;  /* fan control GPIOs. */
> > +       struct gpio_fan_alarm   *alarm; /* fan alarm GPIO. */
> > +       /*
> > +        * Speed conversion array: rpm from/to GPIO bit field.
> > +        * This array _must_ be sorted in ascending rpm order.
> > +        */
> > +       int                     num_speed;
> > +       struct gpio_fan_speed   *speed;
> > +       /*
> > +        * This functions can be supplied if some specific operations are
> > +        * required to get/set a fan control (handle a latch enable GPIO,
> > +        * prevent from writing some transitional control value, etc...)
> > +        */
> > +       int     (*get_ctrl)(int num_ctrl, unsigned *ctrl);
> > +       void    (*set_ctrl)(int num_ctrl, unsigned *ctrl, int ctrl_val);
> 
> Not sure if this is a good/useful API. It expects that the called function
> identifies the fan from the ctrl[] array. Not sure how clumsy the resulting code
> might be. It may be better to leave the API out for now until someone actually
> writes a driver (hint, hint, dns323) using it.

I agree and I will happily throw away the clumsy API :)

Simon
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20101018/93954f42/attachment-0001.sig>

^ permalink raw reply

* Re: [lm-sensors] [PATCH 1/2] hwmon: add generic GPIO fan driver
From: Simon Guinot @ 2010-10-18 20:36 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <20101018160830.GB9033@ericsson.com>


[-- Attachment #1.1: Type: text/plain, Size: 24729 bytes --]

Hi Guenter,

Thanks for your review.

On Mon, Oct 18, 2010 at 09:08:30AM -0700, Guenter Roeck wrote:
> On Sun, Oct 17, 2010 at 11:50:11AM -0400, Simon Guinot wrote:
> > From: Simon Guinot <sguinot@lacie.com>
> > 
> > This patch adds hwmon support for the GPIO connected fan.
> > 
> > Platform specific informations as GPIO pinout and speed conversion array
> > (rpm from/to GPIO value) are passed to the driver via platform_data.
> > 
> > Signed-off-by: Simon Guinot <sguinot@lacie.com>
> 
> Hi Simon,
> 
> good start. Bunch of comments inline. Our mailer was nice enough to replace tabs
> with blanks, thanks to our friends at MicroSomething, so I could not run the patch
> through checkpatch.pl. Hope you did that.

Yes, I did.

> 
> > ---
> >  drivers/hwmon/Kconfig    |    9 +
> >  drivers/hwmon/Makefile   |    1 +
> >  drivers/hwmon/gpio-fan.c |  508 ++++++++++++++++++++++++++++++++++++++++++++++
> >  include/linux/gpio-fan.h |   43 ++++
> >  4 files changed, 561 insertions(+), 0 deletions(-)
> >  create mode 100644 drivers/hwmon/gpio-fan.c
> >  create mode 100644 include/linux/gpio-fan.h
> > 
> > diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig
> > index 4d4d09b..1dc57c1 100644
> > --- a/drivers/hwmon/Kconfig
> > +++ b/drivers/hwmon/Kconfig
> > @@ -399,6 +399,15 @@ config SENSORS_GL520SM
> >           This driver can also be built as a module.  If so, the module
> >           will be called gl520sm.
> > 
> > +config SENSORS_GPIO_FAN
> > +       tristate "GPIO fan"
> > +       depends on GENERIC_GPIO
> > +       help
> > +         If you say yes here you get support for the GPIO connected fan.
> > +
> > +         This driver can also be built as a module.  If so, the module
> > +         will be called gpio-fan.
> > +
> 
> Can you move this up a bit, ahead of SENSORS_FSCHMD ? Trying to stay in sequence.

Ok.

> 
> >  config SENSORS_CORETEMP
> >         tristate "Intel Core/Core2/Atom temperature sensor"
> >         depends on X86 && PCI && EXPERIMENTAL
> > diff --git a/drivers/hwmon/Makefile b/drivers/hwmon/Makefile
> > index e3c2484..a793e28 100644
> > --- a/drivers/hwmon/Makefile
> > +++ b/drivers/hwmon/Makefile
> > @@ -51,6 +51,7 @@ obj-$(CONFIG_SENSORS_FSCHMD)  += fschmd.o
> >  obj-$(CONFIG_SENSORS_G760A)    += g760a.o
> >  obj-$(CONFIG_SENSORS_GL518SM)  += gl518sm.o
> >  obj-$(CONFIG_SENSORS_GL520SM)  += gl520sm.o
> > +obj-$(CONFIG_SENSORS_GPIO_FAN) += gpio-fan.o
> >  obj-$(CONFIG_SENSORS_ULTRA45)  += ultra45_env.o
> >  obj-$(CONFIG_SENSORS_HDAPS)    += hdaps.o
> >  obj-$(CONFIG_SENSORS_I5K_AMB)  += i5k_amb.o
> > diff --git a/drivers/hwmon/gpio-fan.c b/drivers/hwmon/gpio-fan.c
> > new file mode 100644
> > index 0000000..6cc8205
> > --- /dev/null
> > +++ b/drivers/hwmon/gpio-fan.c
> > @@ -0,0 +1,508 @@
> > +/*
> > + * gpio-fan.c - Hwmon driver for GPIO connected fan.
> > + *
> > + * Copyright (C) 2010 LaCie
> > + *
> > + * Author: Simon Guinot <sguinot@lacie.com>
> > + *
> > + * This program is free software; you can redistribute it and/or modify
> > + * it under the terms of the GNU General Public License as published by
> > + * the Free Software Foundation; either version 2 of the License, or
> > + * (at your option) any later version.
> > + *
> > + * This program is distributed in the hope that it will be useful,
> > + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> > + * GNU General Public License for more details.
> > + *
> > + * You should have received a copy of the GNU General Public License
> > + * along with this program; if not, write to the Free Software
> > + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
> > + */
> > +
> > +#include <linux/module.h>
> > +#include <linux/init.h>
> > +#include <linux/slab.h>
> > +#include <linux/interrupt.h>
> > +#include <linux/irq.h>
> > +#include <linux/platform_device.h>
> > +#include <linux/err.h>
> > +#include <linux/mutex.h>
> > +#include <linux/hwmon.h>
> > +#include <linux/gpio.h>
> > +#include <linux/gpio-fan.h>
> > +
> > +struct gpio_fan_data {
> > +       struct platform_device  *pdev;
> > +       struct device           *hwmon_dev;
> > +       struct mutex            lock; /* lock GPIOs operations. */
> > +       int                     num_ctrl;
> > +       unsigned                *ctrl;
> > +       int                     ctrl_val;
> > +       int                     num_speed;
> > +       struct gpio_fan_speed   *speed;
> > +       int                     pwm_enable;
> > +       struct gpio_fan_alarm   *alarm;
> > +       struct work_struct      alarm_work;
> > +       void (*platform_set_ctrl)(int num_ctrl, unsigned *ctrl, int ctrl_val);
> > +};
> > +
> > +/*
> > + * Alarm GPIO.
> > + */
> > +
> > +static void fan_alarm_notify(struct work_struct *ws)
> > +{
> > +       struct gpio_fan_data *fan_data =
> > +               container_of(ws, struct gpio_fan_data, alarm_work);
> > +
> > +       sysfs_notify(&fan_data->pdev->dev.kobj, NULL, "fan1_alarm");
> > +       kobject_uevent(&fan_data->pdev->dev.kobj, KOBJ_CHANGE);
> > +}
> > +
> > +static irqreturn_t fan_alarm_irq_handler(int irq, void *dev_id)
> > +{
> > +       struct gpio_fan_data *fan_data = dev_id;
> > +
> > +       schedule_work(&fan_data->alarm_work);
> > +
> > +       return IRQ_HANDLED;
> > +}
> You are assuming that the irq does not have to be shared, and
> will always be handled. This may interfer with other drivers
> using the same IRQ for other GPIO pins.

Yes, you are right.

> 
> > +
> > +static ssize_t show_fan_alarm(struct device *dev,
> > +                             struct device_attribute *attr, char *buf)
> > +{
> > +       struct gpio_fan_data *fan_data = dev_get_drvdata(dev);
> > +       struct gpio_fan_alarm *alarm = fan_data->alarm;
> > +       int value = gpio_get_value(alarm->gpio);
> > +
> > +       if (alarm->active_low)
> > +               value = !value;
> > +
> > +       return sprintf(buf, "%d\n", value);
> > +}
> > +
> > +static DEVICE_ATTR(fan1_alarm, S_IRUGO, show_fan_alarm, NULL);
> > +
> > +static int __devinit
> > +fan_alarm_init(struct gpio_fan_data *fan_data, struct gpio_fan_alarm *alarm)
> > +{
> > +       int err;
> > +       int alarm_irq;
> > +       struct platform_device *pdev = fan_data->pdev;
> > +
> > +       fan_data->alarm = alarm;
> > +
> > +       err = gpio_request(alarm->gpio, "GPIO fan alarm");
> > +       if (err)
> > +               return err;
> > +
> > +       err = gpio_direction_input(alarm->gpio);
> > +       if (err)
> > +               goto err_free_gpio;
> > +
> > +       err = device_create_file(&pdev->dev, &dev_attr_fan1_alarm);
> > +       if (err)
> > +               goto err_free_gpio;
> > +
> > +       INIT_WORK(&fan_data->alarm_work, fan_alarm_notify);
> > +       alarm_irq = gpio_to_irq(alarm->gpio);
> 
> gpio_to_irq() can return an error. Please check (I see that other drivers
> often don't check the return value, but that may be platform specific knowledge).
 
Yes, I have to check the returned value.

> 
> Also, what happens if the gpio pin does not support interrupts in the first place ?
> Still need to be able to support alarms that case.

Good idea.

> 
> > +       set_irq_type(alarm_irq, IRQ_TYPE_EDGE_BOTH);
> > +       err = request_irq(alarm_irq, fan_alarm_irq_handler, 0,
> > +                         "GPIO fan alarm", fan_data);
> 
> Why not IRQF_SHARED ?

Simply because I have missed that. 

> 
> > +       if (err)
> > +               goto err_free_sysfs;
> > +
> > +       return 0;
> > +
> > +err_free_sysfs:
> > +       device_remove_file(&pdev->dev, &dev_attr_fan1_alarm);
> > +err_free_gpio:
> > +       gpio_free(alarm->gpio);
> > +
> > +       return err;
> > +}
> > +
> > +static void __devexit fan_alarm_free(struct gpio_fan_data *fan_data)
> > +{
> > +       struct platform_device *pdev = fan_data->pdev;
> > +
> > +       free_irq(gpio_to_irq(fan_data->alarm->gpio), fan_data);
> 
> Please check for gpio_to_irq() error return.

Yes.

> 
> > +       device_remove_file(&pdev->dev, &dev_attr_fan1_alarm);
> > +       gpio_free(fan_data->alarm->gpio);
> > +}
> > +
> > +/*
> > + * Control GPIOs.
> > + */
> > +
> > +static int __get_fan_ctrl(struct gpio_fan_data *fan_data)
> > +{
> > +       int i;
> > +       int ctrl_val = 0;
> > +
> > +       for (i = 0; i < fan_data->num_ctrl; i++) {
> > +               int value;
> > +
> > +               value = gpio_get_value(fan_data->ctrl[i]);
> > +               ctrl_val |= (value << i);
> > +       }
> > +       return ctrl_val;
> > +}
> > +
> > +static void __set_fan_ctrl(struct gpio_fan_data *fan_data, int ctrl_val)
> > +{
> > +       int i;
> > +
> > +       for (i = 0; i < fan_data->num_ctrl; i++) {
> > +               int value = !!(ctrl_val & (1 << i));
> > +
> 	value = (ctrl_val & (1 >> i));
>     would be much simpler and easier to understand.
>     Actually, you would not need 'value' in the first place.

I will simplify this function.

> 
> > +               gpio_set_value(fan_data->ctrl[i], value);
> > +       }
> > +}
> > +
> > +static void set_fan_ctrl(struct gpio_fan_data *fan_data, int ctrl_val)
> > +{
> > +       if (fan_data->platform_set_ctrl)
> > +               fan_data->platform_set_ctrl(fan_data->num_ctrl, fan_data->ctrl,
> > +                                           ctrl_val);
> > +       else
> > +               __set_fan_ctrl(fan_data, ctrl_val);
> > +
> > +       fan_data->ctrl_val = ctrl_val;
> > +}
> > +
> > +static int rpm_to_ctrl(struct gpio_fan_data *fan_data, int rpm)
> > +{
> > +       struct gpio_fan_speed *speed = fan_data->speed;
> > +       int num_speed = fan_data->num_speed;
> > +       int ctrl_val = speed[num_speed - 1].ctrl_val; /* Maximum speed */
> > +       int i;
> > +
> > +       for (i = 0; i < num_speed; i++) {
> 
> 	{ } not needed here.

Ok.

> 
> > +               if (speed[i].rpm >= rpm) {
> > +                       ctrl_val = speed[i].ctrl_val;
> > +                       break;
> > +               }
> > +       }
> > +       return ctrl_val;
> > +}
> > +
> > +static int ctrl_to_rpm(struct gpio_fan_data *fan_data, int ctrl_val, int *rpm)
> > +{
> 
> Since rpm is presumably always positive, you don't need a pointer to rpm.
> Return value can be rpm or error.

Yes.

> 
> > +       struct gpio_fan_speed *speed = fan_data->speed;
> > +       int num_speed = fan_data->num_speed;
> > +       int i;
> > +
> > +       for (i = 0; i < num_speed; i++) {
> 
> 	{ } not needed here.

Yes.

> 
> > +               if (speed[i].ctrl_val == ctrl_val) {
> > +                       *rpm = speed[i].rpm;
> > +                       return 0;
> > +               }
> > +       }
> > +       return -EINVAL;
> > +}
> > +
> > +static int pwm_to_rpm(struct gpio_fan_data *fan_data, u8 pwm)
> > +{
> > +       int rpm_min = fan_data->speed[0].rpm;
> > +       int rpm_max = fan_data->speed[fan_data->num_speed - 1].rpm;
> > +
> > +       return rpm_min + DIV_ROUND_UP((rpm_max - rpm_min), 255) * pwm;
> > +}
> > +
> > +static u8 rpm_to_pwm(struct gpio_fan_data *fan_data, int rpm)
> > +{
> > +       int rpm_min = fan_data->speed[0].rpm;
> > +       int rpm_max = fan_data->speed[fan_data->num_speed - 1].rpm;
> > +
> > +       return (rpm - rpm_min) / DIV_ROUND_UP((rpm_max - rpm_min), 255);
> > +}
> > +
> > +static ssize_t show_pwm(struct device *dev,
> > +                       struct device_attribute *attr, char *buf)
> > +{
> > +       struct gpio_fan_data *fan_data = dev_get_drvdata(dev);
> > +       int rpm;
> > +       int ret;
> > +
> > +       ret = ctrl_to_rpm(fan_data, fan_data->ctrl_val, &rpm);
> > +       if (ret)
> > +               return ret;
> > +
> > +       return sprintf(buf, "%d\n", rpm_to_pwm(fan_data, rpm));
> > +}
> > +
> I don't really understand the value of supporting pwm attributes,
> since you have to convert those to rpm anyway. Why not just stick
> with fan1_input and fan1_target ? This would simplify the code a lot.

I don't know very well the hwmon API. I have simply been fooled by the
sysfs-interface document which claim that fan[1-*]_target only make
sense for a closed-loop fan. Moreover, I was expecting gpio-fan to be
compliant with the fancontrol shell script...

But anyway, you are right. I just don't want the pwm interface.

> 
> fan1_min and fan1_max should be supported as well, especially
> since the information is provided anyway.

Yes.

> 
> > +static ssize_t set_pwm(struct device *dev, struct device_attribute *attr,
> > +                      const char *buf, size_t count)
> > +{
> > +       struct gpio_fan_data *fan_data = dev_get_drvdata(dev);
> > +       unsigned long pwm;
> > +       int ctrl_val;
> > +       int ret = count;
> > +
> > +       if (strict_strtoul(buf, 10, &pwm) || pwm > 255)
> > +               return -EINVAL;
> > +
> > +       mutex_lock(&fan_data->lock);
> > +
> > +       if (fan_data->pwm_enable != 1) {
> > +               ret = -EPERM;
> > +               goto exit_unlock;
> > +       }
> > +
> > +       ctrl_val = rpm_to_ctrl(fan_data, pwm_to_rpm(fan_data, (u8) pwm));
> > +       if (ctrl_val != fan_data->ctrl_val)
> > +               set_fan_ctrl(fan_data, ctrl_val);
> > +
> > +exit_unlock:
> > +       mutex_unlock(&fan_data->lock);
> > +
> > +       return ret;
> > +}
> > +
> > +static ssize_t show_pwm_enable(struct device *dev,
> > +                              struct device_attribute *attr, char *buf)
> > +{
> > +       struct gpio_fan_data *fan_data = dev_get_drvdata(dev);
> > +
> > +       return sprintf(buf, "%d\n", fan_data->pwm_enable);
> > +}
> > +
> > +static ssize_t set_pwm_enable(struct device *dev, struct device_attribute *attr,
> > +                             const char *buf, size_t count)
> > +{
> > +       struct gpio_fan_data *fan_data = dev_get_drvdata(dev);
> > +       unsigned long val;
> > +       int ctrl_val;
> > +
> > +       if (strict_strtoul(buf, 10, &val) || val > 1)
> > +               return -EINVAL;
> > +
> > +       if (fan_data->pwm_enable == val)
> > +               return count;
> > +
> > +       mutex_lock(&fan_data->lock);
> > +
> > +       fan_data->pwm_enable = val;
> > +
> > +       /* Disable manual control mode: set fan at full speed. */
> > +       if (val == 0) {
> > +               ctrl_val = fan_data->speed[fan_data->num_speed - 1].ctrl_val;
> > +               if (ctrl_val != fan_data->ctrl_val)
> > +                       set_fan_ctrl(fan_data, ctrl_val);
> > +       }
> > +
> > +       mutex_unlock(&fan_data->lock);
> > +
> > +       return count;
> > +}
> > +
> > +static ssize_t show_pwm_mode(struct device *dev,
> > +                            struct device_attribute *attr, char *buf)
> > +{
> > +       return sprintf(buf, "0\n");
> > +}
> > +
> > +static ssize_t show_rpm(struct device *dev,
> > +                       struct device_attribute *attr, char *buf)
> > +{
> > +       struct gpio_fan_data *fan_data = dev_get_drvdata(dev);
> > +       int ret;
> > +       int rpm;
> > +
> > +       ret = ctrl_to_rpm(fan_data, fan_data->ctrl_val, &rpm);
> > +       if (ret < 0)
> > +               return ret;
> > +
> > +       return sprintf(buf, "%d\n", rpm);
> > +}
> > +
> > +static DEVICE_ATTR(pwm1, S_IRUGO | S_IWUSR, show_pwm, set_pwm);
> > +static DEVICE_ATTR(pwm1_enable, S_IRUGO | S_IWUSR,
> > +                  show_pwm_enable, set_pwm_enable);
> > +static DEVICE_ATTR(pwm1_mode, S_IRUGO, show_pwm_mode, NULL);
> > +static DEVICE_ATTR(fan1_input, S_IRUGO, show_rpm, NULL);
> > +
> > +static struct attribute *gpio_fan_ctrl_attributes[] = {
> > +       &dev_attr_pwm1.attr,
> > +       &dev_attr_pwm1_enable.attr,
> > +       &dev_attr_pwm1_mode.attr,
> > +       &dev_attr_fan1_input.attr,
> > +       NULL
> > +};
> > +
> > +static const struct attribute_group gpio_fan_ctrl_group = {
> > +       .attrs = gpio_fan_ctrl_attributes,
> > +};
> > +
> > +static int __devinit fan_ctrl_init(struct gpio_fan_data *fan_data,
> > +                                  struct gpio_fan_platform_data *pdata)
> > +{
> > +       struct platform_device *pdev = fan_data->pdev;
> > +       int num_ctrl = pdata->num_ctrl;
> > +       unsigned *ctrl = pdata->ctrl;
> > +       int i, err;
> > +
> > +       for (i = 0; i < num_ctrl; i++) {
> > +               err = gpio_request(ctrl[i], "GPIO fan control");
> > +               if (err)
> > +                       goto err_free_gpio;
> > +
> > +               err = gpio_direction_output(ctrl[i], gpio_get_value(ctrl[i]));
> > +               if (err) {
> > +                       gpio_free(ctrl[i]);
> > +                       goto err_free_gpio;
> > +               }
> > +       }
> > +
> > +       err = sysfs_create_group(&pdev->dev.kobj, &gpio_fan_ctrl_group);
> > +       if (err)
> > +               goto err_free_gpio;
> > +
> > +       fan_data->num_ctrl = num_ctrl;
> > +       fan_data->ctrl = ctrl;
> > +       fan_data->platform_set_ctrl = pdata->set_ctrl;
> > +       fan_data->num_speed = pdata->num_speed;
> > +       fan_data->speed = pdata->speed;
> > +       fan_data->pwm_enable = 1; /* Enable manual fan speed control. */
> > +       if (pdata->get_ctrl)
> > +               fan_data->ctrl_val = pdata->get_ctrl(num_ctrl, ctrl);
> > +       else
> > +               fan_data->ctrl_val = __get_fan_ctrl(fan_data);
> > +
> > +       return 0;
> > +
> > +err_free_gpio:
> > +       for (i = i - 1; i >= 0; i--)
> > +               gpio_free(ctrl[i]);
> > +
> This misses the most recently allocated gpio pin if gpio_direction_output() failed.

The gpio is freed above while handling the gpio_direction_output() error.

> 
> > +       return err;
> > +}
> > +
> > +static void __devexit fan_ctrl_free(struct gpio_fan_data *fan_data)
> > +{
> > +       struct platform_device *pdev = fan_data->pdev;
> > +       int i;
> > +
> > +       sysfs_remove_group(&pdev->dev.kobj, &gpio_fan_ctrl_group);
> > +       for (i = 0; i < fan_data->num_ctrl; i++)
> > +               gpio_free(fan_data->ctrl[i]);
> > +}
> > +
> > +/*
> > + * Platform driver.
> > + */
> > +
> > +static ssize_t show_name(struct device *dev,
> > +                        struct device_attribute *attr, char *buf)
> > +{
> > +       return sprintf(buf, "gpio-fan\n");
> > +}
> > +
> > +static DEVICE_ATTR(name, S_IRUGO, show_name, NULL);
> > +
> > +static int __devinit gpio_fan_probe(struct platform_device *pdev)
> > +{
> > +       int err = 0;
> > +       struct gpio_fan_data *fan_data;
> > +       struct gpio_fan_platform_data *pdata = pdev->dev.platform_data;
> > +
> > +       if (!pdata)
> > +               return -EINVAL;
> > +
> > +       fan_data = kzalloc(sizeof(struct gpio_fan_data), GFP_KERNEL);
> > +       if (!fan_data)
> > +               return -ENOMEM;
> > +
> > +       fan_data->pdev = pdev;
> > +       platform_set_drvdata(pdev, fan_data);
> > +       mutex_init(&fan_data->lock);
> > +
> > +       /* Configure alarm GPIO if available. */
> > +       if (pdata->alarm) {
> > +               err = fan_alarm_init(fan_data, pdata->alarm);
> > +               if (err)
> > +                       goto err_free_data;
> > +       }
> > +
> > +       /* Configure control GPIOs if available. */
> > +       if (pdata->ctrl && pdata->num_ctrl) {
> > +               if (!pdata->num_speed || !pdata->speed) {
> > +                       err = -EINVAL;
> > +                       goto err_free_alarm;
> > +               }
> > +               err = fan_ctrl_init(fan_data, pdata);
> > +               if (err)
> > +                       goto err_free_alarm;
> > +       }
> > +
> > +       err = device_create_file(&pdev->dev, &dev_attr_name);
> > +       if (err)
> > +               goto err_free_ctrl;
> > +
> > +       /* Make this driver part of hwmon class. */
> > +       fan_data->hwmon_dev = hwmon_device_register(&pdev->dev);
> > +       if (IS_ERR(fan_data->hwmon_dev)) {
> > +               err = PTR_ERR(fan_data->hwmon_dev);
> > +               goto err_remove_name;
> > +       }
> > +
> > +       dev_info(&pdev->dev, "GPIO fan initialized\n");
> > +
> Might be a good idea to add a notion of which fan was initialized.
> After all, there could be more than one.

dev_info() don't do it for me ? anyway, I will check this too.

> 
> > +       return 0;
> > +
> > +err_remove_name:
> > +       device_remove_file(&pdev->dev, &dev_attr_name);
> > +err_free_ctrl:
> > +       fan_ctrl_free(fan_data);
> 
> Might want to check for fan_data->ctrl to be consistent with the code below.

Of course...

> 
> > +err_free_alarm:
> > +       fan_alarm_free(fan_data);
> 
> This will crash if fan_data->alarm is NULL.

...

> 
> > +err_free_data:
> > +       platform_set_drvdata(pdev, NULL);
> > +       kfree(fan_data);
> > +
> > +       return err;
> > +}
> > +
> > +static int __devexit gpio_fan_remove(struct platform_device *pdev)
> > +{
> > +       struct gpio_fan_data *fan_data = platform_get_drvdata(pdev);
> > +
> > +       hwmon_device_unregister(fan_data->hwmon_dev);
> > +       device_remove_file(&pdev->dev, &dev_attr_name);
> > +       if (fan_data->alarm)
> > +               fan_alarm_free(fan_data);
> > +       if (fan_data->ctrl)
> > +               fan_ctrl_free(fan_data);
> > +       kfree(fan_data);
> > +
> > +       return 0;
> > +}
> > +
> > +static struct platform_driver gpio_fan_driver = {
> > +       .probe  = gpio_fan_probe,
> > +       .remove = __devexit_p(gpio_fan_remove),
> > +       .driver = {
> > +               .name = "gpio-fan",
> > +       },
> > +};
> > +
> > +static int __init gpio_fan_init(void)
> > +{
> > +       return platform_driver_register(&gpio_fan_driver);
> > +}
> > +
> > +static void __exit gpio_fan_exit(void)
> > +{
> > +       platform_driver_unregister(&gpio_fan_driver);
> > +       return;
> > +}
> > +
> > +module_init(gpio_fan_init);
> > +module_exit(gpio_fan_exit);
> > +
> > +MODULE_AUTHOR("Simon Guinot <sguinot@lacie.com>");
> > +MODULE_DESCRIPTION("GPIO FAN driver");
> > +MODULE_LICENSE("GPL");
> > +MODULE_ALIAS("platform:gpio-fan");
> > diff --git a/include/linux/gpio-fan.h b/include/linux/gpio-fan.h
> > new file mode 100644
> > index 0000000..58f0930
> > --- /dev/null
> > +++ b/include/linux/gpio-fan.h
> > @@ -0,0 +1,43 @@
> > +/*
> > + * include/linux/gpio-fan.h
> > + *
> > + * Platform data structure for GPIO fan driver
> > + *
> > + * This file is licensed under the terms of the GNU General Public
> > + * License version 2.  This program is licensed "as is" without any
> > + * warranty of any kind, whether express or implied.
> > + */
> > +
> > +#ifndef __LINUX_GPIO_FAN_H
> > +#define __LINUX_GPIO_FAN_H
> > +
> > +struct gpio_fan_alarm {
> > +       unsigned        gpio;
> > +       unsigned        active_low;
> > +};
> > +
> > +struct gpio_fan_speed {
> > +       int rpm;
> > +       int ctrl_val;
> > +};
> > +
> > +struct gpio_fan_platform_data {
> > +       int                     num_ctrl;
> > +       unsigned                *ctrl;  /* fan control GPIOs. */
> > +       struct gpio_fan_alarm   *alarm; /* fan alarm GPIO. */
> > +       /*
> > +        * Speed conversion array: rpm from/to GPIO bit field.
> > +        * This array _must_ be sorted in ascending rpm order.
> > +        */
> > +       int                     num_speed;
> > +       struct gpio_fan_speed   *speed;
> > +       /*
> > +        * This functions can be supplied if some specific operations are
> > +        * required to get/set a fan control (handle a latch enable GPIO,
> > +        * prevent from writing some transitional control value, etc...)
> > +        */
> > +       int     (*get_ctrl)(int num_ctrl, unsigned *ctrl);
> > +       void    (*set_ctrl)(int num_ctrl, unsigned *ctrl, int ctrl_val);
> 
> Not sure if this is a good/useful API. It expects that the called function
> identifies the fan from the ctrl[] array. Not sure how clumsy the resulting code
> might be. It may be better to leave the API out for now until someone actually
> writes a driver (hint, hint, dns323) using it.

I agree and I will happily throw away the clumsy API :)

Simon

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

[-- Attachment #2: Type: text/plain, Size: 153 bytes --]

_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply

* [PATCH 1/2] x86: Cleanup TIF value gaps in shift range
From: Frederic Weisbecker @ 2010-10-18 20:35 UTC (permalink / raw)
  To: LKML
  Cc: LKML, Frederic Weisbecker, Ingo Molnar, H. Peter Anvin,
	Thomas Gleixner

9, 19 and 26 values are missing from the TIF shift range, probably
due to flags that were removed by the past. Now repack the range
so that we can quickly retrieve the remaining free shift slots.

But take care of keeping the seperation between high and low bits
as some masks are created on top of this boundary.

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
---
 arch/x86/include/asm/thread_info.h |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/arch/x86/include/asm/thread_info.h b/arch/x86/include/asm/thread_info.h
index f0b6e5d..0bbf6f9 100644
--- a/arch/x86/include/asm/thread_info.h
+++ b/arch/x86/include/asm/thread_info.h
@@ -82,19 +82,19 @@ struct thread_info {
 #define TIF_SYSCALL_EMU		6	/* syscall emulation active */
 #define TIF_SYSCALL_AUDIT	7	/* syscall auditing active */
 #define TIF_SECCOMP		8	/* secure computing */
-#define TIF_MCE_NOTIFY		10	/* notify userspace of an MCE */
-#define TIF_USER_RETURN_NOTIFY	11	/* notify kernel of userspace return */
+#define TIF_MCE_NOTIFY		9	/* notify userspace of an MCE */
+#define TIF_USER_RETURN_NOTIFY	10	/* notify kernel of userspace return */
 #define TIF_NOTSC		16	/* TSC is not accessible in userland */
 #define TIF_IA32		17	/* 32bit process */
 #define TIF_FORK		18	/* ret_from_fork */
-#define TIF_MEMDIE		20	/* is terminating due to OOM killer */
-#define TIF_DEBUG		21	/* uses debug registers */
-#define TIF_IO_BITMAP		22	/* uses I/O bitmap */
-#define TIF_FREEZE		23	/* is freezing for suspend */
-#define TIF_FORCED_TF		24	/* true if TF in eflags artificially */
-#define TIF_BLOCKSTEP		25	/* set when we want DEBUGCTLMSR_BTF */
-#define TIF_LAZY_MMU_UPDATES	27	/* task is updating the mmu lazily */
-#define TIF_SYSCALL_TRACEPOINT	28	/* syscall tracepoint instrumentation */
+#define TIF_MEMDIE		19	/* is terminating due to OOM killer */
+#define TIF_DEBUG		20	/* uses debug registers */
+#define TIF_IO_BITMAP		21	/* uses I/O bitmap */
+#define TIF_FREEZE		22	/* is freezing for suspend */
+#define TIF_FORCED_TF		23	/* true if TF in eflags artificially */
+#define TIF_BLOCKSTEP		24	/* set when we want DEBUGCTLMSR_BTF */
+#define TIF_LAZY_MMU_UPDATES	25	/* task is updating the mmu lazily */
+#define TIF_SYSCALL_TRACEPOINT	26	/* syscall tracepoint instrumentation */
 
 #define _TIF_SYSCALL_TRACE	(1 << TIF_SYSCALL_TRACE)
 #define _TIF_NOTIFY_RESUME	(1 << TIF_NOTIFY_RESUME)
-- 
1.6.2.3


^ permalink raw reply related

* [PATCH 2/3 V2] b43: N-PHY: define registers names for 2056 radio
From: John W. Linville @ 2010-10-18 20:34 UTC (permalink / raw)
  To: Rafał Miłecki
  Cc: linux-wireless, b43-dev, Henry Ptasinski, Brett Rudley, Nohee Ko
In-Reply-To: <1287322732-13306-3-git-send-email-zajec5@gmail.com>

On Sun, Oct 17, 2010 at 03:38:51PM +0200, Rafa? Mi?ecki wrote:
> Signed-off-by: Rafa? Mi?ecki <zajec5@gmail.com>
> Cc: Henry Ptasinski <henryp@broadcom.com>
> Cc: Brett Rudley <brudley@broadcom.com>
> Cc: Nohee Ko <noheek@broadcom.com>
> ---
> V2: changed defines prefix from RADIO_ to B as correctly suggested by Stefanik.
> 
> John: in case you got lost the correct order of patches is following:
> 
> [PATCH 1/4 resend] b43: N-PHY: replace N-specific radio_chanspec with common code
> [PATCH 2/4 resend] b43: N-PHY: fix typo: read table when caching IQ LO calibration (do not write)
> [PATCH 3/4] b43: N-PHY: put radio-specific code in separated file
> [PATCH 4/4] b43: N-PHY: put 2056-radio's specific code in separated file
> 
> [PATCH 1/3] b43: N-PHY: define channel table struct for rev3+ devices
> [PATCH 2/3 V2] b43: N-PHY: define registers names for 2056 radio
> [PATCH 3/3] b43: N-PHY: add 2056 radio channels tables
> 
> PATCH 1/3 got some discussion but we decided it's OK.

Thanks for the update.  In the future, please also try to post
replacement patches as a reply to the patch they are replacing.

John
-- 
John W. Linville		Someday the world will need a hero, and you
linville at tuxdriver.com			might be all we have.  Be ready.

^ permalink raw reply

* [PATCH 3/7] tracing: Make graph related irqs/preemptsoff functions global
From: Steven Rostedt @ 2010-10-18 20:29 UTC (permalink / raw)
  To: linux-kernel; +Cc: Ingo Molnar, Andrew Morton, Frederic Weisbecker, Jiri Olsa
In-Reply-To: <20101018202939.828061748@goodmis.org>

[-- Attachment #1: 0003-tracing-Make-graph-related-irqs-preemptsoff-function.patch --]
[-- Type: text/plain, Size: 6478 bytes --]

From: Jiri Olsa <jolsa@redhat.com>

Move trace_graph_function() and print_graph_headers_flags() functions
to the trace_function_graph.c to be globaly available.

Signed-off-by: Jiri Olsa <jolsa@redhat.com>
LKML-Reference: <1285243253-7372-3-git-send-email-jolsa@redhat.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 kernel/trace/trace.h                 |    4 ++
 kernel/trace/trace_functions_graph.c |   63 ++++++++++++++++++++++++++++++++--
 kernel/trace/trace_irqsoff.c         |   56 ++++--------------------------
 3 files changed, 71 insertions(+), 52 deletions(-)

diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
index d39b3c5..9021f8c 100644
--- a/kernel/trace/trace.h
+++ b/kernel/trace/trace.h
@@ -343,6 +343,10 @@ void trace_function(struct trace_array *tr,
 		    unsigned long ip,
 		    unsigned long parent_ip,
 		    unsigned long flags, int pc);
+void trace_graph_function(struct trace_array *tr,
+		    unsigned long ip,
+		    unsigned long parent_ip,
+		    unsigned long flags, int pc);
 void trace_default_header(struct seq_file *m);
 void print_trace_header(struct seq_file *m, struct trace_iterator *iter);
 int trace_empty(struct trace_iterator *iter);
diff --git a/kernel/trace/trace_functions_graph.c b/kernel/trace/trace_functions_graph.c
index 4c58ccc..6f8fe28 100644
--- a/kernel/trace/trace_functions_graph.c
+++ b/kernel/trace/trace_functions_graph.c
@@ -262,6 +262,35 @@ int trace_graph_thresh_entry(struct ftrace_graph_ent *trace)
 		return trace_graph_entry(trace);
 }
 
+static void
+__trace_graph_function(struct trace_array *tr,
+		unsigned long ip, unsigned long flags, int pc)
+{
+	u64 time = trace_clock_local();
+	struct ftrace_graph_ent ent = {
+		.func  = ip,
+		.depth = 0,
+	};
+	struct ftrace_graph_ret ret = {
+		.func     = ip,
+		.depth    = 0,
+		.calltime = time,
+		.rettime  = time,
+	};
+
+	__trace_graph_entry(tr, &ent, flags, pc);
+	__trace_graph_return(tr, &ret, flags, pc);
+}
+
+void
+trace_graph_function(struct trace_array *tr,
+		unsigned long ip, unsigned long parent_ip,
+		unsigned long flags, int pc)
+{
+	__trace_graph_function(tr, parent_ip, flags, pc);
+	__trace_graph_function(tr, ip, flags, pc);
+}
+
 void __trace_graph_return(struct trace_array *tr,
 				struct ftrace_graph_ret *trace,
 				unsigned long flags,
@@ -1179,7 +1208,7 @@ print_graph_comment(struct trace_seq *s, struct trace_entry *ent,
 
 
 enum print_line_t
-print_graph_function_flags(struct trace_iterator *iter, u32 flags)
+__print_graph_function_flags(struct trace_iterator *iter, u32 flags)
 {
 	struct ftrace_graph_ent_entry *field;
 	struct fgraph_data *data = iter->private;
@@ -1242,7 +1271,18 @@ print_graph_function_flags(struct trace_iterator *iter, u32 flags)
 static enum print_line_t
 print_graph_function(struct trace_iterator *iter)
 {
-	return print_graph_function_flags(iter, tracer_flags.val);
+	return __print_graph_function_flags(iter, tracer_flags.val);
+}
+
+enum print_line_t print_graph_function_flags(struct trace_iterator *iter,
+					     u32 flags)
+{
+	if (trace_flags & TRACE_ITER_LATENCY_FMT)
+		flags |= TRACE_GRAPH_PRINT_DURATION;
+	else
+		flags |= TRACE_GRAPH_PRINT_ABS_TIME;
+
+	return __print_graph_function_flags(iter, flags);
 }
 
 static enum print_line_t
@@ -1274,7 +1314,7 @@ static void print_lat_header(struct seq_file *s, u32 flags)
 	seq_printf(s, "#%.*s|||| /                     \n", size, spaces);
 }
 
-void print_graph_headers_flags(struct seq_file *s, u32 flags)
+static void __print_graph_headers_flags(struct seq_file *s, u32 flags)
 {
 	int lat = trace_flags & TRACE_ITER_LATENCY_FMT;
 
@@ -1315,6 +1355,23 @@ void print_graph_headers(struct seq_file *s)
 	print_graph_headers_flags(s, tracer_flags.val);
 }
 
+void print_graph_headers_flags(struct seq_file *s, u32 flags)
+{
+	struct trace_iterator *iter = s->private;
+
+	if (trace_flags & TRACE_ITER_LATENCY_FMT) {
+		/* print nothing if the buffers are empty */
+		if (trace_empty(iter))
+			return;
+
+		print_trace_header(s, iter);
+		flags |= TRACE_GRAPH_PRINT_DURATION;
+	} else
+		flags |= TRACE_GRAPH_PRINT_ABS_TIME;
+
+	__print_graph_headers_flags(s, flags);
+}
+
 void graph_trace_open(struct trace_iterator *iter)
 {
 	/* pid and depth on the last trace processed */
diff --git a/kernel/trace/trace_irqsoff.c b/kernel/trace/trace_irqsoff.c
index 73a6b06..4047e98 100644
--- a/kernel/trace/trace_irqsoff.c
+++ b/kernel/trace/trace_irqsoff.c
@@ -229,75 +229,33 @@ static void irqsoff_trace_close(struct trace_iterator *iter)
 
 static enum print_line_t irqsoff_print_line(struct trace_iterator *iter)
 {
-	u32 flags = GRAPH_TRACER_FLAGS;
-
-	if (trace_flags & TRACE_ITER_LATENCY_FMT)
-		flags |= TRACE_GRAPH_PRINT_DURATION;
-	else
-		flags |= TRACE_GRAPH_PRINT_ABS_TIME;
-
 	/*
 	 * In graph mode call the graph tracer output function,
 	 * otherwise go with the TRACE_FN event handler
 	 */
 	if (is_graph())
-		return print_graph_function_flags(iter, flags);
+		return print_graph_function_flags(iter, GRAPH_TRACER_FLAGS);
 
 	return TRACE_TYPE_UNHANDLED;
 }
 
 static void irqsoff_print_header(struct seq_file *s)
 {
-	if (is_graph()) {
-		struct trace_iterator *iter = s->private;
-		u32 flags = GRAPH_TRACER_FLAGS;
-
-		if (trace_flags & TRACE_ITER_LATENCY_FMT) {
-			/* print nothing if the buffers are empty */
-			if (trace_empty(iter))
-				return;
-
-			print_trace_header(s, iter);
-			flags |= TRACE_GRAPH_PRINT_DURATION;
-		} else
-			flags |= TRACE_GRAPH_PRINT_ABS_TIME;
-
-		print_graph_headers_flags(s, flags);
-	} else
+	if (is_graph())
+		print_graph_headers_flags(s, GRAPH_TRACER_FLAGS);
+	else
 		trace_default_header(s);
 }
 
 static void
-trace_graph_function(struct trace_array *tr,
-		 unsigned long ip, unsigned long flags, int pc)
-{
-	u64 time = trace_clock_local();
-	struct ftrace_graph_ent ent = {
-		.func  = ip,
-		.depth = 0,
-	};
-	struct ftrace_graph_ret ret = {
-		.func     = ip,
-		.depth    = 0,
-		.calltime = time,
-		.rettime  = time,
-	};
-
-	__trace_graph_entry(tr, &ent, flags, pc);
-	__trace_graph_return(tr, &ret, flags, pc);
-}
-
-static void
 __trace_function(struct trace_array *tr,
 		 unsigned long ip, unsigned long parent_ip,
 		 unsigned long flags, int pc)
 {
-	if (!is_graph())
+	if (is_graph())
+		trace_graph_function(tr, ip, parent_ip, flags, pc);
+	else
 		trace_function(tr, ip, parent_ip, flags, pc);
-	else {
-		trace_graph_function(tr, parent_ip, flags, pc);
-		trace_graph_function(tr, ip, flags, pc);
-	}
 }
 
 #else
-- 
1.7.1



^ permalink raw reply related

* [PATCH 1/7] tracing/trivial: Remove cast from void*
From: Steven Rostedt @ 2010-10-18 20:29 UTC (permalink / raw)
  To: linux-kernel; +Cc: Ingo Molnar, Andrew Morton, Frederic Weisbecker, matt mooney
In-Reply-To: <20101018202939.828061748@goodmis.org>

[-- Attachment #1: 0001-tracing-trivial-Remove-cast-from-void.patch --]
[-- Type: text/plain, Size: 1239 bytes --]

From: matt mooney <mfm@muteddisk.com>

Unnecessary cast from void* in assignment.

Signed-off-by: matt mooney <mfm@muteddisk.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 kernel/trace/ftrace.c |    4 ++--
 kernel/trace/trace.c  |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index 65fb077..ebd80d5 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -1638,8 +1638,8 @@ ftrace_failures_open(struct inode *inode, struct file *file)
 
 	ret = ftrace_avail_open(inode, file);
 	if (!ret) {
-		m = (struct seq_file *)file->private_data;
-		iter = (struct ftrace_iterator *)m->private;
+		m = file->private_data;
+		iter = m->private;
 		iter->flags = FTRACE_ITER_FAILURES;
 	}
 
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 9ec59f5..001bcd2 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -2196,7 +2196,7 @@ int tracing_open_generic(struct inode *inode, struct file *filp)
 
 static int tracing_release(struct inode *inode, struct file *file)
 {
-	struct seq_file *m = (struct seq_file *)file->private_data;
+	struct seq_file *m = file->private_data;
 	struct trace_iterator *iter;
 	int cpu;
 
-- 
1.7.1



^ permalink raw reply related

* [PATCH 2/7] tracing: Add proper check for irq_depth routines
From: Steven Rostedt @ 2010-10-18 20:29 UTC (permalink / raw)
  To: linux-kernel; +Cc: Ingo Molnar, Andrew Morton, Frederic Weisbecker, Jiri Olsa
In-Reply-To: <20101018202939.828061748@goodmis.org>

[-- Attachment #1: 0002-tracing-Add-proper-check-for-irq_depth-routines.patch --]
[-- Type: text/plain, Size: 2031 bytes --]

From: Jiri Olsa <jolsa@redhat.com>

The check_irq_entry and check_irq_return could be called
from graph event context. In such case there's no graph
private data allocated. Adding checks to handle this case.

Signed-off-by: Jiri Olsa <jolsa@redhat.com>
LKML-Reference: <20100924154102.GB1818@jolsa.brq.redhat.com>

[ Fixed some grammar in the comments ]

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 kernel/trace/trace_functions_graph.c |   24 ++++++++++++++++++++----
 1 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/kernel/trace/trace_functions_graph.c b/kernel/trace/trace_functions_graph.c
index ef49e93..4c58ccc 100644
--- a/kernel/trace/trace_functions_graph.c
+++ b/kernel/trace/trace_functions_graph.c
@@ -888,12 +888,20 @@ check_irq_entry(struct trace_iterator *iter, u32 flags,
 		unsigned long addr, int depth)
 {
 	int cpu = iter->cpu;
+	int *depth_irq;
 	struct fgraph_data *data = iter->private;
-	int *depth_irq = &(per_cpu_ptr(data->cpu_data, cpu)->depth_irq);
 
-	if (flags & TRACE_GRAPH_PRINT_IRQS)
+	/*
+	 * If we are either displaying irqs, or we got called as
+	 * a graph event and private data does not exist,
+	 * then we bypass the irq check.
+	 */
+	if ((flags & TRACE_GRAPH_PRINT_IRQS) ||
+	    (!data))
 		return 0;
 
+	depth_irq = &(per_cpu_ptr(data->cpu_data, cpu)->depth_irq);
+
 	/*
 	 * We are inside the irq code
 	 */
@@ -926,12 +934,20 @@ static int
 check_irq_return(struct trace_iterator *iter, u32 flags, int depth)
 {
 	int cpu = iter->cpu;
+	int *depth_irq;
 	struct fgraph_data *data = iter->private;
-	int *depth_irq = &(per_cpu_ptr(data->cpu_data, cpu)->depth_irq);
 
-	if (flags & TRACE_GRAPH_PRINT_IRQS)
+	/*
+	 * If we are either displaying irqs, or we got called as
+	 * a graph event and private data does not exist,
+	 * then we bypass the irq check.
+	 */
+	if ((flags & TRACE_GRAPH_PRINT_IRQS) ||
+	    (!data))
 		return 0;
 
+	depth_irq = &(per_cpu_ptr(data->cpu_data, cpu)->depth_irq);
+
 	/*
 	 * We are not inside the irq code.
 	 */
-- 
1.7.1



^ permalink raw reply related

* [PATCH 5/7] tracing: Use one prologue for the wakeup tracer function tracers
From: Steven Rostedt @ 2010-10-18 20:29 UTC (permalink / raw)
  To: linux-kernel; +Cc: Ingo Molnar, Andrew Morton, Frederic Weisbecker, Jiri Olsa
In-Reply-To: <20101018202939.828061748@goodmis.org>

[-- Attachment #1: 0005-tracing-Use-one-prologue-for-the-wakeup-tracer-funct.patch --]
[-- Type: text/plain, Size: 4599 bytes --]

From: Steven Rostedt <srostedt@redhat.com>

The wakeup tracer has three types of function tracers. Normal
function tracer, function graph entry, and function graph return.
Each of these use a complex dance to prevent recursion and whether
to trace the data or not (depending on the wake_task variable).

This patch moves the duplicate code into a single routine, to
prevent future mistakes with modifying duplicate complex code.

Cc: Jiri Olsa <jolsa@redhat.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 kernel/trace/trace_sched_wakeup.c |  102 ++++++++++++++++++-------------------
 1 files changed, 50 insertions(+), 52 deletions(-)

diff --git a/kernel/trace/trace_sched_wakeup.c b/kernel/trace/trace_sched_wakeup.c
index 033510d..31689d2 100644
--- a/kernel/trace/trace_sched_wakeup.c
+++ b/kernel/trace/trace_sched_wakeup.c
@@ -56,43 +56,73 @@ static struct tracer_flags tracer_flags = {
 #define is_graph() (tracer_flags.val & TRACE_DISPLAY_GRAPH)
 
 #ifdef CONFIG_FUNCTION_TRACER
+
 /*
- * wakeup uses its own tracer function to keep the overhead down:
+ * Prologue for the wakeup function tracers.
+ *
+ * Returns 1 if it is OK to continue, and preemption
+ *            is disabled and data->disabled is incremented.
+ *         0 if the trace is to be ignored, and preemption
+ *            is not disabled and data->disabled is
+ *            kept the same.
+ *
+ * Note, this function is also used outside this ifdef but
+ *  inside the #ifdef of the function graph tracer below.
+ *  This is OK, since the function graph tracer is
+ *  dependent on the function tracer.
  */
-static void
-wakeup_tracer_call(unsigned long ip, unsigned long parent_ip)
+static int
+func_prolog_preempt_disable(struct trace_array *tr,
+			    struct trace_array_cpu **data,
+			    int *pc)
 {
-	struct trace_array *tr = wakeup_trace;
-	struct trace_array_cpu *data;
-	unsigned long flags;
 	long disabled;
 	int cpu;
-	int pc;
 
 	if (likely(!wakeup_task))
-		return;
+		return 0;
 
-	pc = preempt_count();
+	*pc = preempt_count();
 	preempt_disable_notrace();
 
 	cpu = raw_smp_processor_id();
 	if (cpu != wakeup_current_cpu)
 		goto out_enable;
 
-	data = tr->data[cpu];
-	disabled = atomic_inc_return(&data->disabled);
+	*data = tr->data[cpu];
+	disabled = atomic_inc_return(&(*data)->disabled);
 	if (unlikely(disabled != 1))
 		goto out;
 
-	local_irq_save(flags);
+	return 1;
 
-	trace_function(tr, ip, parent_ip, flags, pc);
+out:
+	atomic_dec(&(*data)->disabled);
+
+out_enable:
+	preempt_enable_notrace();
+	return 0;
+}
+
+/*
+ * wakeup uses its own tracer function to keep the overhead down:
+ */
+static void
+wakeup_tracer_call(unsigned long ip, unsigned long parent_ip)
+{
+	struct trace_array *tr = wakeup_trace;
+	struct trace_array_cpu *data;
+	unsigned long flags;
+	int pc;
+
+	if (!func_prolog_preempt_disable(tr, &data, &pc))
+		return;
 
+	local_irq_save(flags);
+	trace_function(tr, ip, parent_ip, flags, pc);
 	local_irq_restore(flags);
 
- out:
 	atomic_dec(&data->disabled);
- out_enable:
 	preempt_enable_notrace();
 }
 
@@ -154,32 +184,16 @@ static int wakeup_graph_entry(struct ftrace_graph_ent *trace)
 	struct trace_array *tr = wakeup_trace;
 	struct trace_array_cpu *data;
 	unsigned long flags;
-	long disabled;
-	int cpu, pc, ret = 0;
+	int pc, ret = 0;
 
-	if (likely(!wakeup_task))
+	if (!func_prolog_preempt_disable(tr, &data, &pc))
 		return 0;
 
-	pc = preempt_count();
-	preempt_disable_notrace();
-
-	cpu = raw_smp_processor_id();
-	if (cpu != wakeup_current_cpu)
-		goto out_enable;
-
-	data = tr->data[cpu];
-	disabled = atomic_inc_return(&data->disabled);
-	if (unlikely(disabled != 1))
-		goto out;
-
 	local_save_flags(flags);
 	ret = __trace_graph_entry(tr, trace, flags, pc);
-
-out:
 	atomic_dec(&data->disabled);
-
-out_enable:
 	preempt_enable_notrace();
+
 	return ret;
 }
 
@@ -188,31 +202,15 @@ static void wakeup_graph_return(struct ftrace_graph_ret *trace)
 	struct trace_array *tr = wakeup_trace;
 	struct trace_array_cpu *data;
 	unsigned long flags;
-	long disabled;
-	int cpu, pc;
+	int pc;
 
-	if (likely(!wakeup_task))
+	if (!func_prolog_preempt_disable(tr, &data, &pc))
 		return;
 
-	pc = preempt_count();
-	preempt_disable_notrace();
-
-	cpu = raw_smp_processor_id();
-	if (cpu != wakeup_current_cpu)
-		goto out_enable;
-
-	data = tr->data[cpu];
-	disabled = atomic_inc_return(&data->disabled);
-	if (unlikely(disabled != 1))
-		goto out;
-
 	local_save_flags(flags);
 	__trace_graph_return(tr, trace, flags, pc);
-
-out:
 	atomic_dec(&data->disabled);
 
-out_enable:
 	preempt_enable_notrace();
 	return;
 }
-- 
1.7.1



^ permalink raw reply related

* [PATCH 7/7] tracing: Remove parent recording in latency tracer graph options
From: Steven Rostedt @ 2010-10-18 20:29 UTC (permalink / raw)
  To: linux-kernel; +Cc: Ingo Molnar, Andrew Morton, Frederic Weisbecker, Jiri Olsa
In-Reply-To: <20101018202939.828061748@goodmis.org>

[-- Attachment #1: 0007-tracing-Remove-parent-recording-in-latency-tracer-gr.patch --]
[-- Type: text/plain, Size: 1454 bytes --]

From: Steven Rostedt <srostedt@redhat.com>

Even though the parent is recorded with the normal function tracing
of the latency tracers (irqsoff and wakeup), the function graph
recording is bogus.

This is due to the function graph messing with the return stack.
The latency tracers pass in as the parent CALLER_ADDR0, which
works fine for plain function tracing. But this causes bogus output
with the graph tracer:

 3)    <idle>-0    |  d.s3.  0.000 us    |  return_to_handler();
 3)    <idle>-0    |  d.s3.  0.000 us    |  _raw_spin_unlock_irqrestore();
 3)    <idle>-0    |  d.s3.  0.000 us    |  return_to_handler();
 3)    <idle>-0    |  d.s3.  0.000 us    |  trace_hardirqs_on();

The "return_to_handle()" call is the trampoline of the
function graph tracer, and is meaningless in this context.

Cc: Jiri Olsa <jolsa@redhat.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 kernel/trace/trace_functions_graph.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/kernel/trace/trace_functions_graph.c b/kernel/trace/trace_functions_graph.c
index 6f8fe28..76b0598 100644
--- a/kernel/trace/trace_functions_graph.c
+++ b/kernel/trace/trace_functions_graph.c
@@ -287,7 +287,6 @@ trace_graph_function(struct trace_array *tr,
 		unsigned long ip, unsigned long parent_ip,
 		unsigned long flags, int pc)
 {
-	__trace_graph_function(tr, parent_ip, flags, pc);
 	__trace_graph_function(tr, ip, flags, pc);
 }
 
-- 
1.7.1



^ permalink raw reply related

* [PATCH 6/7] tracing: Use one prologue for the preempt irqs off tracer function tracers
From: Steven Rostedt @ 2010-10-18 20:29 UTC (permalink / raw)
  To: linux-kernel; +Cc: Ingo Molnar, Andrew Morton, Frederic Weisbecker, Jiri Olsa
In-Reply-To: <20101018202939.828061748@goodmis.org>

[-- Attachment #1: 0006-tracing-Use-one-prologue-for-the-preempt-irqs-off-tr.patch --]
[-- Type: text/plain, Size: 4581 bytes --]

From: Steven Rostedt <srostedt@redhat.com>

The preempt and irqsoff tracers have three types of function tracers.
Normal function tracer, function graph entry, and function graph return.
Each of these use a complex dance to prevent recursion and whether
to trace the data or not (depending if interrupts are enabled or not).

This patch moves the duplicate code into a single routine, to
prevent future mistakes with modifying duplicate complex code.

Cc: Jiri Olsa <jolsa@redhat.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 kernel/trace/trace_irqsoff.c |   96 +++++++++++++++++++++---------------------
 1 files changed, 48 insertions(+), 48 deletions(-)

diff --git a/kernel/trace/trace_irqsoff.c b/kernel/trace/trace_irqsoff.c
index 4047e98..5cf8c60 100644
--- a/kernel/trace/trace_irqsoff.c
+++ b/kernel/trace/trace_irqsoff.c
@@ -87,14 +87,22 @@ static __cacheline_aligned_in_smp	unsigned long max_sequence;
 
 #ifdef CONFIG_FUNCTION_TRACER
 /*
- * irqsoff uses its own tracer function to keep the overhead down:
+ * Prologue for the preempt and irqs off function tracers.
+ *
+ * Returns 1 if it is OK to continue, and data->disabled is
+ *            incremented.
+ *         0 if the trace is to be ignored, and data->disabled
+ *            is kept the same.
+ *
+ * Note, this function is also used outside this ifdef but
+ *  inside the #ifdef of the function graph tracer below.
+ *  This is OK, since the function graph tracer is
+ *  dependent on the function tracer.
  */
-static void
-irqsoff_tracer_call(unsigned long ip, unsigned long parent_ip)
+static int func_prolog_dec(struct trace_array *tr,
+			   struct trace_array_cpu **data,
+			   unsigned long *flags)
 {
-	struct trace_array *tr = irqsoff_trace;
-	struct trace_array_cpu *data;
-	unsigned long flags;
 	long disabled;
 	int cpu;
 
@@ -106,18 +114,38 @@ irqsoff_tracer_call(unsigned long ip, unsigned long parent_ip)
 	 */
 	cpu = raw_smp_processor_id();
 	if (likely(!per_cpu(tracing_cpu, cpu)))
-		return;
+		return 0;
 
-	local_save_flags(flags);
+	local_save_flags(*flags);
 	/* slight chance to get a false positive on tracing_cpu */
-	if (!irqs_disabled_flags(flags))
-		return;
+	if (!irqs_disabled_flags(*flags))
+		return 0;
 
-	data = tr->data[cpu];
-	disabled = atomic_inc_return(&data->disabled);
+	*data = tr->data[cpu];
+	disabled = atomic_inc_return(&(*data)->disabled);
 
 	if (likely(disabled == 1))
-		trace_function(tr, ip, parent_ip, flags, preempt_count());
+		return 1;
+
+	atomic_dec(&(*data)->disabled);
+
+	return 0;
+}
+
+/*
+ * irqsoff uses its own tracer function to keep the overhead down:
+ */
+static void
+irqsoff_tracer_call(unsigned long ip, unsigned long parent_ip)
+{
+	struct trace_array *tr = irqsoff_trace;
+	struct trace_array_cpu *data;
+	unsigned long flags;
+
+	if (!func_prolog_dec(tr, &data, &flags))
+		return;
+
+	trace_function(tr, ip, parent_ip, flags, preempt_count());
 
 	atomic_dec(&data->disabled);
 }
@@ -155,30 +183,16 @@ static int irqsoff_graph_entry(struct ftrace_graph_ent *trace)
 	struct trace_array *tr = irqsoff_trace;
 	struct trace_array_cpu *data;
 	unsigned long flags;
-	long disabled;
 	int ret;
-	int cpu;
 	int pc;
 
-	cpu = raw_smp_processor_id();
-	if (likely(!per_cpu(tracing_cpu, cpu)))
-		return 0;
-
-	local_save_flags(flags);
-	/* slight chance to get a false positive on tracing_cpu */
-	if (!irqs_disabled_flags(flags))
+	if (!func_prolog_dec(tr, &data, &flags))
 		return 0;
 
-	data = tr->data[cpu];
-	disabled = atomic_inc_return(&data->disabled);
-
-	if (likely(disabled == 1)) {
-		pc = preempt_count();
-		ret = __trace_graph_entry(tr, trace, flags, pc);
-	} else
-		ret = 0;
-
+	pc = preempt_count();
+	ret = __trace_graph_entry(tr, trace, flags, pc);
 	atomic_dec(&data->disabled);
+
 	return ret;
 }
 
@@ -187,27 +201,13 @@ static void irqsoff_graph_return(struct ftrace_graph_ret *trace)
 	struct trace_array *tr = irqsoff_trace;
 	struct trace_array_cpu *data;
 	unsigned long flags;
-	long disabled;
-	int cpu;
 	int pc;
 
-	cpu = raw_smp_processor_id();
-	if (likely(!per_cpu(tracing_cpu, cpu)))
-		return;
-
-	local_save_flags(flags);
-	/* slight chance to get a false positive on tracing_cpu */
-	if (!irqs_disabled_flags(flags))
+	if (!func_prolog_dec(tr, &data, &flags))
 		return;
 
-	data = tr->data[cpu];
-	disabled = atomic_inc_return(&data->disabled);
-
-	if (likely(disabled == 1)) {
-		pc = preempt_count();
-		__trace_graph_return(tr, trace, flags, pc);
-	}
-
+	pc = preempt_count();
+	__trace_graph_return(tr, trace, flags, pc);
 	atomic_dec(&data->disabled);
 }
 
-- 
1.7.1



^ permalink raw reply related

* [PATCH 4/7] tracing: Graph support for wakeup tracer
From: Steven Rostedt @ 2010-10-18 20:29 UTC (permalink / raw)
  To: linux-kernel; +Cc: Ingo Molnar, Andrew Morton, Frederic Weisbecker, Jiri Olsa
In-Reply-To: <20101018202939.828061748@goodmis.org>

[-- Attachment #1: 0004-tracing-Graph-support-for-wakeup-tracer.patch --]
[-- Type: text/plain, Size: 8193 bytes --]

From: Jiri Olsa <jolsa@redhat.com>

Add function graph support for wakeup latency tracer.
The graph output is enabled by setting the 'display-graph'
trace option.

Signed-off-by: Jiri Olsa <jolsa@redhat.com>
LKML-Reference: <1285243253-7372-4-git-send-email-jolsa@redhat.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 kernel/trace/trace_sched_wakeup.c |  231 +++++++++++++++++++++++++++++++++++--
 1 files changed, 221 insertions(+), 10 deletions(-)

diff --git a/kernel/trace/trace_sched_wakeup.c b/kernel/trace/trace_sched_wakeup.c
index 4086eae..033510d 100644
--- a/kernel/trace/trace_sched_wakeup.c
+++ b/kernel/trace/trace_sched_wakeup.c
@@ -31,13 +31,33 @@ static int			wakeup_rt;
 static arch_spinlock_t wakeup_lock =
 	(arch_spinlock_t)__ARCH_SPIN_LOCK_UNLOCKED;
 
+static void wakeup_reset(struct trace_array *tr);
 static void __wakeup_reset(struct trace_array *tr);
+static int wakeup_graph_entry(struct ftrace_graph_ent *trace);
+static void wakeup_graph_return(struct ftrace_graph_ret *trace);
 
 static int save_lat_flag;
 
+#define TRACE_DISPLAY_GRAPH     1
+
+static struct tracer_opt trace_opts[] = {
+#ifdef CONFIG_FUNCTION_GRAPH_TRACER
+	/* display latency trace as call graph */
+	{ TRACER_OPT(display-graph, TRACE_DISPLAY_GRAPH) },
+#endif
+	{ } /* Empty entry */
+};
+
+static struct tracer_flags tracer_flags = {
+	.val  = 0,
+	.opts = trace_opts,
+};
+
+#define is_graph() (tracer_flags.val & TRACE_DISPLAY_GRAPH)
+
 #ifdef CONFIG_FUNCTION_TRACER
 /*
- * irqsoff uses its own tracer function to keep the overhead down:
+ * wakeup uses its own tracer function to keep the overhead down:
  */
 static void
 wakeup_tracer_call(unsigned long ip, unsigned long parent_ip)
@@ -80,8 +100,191 @@ static struct ftrace_ops trace_ops __read_mostly =
 {
 	.func = wakeup_tracer_call,
 };
+
+static int start_func_tracer(int graph)
+{
+	int ret;
+
+	if (!graph)
+		ret = register_ftrace_function(&trace_ops);
+	else
+		ret = register_ftrace_graph(&wakeup_graph_return,
+					    &wakeup_graph_entry);
+
+	if (!ret && tracing_is_enabled())
+		tracer_enabled = 1;
+	else
+		tracer_enabled = 0;
+
+	return ret;
+}
+
+static void stop_func_tracer(int graph)
+{
+	tracer_enabled = 0;
+
+	if (!graph)
+		unregister_ftrace_function(&trace_ops);
+	else
+		unregister_ftrace_graph();
+}
+
 #endif /* CONFIG_FUNCTION_TRACER */
 
+#ifdef CONFIG_FUNCTION_GRAPH_TRACER
+static int wakeup_set_flag(u32 old_flags, u32 bit, int set)
+{
+
+	if (!(bit & TRACE_DISPLAY_GRAPH))
+		return -EINVAL;
+
+	if (!(is_graph() ^ set))
+		return 0;
+
+	stop_func_tracer(!set);
+
+	wakeup_reset(wakeup_trace);
+	tracing_max_latency = 0;
+
+	return start_func_tracer(set);
+}
+
+static int wakeup_graph_entry(struct ftrace_graph_ent *trace)
+{
+	struct trace_array *tr = wakeup_trace;
+	struct trace_array_cpu *data;
+	unsigned long flags;
+	long disabled;
+	int cpu, pc, ret = 0;
+
+	if (likely(!wakeup_task))
+		return 0;
+
+	pc = preempt_count();
+	preempt_disable_notrace();
+
+	cpu = raw_smp_processor_id();
+	if (cpu != wakeup_current_cpu)
+		goto out_enable;
+
+	data = tr->data[cpu];
+	disabled = atomic_inc_return(&data->disabled);
+	if (unlikely(disabled != 1))
+		goto out;
+
+	local_save_flags(flags);
+	ret = __trace_graph_entry(tr, trace, flags, pc);
+
+out:
+	atomic_dec(&data->disabled);
+
+out_enable:
+	preempt_enable_notrace();
+	return ret;
+}
+
+static void wakeup_graph_return(struct ftrace_graph_ret *trace)
+{
+	struct trace_array *tr = wakeup_trace;
+	struct trace_array_cpu *data;
+	unsigned long flags;
+	long disabled;
+	int cpu, pc;
+
+	if (likely(!wakeup_task))
+		return;
+
+	pc = preempt_count();
+	preempt_disable_notrace();
+
+	cpu = raw_smp_processor_id();
+	if (cpu != wakeup_current_cpu)
+		goto out_enable;
+
+	data = tr->data[cpu];
+	disabled = atomic_inc_return(&data->disabled);
+	if (unlikely(disabled != 1))
+		goto out;
+
+	local_save_flags(flags);
+	__trace_graph_return(tr, trace, flags, pc);
+
+out:
+	atomic_dec(&data->disabled);
+
+out_enable:
+	preempt_enable_notrace();
+	return;
+}
+
+static void wakeup_trace_open(struct trace_iterator *iter)
+{
+	if (is_graph())
+		graph_trace_open(iter);
+}
+
+static void wakeup_trace_close(struct trace_iterator *iter)
+{
+	if (iter->private)
+		graph_trace_close(iter);
+}
+
+#define GRAPH_TRACER_FLAGS (TRACE_GRAPH_PRINT_PROC)
+
+static enum print_line_t wakeup_print_line(struct trace_iterator *iter)
+{
+	/*
+	 * In graph mode call the graph tracer output function,
+	 * otherwise go with the TRACE_FN event handler
+	 */
+	if (is_graph())
+		return print_graph_function_flags(iter, GRAPH_TRACER_FLAGS);
+
+	return TRACE_TYPE_UNHANDLED;
+}
+
+static void wakeup_print_header(struct seq_file *s)
+{
+	if (is_graph())
+		print_graph_headers_flags(s, GRAPH_TRACER_FLAGS);
+	else
+		trace_default_header(s);
+}
+
+static void
+__trace_function(struct trace_array *tr,
+		 unsigned long ip, unsigned long parent_ip,
+		 unsigned long flags, int pc)
+{
+	if (is_graph())
+		trace_graph_function(tr, ip, parent_ip, flags, pc);
+	else
+		trace_function(tr, ip, parent_ip, flags, pc);
+}
+#else
+#define __trace_function trace_function
+
+static int wakeup_set_flag(u32 old_flags, u32 bit, int set)
+{
+	return -EINVAL;
+}
+
+static int wakeup_graph_entry(struct ftrace_graph_ent *trace)
+{
+	return -1;
+}
+
+static enum print_line_t wakeup_print_line(struct trace_iterator *iter)
+{
+	return TRACE_TYPE_UNHANDLED;
+}
+
+static void wakeup_graph_return(struct ftrace_graph_ret *trace) { }
+static void wakeup_print_header(struct seq_file *s) { }
+static void wakeup_trace_open(struct trace_iterator *iter) { }
+static void wakeup_trace_close(struct trace_iterator *iter) { }
+#endif /* CONFIG_FUNCTION_GRAPH_TRACER */
+
 /*
  * Should this new latency be reported/recorded?
  */
@@ -152,7 +355,7 @@ probe_wakeup_sched_switch(void *ignore,
 	/* The task we are waiting for is waking up */
 	data = wakeup_trace->data[wakeup_cpu];
 
-	trace_function(wakeup_trace, CALLER_ADDR0, CALLER_ADDR1, flags, pc);
+	__trace_function(wakeup_trace, CALLER_ADDR0, CALLER_ADDR1, flags, pc);
 	tracing_sched_switch_trace(wakeup_trace, prev, next, flags, pc);
 
 	T0 = data->preempt_timestamp;
@@ -252,7 +455,7 @@ probe_wakeup(void *ignore, struct task_struct *p, int success)
 	 * is not called by an assembly function  (where as schedule is)
 	 * it should be safe to use it here.
 	 */
-	trace_function(wakeup_trace, CALLER_ADDR1, CALLER_ADDR2, flags, pc);
+	__trace_function(wakeup_trace, CALLER_ADDR1, CALLER_ADDR2, flags, pc);
 
 out_locked:
 	arch_spin_unlock(&wakeup_lock);
@@ -303,12 +506,8 @@ static void start_wakeup_tracer(struct trace_array *tr)
 	 */
 	smp_wmb();
 
-	register_ftrace_function(&trace_ops);
-
-	if (tracing_is_enabled())
-		tracer_enabled = 1;
-	else
-		tracer_enabled = 0;
+	if (start_func_tracer(is_graph()))
+		printk(KERN_ERR "failed to start wakeup tracer\n");
 
 	return;
 fail_deprobe_wake_new:
@@ -320,7 +519,7 @@ fail_deprobe:
 static void stop_wakeup_tracer(struct trace_array *tr)
 {
 	tracer_enabled = 0;
-	unregister_ftrace_function(&trace_ops);
+	stop_func_tracer(is_graph());
 	unregister_trace_sched_switch(probe_wakeup_sched_switch, NULL);
 	unregister_trace_sched_wakeup_new(probe_wakeup, NULL);
 	unregister_trace_sched_wakeup(probe_wakeup, NULL);
@@ -379,9 +578,15 @@ static struct tracer wakeup_tracer __read_mostly =
 	.start		= wakeup_tracer_start,
 	.stop		= wakeup_tracer_stop,
 	.print_max	= 1,
+	.print_header	= wakeup_print_header,
+	.print_line	= wakeup_print_line,
+	.flags		= &tracer_flags,
+	.set_flag	= wakeup_set_flag,
 #ifdef CONFIG_FTRACE_SELFTEST
 	.selftest    = trace_selftest_startup_wakeup,
 #endif
+	.open		= wakeup_trace_open,
+	.close		= wakeup_trace_close,
 	.use_max_tr	= 1,
 };
 
@@ -394,9 +599,15 @@ static struct tracer wakeup_rt_tracer __read_mostly =
 	.stop		= wakeup_tracer_stop,
 	.wait_pipe	= poll_wait_pipe,
 	.print_max	= 1,
+	.print_header	= wakeup_print_header,
+	.print_line	= wakeup_print_line,
+	.flags		= &tracer_flags,
+	.set_flag	= wakeup_set_flag,
 #ifdef CONFIG_FTRACE_SELFTEST
 	.selftest    = trace_selftest_startup_wakeup,
 #endif
+	.open		= wakeup_trace_open,
+	.close		= wakeup_trace_close,
 	.use_max_tr	= 1,
 };
 
-- 
1.7.1



^ permalink raw reply related

* [PATCH 0/7] [GIT PULL] tracing: various updates
From: Steven Rostedt @ 2010-10-18 20:29 UTC (permalink / raw)
  To: linux-kernel; +Cc: Ingo Molnar, Andrew Morton, Frederic Weisbecker


Ingo,

I pushed these before, but they had a couple of jump label patches that
caused you a build error. Since these patches have nothing to do with
jump label, I rebased them without the jump label patches on top
of latest tip/perf/core.

The couple of jump label that were taken out of this patch series
now live in the jump label branch of my tree (and were actually in
the last jump label push which also needs a rewrite).

Please pull the latest tip/perf/core tree, which can be found at:

  git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace.git
tip/perf/core


Jiri Olsa (3):
      tracing: Add proper check for irq_depth routines
      tracing: Make graph related irqs/preemptsoff functions global
      tracing: Graph support for wakeup tracer

Steven Rostedt (3):
      tracing: Use one prologue for the wakeup tracer function tracers
      tracing: Use one prologue for the preempt irqs off tracer function tracers
      tracing: Remove parent recording in latency tracer graph options

matt mooney (1):
      tracing/trivial: Remove cast from void*

----
 kernel/trace/ftrace.c                |    4 +-
 kernel/trace/trace.c                 |    2 +-
 kernel/trace/trace.h                 |    4 +
 kernel/trace/trace_functions_graph.c |   86 +++++++++++-
 kernel/trace/trace_irqsoff.c         |  152 +++++++-------------
 kernel/trace/trace_sched_wakeup.c    |  257 ++++++++++++++++++++++++++++++---
 6 files changed, 374 insertions(+), 131 deletions(-)

^ permalink raw reply

* Re: error: refs/tags/2.0.9 does not point to a valid object!
From: Stephen Bash @ 2010-10-18 20:31 UTC (permalink / raw)
  To: Mathieu Malaterre; +Cc: git
In-Reply-To: <AANLkTi=JgVhkNVu70nW7_vbqWUsS=mnJGQDVBtm-dxJD@mail.gmail.com>



----- Original Message -----
> From: "Mathieu Malaterre" <mathieu.malaterre@gmail.com>
> To: git@vger.kernel.org
> Sent: Monday, October 18, 2010 3:23:57 PM
> Subject: error: refs/tags/2.0.9 does not point to a valid object!
> 
> I am trying to convert a SVN repository to GIT.
> 
> The filter ran for a couple of hours. But after the conversion I get
> the following:
> 
> Initialized empty Git repository in /tmp/bla/.git/
> remote: Counting objects: 59368, done.
> remote: Compressing objects: 100% (25408/25408), done.
> remote: Total 59368 (delta 43461), reused 44204 (delta 33809)
> Receiving objects: 100% (59368/59368), 14.40 MiB | 14.27 MiB/s, done.
> Resolving deltas: 100% (43461/43461), done.
> error: refs/tags/2.0.9 does not point to a valid object!
> error: refs/tags/2.0.8 does not point to a valid object!
> error: refs/tags/2.0.7 does not point to a valid object!
> error: refs/tags/2.0.6 does not point to a valid object!
> error: refs/tags/2.0.5 does not point to a valid object!
> error: refs/tags/2.0.4 does not point to a valid object!
> error: refs/tags/2.0.16 does not point to a valid object!
> error: refs/tags/2.0.15 does not point to a valid object!
> error: refs/tags/2.0.14 does not point to a valid object!
> error: refs/tags/2.0.13 does not point to a valid object!
> error: refs/tags/2.0.12 does not point to a valid object!
> error: refs/tags/2.0.11 does not point to a valid object!
> error: refs/tags/2.0.10 does not point to a valid object!
> 
> Could someone please let me know what I am doing wrong in my script
> in filter-branch.

Yep, I ran into the exact same problem.  Short answer, move/remove the refs/original directory before cloning, and the issue should go away.

http://kerneltrap.org/mailarchive/git/2010/8/20/37441

There was also a proposed test case:

http://kerneltrap.org/mailarchive/git/2010/9/7/39119

HTH,
Stephen

^ permalink raw reply

* [U-Boot] [PATCH] MPC5121: Add USB EHCI support
From: Wolfgang Denk @ 2010-10-18 20:31 UTC (permalink / raw)
  To: u-boot
In-Reply-To: <1287062826-12481-1-git-send-email-wd@denx.de>

In message <1287062826-12481-1-git-send-email-wd@denx.de> I wrote:
> From: Damien Dusha <d.dusha@gmail.com>
> 
> Signed-off-by: Francesco Rendine <francesco.rendine@valueteam.com>
> Signed-off-by: Damien Dusha <d.dusha@gmail.com>
> Signed-off-by: Anatolij Gustschin <agust@denx.de>
> 
> Coding style cleanup; slight file restructuring.
> Signed-off-by: Wolfgang Denk <wd@denx.de>
> ---
>  arch/powerpc/include/asm/immap_512x.h   |    4 +
>  board/freescale/mpc5121ads/mpc5121ads.c |    4 +-
>  drivers/usb/host/Makefile               |    4 +
>  drivers/usb/host/ehci-fsl.c             |    2 +-
>  drivers/usb/host/ehci-mpc512x.c         |  159 +++++++++++++++++++++++++++++++
>  drivers/usb/host/ehci.h                 |    5 +
>  include/configs/mpc5121ads.h            |   21 ++++-
>  include/usb/ehci-fsl.h                  |  148 +++++++++++++++++++++++-----
>  8 files changed, 318 insertions(+), 29 deletions(-)
>  create mode 100644 drivers/usb/host/ehci-mpc512x.c

Applied.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
You get a wonderful view from the point of no return.
                                    - Terry Pratchett, _Making_Money_

^ permalink raw reply

* Re: [BISECTED, -next] drm/i915: blurred HDMI output
From: Arnd Bergmann @ 2010-10-18 20:30 UTC (permalink / raw)
  To: Jesse Barnes; +Cc: Jason Wessel, dri-devel
In-Reply-To: <20101018131523.19f71ca3@jbarnes-desktop>

On Monday 18 October 2010 22:15:23 Jesse Barnes wrote:
> On Mon, 18 Oct 2010 21:57:05 +0200 Arnd Bergmann <arnd@arndb.de> wrote:
> > i915 is a module with kms enabled, the blur seems to show up on the
> > text console the moment that the module gets loaded during boot.
> > Before that, the console is in VGA text mode, which is always
> > slightly blurred because the screen has a different native resolution.
> 
> Arg why would the BIOS set the panel fitting bit at all in this
> config?  Any attached outputs (VGA, HDMI) will have their own scalers...

I didn't think the BIOS was setting it. Text mode appears to be blurred
differently, but that's hard to tell...

> Obviously we need to clear it somewhere, but we should be able to avoid
> clearing it on every mode set.  We should probably shut down all panel
> related bits in intel_lvds.c if we fail to detect an LVDS output; that
> should save a little power and avoid problems like this.
> 
> Maybe the below patch which does that will help?

No luck here either.

I don't think the code path you patch here actually gets used, since
intel_lvds_init gets called by intel_setup_outputs only for mobile devices.

	Arnd

^ permalink raw reply

* Re: [PATCH net-next] vxge: make functions local and remove dead code
From: Jon Mason @ 2010-10-18 20:28 UTC (permalink / raw)
  To: Stephen Hemminger
  Cc: David Miller, netdev@vger.kernel.org, Ramkrishna Vepa,
	Sivakumar Subramani, Sreenivasa Honnur
In-Reply-To: <20101015102110.056690c6@nehalam>

On Fri, Oct 15, 2010 at 10:21:10AM -0700, Stephen Hemminger wrote:
> Use results of make namespacecheck to make functions local and
> remove code that is not used.
> 
> Also rename initialize_ethtool_ops to vxge_initialize_ethtool_ops.
> 
> Compile tested only.

These all look sane.  I have a patchset coming out soon that has some
of these changes, and I was going to make the rest of the changes
below in the following series (per your earlier e-mail).  I would
prefer to release those before applying this patch, as it touches many
things.

Thanks,
Jon

> 
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
> 
> ---
>  drivers/net/vxge/vxge-config.c  |  332 +++++++++++++++++++++++++++++-----------
>  drivers/net/vxge/vxge-config.h  |  227 ---------------------------
>  drivers/net/vxge/vxge-ethtool.c |    2
>  drivers/net/vxge/vxge-main.c    |   64 ++++---
>  drivers/net/vxge/vxge-main.h    |   59 -------
>  drivers/net/vxge/vxge-traffic.c |  101 +-----------
>  drivers/net/vxge/vxge-traffic.h |  134 ----------------
>  7 files changed, 304 insertions(+), 615 deletions(-)
> 
> --- a/drivers/net/vxge/vxge-config.c    2010-10-15 09:10:06.686399147 -0700
> +++ b/drivers/net/vxge/vxge-config.c    2010-10-15 10:15:51.420682586 -0700
> @@ -20,6 +20,179 @@
>  #include "vxge-traffic.h"
>  #include "vxge-config.h"
> 
> +static enum vxge_hw_status
> +__vxge_hw_fifo_create(
> +       struct __vxge_hw_vpath_handle *vpath_handle,
> +       struct vxge_hw_fifo_attr *attr);
> +
> +static enum vxge_hw_status
> +__vxge_hw_fifo_abort(
> +       struct __vxge_hw_fifo *fifoh);
> +
> +static enum vxge_hw_status
> +__vxge_hw_fifo_reset(
> +       struct __vxge_hw_fifo *ringh);
> +
> +static enum vxge_hw_status
> +__vxge_hw_fifo_delete(
> +       struct __vxge_hw_vpath_handle *vpath_handle);
> +
> +static struct __vxge_hw_blockpool_entry *
> +__vxge_hw_blockpool_block_allocate(struct __vxge_hw_device *hldev,
> +                       u32 size);
> +
> +static void
> +__vxge_hw_blockpool_block_free(struct __vxge_hw_device *hldev,
> +                       struct __vxge_hw_blockpool_entry *entry);
> +
> +static void vxge_hw_blockpool_block_add(struct __vxge_hw_device *devh,
> +                                       void *block_addr,
> +                                       u32 length,
> +                                       struct pci_dev *dma_h,
> +                                       struct pci_dev *acc_handle);
> +
> +static enum vxge_hw_status
> +__vxge_hw_blockpool_create(struct __vxge_hw_device *hldev,
> +                       struct __vxge_hw_blockpool  *blockpool,
> +                       u32 pool_size,
> +                       u32 pool_max);
> +
> +static void
> +__vxge_hw_blockpool_destroy(struct __vxge_hw_blockpool  *blockpool);
> +
> +static void *
> +__vxge_hw_blockpool_malloc(struct __vxge_hw_device *hldev,
> +                       u32 size,
> +                       struct vxge_hw_mempool_dma *dma_object);
> +
> +static void
> +__vxge_hw_blockpool_free(struct __vxge_hw_device *hldev,
> +                       void *memblock,
> +                       u32 size,
> +                       struct vxge_hw_mempool_dma *dma_object);
> +
> +
> +static struct __vxge_hw_channel*
> +__vxge_hw_channel_allocate(struct __vxge_hw_vpath_handle *vph,
> +                       enum __vxge_hw_channel_type type, u32 length,
> +                       u32 per_dtr_space, void *userdata);
> +
> +static void
> +__vxge_hw_channel_free(
> +       struct __vxge_hw_channel *channel);
> +
> +static enum vxge_hw_status
> +__vxge_hw_channel_initialize(
> +       struct __vxge_hw_channel *channel);
> +
> +static enum vxge_hw_status
> +__vxge_hw_channel_reset(
> +       struct __vxge_hw_channel *channel);
> +
> +static enum vxge_hw_status __vxge_hw_ring_delete(struct __vxge_hw_vpath_handle *vp);
> +
> +static enum vxge_hw_status
> +__vxge_hw_device_fifo_config_check(struct vxge_hw_fifo_config *fifo_config);
> +
> +static enum vxge_hw_status
> +__vxge_hw_device_config_check(struct vxge_hw_device_config *new_config);
> +
> +static void
> +__vxge_hw_device_id_get(struct __vxge_hw_device *hldev);
> +
> +static void
> +__vxge_hw_device_host_info_get(struct __vxge_hw_device *hldev);
> +
> +static enum vxge_hw_status
> +__vxge_hw_vpath_card_info_get(
> +       u32 vp_id,
> +       struct vxge_hw_vpath_reg __iomem *vpath_reg,
> +       struct vxge_hw_device_hw_info *hw_info);
> +
> +static enum vxge_hw_status
> +__vxge_hw_device_initialize(struct __vxge_hw_device *hldev);
> +
> +static void
> +__vxge_hw_device_pci_e_init(struct __vxge_hw_device *hldev);
> +
> +static enum vxge_hw_status
> +__vxge_hw_device_reg_addr_get(struct __vxge_hw_device *hldev);
> +
> +static enum vxge_hw_status
> +__vxge_hw_device_register_poll(
> +       void __iomem    *reg,
> +       u64 mask, u32 max_millis);
> +
> +static inline enum vxge_hw_status
> +__vxge_hw_pio_mem_write64(u64 val64, void __iomem *addr,
> +                         u64 mask, u32 max_millis)
> +{
> +       __vxge_hw_pio_mem_write32_lower((u32)vxge_bVALn(val64, 32, 32), addr);
> +       wmb();
> +
> +       __vxge_hw_pio_mem_write32_upper((u32)vxge_bVALn(val64, 0, 32), addr);
> +       wmb();
> +
> +       return  __vxge_hw_device_register_poll(addr, mask, max_millis);
> +}
> +
> +static struct vxge_hw_mempool*
> +__vxge_hw_mempool_create(struct __vxge_hw_device *devh, u32 memblock_size,
> +                        u32 item_size, u32 private_size, u32 items_initial,
> +                        u32 items_max, struct vxge_hw_mempool_cbs *mp_callback,
> +                        void *userdata);
> +static void __vxge_hw_mempool_destroy(struct vxge_hw_mempool *mempool);
> +
> +static enum vxge_hw_status
> +__vxge_hw_vpath_stats_get(struct __vxge_hw_virtualpath *vpath,
> +                         struct vxge_hw_vpath_stats_hw_info *hw_stats);
> +
> +static enum vxge_hw_status
> +vxge_hw_vpath_stats_enable(struct __vxge_hw_vpath_handle *vpath_handle);
> +
> +static enum vxge_hw_status
> +__vxge_hw_legacy_swapper_set(struct vxge_hw_legacy_reg __iomem *legacy_reg);
> +
> +static u64
> +__vxge_hw_vpath_pci_func_mode_get(u32  vp_id,
> +                                 struct vxge_hw_vpath_reg __iomem *vpath_reg);
> +
> +static u32
> +__vxge_hw_vpath_func_id_get(u32 vp_id, struct vxge_hw_vpmgmt_reg __iomem *vpmgmt_reg);
> +
> +static enum vxge_hw_status
> +__vxge_hw_vpath_addr_get(u32 vp_id, struct vxge_hw_vpath_reg __iomem *vpath_reg,
> +                        u8 (macaddr)[ETH_ALEN], u8 (macaddr_mask)[ETH_ALEN]);
> +
> +static enum vxge_hw_status
> +__vxge_hw_vpath_reset_check(struct __vxge_hw_virtualpath *vpath);
> +
> +
> +static enum vxge_hw_status
> +__vxge_hw_vpath_sw_reset(struct __vxge_hw_device *devh, u32 vp_id);
> +
> +static enum vxge_hw_status
> +__vxge_hw_vpath_fw_ver_get(u32 vp_id, struct vxge_hw_vpath_reg __iomem *vpath_reg,
> +                          struct vxge_hw_device_hw_info *hw_info);
> +
> +static enum vxge_hw_status
> +__vxge_hw_vpath_mac_configure(struct __vxge_hw_device *devh, u32 vp_id);
> +
> +static void
> +__vxge_hw_vp_terminate(struct __vxge_hw_device *devh, u32 vp_id);
> +
> +static enum vxge_hw_status
> +__vxge_hw_vpath_stats_access(struct __vxge_hw_virtualpath *vpath,
> +                            u32 operation, u32 offset, u64 *stat);
> +
> +static enum vxge_hw_status
> +__vxge_hw_vpath_xmac_tx_stats_get(struct __vxge_hw_virtualpath *vpath,
> +                                 struct vxge_hw_xmac_vpath_tx_stats *vpath_tx_stats);
> +
> +static enum vxge_hw_status
> +__vxge_hw_vpath_xmac_rx_stats_get(struct __vxge_hw_virtualpath *vpath,
> +                                 struct vxge_hw_xmac_vpath_rx_stats *vpath_rx_stats);
> +
>  /*
>   * __vxge_hw_channel_allocate - Allocate memory for channel
>   * This function allocates required memory for the channel and various arrays
> @@ -190,7 +363,7 @@ __vxge_hw_device_pci_e_init(struct __vxg
>   * Will poll certain register for specified amount of time.
>   * Will poll until masked bit is not cleared.
>   */
> -enum vxge_hw_status
> +static enum vxge_hw_status
>  __vxge_hw_device_register_poll(void __iomem *reg, u64 mask, u32 max_millis)
>  {
>         u64 val64;
> @@ -221,7 +394,7 @@ __vxge_hw_device_register_poll(void __io
>   * in progress
>   * This routine checks the vpath reset in progress register is turned zero
>   */
> -enum vxge_hw_status
> +static enum vxge_hw_status
>  __vxge_hw_device_vpath_reset_in_prog_check(u64 __iomem *vpath_rst_in_prog)
>  {
>         enum vxge_hw_status status;
> @@ -236,7 +409,7 @@ __vxge_hw_device_vpath_reset_in_prog_che
>   * This routine sets the swapper and reads the toc pointer and returns the
>   * memory mapped address of the toc
>   */
> -struct vxge_hw_toc_reg __iomem *
> +static struct vxge_hw_toc_reg __iomem *
>  __vxge_hw_device_toc_get(void __iomem *bar0)
>  {
>         u64 val64;
> @@ -779,7 +952,7 @@ exit:
>   * vxge_hw_device_xmac_aggr_stats_get - Get the Statistics on aggregate port
>   * Get the Statistics on aggregate port
>   */
> -enum vxge_hw_status
> +static enum vxge_hw_status
>  vxge_hw_device_xmac_aggr_stats_get(struct __vxge_hw_device *hldev, u32 port,
>                                    struct vxge_hw_xmac_aggr_stats *aggr_stats)
>  {
> @@ -814,7 +987,7 @@ exit:
>   * vxge_hw_device_xmac_port_stats_get - Get the Statistics on a port
>   * Get the Statistics on port
>   */
> -enum vxge_hw_status
> +static enum vxge_hw_status
>  vxge_hw_device_xmac_port_stats_get(struct __vxge_hw_device *hldev, u32 port,
>                                    struct vxge_hw_xmac_port_stats *port_stats)
>  {
> @@ -952,20 +1125,6 @@ u32 vxge_hw_device_trace_level_get(struc
>         return 0;
>  #endif
>  }
> -/*
> - * vxge_hw_device_debug_mask_get - Get the debug mask
> - * This routine returns the current debug mask set
> - */
> -u32 vxge_hw_device_debug_mask_get(struct __vxge_hw_device *hldev)
> -{
> -#if defined(VXGE_DEBUG_TRACE_MASK) || defined(VXGE_DEBUG_ERR_MASK)
> -       if (hldev == NULL)
> -               return 0;
> -       return hldev->debug_module_mask;
> -#else
> -       return 0;
> -#endif
> -}
> 
>  /*
>   * vxge_hw_getpause_data -Pause frame frame generation and reception.
> @@ -1090,7 +1249,7 @@ __vxge_hw_ring_block_next_pointer_set(u8
>   *             first block
>   * Returns the dma address of the first RxD block
>   */
> -u64 __vxge_hw_ring_first_block_address_get(struct __vxge_hw_ring *ring)
> +static u64 __vxge_hw_ring_first_block_address_get(struct __vxge_hw_ring *ring)
>  {
>         struct vxge_hw_mempool_dma *dma_object;
> 
> @@ -1252,7 +1411,7 @@ exit:
>   * This function creates Ring and initializes it.
>   *
>   */
> -enum vxge_hw_status
> +static enum vxge_hw_status
>  __vxge_hw_ring_create(struct __vxge_hw_vpath_handle *vp,
>                       struct vxge_hw_ring_attr *attr)
>  {
> @@ -1363,7 +1522,7 @@ exit:
>   * __vxge_hw_ring_abort - Returns the RxD
>   * This function terminates the RxDs of ring
>   */
> -enum vxge_hw_status __vxge_hw_ring_abort(struct __vxge_hw_ring *ring)
> +static enum vxge_hw_status __vxge_hw_ring_abort(struct __vxge_hw_ring *ring)
>  {
>         void *rxdh;
>         struct __vxge_hw_channel *channel;
> @@ -1392,7 +1551,7 @@ enum vxge_hw_status __vxge_hw_ring_abort
>   * __vxge_hw_ring_reset - Resets the ring
>   * This function resets the ring during vpath reset operation
>   */
> -enum vxge_hw_status __vxge_hw_ring_reset(struct __vxge_hw_ring *ring)
> +static enum vxge_hw_status __vxge_hw_ring_reset(struct __vxge_hw_ring *ring)
>  {
>         enum vxge_hw_status status = VXGE_HW_OK;
>         struct __vxge_hw_channel *channel;
> @@ -1419,7 +1578,7 @@ exit:
>   * __vxge_hw_ring_delete - Removes the ring
>   * This function freeup the memory pool and removes the ring
>   */
> -enum vxge_hw_status __vxge_hw_ring_delete(struct __vxge_hw_vpath_handle *vp)
> +static enum vxge_hw_status __vxge_hw_ring_delete(struct __vxge_hw_vpath_handle *vp)
>  {
>         struct __vxge_hw_ring *ring = vp->vpath->ringh;
> 
> @@ -1438,7 +1597,7 @@ enum vxge_hw_status __vxge_hw_ring_delet
>   * __vxge_hw_mempool_grow
>   * Will resize mempool up to %num_allocate value.
>   */
> -enum vxge_hw_status
> +static enum vxge_hw_status
>  __vxge_hw_mempool_grow(struct vxge_hw_mempool *mempool, u32 num_allocate,
>                        u32 *num_allocated)
>  {
> @@ -1527,7 +1686,7 @@ exit:
>   * with size enough to hold %items_initial number of items. Memory is
>   * DMA-able but client must map/unmap before interoperating with the device.
>   */
> -struct vxge_hw_mempool*
> +static struct vxge_hw_mempool*
>  __vxge_hw_mempool_create(
>         struct __vxge_hw_device *devh,
>         u32 memblock_size,
> @@ -1644,7 +1803,7 @@ exit:
>  /*
>   * vxge_hw_mempool_destroy
>   */
> -void __vxge_hw_mempool_destroy(struct vxge_hw_mempool *mempool)
> +static void __vxge_hw_mempool_destroy(struct vxge_hw_mempool *mempool)
>  {
>         u32 i, j;
>         struct __vxge_hw_device *devh = mempool->devh;
> @@ -1700,7 +1859,7 @@ __vxge_hw_device_fifo_config_check(struc
>   * __vxge_hw_device_vpath_config_check - Check vpath configuration.
>   * Check the vpath configuration
>   */
> -enum vxge_hw_status
> +static enum vxge_hw_status
>  __vxge_hw_device_vpath_config_check(struct vxge_hw_vp_config *vp_config)
>  {
>         enum vxge_hw_status status;
> @@ -1922,7 +2081,7 @@ vxge_hw_device_config_default_get(struct
>   * _hw_legacy_swapper_set - Set the swapper bits for the legacy secion.
>   * Set the swapper bits appropriately for the lagacy section.
>   */
> -enum vxge_hw_status
> +static enum vxge_hw_status
>  __vxge_hw_legacy_swapper_set(struct vxge_hw_legacy_reg __iomem *legacy_reg)
>  {
>         u64 val64;
> @@ -1977,7 +2136,7 @@ __vxge_hw_legacy_swapper_set(struct vxge
>   * __vxge_hw_vpath_swapper_set - Set the swapper bits for the vpath.
>   * Set the swapper bits appropriately for the vpath.
>   */
> -enum vxge_hw_status
> +static enum vxge_hw_status
>  __vxge_hw_vpath_swapper_set(struct vxge_hw_vpath_reg __iomem *vpath_reg)
>  {
>  #ifndef __BIG_ENDIAN
> @@ -1996,7 +2155,7 @@ __vxge_hw_vpath_swapper_set(struct vxge_
>   * __vxge_hw_kdfc_swapper_set - Set the swapper bits for the kdfc.
>   * Set the swapper bits appropriately for the vpath.
>   */
> -enum vxge_hw_status
> +static enum vxge_hw_status
>  __vxge_hw_kdfc_swapper_set(
>         struct vxge_hw_legacy_reg __iomem *legacy_reg,
>         struct vxge_hw_vpath_reg __iomem *vpath_reg)
> @@ -2021,28 +2180,6 @@ __vxge_hw_kdfc_swapper_set(
>  }
> 
>  /*
> - * vxge_hw_mgmt_device_config - Retrieve device configuration.
> - * Get device configuration. Permits to retrieve at run-time configuration
> - * values that were used to initialize and configure the device.
> - */
> -enum vxge_hw_status
> -vxge_hw_mgmt_device_config(struct __vxge_hw_device *hldev,
> -                          struct vxge_hw_device_config *dev_config, int size)
> -{
> -
> -       if ((hldev == NULL) || (hldev->magic != VXGE_HW_DEVICE_MAGIC))
> -               return VXGE_HW_ERR_INVALID_DEVICE;
> -
> -       if (size != sizeof(struct vxge_hw_device_config))
> -               return VXGE_HW_ERR_VERSION_CONFLICT;
> -
> -       memcpy(dev_config, &hldev->config,
> -               sizeof(struct vxge_hw_device_config));
> -
> -       return VXGE_HW_OK;
> -}
> -
> -/*
>   * vxge_hw_mgmt_reg_read - Read Titan register.
>   */
>  enum vxge_hw_status
> @@ -2438,7 +2575,7 @@ exit:
>   * __vxge_hw_fifo_abort - Returns the TxD
>   * This function terminates the TxDs of fifo
>   */
> -enum vxge_hw_status __vxge_hw_fifo_abort(struct __vxge_hw_fifo *fifo)
> +static enum vxge_hw_status __vxge_hw_fifo_abort(struct __vxge_hw_fifo *fifo)
>  {
>         void *txdlh;
> 
> @@ -2466,7 +2603,7 @@ enum vxge_hw_status __vxge_hw_fifo_abort
>   * __vxge_hw_fifo_reset - Resets the fifo
>   * This function resets the fifo during vpath reset operation
>   */
> -enum vxge_hw_status __vxge_hw_fifo_reset(struct __vxge_hw_fifo *fifo)
> +static enum vxge_hw_status __vxge_hw_fifo_reset(struct __vxge_hw_fifo *fifo)
>  {
>         enum vxge_hw_status status = VXGE_HW_OK;
> 
> @@ -2501,7 +2638,7 @@ enum vxge_hw_status __vxge_hw_fifo_delet
>   *                          in pci config space.
>   * Read from the vpath pci config space.
>   */
> -enum vxge_hw_status
> +static enum vxge_hw_status
>  __vxge_hw_vpath_pci_read(struct __vxge_hw_virtualpath *vpath,
>                          u32 phy_func_0, u32 offset, u32 *val)
>  {
> @@ -2542,7 +2679,7 @@ exit:
>   * __vxge_hw_vpath_func_id_get - Get the function id of the vpath.
>   * Returns the function number of the vpath.
>   */
> -u32
> +static u32
>  __vxge_hw_vpath_func_id_get(u32 vp_id,
>         struct vxge_hw_vpmgmt_reg __iomem *vpmgmt_reg)
>  {
> @@ -2573,7 +2710,7 @@ __vxge_hw_read_rts_ds(struct vxge_hw_vpa
>   * __vxge_hw_vpath_card_info_get - Get the serial numbers,
>   * part number and product description.
>   */
> -enum vxge_hw_status
> +static enum vxge_hw_status
>  __vxge_hw_vpath_card_info_get(
>         u32 vp_id,
>         struct vxge_hw_vpath_reg __iomem *vpath_reg,
> @@ -2695,7 +2832,7 @@ __vxge_hw_vpath_card_info_get(
>   * __vxge_hw_vpath_fw_ver_get - Get the fw version
>   * Returns FW Version
>   */
> -enum vxge_hw_status
> +static enum vxge_hw_status
>  __vxge_hw_vpath_fw_ver_get(
>         u32 vp_id,
>         struct vxge_hw_vpath_reg __iomem *vpath_reg,
> @@ -2789,7 +2926,7 @@ exit:
>   * __vxge_hw_vpath_pci_func_mode_get - Get the pci mode
>   * Returns pci function mode
>   */
> -u64
> +static u64
>  __vxge_hw_vpath_pci_func_mode_get(
>         u32  vp_id,
>         struct vxge_hw_vpath_reg __iomem *vpath_reg)
> @@ -2995,7 +3132,7 @@ exit:
>   * __vxge_hw_vpath_addr_get - Get the hw address entry for this vpath
>   *               from MAC address table.
>   */
> -enum vxge_hw_status
> +static enum vxge_hw_status
>  __vxge_hw_vpath_addr_get(
>         u32 vp_id, struct vxge_hw_vpath_reg __iomem *vpath_reg,
>         u8 (macaddr)[ETH_ALEN], u8 (macaddr_mask)[ETH_ALEN])
> @@ -3347,7 +3484,7 @@ __vxge_hw_vpath_mgmt_read(
>   * This routine checks the vpath_rst_in_prog register to see if
>   * adapter completed the reset process for the vpath
>   */
> -enum vxge_hw_status
> +static enum vxge_hw_status
>  __vxge_hw_vpath_reset_check(struct __vxge_hw_virtualpath *vpath)
>  {
>         enum vxge_hw_status status;
> @@ -3365,7 +3502,7 @@ __vxge_hw_vpath_reset_check(struct __vxg
>   * __vxge_hw_vpath_reset
>   * This routine resets the vpath on the device
>   */
> -enum vxge_hw_status
> +static enum vxge_hw_status
>  __vxge_hw_vpath_reset(struct __vxge_hw_device *hldev, u32 vp_id)
>  {
>         u64 val64;
> @@ -3383,7 +3520,7 @@ __vxge_hw_vpath_reset(struct __vxge_hw_d
>   * __vxge_hw_vpath_sw_reset
>   * This routine resets the vpath structures
>   */
> -enum vxge_hw_status
> +static enum vxge_hw_status
>  __vxge_hw_vpath_sw_reset(struct __vxge_hw_device *hldev, u32 vp_id)
>  {
>         enum vxge_hw_status status = VXGE_HW_OK;
> @@ -3408,7 +3545,7 @@ exit:
>   * This routine configures the prc registers of virtual path using the config
>   * passed
>   */
> -void
> +static void
>  __vxge_hw_vpath_prc_configure(struct __vxge_hw_device *hldev, u32 vp_id)
>  {
>         u64 val64;
> @@ -3480,7 +3617,7 @@ __vxge_hw_vpath_prc_configure(struct __v
>   * This routine configures the kdfc registers of virtual path using the
>   * config passed
>   */
> -enum vxge_hw_status
> +static enum vxge_hw_status
>  __vxge_hw_vpath_kdfc_configure(struct __vxge_hw_device *hldev, u32 vp_id)
>  {
>         u64 val64;
> @@ -3553,7 +3690,7 @@ exit:
>   * __vxge_hw_vpath_mac_configure
>   * This routine configures the mac of virtual path using the config passed
>   */
> -enum vxge_hw_status
> +static enum vxge_hw_status
>  __vxge_hw_vpath_mac_configure(struct __vxge_hw_device *hldev, u32 vp_id)
>  {
>         u64 val64;
> @@ -3621,7 +3758,7 @@ __vxge_hw_vpath_mac_configure(struct __v
>   * This routine configures the tim registers of virtual path using the config
>   * passed
>   */
> -enum vxge_hw_status
> +static enum vxge_hw_status
>  __vxge_hw_vpath_tim_configure(struct __vxge_hw_device *hldev, u32 vp_id)
>  {
>         u64 val64;
> @@ -3897,7 +4034,7 @@ vxge_hw_vpath_tti_ci_set(struct __vxge_h
>   * This routine is the final phase of init which initializes the
>   * registers of the vpath using the configuration passed.
>   */
> -enum vxge_hw_status
> +static enum vxge_hw_status
>  __vxge_hw_vpath_initialize(struct __vxge_hw_device *hldev, u32 vp_id)
>  {
>         u64 val64;
> @@ -3966,7 +4103,7 @@ exit:
>   * This routine is the initial phase of init which resets the vpath and
>   * initializes the software support structures.
>   */
> -enum vxge_hw_status
> +static enum vxge_hw_status
>  __vxge_hw_vp_initialize(struct __vxge_hw_device *hldev, u32 vp_id,
>                         struct vxge_hw_vp_config *config)
>  {
> @@ -4022,7 +4159,7 @@ exit:
>   * __vxge_hw_vp_terminate - Terminate Virtual Path structure
>   * This routine closes all channels it opened and freeup memory
>   */
> -void
> +static void
>  __vxge_hw_vp_terminate(struct __vxge_hw_device *hldev, u32 vp_id)
>  {
>         struct __vxge_hw_virtualpath *vpath;
> @@ -4384,7 +4521,7 @@ vxge_hw_vpath_enable(struct __vxge_hw_vp
>   * Enable the DMA vpath statistics. The function is to be called to re-enable
>   * the adapter to update stats into the host memory
>   */
> -enum vxge_hw_status
> +static enum vxge_hw_status
>  vxge_hw_vpath_stats_enable(struct __vxge_hw_vpath_handle *vp)
>  {
>         enum vxge_hw_status status = VXGE_HW_OK;
> @@ -4409,7 +4546,7 @@ exit:
>   * __vxge_hw_vpath_stats_access - Get the statistics from the given location
>   *                           and offset and perform an operation
>   */
> -enum vxge_hw_status
> +static enum vxge_hw_status
>  __vxge_hw_vpath_stats_access(struct __vxge_hw_virtualpath *vpath,
>                              u32 operation, u32 offset, u64 *stat)
>  {
> @@ -4445,7 +4582,7 @@ vpath_stats_access_exit:
>  /*
>   * __vxge_hw_vpath_xmac_tx_stats_get - Get the TX Statistics of a vpath
>   */
> -enum vxge_hw_status
> +static enum vxge_hw_status
>  __vxge_hw_vpath_xmac_tx_stats_get(
>         struct __vxge_hw_virtualpath *vpath,
>         struct vxge_hw_xmac_vpath_tx_stats *vpath_tx_stats)
> @@ -4478,9 +4615,9 @@ exit:
>  /*
>   * __vxge_hw_vpath_xmac_rx_stats_get - Get the RX Statistics of a vpath
>   */
> -enum vxge_hw_status
> +static enum vxge_hw_status
>  __vxge_hw_vpath_xmac_rx_stats_get(struct __vxge_hw_virtualpath *vpath,
> -                       struct vxge_hw_xmac_vpath_rx_stats *vpath_rx_stats)
> +                                 struct vxge_hw_xmac_vpath_rx_stats *vpath_rx_stats)
>  {
>         u64 *val64;
>         enum vxge_hw_status status = VXGE_HW_OK;
> @@ -4509,9 +4646,9 @@ exit:
>  /*
>   * __vxge_hw_vpath_stats_get - Get the vpath hw statistics.
>   */
> -enum vxge_hw_status __vxge_hw_vpath_stats_get(
> -                       struct __vxge_hw_virtualpath *vpath,
> -                       struct vxge_hw_vpath_stats_hw_info *hw_stats)
> +static enum vxge_hw_status
> +__vxge_hw_vpath_stats_get(struct __vxge_hw_virtualpath *vpath,
> +                         struct vxge_hw_vpath_stats_hw_info *hw_stats)
>  {
>         u64 val64;
>         enum vxge_hw_status status = VXGE_HW_OK;
> @@ -4643,6 +4780,32 @@ exit:
>         return status;
>  }
> 
> +
> +static void vxge_os_dma_malloc_async(struct pci_dev *pdev, void *devh,
> +                                       unsigned long size)
> +{
> +       gfp_t flags;
> +       void *vaddr;
> +
> +       if (in_interrupt())
> +               flags = GFP_ATOMIC | GFP_DMA;
> +       else
> +               flags = GFP_KERNEL | GFP_DMA;
> +
> +       vaddr = kmalloc((size), flags);
> +
> +       vxge_hw_blockpool_block_add(devh, vaddr, size, pdev, pdev);
> +}
> +
> +static void vxge_os_dma_free(struct pci_dev *pdev, const void *vaddr,
> +                            struct pci_dev **p_dma_acch)
> +{
> +       unsigned long misaligned = *(unsigned long *)p_dma_acch;
> +       u8 *tmp = (u8 *)vaddr;
> +       tmp -= misaligned;
> +       kfree((void *)tmp);
> +}
> +
>  /*
>   * __vxge_hw_blockpool_create - Create block pool
>   */
> @@ -4845,12 +5008,11 @@ void __vxge_hw_blockpool_blocks_remove(s
>   * vxge_hw_blockpool_block_add - callback for vxge_os_dma_malloc_async
>   * Adds a block to block pool
>   */
> -void vxge_hw_blockpool_block_add(
> -                       struct __vxge_hw_device *devh,
> -                       void *block_addr,
> -                       u32 length,
> -                       struct pci_dev *dma_h,
> -                       struct pci_dev *acc_handle)
> +static void vxge_hw_blockpool_block_add(struct __vxge_hw_device *devh,
> +                                       void *block_addr,
> +                                       u32 length,
> +                                       struct pci_dev *dma_h,
> +                                       struct pci_dev *acc_handle)
>  {
>         struct __vxge_hw_blockpool  *blockpool;
>         struct __vxge_hw_blockpool_entry  *entry = NULL;
> --- a/drivers/net/vxge/vxge-config.h    2010-10-15 09:10:06.766402819 -0700
> +++ b/drivers/net/vxge/vxge-config.h    2010-10-15 10:14:19.925408165 -0700
> @@ -183,11 +183,6 @@ struct vxge_hw_device_version {
>         char    version[VXGE_HW_FW_STRLEN];
>  };
> 
> -u64
> -__vxge_hw_vpath_pci_func_mode_get(
> -       u32 vp_id,
> -       struct vxge_hw_vpath_reg __iomem *vpath_reg);
> -
>  /**
>   * struct vxge_hw_fifo_config - Configuration of fifo.
>   * @enable: Is this fifo to be commissioned
> @@ -1426,9 +1421,6 @@ struct vxge_hw_rth_hash_types {
>         u8 hash_type_ipv6ex_en;
>  };
> 
> -u32
> -vxge_hw_device_debug_mask_get(struct __vxge_hw_device *devh);
> -
>  void vxge_hw_device_debug_set(
>         struct __vxge_hw_device *devh,
>         enum vxge_debug_level level,
> @@ -1440,9 +1432,6 @@ vxge_hw_device_error_level_get(struct __
>  u32
>  vxge_hw_device_trace_level_get(struct __vxge_hw_device *devh);
> 
> -u32
> -vxge_hw_device_debug_mask_get(struct __vxge_hw_device *devh);
> -
>  /**
>   * vxge_hw_ring_rxd_size_get   - Get the size of ring descriptor.
>   * @buf_mode: Buffer mode (1, 3 or 5)
> @@ -1817,60 +1806,10 @@ struct vxge_hw_vpath_attr {
>         struct vxge_hw_fifo_attr        fifo_attr;
>  };
> 
> -enum vxge_hw_status
> -__vxge_hw_blockpool_create(struct __vxge_hw_device *hldev,
> -                       struct __vxge_hw_blockpool  *blockpool,
> -                       u32 pool_size,
> -                       u32 pool_max);
> -
> -void
> -__vxge_hw_blockpool_destroy(struct __vxge_hw_blockpool  *blockpool);
> -
> -struct __vxge_hw_blockpool_entry *
> -__vxge_hw_blockpool_block_allocate(struct __vxge_hw_device *hldev,
> -                       u32 size);
> -
> -void
> -__vxge_hw_blockpool_block_free(struct __vxge_hw_device *hldev,
> -                       struct __vxge_hw_blockpool_entry *entry);
> -
> -void *
> -__vxge_hw_blockpool_malloc(struct __vxge_hw_device *hldev,
> -                       u32 size,
> -                       struct vxge_hw_mempool_dma *dma_object);
> -
> -void
> -__vxge_hw_blockpool_free(struct __vxge_hw_device *hldev,
> -                       void *memblock,
> -                       u32 size,
> -                       struct vxge_hw_mempool_dma *dma_object);
> -
> -enum vxge_hw_status
> -__vxge_hw_device_fifo_config_check(struct vxge_hw_fifo_config *fifo_config);
> -
> -enum vxge_hw_status
> -__vxge_hw_device_config_check(struct vxge_hw_device_config *new_config);
> -
> -enum vxge_hw_status
> -vxge_hw_mgmt_device_config(struct __vxge_hw_device *devh,
> -               struct vxge_hw_device_config    *dev_config, int size);
> -
>  enum vxge_hw_status __devinit vxge_hw_device_hw_info_get(
>         void __iomem *bar0,
>         struct vxge_hw_device_hw_info *hw_info);
> 
> -enum vxge_hw_status
> -__vxge_hw_vpath_fw_ver_get(
> -       u32     vp_id,
> -       struct vxge_hw_vpath_reg __iomem *vpath_reg,
> -       struct vxge_hw_device_hw_info *hw_info);
> -
> -enum vxge_hw_status
> -__vxge_hw_vpath_card_info_get(
> -       u32 vp_id,
> -       struct vxge_hw_vpath_reg __iomem *vpath_reg,
> -       struct vxge_hw_device_hw_info *hw_info);
> -
>  enum vxge_hw_status __devinit vxge_hw_device_config_default_get(
>         struct vxge_hw_device_config *device_config);
> 
> @@ -1954,38 +1893,6 @@ out:
>         return vaddr;
>  }
> 
> -extern void vxge_hw_blockpool_block_add(
> -                       struct __vxge_hw_device *devh,
> -                       void *block_addr,
> -                       u32 length,
> -                       struct pci_dev *dma_h,
> -                       struct pci_dev *acc_handle);
> -
> -static inline void vxge_os_dma_malloc_async(struct pci_dev *pdev, void *devh,
> -                                       unsigned long size)
> -{
> -       gfp_t flags;
> -       void *vaddr;
> -
> -       if (in_interrupt())
> -               flags = GFP_ATOMIC | GFP_DMA;
> -       else
> -               flags = GFP_KERNEL | GFP_DMA;
> -
> -       vaddr = kmalloc((size), flags);
> -
> -       vxge_hw_blockpool_block_add(devh, vaddr, size, pdev, pdev);
> -}
> -
> -static inline void vxge_os_dma_free(struct pci_dev *pdev, const void *vaddr,
> -                       struct pci_dev **p_dma_acch)
> -{
> -       unsigned long misaligned = *(unsigned long *)p_dma_acch;
> -       u8 *tmp = (u8 *)vaddr;
> -       tmp -= misaligned;
> -       kfree((void *)tmp);
> -}
> -
>  /*
>   * __vxge_hw_mempool_item_priv - will return pointer on per item private space
>   */
> @@ -2010,40 +1917,6 @@ __vxge_hw_mempool_item_priv(
>                             (*memblock_item_idx) * mempool->items_priv_size;
>  }
> 
> -enum vxge_hw_status
> -__vxge_hw_mempool_grow(
> -       struct vxge_hw_mempool *mempool,
> -       u32 num_allocate,
> -       u32 *num_allocated);
> -
> -struct vxge_hw_mempool*
> -__vxge_hw_mempool_create(
> -       struct __vxge_hw_device *devh,
> -       u32 memblock_size,
> -       u32 item_size,
> -       u32 private_size,
> -       u32 items_initial,
> -       u32 items_max,
> -       struct vxge_hw_mempool_cbs *mp_callback,
> -       void *userdata);
> -
> -struct __vxge_hw_channel*
> -__vxge_hw_channel_allocate(struct __vxge_hw_vpath_handle *vph,
> -                       enum __vxge_hw_channel_type type, u32 length,
> -                       u32 per_dtr_space, void *userdata);
> -
> -void
> -__vxge_hw_channel_free(
> -       struct __vxge_hw_channel *channel);
> -
> -enum vxge_hw_status
> -__vxge_hw_channel_initialize(
> -       struct __vxge_hw_channel *channel);
> -
> -enum vxge_hw_status
> -__vxge_hw_channel_reset(
> -       struct __vxge_hw_channel *channel);
> -
>  /*
>   * __vxge_hw_fifo_txdl_priv - Return the max fragments allocated
>   * for the fifo.
> @@ -2065,9 +1938,6 @@ enum vxge_hw_status vxge_hw_vpath_open(
>         struct vxge_hw_vpath_attr *attr,
>         struct __vxge_hw_vpath_handle **vpath_handle);
> 
> -enum vxge_hw_status
> -__vxge_hw_device_vpath_reset_in_prog_check(u64 __iomem *vpath_rst_in_prog);
> -
>  enum vxge_hw_status vxge_hw_vpath_close(
>         struct __vxge_hw_vpath_handle *vpath_handle);
> 
> @@ -2089,54 +1959,9 @@ enum vxge_hw_status vxge_hw_vpath_mtu_se
>         struct __vxge_hw_vpath_handle *vpath_handle,
>         u32 new_mtu);
> 
> -enum vxge_hw_status vxge_hw_vpath_stats_enable(
> -       struct __vxge_hw_vpath_handle *vpath_handle);
> -
> -enum vxge_hw_status
> -__vxge_hw_vpath_stats_access(
> -       struct __vxge_hw_virtualpath    *vpath,
> -       u32                     operation,
> -       u32                     offset,
> -       u64                     *stat);
> -
> -enum vxge_hw_status
> -__vxge_hw_vpath_xmac_tx_stats_get(
> -       struct __vxge_hw_virtualpath    *vpath,
> -       struct vxge_hw_xmac_vpath_tx_stats *vpath_tx_stats);
> -
> -enum vxge_hw_status
> -__vxge_hw_vpath_xmac_rx_stats_get(
> -       struct __vxge_hw_virtualpath    *vpath,
> -       struct vxge_hw_xmac_vpath_rx_stats *vpath_rx_stats);
> -
> -enum vxge_hw_status
> -__vxge_hw_vpath_stats_get(
> -       struct __vxge_hw_virtualpath *vpath,
> -       struct vxge_hw_vpath_stats_hw_info *hw_stats);
> -
>  void
>  vxge_hw_vpath_rx_doorbell_init(struct __vxge_hw_vpath_handle *vp);
> 
> -enum vxge_hw_status
> -__vxge_hw_device_vpath_config_check(struct vxge_hw_vp_config *vp_config);
> -
> -void
> -__vxge_hw_device_pci_e_init(struct __vxge_hw_device *hldev);
> -
> -enum vxge_hw_status
> -__vxge_hw_legacy_swapper_set(struct vxge_hw_legacy_reg __iomem *legacy_reg);
> -
> -enum vxge_hw_status
> -__vxge_hw_vpath_swapper_set(struct vxge_hw_vpath_reg __iomem *vpath_reg);
> -
> -enum vxge_hw_status
> -__vxge_hw_kdfc_swapper_set(struct vxge_hw_legacy_reg __iomem *legacy_reg,
> -       struct vxge_hw_vpath_reg __iomem *vpath_reg);
> -
> -enum vxge_hw_status
> -__vxge_hw_device_register_poll(
> -       void __iomem    *reg,
> -       u64 mask, u32 max_millis);
> 
>  #ifndef readq
>  static inline u64 readq(void __iomem *addr)
> @@ -2168,62 +1993,12 @@ static inline void __vxge_hw_pio_mem_wri
>         writel(val, addr);
>  }
> 
> -static inline enum vxge_hw_status
> -__vxge_hw_pio_mem_write64(u64 val64, void __iomem *addr,
> -                         u64 mask, u32 max_millis)
> -{
> -       enum vxge_hw_status status = VXGE_HW_OK;
> -
> -       __vxge_hw_pio_mem_write32_lower((u32)vxge_bVALn(val64, 32, 32), addr);
> -       wmb();
> -       __vxge_hw_pio_mem_write32_upper((u32)vxge_bVALn(val64, 0, 32), addr);
> -       wmb();
> -
> -       status = __vxge_hw_device_register_poll(addr, mask, max_millis);
> -       return status;
> -}
> -
> -struct vxge_hw_toc_reg __iomem *
> -__vxge_hw_device_toc_get(void __iomem *bar0);
> -
> -enum vxge_hw_status
> -__vxge_hw_device_reg_addr_get(struct __vxge_hw_device *hldev);
> -
> -void
> -__vxge_hw_device_id_get(struct __vxge_hw_device *hldev);
> -
> -void
> -__vxge_hw_device_host_info_get(struct __vxge_hw_device *hldev);
> -
>  enum vxge_hw_status
>  vxge_hw_device_flick_link_led(struct __vxge_hw_device *devh, u64 on_off);
> 
>  enum vxge_hw_status
> -__vxge_hw_device_initialize(struct __vxge_hw_device *hldev);
> -
> -enum vxge_hw_status
> -__vxge_hw_vpath_pci_read(
> -       struct __vxge_hw_virtualpath    *vpath,
> -       u32                     phy_func_0,
> -       u32                     offset,
> -       u32                     *val);
> -
> -enum vxge_hw_status
> -__vxge_hw_vpath_addr_get(
> -       u32 vp_id,
> -       struct vxge_hw_vpath_reg __iomem *vpath_reg,
> -       u8 (macaddr)[ETH_ALEN],
> -       u8 (macaddr_mask)[ETH_ALEN]);
> -
> -u32
> -__vxge_hw_vpath_func_id_get(
> -       u32 vp_id, struct vxge_hw_vpmgmt_reg __iomem *vpmgmt_reg);
> -
> -enum vxge_hw_status
> -__vxge_hw_vpath_reset_check(struct __vxge_hw_virtualpath *vpath);
> -
> -enum vxge_hw_status
>  vxge_hw_vpath_strip_fcs_check(struct __vxge_hw_device *hldev, u64 vpath_mask);
> +
>  /**
>   * vxge_debug
>   * @level: level of debug verbosity.
> --- a/drivers/net/vxge/vxge-main.c      2010-10-15 09:10:06.734401351 -0700
> +++ b/drivers/net/vxge/vxge-main.c      2010-10-15 10:13:44.000142249 -0700
> @@ -82,6 +82,16 @@ module_param_array(bw_percentage, uint,
> 
>  static struct vxge_drv_config *driver_config;
> 
> +static enum vxge_hw_status vxge_add_mac_addr(struct vxgedev *vdev,
> +                                            struct macInfo *mac);
> +static enum vxge_hw_status vxge_del_mac_addr(struct vxgedev *vdev,
> +                                            struct macInfo *mac);
> +static int vxge_mac_list_add(struct vxge_vpath *vpath, struct macInfo *mac);
> +static int vxge_mac_list_del(struct vxge_vpath *vpath, struct macInfo *mac);
> +static enum vxge_hw_status vxge_restore_vpath_vid_table(struct vxge_vpath *vpath);
> +static enum vxge_hw_status vxge_restore_vpath_mac_addr(struct vxge_vpath *vpath);
> +static enum vxge_hw_status vxge_reset_all_vpaths(struct vxgedev *vdev);
> +
>  static inline int is_vxge_card_up(struct vxgedev *vdev)
>  {
>         return test_bit(__VXGE_STATE_CARD_UP, &vdev->state);
> @@ -138,7 +148,7 @@ static inline void VXGE_COMPLETE_ALL_RX(
>   * This function is called during interrupt context to notify link up state
>   * change.
>   */
> -void
> +static void
>  vxge_callback_link_up(struct __vxge_hw_device *hldev)
>  {
>         struct net_device *dev = hldev->ndev;
> @@ -162,7 +172,7 @@ vxge_callback_link_up(struct __vxge_hw_d
>   * This function is called during interrupt context to notify link down state
>   * change.
>   */
> -void
> +static void
>  vxge_callback_link_down(struct __vxge_hw_device *hldev)
>  {
>         struct net_device *dev = hldev->ndev;
> @@ -354,7 +364,7 @@ static inline void vxge_post(int *dtr_cn
>   * If the interrupt is because of a received frame or if the receive ring
>   * contains fresh as yet un-processed frames, this function is called.
>   */
> -enum vxge_hw_status
> +static enum vxge_hw_status
>  vxge_rx_1b_compl(struct __vxge_hw_ring *ringh, void *dtr,
>                  u8 t_code, void *userdata)
>  {
> @@ -531,7 +541,7 @@ vxge_rx_1b_compl(struct __vxge_hw_ring *
>   * freed and frees all skbs whose data have already DMA'ed into the NICs
>   * internal memory.
>   */
> -enum vxge_hw_status
> +static enum vxge_hw_status
>  vxge_xmit_compl(struct __vxge_hw_fifo *fifo_hw, void *dtr,
>                 enum vxge_hw_fifo_tcode t_code, void *userdata,
>                 struct sk_buff ***skb_ptr, int nr_skb, int *more)
> @@ -1246,7 +1256,7 @@ static int vxge_set_mac_addr(struct net_
>   *
>   * Enables the interrupts for the vpath
>  */
> -void vxge_vpath_intr_enable(struct vxgedev *vdev, int vp_id)
> +static void vxge_vpath_intr_enable(struct vxgedev *vdev, int vp_id)
>  {
>         struct vxge_vpath *vpath = &vdev->vpaths[vp_id];
>         int msix_id = 0;
> @@ -1279,7 +1289,7 @@ void vxge_vpath_intr_enable(struct vxged
>   *
>   * Disables the interrupts for the vpath
>  */
> -void vxge_vpath_intr_disable(struct vxgedev *vdev, int vp_id)
> +static void vxge_vpath_intr_disable(struct vxgedev *vdev, int vp_id)
>  {
>         struct vxge_vpath *vpath = &vdev->vpaths[vp_id];
>         int msix_id;
> @@ -1553,7 +1563,7 @@ out:
>   *
>   * driver may reset the chip on events of serr, eccerr, etc
>   */
> -int vxge_reset(struct vxgedev *vdev)
> +static int vxge_reset(struct vxgedev *vdev)
>  {
>         return do_vxge_reset(vdev, VXGE_LL_FULL_RESET);
>  }
> @@ -1724,7 +1734,7 @@ static enum vxge_hw_status vxge_rth_conf
>         return status;
>  }
> 
> -int vxge_mac_list_add(struct vxge_vpath *vpath, struct macInfo *mac)
> +static int vxge_mac_list_add(struct vxge_vpath *vpath, struct macInfo *mac)
>  {
>         struct vxge_mac_addrs *new_mac_entry;
>         u8 *mac_address = NULL;
> @@ -1757,7 +1767,8 @@ int vxge_mac_list_add(struct vxge_vpath
>  }
> 
>  /* Add a mac address to DA table */
> -enum vxge_hw_status vxge_add_mac_addr(struct vxgedev *vdev, struct macInfo *mac)
> +static enum vxge_hw_status vxge_add_mac_addr(struct vxgedev *vdev,
> +                                            struct macInfo *mac)
>  {
>         enum vxge_hw_status status = VXGE_HW_OK;
>         struct vxge_vpath *vpath;
> @@ -1782,7 +1793,7 @@ enum vxge_hw_status vxge_add_mac_addr(st
>         return status;
>  }
> 
> -int vxge_mac_list_del(struct vxge_vpath *vpath, struct macInfo *mac)
> +static int vxge_mac_list_del(struct vxge_vpath *vpath, struct macInfo *mac)
>  {
>         struct list_head *entry, *next;
>         u64 del_mac = 0;
> @@ -1807,7 +1818,8 @@ int vxge_mac_list_del(struct vxge_vpath
>         return FALSE;
>  }
>  /* delete a mac address from DA table */
> -enum vxge_hw_status vxge_del_mac_addr(struct vxgedev *vdev, struct macInfo *mac)
> +static enum vxge_hw_status vxge_del_mac_addr(struct vxgedev *vdev,
> +                                            struct macInfo *mac)
>  {
>         enum vxge_hw_status status = VXGE_HW_OK;
>         struct vxge_vpath *vpath;
> @@ -1854,7 +1866,7 @@ static vxge_search_mac_addr_in_da_table(
>  }
> 
>  /* Store all vlan ids from the list to the vid table */
> -enum vxge_hw_status vxge_restore_vpath_vid_table(struct vxge_vpath *vpath)
> +static enum vxge_hw_status vxge_restore_vpath_vid_table(struct vxge_vpath *vpath)
>  {
>         enum vxge_hw_status status = VXGE_HW_OK;
>         struct vxgedev *vdev = vpath->vdev;
> @@ -1874,7 +1886,7 @@ enum vxge_hw_status vxge_restore_vpath_v
>  }
> 
>  /* Store all mac addresses from the list to the DA table */
> -enum vxge_hw_status vxge_restore_vpath_mac_addr(struct vxge_vpath *vpath)
> +static enum vxge_hw_status vxge_restore_vpath_mac_addr(struct vxge_vpath *vpath)
>  {
>         enum vxge_hw_status status = VXGE_HW_OK;
>         struct macInfo mac_info;
> @@ -1916,7 +1928,7 @@ enum vxge_hw_status vxge_restore_vpath_m
>  }
> 
>  /* reset vpaths */
> -enum vxge_hw_status vxge_reset_all_vpaths(struct vxgedev *vdev)
> +static enum vxge_hw_status vxge_reset_all_vpaths(struct vxgedev *vdev)
>  {
>         enum vxge_hw_status status = VXGE_HW_OK;
>         struct vxge_vpath *vpath;
> @@ -1948,7 +1960,7 @@ enum vxge_hw_status vxge_reset_all_vpath
>  }
> 
>  /* close vpaths */
> -void vxge_close_vpaths(struct vxgedev *vdev, int index)
> +static void vxge_close_vpaths(struct vxgedev *vdev, int index)
>  {
>         struct vxge_vpath *vpath;
>         int i;
> @@ -1966,7 +1978,7 @@ void vxge_close_vpaths(struct vxgedev *v
>  }
> 
>  /* open vpaths */
> -int vxge_open_vpaths(struct vxgedev *vdev)
> +static int vxge_open_vpaths(struct vxgedev *vdev)
>  {
>         struct vxge_hw_vpath_attr attr;
>         enum vxge_hw_status status;
> @@ -2517,7 +2529,7 @@ static void vxge_poll_vp_lockup(unsigned
>   * Return value: '0' on success and an appropriate (-)ve integer as
>   * defined in errno.h file on failure.
>   */
> -int
> +static int
>  vxge_open(struct net_device *dev)
>  {
>         enum vxge_hw_status status;
> @@ -2721,7 +2733,7 @@ out0:
>  }
> 
>  /* Loop throught the mac address list and delete all the entries */
> -void vxge_free_mac_add_list(struct vxge_vpath *vpath)
> +static void vxge_free_mac_add_list(struct vxge_vpath *vpath)
>  {
> 
>         struct list_head *entry, *next;
> @@ -2745,7 +2757,7 @@ static void vxge_napi_del_all(struct vxg
>         }
>  }
> 
> -int do_vxge_close(struct net_device *dev, int do_io)
> +static int do_vxge_close(struct net_device *dev, int do_io)
>  {
>         enum vxge_hw_status status;
>         struct vxgedev *vdev;
> @@ -2856,7 +2868,7 @@ int do_vxge_close(struct net_device *dev
>   * Return value: '0' on success and an appropriate (-)ve integer as
>   * defined in errno.h file on failure.
>   */
> -int
> +static int
>  vxge_close(struct net_device *dev)
>  {
>         do_vxge_close(dev, 1);
> @@ -3113,10 +3125,10 @@ static const struct net_device_ops vxge_
>  #endif
>  };
> 
> -int __devinit vxge_device_register(struct __vxge_hw_device *hldev,
> -                                  struct vxge_config *config,
> -                                  int high_dma, int no_of_vpath,
> -                                  struct vxgedev **vdev_out)
> +static int __devinit vxge_device_register(struct __vxge_hw_device *hldev,
> +                                         struct vxge_config *config,
> +                                         int high_dma, int no_of_vpath,
> +                                         struct vxgedev **vdev_out)
>  {
>         struct net_device *ndev;
>         enum vxge_hw_status status = VXGE_HW_OK;
> @@ -3164,7 +3176,7 @@ int __devinit vxge_device_register(struc
> 
>         ndev->watchdog_timeo = VXGE_LL_WATCH_DOG_TIMEOUT;
> 
> -       initialize_ethtool_ops(ndev);
> +       vxge_initialize_ethtool_ops(ndev);
> 
>         /* Allocate memory for vpath */
>         vdev->vpaths = kzalloc((sizeof(struct vxge_vpath)) *
> @@ -3249,7 +3261,7 @@ _out0:
>   *
>   * This function will unregister and free network device
>   */
> -void
> +static void
>  vxge_device_unregister(struct __vxge_hw_device *hldev)
>  {
>         struct vxgedev *vdev;
> --- a/drivers/net/vxge/vxge-main.h      2010-10-15 09:10:06.802404471 -0700
> +++ b/drivers/net/vxge/vxge-main.h      2010-10-15 10:13:51.232396166 -0700
> @@ -396,64 +396,7 @@ struct vxge_tx_priv {
>                 mod_timer(&timer, (jiffies + exp)); \
>         } while (0);
> 
> -int __devinit vxge_device_register(struct __vxge_hw_device *devh,
> -                                   struct vxge_config *config,
> -                                   int high_dma, int no_of_vpath,
> -                                   struct vxgedev **vdev);
> -
> -void vxge_device_unregister(struct __vxge_hw_device *devh);
> -
> -void vxge_vpath_intr_enable(struct vxgedev *vdev, int vp_id);
> -
> -void vxge_vpath_intr_disable(struct vxgedev *vdev, int vp_id);
> -
> -void vxge_callback_link_up(struct __vxge_hw_device *devh);
> -
> -void vxge_callback_link_down(struct __vxge_hw_device *devh);
> -
> -enum vxge_hw_status vxge_add_mac_addr(struct vxgedev *vdev,
> -       struct macInfo *mac);
> -
> -int vxge_mac_list_del(struct vxge_vpath *vpath, struct macInfo *mac);
> -
> -int vxge_reset(struct vxgedev *vdev);
> -
> -enum vxge_hw_status
> -vxge_rx_1b_compl(struct __vxge_hw_ring *ringh, void *dtr,
> -       u8 t_code, void *userdata);
> -
> -enum vxge_hw_status
> -vxge_xmit_compl(struct __vxge_hw_fifo *fifo_hw, void *dtr,
> -       enum vxge_hw_fifo_tcode t_code, void *userdata,
> -       struct sk_buff ***skb_ptr, int nr_skbs, int *more);
> -
> -int vxge_close(struct net_device *dev);
> -
> -int vxge_open(struct net_device *dev);
> -
> -void vxge_close_vpaths(struct vxgedev *vdev, int index);
> -
> -int vxge_open_vpaths(struct vxgedev *vdev);
> -
> -enum vxge_hw_status vxge_reset_all_vpaths(struct vxgedev *vdev);
> -
> -enum vxge_hw_status vxge_add_mac_addr(struct vxgedev *vdev,
> -       struct macInfo *mac);
> -
> -enum vxge_hw_status vxge_del_mac_addr(struct vxgedev *vdev,
> -       struct macInfo *mac);
> -
> -int vxge_mac_list_add(struct vxge_vpath *vpath,
> -       struct macInfo *mac);
> -
> -void vxge_free_mac_add_list(struct vxge_vpath *vpath);
> -
> -enum vxge_hw_status vxge_restore_vpath_mac_addr(struct vxge_vpath *vpath);
> -
> -enum vxge_hw_status vxge_restore_vpath_vid_table(struct vxge_vpath *vpath);
> -
> -int do_vxge_close(struct net_device *dev, int do_io);
> -extern void initialize_ethtool_ops(struct net_device *ndev);
> +extern void vxge_initialize_ethtool_ops(struct net_device *ndev);
>  /**
>   * #define VXGE_DEBUG_INIT: debug for initialization functions
>   * #define VXGE_DEBUG_TX        : debug transmit related functions
> --- a/drivers/net/vxge/vxge-traffic.c   2010-10-15 09:10:06.750402084 -0700
> +++ b/drivers/net/vxge/vxge-traffic.c   2010-10-15 09:36:10.750557049 -0700
> @@ -17,6 +17,13 @@
>  #include "vxge-config.h"
>  #include "vxge-main.h"
> 
> +static enum vxge_hw_status
> +__vxge_hw_device_handle_error(struct __vxge_hw_device *hldev,
> +                             u32 vp_id, enum vxge_hw_event type);
> +static enum vxge_hw_status
> +__vxge_hw_vpath_alarm_process(struct __vxge_hw_virtualpath *vpath,
> +                             u32 skip_alarms);
> +
>  /*
>   * vxge_hw_vpath_intr_enable - Enable vpath interrupts.
>   * @vp: Virtual Path handle.
> @@ -513,7 +520,7 @@ exit:
>   * Link up indication handler. The function is invoked by HW when
>   * Titan indicates that the link is up for programmable amount of time.
>   */
> -enum vxge_hw_status
> +static enum vxge_hw_status
>  __vxge_hw_device_handle_link_up_ind(struct __vxge_hw_device *hldev)
>  {
>         /*
> @@ -538,7 +545,7 @@ exit:
>   * Link down indication handler. The function is invoked by HW when
>   * Titan indicates that the link is down.
>   */
> -enum vxge_hw_status
> +static enum vxge_hw_status
>  __vxge_hw_device_handle_link_down_ind(struct __vxge_hw_device *hldev)
>  {
>         /*
> @@ -564,7 +571,7 @@ exit:
>   *
>   * Handle error.
>   */
> -enum vxge_hw_status
> +static enum vxge_hw_status
>  __vxge_hw_device_handle_error(
>                 struct __vxge_hw_device *hldev,
>                 u32 vp_id,
> @@ -646,7 +653,7 @@ void vxge_hw_device_clear_tx_rx(struct _
>   * it swaps the reserve and free arrays.
>   *
>   */
> -enum vxge_hw_status
> +static enum vxge_hw_status
>  vxge_hw_channel_dtr_alloc(struct __vxge_hw_channel *channel, void **dtrh)
>  {
>         void **tmp_arr;
> @@ -692,7 +699,8 @@ _alloc_after_swap:
>   * Posts a dtr to work array.
>   *
>   */
> -void vxge_hw_channel_dtr_post(struct __vxge_hw_channel *channel, void *dtrh)
> +static void vxge_hw_channel_dtr_post(struct __vxge_hw_channel *channel,
> +                                    void *dtrh)
>  {
>         vxge_assert(channel->work_arr[channel->post_index] == NULL);
> 
> @@ -1658,37 +1666,6 @@ exit:
>  }
> 
>  /**
> - * vxge_hw_vpath_vid_get_next - Get the next vid entry for this vpath
> - *               from vlan id table.
> - * @vp: Vpath handle.
> - * @vid: Buffer to return vlan id
> - *
> - * Returns the next vlan id in the list for this vpath.
> - * see also: vxge_hw_vpath_vid_get
> - *
> - */
> -enum vxge_hw_status
> -vxge_hw_vpath_vid_get_next(struct __vxge_hw_vpath_handle *vp, u64 *vid)
> -{
> -       u64 data;
> -       enum vxge_hw_status status = VXGE_HW_OK;
> -
> -       if (vp == NULL) {
> -               status = VXGE_HW_ERR_INVALID_HANDLE;
> -               goto exit;
> -       }
> -
> -       status = __vxge_hw_vpath_rts_table_get(vp,
> -                       VXGE_HW_RTS_ACCESS_STEER_CTRL_ACTION_LIST_NEXT_ENTRY,
> -                       VXGE_HW_RTS_ACCESS_STEER_CTRL_DATA_STRUCT_SEL_VID,
> -                       0, vid, &data);
> -
> -       *vid = VXGE_HW_RTS_ACCESS_STEER_DATA0_GET_VLAN_ID(*vid);
> -exit:
> -       return status;
> -}
> -
> -/**
>   * vxge_hw_vpath_vid_delete - Delete the vlan id entry for this vpath
>   *               to vlan id table.
>   * @vp: Vpath handle.
> @@ -1898,9 +1875,9 @@ exit:
>   * Process vpath alarms.
>   *
>   */
> -enum vxge_hw_status __vxge_hw_vpath_alarm_process(
> -                       struct __vxge_hw_virtualpath *vpath,
> -                       u32 skip_alarms)
> +static enum vxge_hw_status
> +__vxge_hw_vpath_alarm_process(struct __vxge_hw_virtualpath *vpath,
> +                             u32 skip_alarms)
>  {
>         u64 val64;
>         u64 alarm_status;
> @@ -2265,36 +2242,6 @@ vxge_hw_vpath_msix_mask(struct __vxge_hw
>  }
> 
>  /**
> - * vxge_hw_vpath_msix_clear - Clear MSIX Vector.
> - * @vp: Virtual Path handle.
> - * @msix_id:  MSI ID
> - *
> - * The function clears the msix interrupt for the given msix_id
> - *
> - * Returns: 0,
> - * Otherwise, VXGE_HW_ERR_WRONG_IRQ if the msix index is out of range
> - * status.
> - * See also:
> - */
> -void
> -vxge_hw_vpath_msix_clear(struct __vxge_hw_vpath_handle *vp, int msix_id)
> -{
> -       struct __vxge_hw_device *hldev = vp->vpath->hldev;
> -       if (hldev->config.intr_mode ==
> -                       VXGE_HW_INTR_MODE_MSIX_ONE_SHOT) {
> -               __vxge_hw_pio_mem_write32_upper(
> -                       (u32)vxge_bVALn(vxge_mBIT(msix_id >> 2), 0, 32),
> -                               &hldev->common_reg->
> -                                       clr_msix_one_shot_vec[msix_id%4]);
> -       } else {
> -               __vxge_hw_pio_mem_write32_upper(
> -                       (u32)vxge_bVALn(vxge_mBIT(msix_id >> 2), 0, 32),
> -                               &hldev->common_reg->
> -                                       clear_msix_mask_vect[msix_id%4]);
> -       }
> -}
> -
> -/**
>   * vxge_hw_vpath_msix_unmask - Unmask the MSIX Vector.
>   * @vp: Virtual Path handle.
>   * @msix_id:  MSI ID
> @@ -2316,22 +2263,6 @@ vxge_hw_vpath_msix_unmask(struct __vxge_
>  }
> 
>  /**
> - * vxge_hw_vpath_msix_mask_all - Mask all MSIX vectors for the vpath.
> - * @vp: Virtual Path handle.
> - *
> - * The function masks all msix interrupt for the given vpath
> - *
> - */
> -void
> -vxge_hw_vpath_msix_mask_all(struct __vxge_hw_vpath_handle *vp)
> -{
> -
> -       __vxge_hw_pio_mem_write32_upper(
> -               (u32)vxge_bVALn(vxge_mBIT(vp->vpath->vp_id), 0, 32),
> -               &vp->vpath->hldev->common_reg->set_msix_mask_all_vect);
> -}
> -
> -/**
>   * vxge_hw_vpath_inta_mask_tx_rx - Mask Tx and Rx interrupts.
>   * @vp: Virtual Path handle.
>   *
> --- a/drivers/net/vxge/vxge-traffic.h   2010-10-15 09:10:06.834405939 -0700
> +++ b/drivers/net/vxge/vxge-traffic.h   2010-10-15 10:14:43.870258247 -0700
> @@ -1749,14 +1749,6 @@ vxge_hw_mrpcim_stats_access(
>         u64 *stat);
> 
>  enum vxge_hw_status
> -vxge_hw_device_xmac_aggr_stats_get(struct __vxge_hw_device *devh, u32 port,
> -                                  struct vxge_hw_xmac_aggr_stats *aggr_stats);
> -
> -enum vxge_hw_status
> -vxge_hw_device_xmac_port_stats_get(struct __vxge_hw_device *devh, u32 port,
> -                                  struct vxge_hw_xmac_port_stats *port_stats);
> -
> -enum vxge_hw_status
>  vxge_hw_device_xmac_stats_get(struct __vxge_hw_device *devh,
>                               struct vxge_hw_xmac_stats *xmac_stats);
> 
> @@ -2117,49 +2109,10 @@ struct __vxge_hw_ring_rxd_priv {
>  #endif
>  };
> 
> -/* ========================= RING PRIVATE API ============================= */
> -u64
> -__vxge_hw_ring_first_block_address_get(
> -       struct __vxge_hw_ring *ringh);
> -
> -enum vxge_hw_status
> -__vxge_hw_ring_create(
> -       struct __vxge_hw_vpath_handle *vpath_handle,
> -       struct vxge_hw_ring_attr *attr);
> -
> -enum vxge_hw_status
> -__vxge_hw_ring_abort(
> -       struct __vxge_hw_ring *ringh);
> -
> -enum vxge_hw_status
> -__vxge_hw_ring_reset(
> -       struct __vxge_hw_ring *ringh);
> -
> -enum vxge_hw_status
> -__vxge_hw_ring_delete(
> -       struct __vxge_hw_vpath_handle *vpath_handle);
> -
>  /* ========================= FIFO PRIVATE API ============================= */
> 
>  struct vxge_hw_fifo_attr;
> 
> -enum vxge_hw_status
> -__vxge_hw_fifo_create(
> -       struct __vxge_hw_vpath_handle *vpath_handle,
> -       struct vxge_hw_fifo_attr *attr);
> -
> -enum vxge_hw_status
> -__vxge_hw_fifo_abort(
> -       struct __vxge_hw_fifo *fifoh);
> -
> -enum vxge_hw_status
> -__vxge_hw_fifo_reset(
> -       struct __vxge_hw_fifo *ringh);
> -
> -enum vxge_hw_status
> -__vxge_hw_fifo_delete(
> -       struct __vxge_hw_vpath_handle *vpath_handle);
> -
>  struct vxge_hw_mempool_cbs {
>         void (*item_func_alloc)(
>                         struct vxge_hw_mempool *mempoolh,
> @@ -2169,10 +2122,6 @@ struct vxge_hw_mempool_cbs {
>                         u32                     is_last);
>  };
> 
> -void
> -__vxge_hw_mempool_destroy(
> -       struct vxge_hw_mempool *mempool);
> -
>  #define VXGE_HW_VIRTUAL_PATH_HANDLE(vpath)                             \
>                 ((struct __vxge_hw_vpath_handle *)(vpath)->vpath_handles.next)
> 
> @@ -2195,61 +2144,10 @@ __vxge_hw_vpath_rts_table_set(
>         u64                     data2);
> 
>  enum vxge_hw_status
> -__vxge_hw_vpath_reset(
> -       struct __vxge_hw_device *devh,
> -       u32                     vp_id);
> -
> -enum vxge_hw_status
> -__vxge_hw_vpath_sw_reset(
> -       struct __vxge_hw_device *devh,
> -       u32                     vp_id);
> -
> -enum vxge_hw_status
>  __vxge_hw_vpath_enable(
>         struct __vxge_hw_device *devh,
>         u32                     vp_id);
> 
> -void
> -__vxge_hw_vpath_prc_configure(
> -       struct __vxge_hw_device *devh,
> -       u32                     vp_id);
> -
> -enum vxge_hw_status
> -__vxge_hw_vpath_kdfc_configure(
> -       struct __vxge_hw_device *devh,
> -       u32                     vp_id);
> -
> -enum vxge_hw_status
> -__vxge_hw_vpath_mac_configure(
> -       struct __vxge_hw_device *devh,
> -       u32                     vp_id);
> -
> -enum vxge_hw_status
> -__vxge_hw_vpath_tim_configure(
> -       struct __vxge_hw_device *devh,
> -       u32                     vp_id);
> -
> -enum vxge_hw_status
> -__vxge_hw_vpath_initialize(
> -       struct __vxge_hw_device *devh,
> -       u32                     vp_id);
> -
> -enum vxge_hw_status
> -__vxge_hw_vp_initialize(
> -       struct __vxge_hw_device *devh,
> -       u32                     vp_id,
> -       struct vxge_hw_vp_config        *config);
> -
> -void
> -__vxge_hw_vp_terminate(
> -       struct __vxge_hw_device *devh,
> -       u32                     vp_id);
> -
> -enum vxge_hw_status
> -__vxge_hw_vpath_alarm_process(
> -       struct __vxge_hw_virtualpath    *vpath,
> -       u32                     skip_alarms);
> -
>  void vxge_hw_device_intr_enable(
>         struct __vxge_hw_device *devh);
> 
> @@ -2321,11 +2219,6 @@ vxge_hw_vpath_vid_get(
>         u64                     *vid);
> 
>  enum vxge_hw_status
> -vxge_hw_vpath_vid_get_next(
> -       struct __vxge_hw_vpath_handle *vpath_handle,
> -       u64                     *vid);
> -
> -enum vxge_hw_status
>  vxge_hw_vpath_vid_delete(
>         struct __vxge_hw_vpath_handle *vpath_handle,
>         u64                     vid);
> @@ -2387,16 +2280,9 @@ vxge_hw_vpath_msix_mask(struct __vxge_hw
>  void vxge_hw_device_flush_io(struct __vxge_hw_device *devh);
> 
>  void
> -vxge_hw_vpath_msix_clear(struct __vxge_hw_vpath_handle *vpath_handle,
> -                        int msix_id);
> -
> -void
>  vxge_hw_vpath_msix_unmask(struct __vxge_hw_vpath_handle *vpath_handle,
>                           int msix_id);
> 
> -void
> -vxge_hw_vpath_msix_mask_all(struct __vxge_hw_vpath_handle *vpath_handle);
> -
>  enum vxge_hw_status vxge_hw_vpath_intr_enable(
>                                 struct __vxge_hw_vpath_handle *vpath_handle);
> 
> @@ -2415,12 +2301,6 @@ vxge_hw_channel_msix_mask(struct __vxge_
>  void
>  vxge_hw_channel_msix_unmask(struct __vxge_hw_channel *channelh, int msix_id);
> 
> -enum vxge_hw_status
> -vxge_hw_channel_dtr_alloc(struct __vxge_hw_channel *channel, void **dtrh);
> -
> -void
> -vxge_hw_channel_dtr_post(struct __vxge_hw_channel *channel, void *dtrh);
> -
>  void
>  vxge_hw_channel_dtr_try_complete(struct __vxge_hw_channel *channel,
>                                  void **dtrh);
> @@ -2436,18 +2316,4 @@ vxge_hw_channel_dtr_count(struct __vxge_
>  void
>  vxge_hw_vpath_tti_ci_set(struct __vxge_hw_device *hldev, u32 vp_id);
> 
> -/* ========================== PRIVATE API ================================= */
> -
> -enum vxge_hw_status
> -__vxge_hw_device_handle_link_up_ind(struct __vxge_hw_device *hldev);
> -
> -enum vxge_hw_status
> -__vxge_hw_device_handle_link_down_ind(struct __vxge_hw_device *hldev);
> -
> -enum vxge_hw_status
> -__vxge_hw_device_handle_error(
> -               struct __vxge_hw_device *hldev,
> -               u32 vp_id,
> -               enum vxge_hw_event type);
> -
>  #endif
> --- a/drivers/net/vxge/vxge-ethtool.c   2010-10-15 09:10:06.718400615 -0700
> +++ b/drivers/net/vxge/vxge-ethtool.c   2010-10-15 10:13:39.927999492 -0700
> @@ -1142,7 +1142,7 @@ static const struct ethtool_ops vxge_eth
>         .get_ethtool_stats      = vxge_get_ethtool_stats,
>  };
> 
> -void initialize_ethtool_ops(struct net_device *ndev)
> +void vxge_initialize_ethtool_ops(struct net_device *ndev)
>  {
>         SET_ETHTOOL_OPS(ndev, &vxge_ethtool_ops);
>  }
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: drivers/media/IR/imon.c: Use pr_err instead of err
From: Jarod Wilson @ 2010-10-18 20:27 UTC (permalink / raw)
  To: Joe Perches; +Cc: Mauro Carvalho Chehab, linux-media, LKML
In-Reply-To: <1277018446.1548.66.camel@Joe-Laptop.home>

On Sun, Jun 20, 2010 at 07:20:46AM -0000, Joe Perches wrote:
> Use the standard error logging mechanisms.
> Add #define pr_fmt(fmt) KBUILD_MODNAME ":%s" fmt, __func__
> Remove __func__ from err calls, add '\n', rename to pr_err
> 
> Signed-off-by: Joe Perches <joe@perches.com>

Since I haven't got around to actually looking into using dev_foo bits
instead where appropriate, lets just go ahead with this patch and if/when
I get around to it later, I can switch things to dev_foo where possible.

Acked-by: Jarod Wilson <jarod@redhat.com>

-- 
Jarod Wilson
jarod@redhat.com


^ permalink raw reply

* [PATCH 2/2] Allow nodes at the root to be specified by path as well as by label.
From: John Bonesio @ 2010-10-18 20:25 UTC (permalink / raw)
  To: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ
In-Reply-To: <20101018202353.24286.74857.stgit@riker>

Changes to allow us to specify a node by it's path. A path can be used in
place of a label.

This is particularly useful when overriding existing nodes.
This way we don't have to label every possible node in a device tree we know
is a base device tree for a class of systems, and we know the tree will be
modified for the specific systems.

Signed-off-by: John Bonesio <bones-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
---

 dtc-parser.y |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/dtc-parser.y b/dtc-parser.y
index 56d7789..0efd0cc 100644
--- a/dtc-parser.y
+++ b/dtc-parser.y
@@ -134,22 +134,30 @@ devicetree:
 		{
 			struct node *target;
 
-			target = get_node_by_label($1, $2);
+			if ($2[0] == '/')
+				target = get_node_by_path($1, $2);
+			else
+				target = get_node_by_label($1, $2);
+
 			if (target)
 				merge_nodes(target, $3);
 			else
-				print_error("label, '%s' not found", $2);
+				print_error("label or path, '%s', not found", $2);
 			$$ = $1;
 		}
 	| devicetree DT_REMOVENODE DT_REF ';'
 		{
 			struct node *target;
 
-			target = get_node_by_label($1, $3);
+			if ($3[0] == '/')
+				target = get_node_by_path($1, $3);
+			else
+				target = get_node_by_label($1, $3);
+
 			if (target)
 				remove_nodes(target);
 			else
-				print_error("label, '%s' not found", $3);
+				print_error("label or path, '%s', not found", $3);
 		}
 	;

^ permalink raw reply related

* [PATCH 1/2] Implements new features for updating existing device tree nodes.
From: John Bonesio @ 2010-10-18 20:25 UTC (permalink / raw)
  To: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ

This is interesting when the /include/ "<filename>" feature is used. This way
we can create base device tree source files for a family of systems and modify
the device tree for a specific system.

The current sytem allows an existing node to be extended with new properties
and subnodes.

The new features allow an existing node to be replaced completely by the new
properties and subnodes. The new features also allow an existing node to be
deleted.

Signed-off-by: John Bonesio <bones-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
---

I was originally going to submit just one patch, as the change in the
second one is pretty trivial. However, I thought people might appreciate
that the change to refer to nodes by path is highlighted separately.

Comment away!

- John

 dtc-lexer.l  |    6 ++++++
 dtc-parser.y |   14 ++++++++++++--
 dtc.h        |    3 +++
 livetree.c   |   25 +++++++++++++++++++++++++
 4 files changed, 46 insertions(+), 2 deletions(-)

diff --git a/dtc-lexer.l b/dtc-lexer.l
index 081e13a..80a886a 100644
--- a/dtc-lexer.l
+++ b/dtc-lexer.l
@@ -96,6 +96,12 @@ static int pop_input_file(void);
 			return DT_MEMRESERVE;
 		}
 
+<*>"/remove-node/"	{
+			DPRINT("Keyword: /remove-node/\n");
+			BEGIN_DEFAULT();
+			return DT_REMOVENODE;
+		}
+
 <*>{LABEL}:	{
 			DPRINT("Label: %s\n", yytext);
 			yylval.labelref = xstrdup(yytext);
diff --git a/dtc-parser.y b/dtc-parser.y
index e1846d4..56d7789 100644
--- a/dtc-parser.y
+++ b/dtc-parser.y
@@ -55,6 +55,7 @@ static unsigned long long eval_literal(const char *s, int base, int bits);
 
 %token DT_V1
 %token DT_MEMRESERVE
+%token DT_REMOVENODE
 %token <propnodename> DT_PROPNODENAME
 %token <literal> DT_LITERAL
 %token <cbase> DT_BASE
@@ -137,10 +138,19 @@ devicetree:
 			if (target)
 				merge_nodes(target, $3);
 			else
-				print_error("label, '%s' does not exist in"
-					" node extension", $2);
+				print_error("label, '%s' not found", $2);
 			$$ = $1;
 		}
+	| devicetree DT_REMOVENODE DT_REF ';'
+		{
+			struct node *target;
+
+			target = get_node_by_label($1, $3);
+			if (target)
+				remove_nodes(target);
+			else
+				print_error("label, '%s' not found", $3);
+		}
 	;
 
 nodedef:
diff --git a/dtc.h b/dtc.h
index b36ac5d..e7cb45c 100644
--- a/dtc.h
+++ b/dtc.h
@@ -175,9 +175,12 @@ struct node *build_node(struct property *proplist, struct node *children);
 struct node *name_node(struct node *node, char *name);
 struct node *chain_node(struct node *first, struct node *list);
 struct node *merge_nodes(struct node *old_node, struct node *new_node);
+struct node *replace_nodes(struct node *old_node, struct node *new_node);
+void remove_nodes(struct node *node);
 
 void add_property(struct node *node, struct property *prop);
 void add_child(struct node *parent, struct node *child);
+void remove_child(struct node *parent, struct node *child);
 
 const char *get_unitname(struct node *node);
 struct property *get_property(struct node *node, const char *propname);
diff --git a/livetree.c b/livetree.c
index 13c5f10..924c060 100644
--- a/livetree.c
+++ b/livetree.c
@@ -167,6 +167,14 @@ struct node *merge_nodes(struct node *old_node, struct node *new_node)
 	return old_node;
 }
 
+void remove_nodes(struct node *node) {
+	/*
+	 * For now, just unlink the node from the tree structure.
+	 * This leaks memory, but at this point the developers are ok with this.
+	 */
+	remove_child(node->parent, node);
+}
+
 struct node *chain_node(struct node *first, struct node *list)
 {
 	assert(first->next_sibling == NULL);
@@ -202,6 +210,23 @@ void add_child(struct node *parent, struct node *child)
 	*p = child;
 }
 
+void remove_child(struct node *parent, struct node *child)
+{
+	struct node **p;
+
+	/* Make sure we've got a consistent tree here */
+	assert(child->parent == parent);
+
+	p = &parent->children;
+	while (*p) {
+		if (*p == child) {
+			*p = (*p)->next_sibling;
+		}
+		p = &((*p)->next_sibling);
+	}
+	child->parent = NULL;
+}
+
 struct reserve_info *build_reserve_entry(uint64_t address, uint64_t size)
 {
 	struct reserve_info *new = xmalloc(sizeof(*new));

^ permalink raw reply related

* [U-Boot] [U-boot][PATCH] MAINTAINERS: Fix alphabetical order in ARM subsection
From: Wolfgang Denk @ 2010-10-18 20:25 UTC (permalink / raw)
  To: u-boot
In-Reply-To: <1287423514-4132-1-git-send-email-eballetbo@iseebcn.com>

Dear Enric Balletbo i Serra,

In message <1287423514-4132-1-git-send-email-eballetbo@iseebcn.com> you wrote:
> I'm noticed that IGEP maintainer isn't in the correct place within
> the ARM subsection: it's supposed to be in alphabetical order by
> maintainer. This patch fix this.
> 
> Signed-off-by: Enric Balletbo i Serra <eballetbo@iseebcn.com>
> ---
>  MAINTAINERS |   10 +++++-----
>  1 files changed, 5 insertions(+), 5 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"How is this place run - is it an anarchy?"
"No, I wouldn't say so; it is not that well organised..."

^ permalink raw reply

* RE: linux-next: build failure after merge of the sound-asoc tree
From: Peter Hsiang @ 2010-10-18 20:25 UTC (permalink / raw)
  To: Stephen Rothwell, Mark Brown, Liam Girdwood
  Cc: linux-next@vger.kernel.org, linux-kernel@vger.kernel.org
In-Reply-To: <20101018142934.65f5d0fa.sfr@canb.auug.org.au>

On Sun, Oct 17, 2010, Stephen Rothwell wrote:
> Hi all,
> 
> After merging the sound-asoc tree, today's linux-next build (x86_64
> allmodconfig) failed like this:
> 
> sound/soc/codecs/max98088.c:28:28: error: sound/max98088.h: No such file or
> directory
> 

Mark, 

This message seems to be saying that this header file is missing.
However, this header file was included in the patch that was submitted,
and it did compile fine here before the submit.
I don't understand why it's not there after it was applied?

Thanks,

Peter

^ permalink raw reply

* Re: linux-next: build failure after merge of the final tree (mmc tree related)
From: Chris Ball @ 2010-10-18 20:24 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: linux-next, linux-kernel, Wolfram Sang, linux-mmc
In-Reply-To: <20101018183540.2a7dfc8f.sfr@canb.auug.org.au>

Hi Stephen,

On Mon, Oct 18, 2010 at 06:35:40PM +1100, Stephen Rothwell wrote:
> After merging the scsi-post-merge tree, today's linux-next build ()
> failed like this:
[...] 
> Caused by commit a2fe088a5aaa51b54c018cf309cdc728d5f4e540 ("mmc:
> sdhci-of-esdhc: factor out common stuff").
> 
> This was clearly never build tested ...
> 
> I have reverted that commit for today.

Sorry about this -- you're right, my test compile missed this patch.
I've pushed a tested fix now.

Thanks,

- Chris.
-- 
Chris Ball   <cjb@laptop.org>   <http://printf.net/>
One Laptop Per Child

^ permalink raw reply

* [U-Boot] Pull request: nand flash
From: Wolfgang Denk @ 2010-10-18 20:24 UTC (permalink / raw)
  To: u-boot
In-Reply-To: <20101018201457.GA21725@udp111988uds.am.freescale.net>

Dear Scott Wood,

In message <20101018201457.GA21725@udp111988uds.am.freescale.net> you wrote:
> The following changes since commit cacc342d5aa311673efdc05770cb53246dd41c9f:
>   Wolfgang Denk (1):
>         Merge branch 'master' of git://git.denx.de/u-boot-arm
> 
> are available in the git repository at:
> 
>   git://git.denx.de/u-boot-nand-flash.git master
> 
> Scott Wood (1):
>       Fix warning in nand unlock command
> 
>  common/cmd_nand.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"And they told us, what they wanted... Was a sound  that  could  kill
some-one, from a distance."                               - Kate Bush

^ permalink raw reply


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.