* Re: [PATCH] virtio_net: indicate oom when addbuf returns failure
From: Herbert Xu @ 2010-06-06 22:24 UTC (permalink / raw)
To: Michael S. Tsirkin
Cc: Rusty Russell, stable, Bruce Rogers, netdev, virtualization,
Shirley Ma
In-Reply-To: <20100606201258.GA21196@redhat.com>
On Sun, Jun 06, 2010 at 11:13:00PM +0300, Michael S. Tsirkin wrote:
>
> Actually this code looks strange:
> Note that add_buf inicates out of memory
> condition with a positive return value, and ring full
> (which is not an error!) with -ENOSPC.
Indeed, this ultimately came from
commit 9ab86bbcf8be755256f0a5e994e0b38af6b4d399
Author: Shirley Ma <mashirle@us.ibm.com>
Date: Fri Jan 29 03:20:04 2010 +0000
virtio_net: Defer skb allocation in receive path Date: Wed, 13 Jan 2010 12:53:38 -0800
(Greg, please don't apply this even though I've just given you
the upstream commit ID that you were asking for :)
where it confuses a memory allocation error with an add_buf failure.
> Possibly the right thing to do is to
> 1. handle ENOMEM specially
> 2. fix add_buf to return ENOMEM on error
I think we should make it so that only a memory allocation error
is returned as before. There is no need for returning the add_buf
error unless add_buf is now doing an allocation itself that needs
to be retried.
Thanks,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply
* Re: [PATCH 1/2] net: ll_temac: fix interrupt bug when interrupt 0 is used
From: Benjamin Herrenschmidt @ 2010-06-06 21:57 UTC (permalink / raw)
To: John Linn
Cc: netdev, linuxppc-dev, grant.likely, jwboyer, michal.simek,
john.williams, Brian Hill
In-Reply-To: <6f264a7a-e5da-494a-a24d-1578ca422807@VA3EHSMHS016.ehs.local>
On Wed, 2010-05-26 at 11:29 -0600, John Linn wrote:
> The code is not checking the interrupt for DMA correctly so that an
> interrupt number of 0 will cause a false error.
>
> Signed-off-by: Brian Hill <brian.hill@xilinx.com>
> Signed-off-by: John Linn <john.linn@xilinx.com>
> ---
> drivers/net/ll_temac_main.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/net/ll_temac_main.c b/drivers/net/ll_temac_main.c
> index fa7620e..0615737 100644
> --- a/drivers/net/ll_temac_main.c
> +++ b/drivers/net/ll_temac_main.c
> @@ -950,7 +950,7 @@ temac_of_probe(struct of_device *op, const struct of_device_id *match)
>
> lp->rx_irq = irq_of_parse_and_map(np, 0);
> lp->tx_irq = irq_of_parse_and_map(np, 1);
> - if (!lp->rx_irq || !lp->tx_irq) {
> + if ((lp->rx_irq == NO_IRQ) || (lp->tx_irq == NO_IRQ)) {
> dev_err(&op->dev, "could not determine irqs\n");
> rc = -ENOMEM;
> goto nodev;
Hasn't NO_IRQ been deprecated ?
Linus made it clear a while back that interrupt 0 was not valid and
that's the way it should be.
We now have an interrupt remapping scheme on powerpc, so we ensure that
0 always mean no interrupt. Other archs might need some fixups. Which
are specifically needs this patch ?
Cheers,
Ben.
^ permalink raw reply
* Re: [RFC] pm_qos: get rid of the allocation in pm_qos_add_request()
From: mark gross @ 2010-06-06 21:32 UTC (permalink / raw)
To: James Bottomley
Cc: pm list, markgross, netdev, alsa-devel, Takashi Iwai,
Jaroslav Kysela
In-Reply-To: <1275765614.7227.42.camel@mulgrave.site>
On Sat, Jun 05, 2010 at 02:20:14PM -0500, James Bottomley wrote:
> [alsa-devel says it's a moderated list, so feel free to drop before
> replying]
>
> Since every caller has to squirrel away the returned pointer anyway,
> they might as well supply the memory area. This fixes a bug in a few of
> the call sites where the returned pointer was dereferenced without
> checking it for NULL (which gets returned if the kzalloc failed).
>
> I'd like to hear how sound and netdev feels about this: it will add
> about two more pointers worth of data to struct netdev and struct
> snd_pcm_substream .. but I think it's worth it. If you're OK, I'll add
> your acks and send through the pm tree.
>
> This also looks to me like an android independent clean up (even though
> it renders the request_add atomically callable). I also added include
> guards to include/linux/pm_qos_params.h
>
> James
>
> ---
>
> drivers/net/e1000e/netdev.c | 17 ++++------
> drivers/net/igbvf/netdev.c | 9 ++---
> drivers/net/wireless/ipw2x00/ipw2100.c | 12 +++---
> include/linux/netdevice.h | 2 +-
> include/linux/pm_qos_params.h | 12 +++++--
> include/sound/pcm.h | 2 +-
> kernel/pm_qos_params.c | 55 ++++++++++++++++---------------
> sound/core/pcm_native.c | 12 ++-----
> 8 files changed, 60 insertions(+), 61 deletions(-)
>
> diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
> index 24507f3..47ea62f 100644
> --- a/drivers/net/e1000e/netdev.c
> +++ b/drivers/net/e1000e/netdev.c
> @@ -2901,10 +2901,10 @@ static void e1000_configure_rx(struct e1000_adapter *adapter)
> * dropped transactions.
> */
> pm_qos_update_request(
> - adapter->netdev->pm_qos_req, 55);
> + &adapter->netdev->pm_qos_req, 55);
> } else {
> pm_qos_update_request(
> - adapter->netdev->pm_qos_req,
> + &adapter->netdev->pm_qos_req,
> PM_QOS_DEFAULT_VALUE);
> }
> }
> @@ -3196,9 +3196,9 @@ int e1000e_up(struct e1000_adapter *adapter)
>
> /* DMA latency requirement to workaround early-receive/jumbo issue */
> if (adapter->flags & FLAG_HAS_ERT)
> - adapter->netdev->pm_qos_req =
> - pm_qos_add_request(PM_QOS_CPU_DMA_LATENCY,
> - PM_QOS_DEFAULT_VALUE);
> + pm_qos_add_request(&adapter->netdev->pm_qos_req,
> + PM_QOS_CPU_DMA_LATENCY,
> + PM_QOS_DEFAULT_VALUE);
>
> /* hardware has been reset, we need to reload some things */
> e1000_configure(adapter);
> @@ -3263,11 +3263,8 @@ void e1000e_down(struct e1000_adapter *adapter)
> e1000_clean_tx_ring(adapter);
> e1000_clean_rx_ring(adapter);
>
> - if (adapter->flags & FLAG_HAS_ERT) {
> - pm_qos_remove_request(
> - adapter->netdev->pm_qos_req);
> - adapter->netdev->pm_qos_req = NULL;
> - }
> + if (adapter->flags & FLAG_HAS_ERT)
> + pm_qos_remove_request(&adapter->netdev->pm_qos_req);
>
> /*
> * TODO: for power management, we could drop the link and
> diff --git a/drivers/net/igbvf/netdev.c b/drivers/net/igbvf/netdev.c
> index 5e2b2a8..5da569f 100644
> --- a/drivers/net/igbvf/netdev.c
> +++ b/drivers/net/igbvf/netdev.c
> @@ -48,7 +48,7 @@
> #define DRV_VERSION "1.0.0-k0"
> char igbvf_driver_name[] = "igbvf";
> const char igbvf_driver_version[] = DRV_VERSION;
> -struct pm_qos_request_list *igbvf_driver_pm_qos_req;
> +struct pm_qos_request_list igbvf_driver_pm_qos_req;
> static const char igbvf_driver_string[] =
> "Intel(R) Virtual Function Network Driver";
> static const char igbvf_copyright[] = "Copyright (c) 2009 Intel Corporation.";
> @@ -2902,8 +2902,8 @@ static int __init igbvf_init_module(void)
> printk(KERN_INFO "%s\n", igbvf_copyright);
>
> ret = pci_register_driver(&igbvf_driver);
> - igbvf_driver_pm_qos_req = pm_qos_add_request(PM_QOS_CPU_DMA_LATENCY,
> - PM_QOS_DEFAULT_VALUE);
> + pm_qos_add_request(igbvf_driver_pm_qos_req, PM_QOS_CPU_DMA_LATENCY,
> + PM_QOS_DEFAULT_VALUE);
>
> return ret;
> }
> @@ -2918,8 +2918,7 @@ module_init(igbvf_init_module);
> static void __exit igbvf_exit_module(void)
> {
> pci_unregister_driver(&igbvf_driver);
> - pm_qos_remove_request(igbvf_driver_pm_qos_req);
> - igbvf_driver_pm_qos_req = NULL;
> + pm_qos_remove_request(&igbvf_driver_pm_qos_req);
> }
> module_exit(igbvf_exit_module);
>
> diff --git a/drivers/net/wireless/ipw2x00/ipw2100.c b/drivers/net/wireless/ipw2x00/ipw2100.c
> index 0bd4dfa..7f0d98b 100644
> --- a/drivers/net/wireless/ipw2x00/ipw2100.c
> +++ b/drivers/net/wireless/ipw2x00/ipw2100.c
> @@ -174,7 +174,7 @@ that only one external action is invoked at a time.
> #define DRV_DESCRIPTION "Intel(R) PRO/Wireless 2100 Network Driver"
> #define DRV_COPYRIGHT "Copyright(c) 2003-2006 Intel Corporation"
>
> -struct pm_qos_request_list *ipw2100_pm_qos_req;
> +struct pm_qos_request_list ipw2100_pm_qos_req;
>
> /* Debugging stuff */
> #ifdef CONFIG_IPW2100_DEBUG
> @@ -1741,7 +1741,7 @@ static int ipw2100_up(struct ipw2100_priv *priv, int deferred)
> /* the ipw2100 hardware really doesn't want power management delays
> * longer than 175usec
> */
> - pm_qos_update_request(ipw2100_pm_qos_req, 175);
> + pm_qos_update_request(&ipw2100_pm_qos_req, 175);
>
> /* If the interrupt is enabled, turn it off... */
> spin_lock_irqsave(&priv->low_lock, flags);
> @@ -1889,7 +1889,7 @@ static void ipw2100_down(struct ipw2100_priv *priv)
> ipw2100_disable_interrupts(priv);
> spin_unlock_irqrestore(&priv->low_lock, flags);
>
> - pm_qos_update_request(ipw2100_pm_qos_req, PM_QOS_DEFAULT_VALUE);
> + pm_qos_update_request(&ipw2100_pm_qos_req, PM_QOS_DEFAULT_VALUE);
>
> /* We have to signal any supplicant if we are disassociating */
> if (associated)
> @@ -6669,8 +6669,8 @@ static int __init ipw2100_init(void)
> if (ret)
> goto out;
>
> - ipw2100_pm_qos_req = pm_qos_add_request(PM_QOS_CPU_DMA_LATENCY,
> - PM_QOS_DEFAULT_VALUE);
> + pm_qos_add_request(&ipw2100_pm_qos_req, PM_QOS_CPU_DMA_LATENCY,
> + PM_QOS_DEFAULT_VALUE);
> #ifdef CONFIG_IPW2100_DEBUG
> ipw2100_debug_level = debug;
> ret = driver_create_file(&ipw2100_pci_driver.driver,
> @@ -6692,7 +6692,7 @@ static void __exit ipw2100_exit(void)
> &driver_attr_debug_level);
> #endif
> pci_unregister_driver(&ipw2100_pci_driver);
> - pm_qos_remove_request(ipw2100_pm_qos_req);
> + pm_qos_remove_request(&ipw2100_pm_qos_req);
> }
>
> module_init(ipw2100_init);
> diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
> index 40291f3..393555a 100644
> --- a/include/linux/netdevice.h
> +++ b/include/linux/netdevice.h
> @@ -779,7 +779,7 @@ struct net_device {
> */
> char name[IFNAMSIZ];
>
> - struct pm_qos_request_list *pm_qos_req;
> + struct pm_qos_request_list pm_qos_req;
>
> /* device name hash chain */
> struct hlist_node name_hlist;
> diff --git a/include/linux/pm_qos_params.h b/include/linux/pm_qos_params.h
> index 8ba440e..d823cc0 100644
> --- a/include/linux/pm_qos_params.h
> +++ b/include/linux/pm_qos_params.h
> @@ -1,8 +1,10 @@
> +#ifndef _LINUX_PM_QOS_PARAMS_H
> +#define _LINUX_PM_QOS_PARAMS_H
> /* interface for the pm_qos_power infrastructure of the linux kernel.
> *
> * Mark Gross <mgross@linux.intel.com>
> */
> -#include <linux/list.h>
> +#include <linux/plist.h>
> #include <linux/notifier.h>
> #include <linux/miscdevice.h>
>
> @@ -14,9 +16,12 @@
> #define PM_QOS_NUM_CLASSES 4
> #define PM_QOS_DEFAULT_VALUE -1
>
> -struct pm_qos_request_list;
> +struct pm_qos_request_list {
> + struct plist_node list;
> + int pm_qos_class;
> +};
so the test for an un-registerd or in-initialized request is if list == null.
>
> -struct pm_qos_request_list *pm_qos_add_request(int pm_qos_class, s32 value);
> +void pm_qos_add_request(struct pm_qos_request_list *l, int pm_qos_class, s32 value);
> void pm_qos_update_request(struct pm_qos_request_list *pm_qos_req,
> s32 new_value);
> void pm_qos_remove_request(struct pm_qos_request_list *pm_qos_req);
> @@ -25,3 +30,4 @@ int pm_qos_request(int pm_qos_class);
> int pm_qos_add_notifier(int pm_qos_class, struct notifier_block *notifier);
> int pm_qos_remove_notifier(int pm_qos_class, struct notifier_block *notifier);
>
> +#endif
> diff --git a/include/sound/pcm.h b/include/sound/pcm.h
> index dd76cde..6e3a297 100644
> --- a/include/sound/pcm.h
> +++ b/include/sound/pcm.h
> @@ -366,7 +366,7 @@ struct snd_pcm_substream {
> int number;
> char name[32]; /* substream name */
> int stream; /* stream (direction) */
> - struct pm_qos_request_list *latency_pm_qos_req; /* pm_qos request */
> + struct pm_qos_request_list latency_pm_qos_req; /* pm_qos request */
> size_t buffer_bytes_max; /* limit ring buffer size */
> struct snd_dma_buffer dma_buffer;
> unsigned int dma_buf_id;
> diff --git a/kernel/pm_qos_params.c b/kernel/pm_qos_params.c
> index 241fa79..f1d3d23 100644
> --- a/kernel/pm_qos_params.c
> +++ b/kernel/pm_qos_params.c
> @@ -30,7 +30,6 @@
> /*#define DEBUG*/
>
> #include <linux/pm_qos_params.h>
> -#include <linux/plist.h>
? plist pm_qos isn't yet in the code base yet. ;)
Is this patch assumed after your RFC patch?
It must be....
> #include <linux/sched.h>
> #include <linux/spinlock.h>
> #include <linux/slab.h>
> @@ -49,11 +48,6 @@
> * or pm_qos_object list and pm_qos_objects need to happen with pm_qos_lock
> * held, taken with _irqsave. One lock to rule them all
> */
> -struct pm_qos_request_list {
> - struct plist_node list;
> - int pm_qos_class;
> -};
> -
> enum pm_qos_type {
> PM_QOS_MAX, /* return the largest value */
> PM_QOS_MIN, /* return the smallest value */
> @@ -195,6 +189,11 @@ int pm_qos_request(int pm_qos_class)
> }
> EXPORT_SYMBOL_GPL(pm_qos_request);
>
> +static int pm_qos_request_active(struct pm_qos_request_list *req)
> +{
> + return req->pm_qos_class != 0;
> +}
> +
> /**
> * pm_qos_add_request - inserts new qos request into the list
> * @pm_qos_class: identifies which list of qos request to us
> @@ -206,25 +205,22 @@ EXPORT_SYMBOL_GPL(pm_qos_request);
> * element as a handle for use in updating and removal. Call needs to save
> * this handle for later use.
> */
> -struct pm_qos_request_list *pm_qos_add_request(int pm_qos_class, s32 value)
> +void pm_qos_add_request(struct pm_qos_request_list *dep,
> + int pm_qos_class, s32 value)
> {
> - struct pm_qos_request_list *dep;
> -
> - dep = kzalloc(sizeof(struct pm_qos_request_list), GFP_KERNEL);
> - if (dep) {
> - struct pm_qos_object *o = pm_qos_array[pm_qos_class];
> - int new_value;
> -
> - if (value == PM_QOS_DEFAULT_VALUE)
> - new_value = o->default_value;
> - else
> - new_value = value;
> - plist_node_init(&dep->list, new_value);
> - dep->pm_qos_class = pm_qos_class;
> - update_target(o, &dep->list, 0);
> - }
> + struct pm_qos_object *o = pm_qos_array[pm_qos_class];
> + int new_value;
> +
> + if (pm_qos_request_active(dep))
> + return;
>
> - return dep;
> + if (value == PM_QOS_DEFAULT_VALUE)
> + new_value = o->default_value;
> + else
> + new_value = value;
> + plist_node_init(&dep->list, new_value);
> + dep->pm_qos_class = pm_qos_class;
> + update_target(o, &dep->list, 0);
> }
> EXPORT_SYMBOL_GPL(pm_qos_add_request);
>
> @@ -286,7 +282,7 @@ void pm_qos_remove_request(struct pm_qos_request_list *pm_qos_req)
>
> o = pm_qos_array[pm_qos_req->pm_qos_class];
> update_target(o, &pm_qos_req->list, 1);
> - kfree(pm_qos_req);
> + memset(pm_qos_req, 0, sizeof(*pm_qos_req));
I was wondering how to tell if a pm_qos_request was un-initialized
un-registered request.
> }
> EXPORT_SYMBOL_GPL(pm_qos_remove_request);
>
> @@ -334,8 +330,12 @@ static int pm_qos_power_open(struct inode *inode, struct file *filp)
>
> pm_qos_class = find_pm_qos_object_by_minor(iminor(inode));
> if (pm_qos_class >= 0) {
> - filp->private_data = (void *) pm_qos_add_request(pm_qos_class,
> - PM_QOS_DEFAULT_VALUE);
> + struct pm_qos_request_list *req = kzalloc(GFP_KERNEL, sizeof(*req));
> + if (!req)
> + return -ENOMEM;
> +
> + pm_qos_add_request(req, pm_qos_class, PM_QOS_DEFAULT_VALUE);
> + filp->private_data = req;
>
> if (filp->private_data)
> return 0;
> @@ -347,8 +347,9 @@ static int pm_qos_power_release(struct inode *inode, struct file *filp)
> {
> struct pm_qos_request_list *req;
>
> - req = (struct pm_qos_request_list *)filp->private_data;
> + req = filp->private_data;
> pm_qos_remove_request(req);
> + kfree(req);
>
> return 0;
> }
> diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c
> index 303ac04..d3b8b51 100644
> --- a/sound/core/pcm_native.c
> +++ b/sound/core/pcm_native.c
> @@ -451,13 +451,10 @@ static int snd_pcm_hw_params(struct snd_pcm_substream *substream,
> snd_pcm_timer_resolution_change(substream);
> runtime->status->state = SNDRV_PCM_STATE_SETUP;
>
> - if (substream->latency_pm_qos_req) {
> - pm_qos_remove_request(substream->latency_pm_qos_req);
> - substream->latency_pm_qos_req = NULL;
> - }
> + pm_qos_remove_request(&substream->latency_pm_qos_req);
> if ((usecs = period_to_usecs(runtime)) >= 0)
> - substream->latency_pm_qos_req = pm_qos_add_request(
> - PM_QOS_CPU_DMA_LATENCY, usecs);
> + pm_qos_add_request(&substream->latency_pm_qos_req,
> + PM_QOS_CPU_DMA_LATENCY, usecs);
How are we going to avoid re-adding the latency_pm_qos_request multiple
times to the list? the last time I looked at this I really wanted to
change this to update_request. But, I got pushback so I added the file
gard in pmqos_params.c instead.
--mgross
> return 0;
> _error:
> /* hardware might be unuseable from this time,
> @@ -512,8 +509,7 @@ static int snd_pcm_hw_free(struct snd_pcm_substream *substream)
> if (substream->ops->hw_free)
> result = substream->ops->hw_free(substream);
> runtime->status->state = SNDRV_PCM_STATE_OPEN;
> - pm_qos_remove_request(substream->latency_pm_qos_req);
> - substream->latency_pm_qos_req = NULL;
> + pm_qos_remove_request(&substream->latency_pm_qos_req);
> return result;
> }
>
>
>
^ permalink raw reply
* Re: Bug#584724: linux-image-2.6.32-5-amd64: NETDEV WATCHDOG: (via-rhine): transmit queue 0 timed out
From: Ben Hutchings @ 2010-06-06 21:23 UTC (permalink / raw)
To: Roger Luethi; +Cc: netdev, R. Scott Bailey, 584724
In-Reply-To: <20100606024158.12393.82960.reportbug@buzz.bailey>
[-- Attachment #1: Type: text/plain, Size: 40499 bytes --]
Roger,
There's some kind of TX lock-up bug in via-rhine (or more likely certain
variants of the hardware).
On Sat, 2010-06-05 at 22:41 -0400, R. Scott Bailey wrote:
> Package: linux-2.6
> Version: 2.6.32-15
> Severity: normal
>
> This appears to be the same bug as:
> https://bugzilla.kernel.org/show_bug.cgi?id=11663
>
> I have attached kernel output; once the timeout occurs, the interface is
> unusable and bounces spastically (without becoming operational) until the
> system is rebooted. This most often is triggered by samba traffic, but that
> could be because that is just the heaviest traffic on my system. ;-)
>
> BTW, this interface is reported by lspci as:
> 00:12.0 Ethernet controller: VIA Technologies, Inc. VT6102 [Rhine-II] (rev 7c)
>
> Double-BTW, this is not a new problem with 2.6.32, but our activity levels
> have picked up recently and trigger it more frequently.
Here's that attachment inline:
> Jun 5 21:01:57 buzz kernel: [104288.805044] WARNING: at /build/buildd-linux-2.6_2.6.32-15-i386-fb7Hfg/linux-2.6-2.6.32/debian/build/source_i386_none/net/sched/sch_generic.c:261 dev_watchdog+0xd2/0x16f()
> Jun 5 21:01:57 buzz kernel: [104288.805052] Hardware name: MS-7253
> Jun 5 21:01:57 buzz kernel: [104288.805057] NETDEV WATCHDOG: eth0 (via-rhine): transmit queue 0 timed out
> Jun 5 21:01:57 buzz kernel: [104288.805062] Modules linked in: tcp_diag inet_diag ufs qnx4 hfsplus hfs minix ntfs vfat msdos fat jfs xfs via drm ip6_tables ppdev lp xt_multiport iptable_filter ip_tables x_tables kvm_amd kvm powernow_k8 cpufreq_stats cpufreq_powersave cpufreq_userspace cpufreq_conservative dm_snapshot dm_mirror dm_region_hash dm_log fuse nfsd exportfs nfs lockd fscache nfs_acl auth_rpcgss sunrpc ext3 jbd ext2 snd_hda_codec_realtek snd_hda_intel snd_hda_codec snd_hwdep snd_pcm_oss snd_mixer_oss snd_pcm snd_seq_midi snd_rawmidi snd_seq_midi_event snd_seq snd_timer snd_seq_device snd soundcore snd_page_alloc psmouse i2c_viapro tpm_tis evdev tpm k8temp tpm_bios edac_core pcspkr serio_raw i2c_core edac_mce_amd parport_pc parport shpchp pci_hotplug button processor sha256_generic aes_x86_64 aes_generic cbc ext4 mbcache jbd2 crc16 dm_crypt raid1 md_mod reiserfs dm_mod usb_storage usbhid hid sg sr_mod cdrom st sd_mod crc_t10dif osst ata_generic sata_via thermal uhci_
> hcd via_rhine pata_via atp870u tul
> Jun 5 21:01:57 buzz kernel: p libata ehci_hcd thermal_sys mii usbcore nls_base scsi_mod [last unloaded: scsi_wait_scan]
> Jun 5 21:01:57 buzz kernel: [104288.805243] Pid: 0, comm: swapper Not tainted 2.6.32-5-amd64 #1
> Jun 5 21:01:57 buzz kernel: [104288.805248] Call Trace:
> Jun 5 21:01:57 buzz kernel: [104288.805253] <IRQ> [<ffffffff8125defb>] ? dev_watchdog+0xd2/0x16f
> Jun 5 21:01:57 buzz kernel: [104288.805268] [<ffffffff8125defb>] ? dev_watchdog+0xd2/0x16f
> Jun 5 21:01:57 buzz kernel: [104288.805278] [<ffffffff8104db48>] ? warn_slowpath_common+0x77/0xa3
> Jun 5 21:01:57 buzz kernel: [104288.805285] [<ffffffff8125de29>] ? dev_watchdog+0x0/0x16f
> Jun 5 21:01:57 buzz kernel: [104288.805292] [<ffffffff8104dbd0>] ? warn_slowpath_fmt+0x51/0x59
> Jun 5 21:01:57 buzz kernel: [104288.805304] [<ffffffff8104a046>] ? try_to_wake_up+0x249/0x259
> Jun 5 21:01:57 buzz kernel: [104288.805314] [<ffffffff81064853>] ? autoremove_wake_function+0x9/0x2e
> Jun 5 21:01:57 buzz kernel: [104288.805321] [<ffffffff8125ddfd>] ? netif_tx_lock+0x3d/0x69
> Jun 5 21:01:57 buzz kernel: [104288.805330] [<ffffffff81248dec>] ? netdev_drivername+0x3b/0x40
> Jun 5 21:01:57 buzz kernel: [104288.805338] [<ffffffff8125defb>] ? dev_watchdog+0xd2/0x16f
> Jun 5 21:01:57 buzz kernel: [104288.805347] [<ffffffff81030065>] ? amd_iommu_map_range+0x13/0x8a
> Jun 5 21:01:57 buzz kernel: [104288.805356] [<ffffffff81061834>] ? __queue_work+0x22/0x32
> Jun 5 21:01:57 buzz kernel: [104288.805366] [<ffffffff8105a05f>] ? run_timer_softirq+0x1c9/0x268
> Jun 5 21:01:57 buzz kernel: [104288.805377] [<ffffffff810538b2>] ? __do_softirq+0xdd/0x19f
> Jun 5 21:01:57 buzz kernel: [104288.805387] [<ffffffff81024c92>] ? lapic_next_event+0x18/0x1d
> Jun 5 21:01:57 buzz kernel: [104288.805396] [<ffffffff81011cac>] ? call_softirq+0x1c/0x30
> Jun 5 21:01:57 buzz kernel: [104288.805403] [<ffffffff81013903>] ? do_softirq+0x3f/0x7c
> Jun 5 21:01:57 buzz kernel: [104288.805411] [<ffffffff81053721>] ? irq_exit+0x36/0x76
> Jun 5 21:01:57 buzz kernel: [104288.805419] [<ffffffff81025757>] ? smp_apic_timer_interrupt+0x87/0x95
> Jun 5 21:01:57 buzz kernel: [104288.805426] [<ffffffff81011673>] ? apic_timer_interrupt+0x13/0x20
> Jun 5 21:01:57 buzz kernel: [104288.805431] <EOI> [<ffffffff8102c558>] ? native_safe_halt+0x2/0x3
> Jun 5 21:01:57 buzz kernel: [104288.805448] [<ffffffff81017c6d>] ? default_idle+0x34/0x51
> Jun 5 21:01:57 buzz kernel: [104288.805456] [<ffffffff81017ff9>] ? c1e_idle+0xf5/0xfb
> Jun 5 21:01:57 buzz kernel: [104288.805466] [<ffffffff8100feb1>] ? cpu_idle+0xa2/0xda
> Jun 5 21:01:57 buzz kernel: [104288.805472] ---[ end trace 6b516d8045567b1e ]---
> Jun 5 21:01:57 buzz kernel: [104288.805621] eth0: Transmit timed out, status 0003, PHY status 786d, resetting...
> Jun 5 21:01:57 buzz kernel: [104288.806347] eth0: link up, 100Mbps, full-duplex, lpa 0x45E1
> Jun 5 21:02:00 buzz kernel: [104292.805163] eth0: Transmit timed out, status 0003, PHY status 786d, resetting...
> Jun 5 21:02:00 buzz kernel: [104292.805934] eth0: link up, 100Mbps, full-duplex, lpa 0x45E1
More system information follows:
> -- Package-specific info:
> ** Version:
> Linux version 2.6.32-5-amd64 (Debian 2.6.32-15) (ben@decadent.org.uk) (gcc version 4.3.5 (Debian 4.3.5-1) ) #1 SMP Tue Jun 1 06:11:58 UTC 2010
>
> ** Command line:
> BOOT_IMAGE=/vmlinuz-2.6.32-5-amd64 root=/dev/mapper/vg00-root ro ipv6.disable=1 rootdelay=10
>
> ** Not tainted
>
> ** Kernel log:
> [ 20.917471] shpchp: Standard Hot Plug PCI Controller Driver version: 0.4
> [ 20.924598] udev: renamed network interface eth0 to eth1
> [ 20.953407] udev: renamed network interface eth1_rename to eth0
> [ 21.014759] parport_pc 00:0a: reported by Plug and Play ACPI
> [ 21.014871] parport0: PC-style at 0x378, irq 7 [PCSPP]
> [ 21.018448] input: PC Speaker as /devices/platform/pcspkr/input/input5
> [ 21.032277] k8temp 0000:00:18.3: Temperature readouts might be wrong - check erratum #141
> [ 21.209202] EDAC MC: Ver: 2.1.0 Jun 1 2010
> [ 21.226787] st0: Block limits 2 - 16777214 bytes.
> [ 21.229458] EDAC amd64_edac: Ver: 3.2.0 Jun 1 2010
> [ 21.229633] EDAC amd64: This node reports that Memory ECC is currently disabled, set F3x44[22] (0000:00:18.3).
> [ 21.229720] EDAC amd64: ECC disabled in the BIOS or no ECC capability, module will not load.
> [ 21.229722] Either enable ECC checking or force module loading by setting 'ecc_enable_override'.
> [ 21.229723] (Note that use of the override may cause unknown side effects.)
> [ 21.229934] amd64_edac: probe of 0000:00:18.2 failed with error -22
> [ 21.373141] HDA Intel 0000:04:01.0: PCI INT A -> GSI 17 (level, low) -> IRQ 17
> [ 21.373280] HDA Intel 0000:04:01.0: setting latency timer to 64
> [ 21.373285] HDA Intel 0000:04:01.0: PCI: Disallowing DAC for device
> [ 21.461004] hda_codec: ALC883: BIOS auto-probing.
> [ 21.462907] input: HDA Digital PCBeep as /devices/pci0000:00/0000:00:13.0/0000:04:01.0/input/input6
> [ 22.156505] Adding 262136k swap on /dev/mapper/vg00-swap. Priority:-1 extents:1 across:262136k
> [ 32.897030] kjournald starting. Commit interval 5 seconds
> [ 32.909096] EXT3 FS on md0, internal journal
> [ 32.909200] EXT3-fs: mounted filesystem with ordered data mode.
> [ 33.073055] kjournald starting. Commit interval 5 seconds
> [ 33.156713] EXT3 FS on dm-5, internal journal
> [ 33.156817] EXT3-fs: mounted filesystem with ordered data mode.
> [ 33.181588] kjournald starting. Commit interval 5 seconds
> [ 33.182243] EXT3 FS on dm-4, internal journal
> [ 33.182343] EXT3-fs: mounted filesystem with ordered data mode.
> [ 33.232237] EXT4-fs (dm-9): mounted filesystem with ordered data mode
> [ 33.287448] EXT4-fs (dm-6): mounted filesystem with ordered data mode
> [ 33.348953] EXT4-fs (dm-3): mounted filesystem with ordered data mode
> [ 33.414076] EXT4-fs (dm-1): mounted filesystem with ordered data mode
> [ 33.497949] EXT4-fs (dm-2): mounted filesystem with ordered data mode
> [ 33.672536] EXT4-fs (dm-12): mounted filesystem with ordered data mode
> [ 33.725336] EXT4-fs (dm-7): mounted filesystem with ordered data mode
> [ 33.791361] EXT4-fs (dm-10): mounted filesystem with ordered data mode
> [ 33.865425] EXT4-fs (dm-11): mounted filesystem with ordered data mode
> [ 33.964434] EXT4-fs (dm-13): mounted filesystem with ordered data mode
> [ 50.233632] RPC: Registered udp transport module.
> [ 50.233703] RPC: Registered tcp transport module.
> [ 50.233759] RPC: Registered tcp NFSv4.1 backchannel transport module.
> [ 50.261049] Slow work thread pool: Starting up
> [ 50.261195] Slow work thread pool: Ready
> [ 50.261332] FS-Cache: Loaded
> [ 50.317395] FS-Cache: Netfs 'nfs' registered for caching
> [ 50.349999] Installing knfsd (copyright (C) 1996 okir@monad.swb.de).
> [ 50.925510] fuse init (API version 7.13)
> [ 52.467290] powernow-k8: Found 1 AMD Athlon(tm) 64 X2 Dual Core Processor 4200+ processors (2 cpu cores) (version 2.20.00)
> [ 52.467426] powernow-k8: 0 : fid 0xe (2200 MHz), vid 0xc
> [ 52.467483] powernow-k8: 1 : fid 0xc (2000 MHz), vid 0xe
> [ 52.467541] powernow-k8: 2 : fid 0xa (1800 MHz), vid 0x10
> [ 52.467599] powernow-k8: 3 : fid 0x2 (1000 MHz), vid 0x12
> [ 52.678554] kvm: Nested Virtualization enabled
> [ 53.153019] Clocksource tsc unstable (delta = -269844223 ns)
> [ 55.712610] st0: Failed to read 64512 byte block with 80 byte transfer.
> [ 71.320893] ip_tables: (C) 2000-2006 Netfilter Core Team
> [ 73.046091] lp0: using parport0 (interrupt-driven).
> [ 73.057427] ppdev: user-space parallel port driver
> [ 76.243406] ip6_tables: (C) 2000-2006 Netfilter Core Team
> [ 78.057768] [drm] Initialized drm 1.1.0 20060810
> [ 78.162620] alloc irq_desc for 16 on node 0
> [ 78.162625] alloc kstat_irqs on node 0
> [ 78.162636] pci 0000:01:00.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16
> [ 78.164716] [drm] Initialized via 2.11.1 20070202 for 0000:01:00.0 on minor 0
> [ 78.165039] ioctl32(Xorg:3623): Unknown cmd fd(11) cmd(c0106407){t:'d';sz:16} arg(ff894e10) on /dev/dri/card0
> [ 78.165056] ioctl32(Xorg:3623): Unknown cmd fd(11) cmd(c0086401){t:'d';sz:8} arg(ff894e08) on /dev/dri/card0
> [ 78.228349] ioctl32(Xorg:3623): Unknown cmd fd(11) cmd(c0246400){t:'d';sz:36} arg(0869c910) on /dev/dri/card0
> [ 78.234915] ioctl32(Xorg:3623): Unknown cmd fd(11) cmd(c0246400){t:'d';sz:36} arg(0869c910) on /dev/dri/card0
> [ 82.424895] NFSD: Using /var/lib/nfs/v4recovery as the NFSv4 state recovery directory
> [ 82.437939] NFSD: starting 90-second grace period
> [ 306.805357] SGI XFS with ACLs, security attributes, realtime, large block/inode numbers, no debug enabled
> [ 306.807862] SGI XFS Quota Management subsystem
> [ 306.825141] JFS: nTxBlock = 8192, nTxLock = 65536
> [ 306.851135] NTFS driver 2.1.29 [Flags: R/W MODULE].
> [ 306.872372] QNX4 filesystem 0.2.3 registered.
> [ 686.805028] ata4: lost interrupt (Status 0x51)
> [ 691.805047] ata4.01: qc timeout (cmd 0xa0)
> [ 691.805064] ata4.01: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6 frozen
> [ 691.805092] sr 4:0:1:0: CDB: Test Unit Ready: 00 00 00 00 00 00
> [ 691.805105] ata4.01: cmd a0/00:00:00:00:00/00:00:00:00:00/b0 tag 0
> [ 691.805106] res 51/20:03:00:00:00/00:00:00:00:00/b0 Emask 0x5 (timeout)
> [ 691.805110] ata4.01: status: { DRDY ERR }
> [ 691.805136] ata4: soft resetting link
> [ 692.193313] ata4.01: configured for UDMA/66
> [ 697.193028] ata4.01: qc timeout (cmd 0xa0)
> [ 697.193037] ata4.01: TEST_UNIT_READY failed (err_mask=0x5)
> [ 697.193060] ata4: soft resetting link
> [ 697.585251] ata4.01: configured for UDMA/66
> [ 702.585058] ata4.01: qc timeout (cmd 0xa0)
> [ 702.585071] ata4.01: TEST_UNIT_READY failed (err_mask=0x5)
> [ 702.585076] ata4.01: limiting speed to UDMA/66:PIO3
> [ 702.585103] ata4: soft resetting link
> [ 702.977291] ata4.01: configured for UDMA/66
> [ 707.977030] ata4.01: qc timeout (cmd 0xa0)
> [ 707.977040] ata4.01: TEST_UNIT_READY failed (err_mask=0x5)
> [ 707.977043] ata4.01: disabled
> [ 707.977081] ata4: soft resetting link
> [ 708.301095] ata4: EH complete
>
> ** Model information
> sys_vendor: MICRO-STAR INTERNATIONAL CO., LTD
> product_name: MS-7253
> product_version: 1.00
> chassis_vendor:
> chassis_version:
> bios_vendor: Phoenix Technologies, LTD
> bios_version: 6.00 PG
> board_vendor: MICRO-STAR INTERNATIONAL CO., LTD
> board_name: MS-7253
> board_version: 1.00
>
> ** Loaded modules:
> Module Size Used by
> ufs 56458 0
> qnx4 6194 0
> hfsplus 64966 0
> hfs 37199 0
> minix 21117 0
> ntfs 162540 0
> vfat 7836 0
> msdos 5914 0
> fat 39990 2 vfat,msdos
> jfs 140115 0
> xfs 436189 0
> via 32847 0
> drm 142199 1 via
> ip6_tables 14867 0
> ppdev 5030 0
> lp 7462 0
> xt_multiport 2267 1
> iptable_filter 2258 1
> ip_tables 13675 1 iptable_filter
> x_tables 12685 3 ip6_tables,xt_multiport,ip_tables
> kvm_amd 31222 0
> kvm 213448 1 kvm_amd
> powernow_k8 10978 1
> cpufreq_stats 2659 0
> cpufreq_powersave 902 0
> cpufreq_userspace 1992 0
> cpufreq_conservative 5162 0
> dm_snapshot 18513 0
> dm_mirror 10843 0
> dm_region_hash 6680 1 dm_mirror
> dm_log 7381 2 dm_mirror,dm_region_hash
> fuse 49982 1
> nfsd 253350 13
> exportfs 3122 2 xfs,nfsd
> nfs 239786 0
> lockd 57299 2 nfsd,nfs
> fscache 29818 1 nfs
> nfs_acl 2031 2 nfsd,nfs
> auth_rpcgss 33428 2 nfsd,nfs
> sunrpc 160117 12 nfsd,nfs,lockd,nfs_acl,auth_rpcgss
> ext3 106326 3
> jbd 36861 1 ext3
> ext2 52953 1
> snd_hda_codec_realtek 235026 1
> snd_hda_intel 19907 0
> snd_hda_codec 53892 2 snd_hda_codec_realtek,snd_hda_intel
> snd_hwdep 5236 1 snd_hda_codec
> snd_pcm_oss 32415 0
> snd_mixer_oss 12478 1 snd_pcm_oss
> snd_pcm 60119 3 snd_hda_intel,snd_hda_codec,snd_pcm_oss
> snd_seq_midi 4256 0
> snd_rawmidi 15323 1 snd_seq_midi
> snd_seq_midi_event 4628 1 snd_seq_midi
> snd_seq 41281 2 snd_seq_midi,snd_seq_midi_event
> snd_timer 15486 2 snd_pcm,snd_seq
> snd_seq_device 4493 3 snd_seq_midi,snd_rawmidi,snd_seq
> snd 45918 11 snd_hda_codec_realtek,snd_hda_intel,snd_hda_codec,snd_hwdep,snd_pcm_oss,snd_mixer_oss,snd_pcm,snd_rawmidi,snd_seq,snd_timer,snd_seq_device
> edac_core 29197 0
> psmouse 49777 0
> soundcore 4566 1 snd
> edac_mce_amd 6433 0
> evdev 7352 14
> tpm_tis 7336 0
> snd_page_alloc 6217 2 snd_hda_intel,snd_pcm
> tpm 9549 1 tpm_tis
> pcspkr 1699 0
> tpm_bios 4489 1 tpm
> serio_raw 3752 0
> k8temp 3139 0
> parport_pc 18855 1
> i2c_viapro 5483 0
> i2c_core 15328 2 drm,i2c_viapro
> parport 27682 3 ppdev,lp,parport_pc
> shpchp 26232 0
> pci_hotplug 21203 1 shpchp
> button 4650 0
> processor 30167 1 powernow_k8
> sha256_generic 8644 2
> aes_x86_64 7340 2
> aes_generic 25714 1 aes_x86_64
> cbc 2507 1
> ext4 285387 11
> mbcache 5050 3 ext3,ext2,ext4
> jbd2 66823 1 ext4
> crc16 1319 1 ext4
> dm_crypt 10491 1
> raid1 17999 2
> md_mod 73040 3 raid1
> reiserfs 193756 0
> dm_mod 53434 58 dm_snapshot,dm_mirror,dm_log,dm_crypt
> usb_storage 39337 1
> usbhid 33244 2
> hid 62793 1 usbhid
> sg 18632 0
> sr_mod 12250 0
> sd_mod 29553 8
> crc_t10dif 1276 1 sd_mod
> cdrom 28631 1 sr_mod
> st 30404 2
> ata_generic 2983 0
> osst 44725 0
> pata_via 7461 0
> uhci_hcd 18521 0
> sata_via 7789 4
> via_rhine 17371 0
> atp870u 24161 1
> thermal 11610 0
> tulip 41368 0
> thermal_sys 11942 2 processor,thermal
> ehci_hcd 31023 0
> libata 133008 3 ata_generic,pata_via,sata_via
> scsi_mod 121717 8 usb_storage,sg,sr_mod,sd_mod,st,osst,atp870u,libata
> mii 3210 1 via_rhine
> usbcore 121671 7 usb_storage,usbhid,uhci_hcd,ehci_hcd
> nls_base 6361 7 hfsplus,hfs,ntfs,vfat,fat,jfs,usbcore
>
> ** PCI devices:
> 00:00.0 Host bridge [0600]: VIA Technologies, Inc. K8M890CE Host Bridge [1106:0336]
> Subsystem: VIA Technologies, Inc. K8M890CE Host Bridge [1106:0336]
> Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
> Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort+ >SERR- <PERR- INTx-
> Latency: 8, Cache Line Size: 32 bytes
> Region 0: Memory at <ignored> (32-bit, prefetchable)
> Capabilities: <access denied>
> Kernel driver in use: agpgart-amd64
>
> 00:00.1 Host bridge [0600]: VIA Technologies, Inc. K8M890CE Host Bridge [1106:1336]
> Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
> Status: Cap- 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
> Latency: 0, Cache Line Size: 32 bytes
>
> 00:00.2 Host bridge [0600]: VIA Technologies, Inc. K8M890CE Host Bridge [1106:2336]
> Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
> Status: Cap- 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
> Latency: 0, Cache Line Size: 32 bytes
>
> 00:00.3 Host bridge [0600]: VIA Technologies, Inc. K8M890CE Host Bridge [1106:3336]
> Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
> Status: Cap- 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
> Latency: 0, Cache Line Size: 32 bytes
>
> 00:00.4 Host bridge [0600]: VIA Technologies, Inc. K8M890CE Host Bridge [1106:4336]
> Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
> Status: Cap- 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
> Latency: 0, Cache Line Size: 32 bytes
>
> 00:00.5 PIC [0800]: VIA Technologies, Inc. K8M890CE I/O APIC Interrupt Controller [1106:5336] (prog-if 20 [IO(X)-APIC])
> Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
> Status: Cap- 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
> Latency: 0, Cache Line Size: 32 bytes
>
> 00:00.7 Host bridge [0600]: VIA Technologies, Inc. K8M890CE Host Bridge [1106:7336]
> Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
> Status: Cap- 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
> Latency: 0, Cache Line Size: 32 bytes
>
> 00:01.0 PCI bridge [0604]: VIA Technologies, Inc. VT8237 PCI bridge [K8T800/K8T890 South] [1106:b188] (prog-if 00 [Normal decode])
> Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
> Status: Cap+ 66MHz+ UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
> Latency: 0, Cache Line Size: 32 bytes
> Bus: primary=00, secondary=01, subordinate=01, sec-latency=0
> I/O behind bridge: 0000e000-0000efff
> Memory behind bridge: dd000000-deffffff
> Prefetchable memory behind bridge: c0000000-cfffffff
> Secondary status: 66MHz+ FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- <SERR- <PERR-
> BridgeCtl: Parity- SERR- NoISA- VGA+ MAbort- >Reset- FastB2B-
> PriDiscTmr- SecDiscTmr- DiscTmrStat- DiscTmrSERREn-
> Capabilities: <access denied>
>
> 00:02.0 PCI bridge [0604]: VIA Technologies, Inc. K8T890 PCI to PCI Bridge Controller [1106:a238] (prog-if 00 [Normal decode])
> Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
> Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
> Latency: 0, Cache Line Size: 32 bytes
> Bus: primary=00, secondary=02, subordinate=02, sec-latency=0
> I/O behind bridge: 0000d000-0000dfff
> Memory behind bridge: dfc00000-dfcfffff
> Prefetchable memory behind bridge: 00000000dfb00000-00000000dfbfffff
> Secondary status: 66MHz- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- <SERR- <PERR-
> BridgeCtl: Parity- SERR- NoISA- VGA- MAbort- >Reset- FastB2B-
> PriDiscTmr- SecDiscTmr- DiscTmrStat- DiscTmrSERREn-
> Capabilities: <access denied>
> Kernel driver in use: pcieport
>
> 00:03.0 PCI bridge [0604]: VIA Technologies, Inc. K8T890 PCI to PCI Bridge Controller [1106:c238] (prog-if 00 [Normal decode])
> Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
> Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
> Latency: 0, Cache Line Size: 32 bytes
> Bus: primary=00, secondary=03, subordinate=03, sec-latency=0
> I/O behind bridge: 0000c000-0000cfff
> Memory behind bridge: dfe00000-dfefffff
> Prefetchable memory behind bridge: 00000000dfd00000-00000000dfdfffff
> Secondary status: 66MHz- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- <SERR- <PERR-
> BridgeCtl: Parity- SERR- NoISA- VGA- MAbort- >Reset- FastB2B-
> PriDiscTmr- SecDiscTmr- DiscTmrStat- DiscTmrSERREn-
> Capabilities: <access denied>
> Kernel driver in use: pcieport
>
> 00:0f.0 IDE interface [0101]: VIA Technologies, Inc. VT8237A SATA 2-Port Controller [1106:0591] (rev 80) (prog-if 8f [Master SecP SecO PriP PriO])
> Subsystem: Micro-Star International Co., Ltd. Device [1462:7253]
> Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
> Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
> Latency: 64
> Interrupt: pin B routed to IRQ 21
> Region 0: I/O ports at ff00 [size=8]
> Region 1: I/O ports at fe00 [size=4]
> Region 2: I/O ports at fd00 [size=8]
> Region 3: I/O ports at fc00 [size=4]
> Region 4: I/O ports at fb00 [size=16]
> Region 5: I/O ports at f400 [size=256]
> Capabilities: <access denied>
> Kernel driver in use: sata_via
>
> 00:0f.1 IDE interface [0101]: VIA Technologies, Inc. VT82C586A/B/VT82C686/A/B/VT823x/A/C PIPC Bus Master IDE [1106:0571] (rev 07) (prog-if 8a [Master SecP PriP])
> Subsystem: Micro-Star International Co., Ltd. Device [1462:7253]
> Control: I/O+ Mem- BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
> Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx+
> Latency: 64
> Region 0: [virtual] Memory at 000001f0 (32-bit, non-prefetchable) [size=8]
> Region 1: [virtual] Memory at 000003f0 (type 3, non-prefetchable) [size=1]
> Region 2: [virtual] Memory at 00000170 (32-bit, non-prefetchable) [size=8]
> Region 3: [virtual] Memory at 00000370 (type 3, non-prefetchable) [size=1]
> Region 4: I/O ports at fa00 [size=16]
> Capabilities: <access denied>
> Kernel driver in use: pata_via
>
> 00:10.0 USB Controller [0c03]: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller [1106:3038] (rev a0) (prog-if 00 [UHCI])
> Subsystem: Micro-Star International Co., Ltd. Device [1462:7253]
> Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
> Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
> Latency: 64, Cache Line Size: 32 bytes
> Interrupt: pin A routed to IRQ 20
> Region 4: I/O ports at f900 [size=32]
> Capabilities: <access denied>
> Kernel driver in use: uhci_hcd
>
> 00:10.1 USB Controller [0c03]: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller [1106:3038] (rev a0) (prog-if 00 [UHCI])
> Subsystem: Micro-Star International Co., Ltd. Device [1462:7253]
> Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
> Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
> Latency: 64, Cache Line Size: 32 bytes
> Interrupt: pin B routed to IRQ 22
> Region 4: I/O ports at f800 [size=32]
> Capabilities: <access denied>
> Kernel driver in use: uhci_hcd
>
> 00:10.2 USB Controller [0c03]: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller [1106:3038] (rev a0) (prog-if 00 [UHCI])
> Subsystem: Micro-Star International Co., Ltd. Device [1462:7253]
> Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
> Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
> Latency: 64, Cache Line Size: 32 bytes
> Interrupt: pin C routed to IRQ 21
> Region 4: I/O ports at f700 [size=32]
> Capabilities: <access denied>
> Kernel driver in use: uhci_hcd
>
> 00:10.3 USB Controller [0c03]: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller [1106:3038] (rev a0) (prog-if 00 [UHCI])
> Subsystem: Micro-Star International Co., Ltd. Device [1462:7253]
> Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
> Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
> Latency: 64, Cache Line Size: 32 bytes
> Interrupt: pin D routed to IRQ 23
> Region 4: I/O ports at f600 [size=32]
> Capabilities: <access denied>
> Kernel driver in use: uhci_hcd
>
> 00:10.4 USB Controller [0c03]: VIA Technologies, Inc. USB 2.0 [1106:3104] (rev 86) (prog-if 20 [EHCI])
> Subsystem: Micro-Star International Co., Ltd. Device [1462:7253]
> Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV+ VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
> Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
> Latency: 64, Cache Line Size: 64 bytes
> Interrupt: pin C routed to IRQ 21
> Region 0: Memory at dffff000 (32-bit, non-prefetchable) [size=256]
> Capabilities: <access denied>
> Kernel driver in use: ehci_hcd
>
> 00:11.0 ISA bridge [0601]: VIA Technologies, Inc. VT8237A PCI to ISA Bridge [1106:3337]
> Subsystem: VIA Technologies, Inc. VT8237A PCI to ISA Bridge [1106:3337]
> Control: I/O+ Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
> Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
> Capabilities: <access denied>
>
> 00:11.7 Host bridge [0600]: VIA Technologies, Inc. VT8251 Ultra VLINK Controller [1106:287e]
> Subsystem: VIA Technologies, Inc. Device [1106:337e]
> Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
> Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort+ >SERR- <PERR- INTx-
> Latency: 64
> Capabilities: <access denied>
>
> 00:12.0 Ethernet controller [0200]: VIA Technologies, Inc. VT6102 [Rhine-II] [1106:3065] (rev 7c)
> Subsystem: Micro-Star International Co., Ltd. Device [1462:7253]
> Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
> Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
> Latency: 64 (750ns min, 2000ns max), Cache Line Size: 32 bytes
> Interrupt: pin A routed to IRQ 23
> Region 0: I/O ports at f200 [size=256]
> Region 1: Memory at dfffe000 (32-bit, non-prefetchable) [size=256]
> Capabilities: <access denied>
> Kernel driver in use: via-rhine
>
> 00:13.0 PCI bridge [0604]: VIA Technologies, Inc. VT8237A Host Bridge [1106:337b] (prog-if 00 [Normal decode])
> Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
> Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort+ >SERR- <PERR- INTx-
> Latency: 0
> Bus: primary=00, secondary=04, subordinate=04, sec-latency=0
> I/O behind bridge: 0000b000-0000bfff
> Memory behind bridge: dfa00000-dfafffff
> Prefetchable memory behind bridge: 00000000df900000-00000000df9fffff
> Secondary status: 66MHz- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- <SERR- <PERR-
> BridgeCtl: Parity- SERR- NoISA- VGA- MAbort- >Reset- FastB2B-
> PriDiscTmr- SecDiscTmr- DiscTmrStat- DiscTmrSERREn-
> Capabilities: <access denied>
>
> 00:13.1 PCI bridge [0604]: VIA Technologies, Inc. VT8237A PCI to PCI Bridge [1106:337a] (prog-if 01 [Subtractive decode])
> Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
> Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort+ >SERR- <PERR- INTx-
> Latency: 0
> Bus: primary=00, secondary=05, subordinate=05, sec-latency=0
> I/O behind bridge: 0000a000-0000afff
> Memory behind bridge: df800000-df8fffff
> Prefetchable memory behind bridge: 00000000df700000-00000000df7fffff
> Secondary status: 66MHz- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- <SERR- <PERR-
> BridgeCtl: Parity- SERR- NoISA- VGA- MAbort- >Reset- FastB2B-
> PriDiscTmr- SecDiscTmr- DiscTmrStat- DiscTmrSERREn-
> Capabilities: <access denied>
>
> 00:18.0 Host bridge [0600]: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] HyperTransport Technology Configuration [1022:1100]
> Control: I/O- Mem- BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
> Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
> Capabilities: <access denied>
>
> 00:18.1 Host bridge [0600]: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Address Map [1022:1101]
> Control: I/O- Mem- BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
> Status: Cap- 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
>
> 00:18.2 Host bridge [0600]: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] DRAM Controller [1022:1102]
> Control: I/O- Mem- BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
> Status: Cap- 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
>
> 00:18.3 Host bridge [0600]: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Miscellaneous Control [1022:1103]
> Control: I/O- Mem- BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
> Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
> Capabilities: <access denied>
> Kernel driver in use: k8temp
>
> 01:00.0 VGA compatible controller [0300]: VIA Technologies, Inc. K8M890CE/K8N890CE [Chrome 9] [1106:3230] (rev 11) (prog-if 00 [VGA controller])
> Subsystem: Micro-Star International Co., Ltd. Device [1462:7253]
> Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
> Status: Cap+ 66MHz+ UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
> Latency: 64 (500ns min)
> Interrupt: pin A routed to IRQ 16
> Region 0: Memory at c0000000 (32-bit, prefetchable) [size=256M]
> Region 1: Memory at dd000000 (32-bit, non-prefetchable) [size=16M]
> [virtual] Expansion ROM at de000000 [disabled] [size=64K]
> Capabilities: <access denied>
>
> 04:01.0 Audio device [0403]: VIA Technologies, Inc. VT1708/A [Azalia HDAC] (VIA High Definition Audio Controller) [1106:3288] (rev 10)
> Subsystem: Micro-Star International Co., Ltd. Device [1462:7253]
> Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
> Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
> Latency: 0, Cache Line Size: 32 bytes
> Interrupt: pin A routed to IRQ 17
> Region 0: Memory at dfafc000 (64-bit, non-prefetchable) [size=16K]
> Capabilities: <access denied>
> Kernel driver in use: HDA Intel
>
> 05:04.0 SCSI storage controller [0100]: Artop Electronic Corp AEC6712UW SCSI [1191:8010] (rev 01)
> Subsystem: Artop Electronic Corp AEC6712UW SCSI [1191:8010]
> Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
> Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
> Latency: 254
> Interrupt: pin A routed to IRQ 17
> Region 0: I/O ports at af00 [size=64]
> [virtual] Expansion ROM at df740000 [disabled] [size=64K]
> Capabilities: <access denied>
> Kernel driver in use: atp870u
>
> 05:05.0 Ethernet controller [0200]: Digital Equipment Corporation DECchip 21142/43 [1011:0019] (rev 30)
> Subsystem: Digital Equipment Corporation DE500B Fast Ethernet [1011:500b]
> Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
> Status: Cap- 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
> Latency: 64 (5000ns min, 10000ns max), Cache Line Size: 32 bytes
> Interrupt: pin A routed to IRQ 18
> Region 0: I/O ports at ae00 [size=128]
> Region 1: Memory at df8ff000 (32-bit, non-prefetchable) [size=128]
> [virtual] Expansion ROM at df700000 [disabled] [size=256K]
> Kernel driver in use: tulip
>
>
> ** USB devices:
> Bus 005 Device 003: ID 08ec:0010 M-Systems Flash Disk Pioneers DiskOnKey
> Bus 005 Device 002: ID 058f:6362 Alcor Micro Corp. Flash Card Reader/Writer
> Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
> Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
> Bus 003 Device 004: ID 045e:005f Microsoft Corp. Wireless MultiMedia Keyboard
> Bus 003 Device 003: ID 0557:7000 ATEN International Co., Ltd Hub
> Bus 003 Device 002: ID 051d:0002 American Power Conversion Uninterruptible Power Supply
> Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
> Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
> Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
>
>
> -- System Information:
> Debian Release: squeeze/sid
> APT prefers testing
> APT policy: (900, 'testing'), (500, 'stable'), (400, 'oldstable'), (50, 'unstable')
> Architecture: i386 (x86_64)
>
> Kernel: Linux 2.6.32-5-amd64 (SMP w/2 CPU cores)
> Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
> Shell: /bin/sh linked to /bin/bash
>
> Versions of packages linux-image-2.6.32-5-amd64 depends on:
> ii debconf [debconf-2.0] 1.5.32 Debian configuration management sy
> ii initramfs-tools [linux-initr 0.94.4 tools for generating an initramfs
> ii linux-base 2.6.32-15 Linux image base package
> ii module-init-tools 3.12~pre2-3 tools for managing Linux kernel mo
>
> Versions of packages linux-image-2.6.32-5-amd64 recommends:
> ii firmware-linux-free 2.6.32-9 Binary firmware for various driver
> ii libc6-i686 2.10.2-9 GNU C Library: Shared libraries [i
>
> Versions of packages linux-image-2.6.32-5-amd64 suggests:
> pn grub | lilo <none> (no description available)
> pn linux-doc-2.6.32 <none> (no description available)
>
> Versions of packages linux-image-2.6.32-5-amd64 is related to:
> pn firmware-bnx2 <none> (no description available)
> pn firmware-bnx2x <none> (no description available)
> pn firmware-ipw2x00 <none> (no description available)
> pn firmware-ivtv <none> (no description available)
> pn firmware-iwlwifi <none> (no description available)
> pn firmware-linux <none> (no description available)
> pn firmware-linux-nonfree <none> (no description available)
> pn firmware-qlogic <none> (no description available)
> pn firmware-ralink <none> (no description available)
> pn xen-hypervisor <none> (no description available)
>
> -- debconf information:
> linux-image-2.6.32-5-amd64/postinst/missing-firmware-2.6.32-5-amd64:
> linux-image-2.6.32-5-amd64/postinst/bootloader-error-2.6.32-5-amd64:
> linux-image-2.6.32-5-amd64/prerm/would-invalidate-boot-loader-2.6.32-5-amd64: true
> shared/kernel-image/really-run-bootloader: true
> linux-image-2.6.32-5-amd64/postinst/depmod-error-initrd-2.6.32-5-amd64: false
> linux-image-2.6.32-5-amd64/prerm/removing-running-kernel-2.6.32-5-amd64: true
> linux-image-2.6.32-5-amd64/postinst/bootloader-test-error-2.6.32-5-amd64:
--
Ben Hutchings
Once a job is fouled up, anything done to improve it makes it worse.
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
^ permalink raw reply
* Re: [PATCH] virtio_net: indicate oom when addbuf returns failure
From: Michael S. Tsirkin @ 2010-06-06 20:13 UTC (permalink / raw)
To: Rusty Russell; +Cc: Herbert Xu, netdev, virtualization, stable, Bruce Rogers
In-Reply-To: <201006041028.56798.rusty@rustcorp.com.au>
On Fri, Jun 04, 2010 at 10:28:56AM +0930, Rusty Russell wrote:
> This patch is a subset of an already upstream patch, but this portion
> is useful in earlier releases.
>
> Please consider for the 2.6.32 and 2.6.33 stable trees.
>
> If the add_buf operation fails, indicate failure to the caller.
>
> Signed-off-by: Bruce Rogers <brogers@novell.com>
> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Actually this code looks strange:
Note that add_buf inicates out of memory
condition with a positive return value, and ring full
(which is not an error!) with -ENOSPC.
So it seems that this patch (and upstream code) will fill
the ring and then end up setting oom = true and rescheduling the work
forever. And I suspect I actually saw this at some point
on one of my systems: observed BW would drop
with high CPU usage until reboot.
Can't reproduce it now anymore ..
> --- a/drivers/net/virtio_net.c
> +++ b/drivers/net/virtio_net.c
>
> @@ -318,6 +318,7 @@ static bool try_fill_recv_maxbufs(struct
> skb_unlink(skb, &vi->recv);
> trim_pages(vi, skb);
> kfree_skb(skb);
> + oom = true;
> break;
> }
> vi->num++;
> @@ -368,6 +369,7 @@ static bool try_fill_recv(struct virtnet
> if (err < 0) {
> skb_unlink(skb, &vi->recv);
> kfree_skb(skb);
> + oom = true;
> break;
> }
> vi->num++;
Possibly the right thing to do is to
1. handle ENOMEM specially
2. fix add_buf to return ENOMEM on error
Something like the below for upstream (warning: compile
tested only) and a similar one later for stable:
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index 06c30df..85615a3 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -416,7 +416,7 @@ static int add_recvbuf_mergeable(struct virtnet_info *vi, gfp_t gfp)
static bool try_fill_recv(struct virtnet_info *vi, gfp_t gfp)
{
int err;
- bool oom = false;
+ bool oom;
do {
if (vi->mergeable_rx_bufs)
@@ -426,10 +426,9 @@ static bool try_fill_recv(struct virtnet_info *vi, gfp_t gfp)
else
err = add_recvbuf_small(vi, gfp);
- if (err < 0) {
- oom = true;
+ oom = err == -ENOMEM;
+ if (err < 0)
break;
- }
++vi->num;
} while (err > 0);
if (unlikely(vi->num > vi->max))
diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c
index f9e6fbb..3c7f10a 100644
--- a/drivers/virtio/virtio_ring.c
+++ b/drivers/virtio/virtio_ring.c
@@ -119,7 +119,7 @@ static int vring_add_indirect(struct vring_virtqueue *vq,
desc = kmalloc((out + in) * sizeof(struct vring_desc), gfp);
if (!desc)
- return vq->vring.num;
+ return -ENOMEM;
/* Transfer entries from the sg list into the indirect page */
for (i = 0; i < out; i++) {
^ permalink raw reply related
* Re: [RFC][PATCH] Fix another namespace issue with devices assigned to classes
From: Kay Sievers @ 2010-06-06 17:17 UTC (permalink / raw)
To: Johannes Berg; +Cc: Eric W. Biederman, Greg KH, netdev
In-Reply-To: <1275829701.3615.54.camel@jlt3.sipsolutions.net>
On Sun, Jun 6, 2010 at 15:08, Johannes Berg <johannes@sipsolutions.net> wrote:
> On Fri, 2010-06-04 at 10:34 +0200, Kay Sievers wrote:
>> Actually there is not much reason to ever use "struct class" today.
>> The layout for classes in /sys is not extendable like it is for buses
>> which put all devices in a devices/ subdir and have the main subsystem
>> directory to add custom things.
>
> Ok, I don't get it.
>
> For hwsim, we create entirely virtual "struct device"s. I think we just
> need that so userspace like network-manager doesn't get completely
> confused. BUT: device_create() needs a struct class parameter as the
> first parameter. So should we have a virtual class _and_ a virtual bus??
>
> Similarly for wireless itself (net/wireless/), we use
> device_initialize() and set up the dev.class and dev.platform_data (not
> sure why platform data?) since this is a virtual abstraction. Basically
> we want to show in sysfs that
>
> physical device
> +--- (virtual) wireless phy device 1
> +--- netdev 1
> +--- netdev 2
> +--- netdev 3
> +--- (virtual) wireless phy device 2
> +--- netdev 4
>
> Although the second wireless phy device is only done by ath9k and will
> be removed soon. Still we should show that those netdevs all belong to
> the given wireless phy device.
>
> So ... what should I do? How can I do device_create/device_initialize
> without a struct class?
There is no real difference between classes and buses. Actually we're
working on merging them completely inside the kernel. Just declare a
"struct bus_type" instead of a "struct class".
> And why a bus instead? It's not like there are
> devices that need to be discovered and bound to it etc.
Because class devices are not meat to ever have children from other
classes. This is just not what they should be used like.
Also the flat directories in /sys/class/<name>/* are not extendable
with other stuff, and they should not be used for new stuff. You can
never put subsystem-wide properties to that directory without
confusing userspace. That is not a problem at all with buses, as they
have a dedicated devices/ subdir in the bus directory. If there are no
legacy reason, or things which are already a class, and they should
look similar, no new classes should be added to the kernel.
Kay
^ permalink raw reply
* Re: [RFC][PATCH] Fix another namespace issue with devices assigned to classes
From: Johannes Berg @ 2010-06-06 13:08 UTC (permalink / raw)
To: Kay Sievers; +Cc: Eric W. Biederman, Greg KH, netdev
In-Reply-To: <AANLkTin6ub4k4QYSMnGLRw7lxQaz23Xmo2GQC1RrUf-X@mail.gmail.com>
On Fri, 2010-06-04 at 10:34 +0200, Kay Sievers wrote:
> >> Assuming that hwsim is th parent of the network interface, it should
> >> us a "struct bus_type" not a "struct class" for the subsystem it
> >> assigns the devices to.
> >
> > It's all virtual, so yeah, I guess it is the parent? It currently
> > creates a virtual struct device in the hwsim class and assigns that to
> > the netdev parent indirectly via the wiphy or something like that.
> >
> >> Classes should not be used for anything completely simple, at best not
> >> be used at all, they are just too simple. We never know about future
> >> requirements, which usually all go wrong with the non-extendable class
> >> logic.
> >>
> >> The difference in the code to switch from class to bus should be minimal.
> >
> > Does that mean cfg80211 (net/wireless/) should also not use a struct
> > class? I'm not familiar with any of these details, mind helping me out?
>
> Everything that might ever have a child device, or might ever need a
> sysfs attribute gobal to the subsystem must convert to a bus.
>
> Actually there is not much reason to ever use "struct class" today.
> The layout for classes in /sys is not extendable like it is for buses
> which put all devices in a devices/ subdir and have the main subsystem
> directory to add custom things.
Ok, I don't get it.
For hwsim, we create entirely virtual "struct device"s. I think we just
need that so userspace like network-manager doesn't get completely
confused. BUT: device_create() needs a struct class parameter as the
first parameter. So should we have a virtual class _and_ a virtual bus??
Similarly for wireless itself (net/wireless/), we use
device_initialize() and set up the dev.class and dev.platform_data (not
sure why platform data?) since this is a virtual abstraction. Basically
we want to show in sysfs that
physical device
+--- (virtual) wireless phy device 1
+--- netdev 1
+--- netdev 2
+--- netdev 3
+--- (virtual) wireless phy device 2
+--- netdev 4
Although the second wireless phy device is only done by ath9k and will
be removed soon. Still we should show that those netdevs all belong to
the given wireless phy device.
So ... what should I do? How can I do device_create/device_initialize
without a struct class? And why a bus instead? It's not like there are
devices that need to be discovered and bound to it etc.
johannes
^ permalink raw reply
* Re: [2.6.35-rc1] page alloc failure order:1, mode:0x4020
From: Eric Dumazet @ 2010-06-06 10:42 UTC (permalink / raw)
To: Michael Guntsche; +Cc: linux-kernel, netdev
In-Reply-To: <20100606095640.GA4436@trillian.comsick.at>
Le dimanche 06 juin 2010 à 11:56 +0200, Michael Guntsche a écrit :
> On 2010.06.04 18:16:44 , Michael Guntsche wrote:
> > I applied the patch recompiled and run it on the routerboard, trying
> > to trigger the bug again.
>
> Hi Eric,
>
> Up to now I was not able to reproduce the bug, do you think this patch
> can be pushed to mainline or is there a "better"/other fix for it?
>
> Kind regards,
> Michael
>
>
Thanks Michael for testing.
I'll submit ASAP an official patch, sent to all people involved in this
driver to get their Ack (or Nack).
IEEE80211_MAX_MPDU_LEN being 3840 + somebits is suspect, since it doesnt
match 802.11 specs.
It should be more close of 2304 + MAC header (32bytes) + FCS (4 bytes) ?
^ permalink raw reply
* Re: [2.6.35-rc1] page alloc failure order:1, mode:0x4020
From: Michael Guntsche @ 2010-06-06 9:56 UTC (permalink / raw)
To: Eric Dumazet; +Cc: linux-kernel, netdev
In-Reply-To: <20100604161644.GA98048@trillian.local>
On 2010.06.04 18:16:44 , Michael Guntsche wrote:
> I applied the patch recompiled and run it on the routerboard, trying
> to trigger the bug again.
Hi Eric,
Up to now I was not able to reproduce the bug, do you think this patch
can be pushed to mainline or is there a "better"/other fix for it?
Kind regards,
Michael
^ permalink raw reply
* Re: [PATCH] KVM: add schedule check to napi_enable call
From: Herbert Xu @ 2010-06-06 9:40 UTC (permalink / raw)
To: Bruce Rogers; +Cc: netdev, rusty
In-Reply-To: <4C07F8FF0200004800097554@sinclair.provo.novell.com>
Bruce Rogers <brogers@novell.com> wrote:
> Please consider this patch for the 2.6.32, 2.6.33, and 2.6.34 stable trees as well as current development trees. (I've only tested on 2.6.32 however)
>
> virtio_net: Add schedule check to napi_enable call
> Under harsh testing conditions, including low memory, the guest would
> stop receiving packets. With this patch applied we no longer see any
> problems in the driver while performing these tests for extended periods
> of time.
>
> Make sure napi is scheduled subsequent to each napi_enable.
>
> Signed-off-by: Bruce Rogers <brogers@novell.com>
> Signed-off-by: Olaf Kirch <okir@suse.de>
> Acked-by: Rusty Russell <rusty@rustcorp.com.au>
> Cc: stable@kernel.org
Looks good to me.
Thanks!
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply
* Re: [PATCH 1/2] net: ll_temac: fix interrupt bug when interrupt 0 is used
From: Grant Likely @ 2010-06-06 3:33 UTC (permalink / raw)
To: John Williams; +Cc: linuxppc-dev, netdev, Brian Hill, michal.simek, John Linn
In-Reply-To: <AANLkTin0Lg8HCpCAmyy_ybPlv6K9_iyE2aFrhifw486D@mail.gmail.com>
On Wed, May 26, 2010 at 10:12 PM, John Williams
<john.williams@petalogix.com> wrote:
> On Thu, May 27, 2010 at 3:29 AM, John Linn <john.linn@xilinx.com> wrote:
>> The code is not checking the interrupt for DMA correctly so that an
>> interrupt number of 0 will cause a false error.
>>
>> Signed-off-by: Brian Hill <brian.hill@xilinx.com>
>> Signed-off-by: John Linn <john.linn@xilinx.com>
>> ---
>> drivers/net/ll_temac_main.c | 2 +-
>> 1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/drivers/net/ll_temac_main.c b/drivers/net/ll_temac_main.c
>> index fa7620e..0615737 100644
>> --- a/drivers/net/ll_temac_main.c
>> +++ b/drivers/net/ll_temac_main.c
>> @@ -950,7 +950,7 @@ temac_of_probe(struct of_device *op, const struct of_device_id *match)
>>
>> lp->rx_irq = irq_of_parse_and_map(np, 0);
>> lp->tx_irq = irq_of_parse_and_map(np, 1);
>> - if (!lp->rx_irq || !lp->tx_irq) {
>> + if ((lp->rx_irq == NO_IRQ) || (lp->tx_irq == NO_IRQ)) {
>
> Personally I think this is the right thing to do. But, I thought the
> IRQ 0 == NO_IRQ (AKA "all-the-world's-an-x86-and-if-not-it-should-be")
> holy war was already fought and won (or lost, depending on your
> perspective)?
>
> I seem to recall giving reluctant assent to a patch from Grant a few
> months ago that touched MicroBlaze thus?
I've still got the patch in my private queue. I can reapply it, test
it and repost it. I think what was still a bit up in the air was the
exact method to map hw irq numbers onto linux irqs.
g.
^ permalink raw reply
* [PATCH net-next 08/10] tg3: Add 5719 ASIC rev
From: Matt Carlson @ 2010-06-06 3:24 UTC (permalink / raw)
To: davem; +Cc: netdev, andy, mcarlson, Michael Chan
This patch adds the 5719 ASIC revision.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
---
drivers/net/tg3.c | 68 +++++++++++++++++++++++++++++++++++++++--------------
drivers/net/tg3.h | 2 +
2 files changed, 52 insertions(+), 18 deletions(-)
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 1e1c341..63a5b96 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -1084,7 +1084,8 @@ static int tg3_mdio_init(struct tg3 *tp)
u32 reg;
struct phy_device *phydev;
- if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717) {
+ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 ||
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719) {
u32 is_serdes;
tp->phy_addr = PCI_FUNC(tp->pdev->devfn) + 1;
@@ -1600,7 +1601,8 @@ static void tg3_phy_toggle_apd(struct tg3 *tp, bool enable)
u32 reg;
if (!(tp->tg3_flags2 & TG3_FLG2_5705_PLUS) ||
- (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 &&
+ ((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 ||
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719) &&
(tp->tg3_flags2 & TG3_FLG2_MII_SERDES)))
return;
@@ -1975,7 +1977,8 @@ static int tg3_phy_reset(struct tg3 *tp)
}
}
- if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 &&
+ if ((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 ||
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719) &&
(tp->tg3_flags2 & TG3_FLG2_MII_SERDES))
return 0;
@@ -2060,6 +2063,7 @@ static void tg3_frob_aux_power(struct tg3 *tp)
/* The GPIOs do something completely different on 57765. */
if ((tp->tg3_flags2 & TG3_FLG2_IS_NIC) == 0 ||
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 ||
GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765)
return;
@@ -7083,6 +7087,7 @@ static int tg3_chip_reset(struct tg3 *tp)
tp->pci_chip_rev_id != CHIPREV_ID_5750_A0 &&
GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5785 &&
GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5717 &&
+ GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5719 &&
GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_57765) {
val = tr32(0x7c00);
@@ -7518,7 +7523,8 @@ static void tg3_rings_reset(struct tg3 *tp)
/* Disable all receive return rings but the first. */
- if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717)
+ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 ||
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719)
limit = NIC_SRAM_RCV_RET_RCB + TG3_BDINFO_SIZE * 17;
else if (!(tp->tg3_flags2 & TG3_FLG2_5705_PLUS))
limit = NIC_SRAM_RCV_RET_RCB + TG3_BDINFO_SIZE * 16;
@@ -7756,6 +7762,7 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
return err;
if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 ||
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 ||
GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765) {
val = tr32(TG3PCI_DMA_RW_CTRL) &
~DMA_RWCTRL_DIS_CACHE_ALIGNMENT;
@@ -7884,7 +7891,8 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
((u64) tpr->rx_std_mapping >> 32));
tw32(RCVDBDI_STD_BD + TG3_BDINFO_HOST_ADDR + TG3_64BIT_REG_LOW,
((u64) tpr->rx_std_mapping & 0xffffffff));
- if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5717)
+ if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5717 &&
+ GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5719)
tw32(RCVDBDI_STD_BD + TG3_BDINFO_NIC_ADDR,
NIC_SRAM_RX_BUFFER_DESC);
@@ -7909,7 +7917,8 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
tw32(RCVDBDI_JUMBO_BD + TG3_BDINFO_MAXLEN_FLAGS,
(RX_JUMBO_MAX_SIZE << BDINFO_FLAGS_MAXLEN_SHIFT) |
BDINFO_FLAGS_USE_EXT_RECV);
- if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5717)
+ if (!(tp->tg3_flags3 & TG3_FLG3_USE_JUMBO_BDFLAG) ||
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765)
tw32(RCVDBDI_JUMBO_BD + TG3_BDINFO_NIC_ADDR,
NIC_SRAM_RX_JUMBO_BUFFER_DESC);
} else {
@@ -7918,6 +7927,7 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
}
if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 ||
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 ||
GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765)
val = (RX_STD_MAX_SIZE_5705 << BDINFO_FLAGS_MAXLEN_SHIFT) |
(TG3_RX_STD_DMA_SZ << 2);
@@ -7936,6 +7946,7 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
tw32_rx_mbox(TG3_RX_JMB_PROD_IDX_REG, tpr->rx_jmb_prod_idx);
if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 ||
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 ||
GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765) {
tw32(STD_REPLENISH_LWM, 32);
tw32(JMB_REPLENISH_LWM, 16);
@@ -7971,7 +7982,8 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
RDMAC_MODE_FIFOURUN_ENAB | RDMAC_MODE_FIFOOREAD_ENAB |
RDMAC_MODE_LNGREAD_ENAB);
- if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717)
+ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 ||
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719)
rdmac_mode |= RDMAC_MODE_MULT_DMA_RD_DIS;
if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5784 ||
@@ -8626,6 +8638,7 @@ static int tg3_test_interrupt(struct tg3 *tp)
* observable way to know whether the interrupt was delivered.
*/
if ((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 ||
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 ||
GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765) &&
(tp->tg3_flags2 & TG3_FLG2_USING_MSI)) {
val = tr32(MSGINT_MODE) | MSGINT_MODE_ONE_SHOT_DISABLE;
@@ -8670,6 +8683,7 @@ static int tg3_test_interrupt(struct tg3 *tp)
if (intr_ok) {
/* Reenable MSI one shot mode. */
if ((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 ||
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 ||
GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765) &&
(tp->tg3_flags2 & TG3_FLG2_USING_MSI)) {
val = tr32(MSGINT_MODE) & ~MSGINT_MODE_ONE_SHOT_DISABLE;
@@ -8812,7 +8826,8 @@ static bool tg3_enable_msix(struct tg3 *tp)
if (tp->irq_cnt > 1) {
tp->tg3_flags3 |= TG3_FLG3_ENABLE_RSS;
- if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717) {
+ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 ||
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719) {
tp->tg3_flags3 |= TG3_FLG3_ENABLE_TSS;
tp->dev->real_num_tx_queues = tp->irq_cnt - 1;
}
@@ -8965,6 +8980,7 @@ static int tg3_open(struct net_device *dev)
}
if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5717 &&
+ GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5719 &&
GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_57765 &&
(tp->tg3_flags2 & TG3_FLG2_USING_MSI) &&
(tp->tg3_flags2 & TG3_FLG2_1SHOT_MSI)) {
@@ -10576,7 +10592,8 @@ static int tg3_test_memory(struct tg3 *tp)
int err = 0;
int i;
- if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717)
+ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 ||
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719)
mem_tbl = mem_tbl_5717;
else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765)
mem_tbl = mem_tbl_57765;
@@ -11656,7 +11673,8 @@ static void __devinit tg3_nvram_init(struct tg3 *tp)
else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780 ||
GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765)
tg3_get_57780_nvram_info(tp);
- else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717)
+ else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 ||
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719)
tg3_get_5717_nvram_info(tp);
else
tg3_get_nvram_info(tp);
@@ -12092,11 +12110,10 @@ static void __devinit tg3_get_eeprom_hw_cfg(struct tg3 *tp)
tp->phy_id = eeprom_phy_id;
if (eeprom_phy_serdes) {
- if ((tp->tg3_flags2 & TG3_FLG2_5780_CLASS) ||
- GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717)
- tp->tg3_flags2 |= TG3_FLG2_MII_SERDES;
- else
+ if (!(tp->tg3_flags2 & TG3_FLG2_5705_PLUS))
tp->tg3_flags2 |= TG3_FLG2_PHY_SERDES;
+ else
+ tp->tg3_flags2 |= TG3_FLG2_MII_SERDES;
}
if (tp->tg3_flags2 & TG3_FLG2_5750_PLUS)
@@ -12826,7 +12843,8 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
if (tp->pdev->device == TG3PCI_DEVICE_TIGON3_5717 ||
tp->pdev->device == TG3PCI_DEVICE_TIGON3_5718 ||
- tp->pdev->device == TG3PCI_DEVICE_TIGON3_5724)
+ tp->pdev->device == TG3PCI_DEVICE_TIGON3_5724 ||
+ tp->pdev->device == TG3PCI_DEVICE_TIGON3_5719)
pci_read_config_dword(tp->pdev,
TG3PCI_GEN2_PRODID_ASICREV,
&prod_id_asic_rev);
@@ -12992,6 +13010,7 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785 ||
GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780 ||
GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 ||
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 ||
GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765)
tp->tg3_flags3 |= TG3_FLG3_5755_PLUS;
@@ -13021,6 +13040,7 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
/* Determine TSO capabilities */
if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 ||
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 ||
GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765)
tp->tg3_flags2 |= TG3_FLG2_HW_TSO_3;
else if ((tp->tg3_flags3 & TG3_FLG3_5755_PLUS) ||
@@ -13058,6 +13078,7 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
}
if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 ||
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 ||
GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765) {
tp->tg3_flags |= TG3_FLAG_SUPPORT_MSIX;
tp->irq_max = TG3_IRQ_MAX_VECS;
@@ -13065,6 +13086,7 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
}
if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 ||
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 ||
GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906)
tp->tg3_flags3 |= TG3_FLG3_SHORT_DMA_BUG;
else if (!(tp->tg3_flags3 & TG3_FLG3_5755_PLUS)) {
@@ -13073,6 +13095,7 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
}
if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 ||
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 ||
GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765)
tp->tg3_flags3 |= TG3_FLG3_USE_JUMBO_BDFLAG;
@@ -13275,6 +13298,7 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785 ||
GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57780 ||
GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 ||
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 ||
GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765)
tp->tg3_flags |= TG3_FLAG_CPMU_PRESENT;
@@ -13355,6 +13379,7 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5785 &&
GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_57780 &&
GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5717 &&
+ GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5719 &&
GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_57765) {
if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5755 ||
GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5787 ||
@@ -13603,9 +13628,12 @@ static int __devinit tg3_get_device_address(struct tg3 *tp)
tw32_f(NVRAM_CMD, NVRAM_CMD_RESET);
else
tg3_nvram_unlock(tp);
- } else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717) {
- if (PCI_FUNC(tp->pdev->devfn))
+ } else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 ||
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719) {
+ if (PCI_FUNC(tp->pdev->devfn) & 1)
mac_offset = 0xcc;
+ if (PCI_FUNC(tp->pdev->devfn) > 1)
+ mac_offset += 0x18c;
} else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906)
mac_offset = 0x10;
@@ -13691,6 +13719,7 @@ static u32 __devinit tg3_calc_dma_bndry(struct tg3 *tp, u32 val)
#endif
if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 ||
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 ||
GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765) {
val = goal ? 0 : DMA_RWCTRL_DIS_CACHE_ALIGNMENT;
goto out;
@@ -13903,6 +13932,7 @@ static int __devinit tg3_test_dma(struct tg3 *tp)
tp->dma_rwctrl = tg3_calc_dma_bndry(tp, tp->dma_rwctrl);
if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 ||
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 ||
GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765)
goto out;
@@ -14102,6 +14132,7 @@ static void __devinit tg3_init_link_config(struct tg3 *tp)
static void __devinit tg3_init_bufmgr_config(struct tg3 *tp)
{
if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717 ||
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5719 ||
GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_57765) {
tp->bufmgr_config.mbuf_read_dma_low_water =
DEFAULT_MB_RDMA_LOW_WATER_5705;
@@ -14427,7 +14458,8 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
}
if ((tp->tg3_flags3 & TG3_FLG3_5755_PLUS) &&
- tp->pci_chip_rev_id != CHIPREV_ID_5717_A0)
+ tp->pci_chip_rev_id != CHIPREV_ID_5717_A0 &&
+ GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5719)
dev->netdev_ops = &tg3_netdev_ops;
else
dev->netdev_ops = &tg3_netdev_ops_dma_bug;
diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
index 878cdee..74e5bc2 100644
--- a/drivers/net/tg3.h
+++ b/drivers/net/tg3.h
@@ -53,6 +53,7 @@
#define TG3PCI_DEVICE_TIGON3_57765 0x16b4
#define TG3PCI_DEVICE_TIGON3_57791 0x16b2
#define TG3PCI_DEVICE_TIGON3_57795 0x16b6
+#define TG3PCI_DEVICE_TIGON3_5719 0x1657
/* 0x04 --> 0x2c unused */
#define TG3PCI_SUBVENDOR_ID_BROADCOM PCI_VENDOR_ID_BROADCOM
#define TG3PCI_SUBDEVICE_ID_BROADCOM_95700A6 0x1644
@@ -160,6 +161,7 @@
#define ASIC_REV_57780 0x57780
#define ASIC_REV_5717 0x5717
#define ASIC_REV_57765 0x57785
+#define ASIC_REV_5719 0x5719
#define GET_CHIP_REV(CHIP_REV_ID) ((CHIP_REV_ID) >> 8)
#define CHIPREV_5700_AX 0x70
#define CHIPREV_5700_BX 0x71
--
1.6.4.4
^ permalink raw reply related
* [PATCH net-next 10/10] tg3: Update version to 3.111
From: Matt Carlson @ 2010-06-06 3:24 UTC (permalink / raw)
To: davem; +Cc: netdev, andy, mcarlson, Michael Chan
This patch updates the tg3 version to 3.111.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
---
drivers/net/tg3.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index eea0748..289cdc5 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -67,8 +67,8 @@
#include "tg3.h"
#define DRV_MODULE_NAME "tg3"
-#define DRV_MODULE_VERSION "3.110"
-#define DRV_MODULE_RELDATE "April 9, 2010"
+#define DRV_MODULE_VERSION "3.111"
+#define DRV_MODULE_RELDATE "June 5, 2010"
#define TG3_DEF_MAC_MODE 0
#define TG3_DEF_RX_MODE 0
--
1.6.4.4
^ permalink raw reply related
* [PATCH net-next 02/10] tg3: Avoid tx lockups on 5755+ devices
From: Matt Carlson @ 2010-06-06 3:24 UTC (permalink / raw)
To: davem; +Cc: netdev, andy, mcarlson, Michael Chan
In certain edge conditions, internal tx resources can get corrupted.
This patch enables a bit that will fix the problem.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
---
drivers/net/tg3.c | 3 +++
drivers/net/tg3.h | 1 +
2 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index bd33117..057e8eb 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -8214,6 +8214,9 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
}
tp->tx_mode = TX_MODE_ENABLE;
+ if ((tp->tg3_flags3 & TG3_FLG3_5755_PLUS) ||
+ GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906)
+ tp->tx_mode |= TX_MODE_MBUF_LOCKUP_FIX;
tw32_f(MAC_TX_MODE, tp->tx_mode);
udelay(100);
diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
index 84ea0dc..c245e80 100644
--- a/drivers/net/tg3.h
+++ b/drivers/net/tg3.h
@@ -469,6 +469,7 @@
#define TX_MODE_FLOW_CTRL_ENABLE 0x00000010
#define TX_MODE_BIG_BCKOFF_ENABLE 0x00000020
#define TX_MODE_LONG_PAUSE_ENABLE 0x00000040
+#define TX_MODE_MBUF_LOCKUP_FIX 0x00000100
#define MAC_TX_STATUS 0x00000460
#define TX_STATUS_XOFFED 0x00000001
#define TX_STATUS_SENT_XOFF 0x00000002
--
1.6.4.4
^ permalink raw reply related
* [PATCH net-next 04/10] tg3: Off-by-one error in RSS setup
From: Matt Carlson @ 2010-06-06 3:24 UTC (permalink / raw)
To: davem; +Cc: netdev, andy, mcarlson, Michael Chan
The driver was incorrectly programming the indirection table such that
rx traffic intended for the second ring went to the first ring, rx
traffic intended for the third ring went to the second ring, etc. This
patch changes the code so that rx traffic is diverted to the proper
ring.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
---
drivers/net/tg3.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 86f8798..3dccc58 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -8228,7 +8228,7 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
for (i = 0; i < TG3_RSS_INDIR_TBL_SIZE; i++) {
int idx = i % sizeof(val);
- ent[idx] = i % (tp->irq_cnt - 1);
+ ent[idx] = (i % (tp->irq_cnt - 1)) + 1;
if (idx == sizeof(val) - 1) {
tw32(reg, val);
reg += 4;
--
1.6.4.4
^ permalink raw reply related
* [PATCH net-next 05/10] tg3: Allow single MSI-X vector allocations
From: Matt Carlson @ 2010-06-06 3:24 UTC (permalink / raw)
To: davem; +Cc: netdev, andy, mcarlson, Michael Chan
This patch changes the code to make it legal to allocate only one MSI-X
vector. It also fixes a bug where the driver was not checking for error
return codes from pci_enable_msix().
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
---
drivers/net/tg3.c | 24 ++++++++++++------------
1 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 3dccc58..d169337 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -145,8 +145,6 @@
#define TG3_RX_JMB_BUFF_RING_SIZE \
(sizeof(struct ring_info) * TG3_RX_JUMBO_RING_SIZE)
-#define TG3_RSS_MIN_NUM_MSIX_VECS 2
-
/* Due to a hardware bug, the 5701 can only DMA to memory addresses
* that are at least dword aligned when used in PCIX mode. The driver
* works around this bug by double copying the packet. This workaround
@@ -8797,9 +8795,9 @@ static bool tg3_enable_msix(struct tg3 *tp)
}
rc = pci_enable_msix(tp->pdev, msix_ent, tp->irq_cnt);
- if (rc != 0) {
- if (rc < TG3_RSS_MIN_NUM_MSIX_VECS)
- return false;
+ if (rc < 0) {
+ return false;
+ } else if (rc != 0) {
if (pci_enable_msix(tp->pdev, msix_ent, rc))
return false;
netdev_notice(tp->dev, "Requested %d MSI-X vectors, received %d\n",
@@ -8807,16 +8805,18 @@ static bool tg3_enable_msix(struct tg3 *tp)
tp->irq_cnt = rc;
}
- tp->tg3_flags3 |= TG3_FLG3_ENABLE_RSS;
-
for (i = 0; i < tp->irq_max; i++)
tp->napi[i].irq_vec = msix_ent[i].vector;
- if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717) {
- tp->tg3_flags3 |= TG3_FLG3_ENABLE_TSS;
- tp->dev->real_num_tx_queues = tp->irq_cnt - 1;
- } else
- tp->dev->real_num_tx_queues = 1;
+ tp->dev->real_num_tx_queues = 1;
+ if (tp->irq_cnt > 1) {
+ tp->tg3_flags3 |= TG3_FLG3_ENABLE_RSS;
+
+ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717) {
+ tp->tg3_flags3 |= TG3_FLG3_ENABLE_TSS;
+ tp->dev->real_num_tx_queues = tp->irq_cnt - 1;
+ }
+ }
return true;
}
--
1.6.4.4
^ permalink raw reply related
* [PATCH net-next 00/11] tg3: Bugfixes and 5719 support
From: Matt Carlson @ 2010-06-06 3:24 UTC (permalink / raw)
To: davem; +Cc: netdev, andy, mcarlson
This patchset adds some bugfixes and adds 5719 device support.
^ permalink raw reply
* [PATCH net-next 09/10] tg3: Add 5719 PCI device and phy IDs
From: Matt Carlson @ 2010-06-06 3:24 UTC (permalink / raw)
To: davem; +Cc: netdev, andy, mcarlson, Michael Chan
This patch adds the 5719 PCI device and phy IDs.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
---
drivers/net/tg3.c | 2 ++
drivers/net/tg3.h | 4 +++-
2 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 63a5b96..eea0748 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -270,6 +270,7 @@ static DEFINE_PCI_DEVICE_TABLE(tg3_pci_tbl) = {
{PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, TG3PCI_DEVICE_TIGON3_57765)},
{PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, TG3PCI_DEVICE_TIGON3_57791)},
{PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, TG3PCI_DEVICE_TIGON3_57795)},
+ {PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, TG3PCI_DEVICE_TIGON3_5719)},
{PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, PCI_DEVICE_ID_SYSKONNECT_9DXX)},
{PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, PCI_DEVICE_ID_SYSKONNECT_9MXX)},
{PCI_DEVICE(PCI_VENDOR_ID_ALTIMA, PCI_DEVICE_ID_ALTIMA_AC1000)},
@@ -14210,6 +14211,7 @@ static char * __devinit tg3_phy_string(struct tg3 *tp)
case TG3_PHY_ID_BCM5718C: return "5718C";
case TG3_PHY_ID_BCM5718S: return "5718S";
case TG3_PHY_ID_BCM57765: return "57765";
+ case TG3_PHY_ID_BCM5719C: return "5719C";
case TG3_PHY_ID_BCM8002: return "8002/serdes";
case 0: return "serdes";
default: return "unknown";
diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
index 74e5bc2..6b6af76 100644
--- a/drivers/net/tg3.h
+++ b/drivers/net/tg3.h
@@ -2949,6 +2949,7 @@ struct tg3 {
#define TG3_PHY_ID_BCM5718C 0x5c0d8a00
#define TG3_PHY_ID_BCM5718S 0xbc050ff0
#define TG3_PHY_ID_BCM57765 0x5c0d8a40
+#define TG3_PHY_ID_BCM5719C 0x5c0d8a20
#define TG3_PHY_ID_BCM5906 0xdc00ac40
#define TG3_PHY_ID_BCM8002 0x60010140
#define TG3_PHY_ID_INVALID 0xffffffff
@@ -2972,7 +2973,8 @@ struct tg3 {
(X) == TG3_PHY_ID_BCM5755 || (X) == TG3_PHY_ID_BCM5756 || \
(X) == TG3_PHY_ID_BCM5906 || (X) == TG3_PHY_ID_BCM5761 || \
(X) == TG3_PHY_ID_BCM5718C || (X) == TG3_PHY_ID_BCM5718S || \
- (X) == TG3_PHY_ID_BCM57765 || (X) == TG3_PHY_ID_BCM8002)
+ (X) == TG3_PHY_ID_BCM57765 || (X) == TG3_PHY_ID_BCM5719C || \
+ (X) == TG3_PHY_ID_BCM8002)
u32 led_ctrl;
u32 phy_otp;
--
1.6.4.4
^ permalink raw reply related
* [PATCH net-next 03/10] tg3: Fix a memory leak on 5717+ devices
From: Matt Carlson @ 2010-06-06 3:24 UTC (permalink / raw)
To: davem; +Cc: netdev, andy, mcarlson, Michael Chan
The rx resources for MSI-X interrupt vector 0 were not being freed
correctly. This happens because the teardown loop continue's to the
next loop iteration if it detects the tx ring for that vector is not
setup, thus bypassing the rx teardown code. This patch moves the
call to tg3_rx_prodring_free() earlier in the loop.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
---
drivers/net/tg3.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 057e8eb..86f8798 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -6229,6 +6229,8 @@ static void tg3_free_rings(struct tg3 *tp)
for (j = 0; j < tp->irq_cnt; j++) {
struct tg3_napi *tnapi = &tp->napi[j];
+ tg3_rx_prodring_free(tp, &tp->prodring[j]);
+
if (!tnapi->tx_buffers)
continue;
@@ -6264,8 +6266,6 @@ static void tg3_free_rings(struct tg3 *tp)
dev_kfree_skb_any(skb);
}
-
- tg3_rx_prodring_free(tp, &tp->prodring[j]);
}
}
--
1.6.4.4
^ permalink raw reply related
* [PATCH net-next 06/10] tg3: 5717: Allow serdes link via parallel detect
From: Matt Carlson @ 2010-06-06 3:24 UTC (permalink / raw)
To: davem; +Cc: netdev, andy, mcarlson, Michael Chan
The 5717 serdes phy brings link up via parallel detection without any
additional help from the driver. This patch changes the
tg3_setup_fiber_mii_phy() function to detect and allow the use of this
feature.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
---
drivers/net/tg3.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index d169337..2dcde13 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -4206,6 +4206,8 @@ static int tg3_setup_fiber_mii_phy(struct tg3 *tp, int force_reset)
current_duplex = DUPLEX_FULL;
else
current_duplex = DUPLEX_HALF;
+ } else if (!(tp->tg3_flags2 & TG3_FLG2_5780_CLASS)) {
+ /* Link is up via parallel detect */
} else {
current_link_up = 0;
}
@@ -8531,8 +8533,10 @@ static void tg3_timer(unsigned long __opaque)
}
tg3_setup_phy(tp, 0);
}
- } else if (tp->tg3_flags2 & TG3_FLG2_MII_SERDES)
+ } else if ((tp->tg3_flags2 & TG3_FLG2_MII_SERDES) &&
+ !(tp->tg3_flags2 & TG3_FLG2_5780_CLASS)) {
tg3_serdes_parallel_detect(tp);
+ }
tp->timer_counter = tp->timer_multiplier;
}
--
1.6.4.4
^ permalink raw reply related
* [PATCH net-next 07/10] tg3: Use devfn to determine function number
From: Matt Carlson @ 2010-06-06 3:24 UTC (permalink / raw)
To: davem; +Cc: netdev, andy, mcarlson, Michael Chan
The driver sometimes needs to know which function number the current
device is. This patch changes the code to use devfn over internal
register values.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
---
drivers/net/tg3.c | 10 +++-------
drivers/net/tg3.h | 4 +---
2 files changed, 4 insertions(+), 10 deletions(-)
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 2dcde13..1e1c341 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -1085,13 +1085,9 @@ static int tg3_mdio_init(struct tg3 *tp)
struct phy_device *phydev;
if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717) {
- u32 funcnum, is_serdes;
+ u32 is_serdes;
- funcnum = tr32(TG3_CPMU_STATUS) & TG3_CPMU_STATUS_PCIE_FUNC;
- if (funcnum)
- tp->phy_addr = 2;
- else
- tp->phy_addr = 1;
+ tp->phy_addr = PCI_FUNC(tp->pdev->devfn) + 1;
if (tp->pci_chip_rev_id != CHIPREV_ID_5717_A0)
is_serdes = tr32(SG_DIG_STATUS) & SG_DIG_IS_SERDES;
@@ -13608,7 +13604,7 @@ static int __devinit tg3_get_device_address(struct tg3 *tp)
else
tg3_nvram_unlock(tp);
} else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5717) {
- if (tr32(TG3_CPMU_STATUS) & TG3_CPMU_STATUS_PCIE_FUNC)
+ if (PCI_FUNC(tp->pdev->devfn))
mac_offset = 0xcc;
} else if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906)
mac_offset = 0x10;
diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
index c245e80..878cdee 100644
--- a/drivers/net/tg3.h
+++ b/drivers/net/tg3.h
@@ -1073,10 +1073,8 @@
#define TG3_CPMU_HST_ACC 0x0000361c
#define CPMU_HST_ACC_MACCLK_MASK 0x001f0000
#define CPMU_HST_ACC_MACCLK_6_25 0x00130000
-/* 0x3620 --> 0x362c unused */
+/* 0x3620 --> 0x3630 unused */
-#define TG3_CPMU_STATUS 0x0000362c
-#define TG3_CPMU_STATUS_PCIE_FUNC 0x20000000
#define TG3_CPMU_CLCK_STAT 0x00003630
#define CPMU_CLCK_STAT_MAC_CLCK_MASK 0x001f0000
#define CPMU_CLCK_STAT_MAC_CLCK_62_5 0x00000000
--
1.6.4.4
^ permalink raw reply related
* [PATCH net-next 01/10] tg3: Relocate APE mutex regs for 5717+
From: Matt Carlson @ 2010-06-06 3:24 UTC (permalink / raw)
To: davem; +Cc: netdev, andy, mcarlson, Michael Chan
The 5717 and later devices relocate the APE mutex registers. This patch
organizes the code so that the driver can use the mutex registers in the
old and new locations.
Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>
---
drivers/net/tg3.c | 44 ++++++++++++++++++++++++++++++++------------
drivers/net/tg3.h | 6 ++++++
2 files changed, 38 insertions(+), 12 deletions(-)
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 573054a..bd33117 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -585,18 +585,23 @@ static void tg3_read_mem(struct tg3 *tp, u32 off, u32 *val)
static void tg3_ape_lock_init(struct tg3 *tp)
{
int i;
+ u32 regbase;
+
+ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5761)
+ regbase = TG3_APE_LOCK_GRANT;
+ else
+ regbase = TG3_APE_PER_LOCK_GRANT;
/* Make sure the driver hasn't any stale locks. */
for (i = 0; i < 8; i++)
- tg3_ape_write32(tp, TG3_APE_LOCK_GRANT + 4 * i,
- APE_LOCK_GRANT_DRIVER);
+ tg3_ape_write32(tp, regbase + 4 * i, APE_LOCK_GRANT_DRIVER);
}
static int tg3_ape_lock(struct tg3 *tp, int locknum)
{
int i, off;
int ret = 0;
- u32 status;
+ u32 status, req, gnt;
if (!(tp->tg3_flags3 & TG3_FLG3_ENABLE_APE))
return 0;
@@ -609,13 +614,21 @@ static int tg3_ape_lock(struct tg3 *tp, int locknum)
return -EINVAL;
}
+ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5761) {
+ req = TG3_APE_LOCK_REQ;
+ gnt = TG3_APE_LOCK_GRANT;
+ } else {
+ req = TG3_APE_PER_LOCK_REQ;
+ gnt = TG3_APE_PER_LOCK_GRANT;
+ }
+
off = 4 * locknum;
- tg3_ape_write32(tp, TG3_APE_LOCK_REQ + off, APE_LOCK_REQ_DRIVER);
+ tg3_ape_write32(tp, req + off, APE_LOCK_REQ_DRIVER);
/* Wait for up to 1 millisecond to acquire lock. */
for (i = 0; i < 100; i++) {
- status = tg3_ape_read32(tp, TG3_APE_LOCK_GRANT + off);
+ status = tg3_ape_read32(tp, gnt + off);
if (status == APE_LOCK_GRANT_DRIVER)
break;
udelay(10);
@@ -623,7 +636,7 @@ static int tg3_ape_lock(struct tg3 *tp, int locknum)
if (status != APE_LOCK_GRANT_DRIVER) {
/* Revoke the lock request. */
- tg3_ape_write32(tp, TG3_APE_LOCK_GRANT + off,
+ tg3_ape_write32(tp, gnt + off,
APE_LOCK_GRANT_DRIVER);
ret = -EBUSY;
@@ -634,7 +647,7 @@ static int tg3_ape_lock(struct tg3 *tp, int locknum)
static void tg3_ape_unlock(struct tg3 *tp, int locknum)
{
- int off;
+ u32 gnt;
if (!(tp->tg3_flags3 & TG3_FLG3_ENABLE_APE))
return;
@@ -647,8 +660,12 @@ static void tg3_ape_unlock(struct tg3 *tp, int locknum)
return;
}
- off = 4 * locknum;
- tg3_ape_write32(tp, TG3_APE_LOCK_GRANT + off, APE_LOCK_GRANT_DRIVER);
+ if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5761)
+ gnt = TG3_APE_LOCK_GRANT;
+ else
+ gnt = TG3_APE_PER_LOCK_GRANT;
+
+ tg3_ape_write32(tp, gnt + 4 * locknum, APE_LOCK_GRANT_DRIVER);
}
static void tg3_disable_ints(struct tg3 *tp)
@@ -6782,7 +6799,8 @@ static void tg3_restore_pci_state(struct tg3 *tp)
/* Allow reads and writes to the APE register and memory space. */
if (tp->tg3_flags3 & TG3_FLG3_ENABLE_APE)
val |= PCISTATE_ALLOW_APE_CTLSPC_WR |
- PCISTATE_ALLOW_APE_SHMEM_WR;
+ PCISTATE_ALLOW_APE_SHMEM_WR |
+ PCISTATE_ALLOW_APE_PSPACE_WR;
pci_write_config_dword(tp->pdev, TG3PCI_PCISTATE, val);
pci_write_config_word(tp->pdev, PCI_COMMAND, tp->pci_cmd);
@@ -7720,7 +7738,8 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
*/
val = tr32(TG3PCI_PCISTATE);
val |= PCISTATE_ALLOW_APE_CTLSPC_WR |
- PCISTATE_ALLOW_APE_SHMEM_WR;
+ PCISTATE_ALLOW_APE_SHMEM_WR |
+ PCISTATE_ALLOW_APE_PSPACE_WR;
tw32(TG3PCI_PCISTATE, val);
}
@@ -13242,7 +13261,8 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
* APE register and memory space.
*/
pci_state_reg |= PCISTATE_ALLOW_APE_CTLSPC_WR |
- PCISTATE_ALLOW_APE_SHMEM_WR;
+ PCISTATE_ALLOW_APE_SHMEM_WR |
+ PCISTATE_ALLOW_APE_PSPACE_WR;
pci_write_config_dword(tp->pdev, TG3PCI_PCISTATE,
pci_state_reg);
}
diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
index ce9c491..84ea0dc 100644
--- a/drivers/net/tg3.h
+++ b/drivers/net/tg3.h
@@ -231,6 +231,7 @@
#define PCISTATE_RETRY_SAME_DMA 0x00002000
#define PCISTATE_ALLOW_APE_CTLSPC_WR 0x00010000
#define PCISTATE_ALLOW_APE_SHMEM_WR 0x00020000
+#define PCISTATE_ALLOW_APE_PSPACE_WR 0x00040000
#define TG3PCI_CLOCK_CTRL 0x00000074
#define CLOCK_CTRL_CORECLK_DISABLE 0x00000200
#define CLOCK_CTRL_RXCLK_DISABLE 0x00000400
@@ -2209,6 +2210,11 @@
#define APE_EVENT_STATUS_STATE_SUSPEND 0x00040000
#define APE_EVENT_STATUS_EVENT_PENDING 0x80000000
+#define TG3_APE_PER_LOCK_REQ 0x8400
+#define APE_LOCK_PER_REQ_DRIVER 0x00001000
+#define TG3_APE_PER_LOCK_GRANT 0x8420
+#define APE_PER_LOCK_GRANT_DRIVER 0x00001000
+
/* APE convenience enumerations. */
#define TG3_APE_LOCK_GRC 1
#define TG3_APE_LOCK_MEM 4
--
1.6.4.4
^ permalink raw reply related
* Re: Ethernet drivers wiki page
From: Luis R. Rodriguez @ 2010-06-05 22:54 UTC (permalink / raw)
To: Stephen Hemminger
Cc: netdev, H. Peter Anvin, Johannes Berg, linux-kernel,
Luis R. Rodriguez
In-Reply-To: <20100604152324.1fa28f2f@nehalam>
On Fri, Jun 4, 2010 at 3:23 PM, Stephen Hemminger <shemminger@vyatta.com> wrote:
> On Fri, 4 Jun 2010 15:04:17 -0700
> "Luis R. Rodriguez" <mcgrof@gmail.com> wrote:
>
>> On Fri, Jun 4, 2010 at 2:52 PM, Luis R. Rodriguez <mcgrof@gmail.com> wrote:
>> > Where can I start adding documentation for our Ethernet drivers
>> > upstream? I was hoping for a wiki but I don't think we have a netdev
>> > one yet. Shall we create one or piggy back on something else? I'm
>> > reviewing:
>> >
>> > https://wiki.kernel.org/
>> >
>> > FWIW, I want to see something like this:
>> >
>> > http://wireless.kernel.org/en/users/Drivers
>> >
>> > But for ethernet.
>>
>> Since I've stuffed a few ethernet drivers on compat-wireless I might
>> as well start carrying more. So now we'd have 802.11, Bluetooth and
>> Ethernet all backported using the same framework, automatically, down
>> to at least the oldest stable kernel supported listed on kernel.org
>> and using all a generic compat module.
>>
>> I want to document all this crap.
>
> Why not Documentation/networking in kernel source?
I think a wiki works better for this sort of documentation, the
documentation I intend on writing is for end users, not developers.
Users tend to also search on google, not the kernel source.
> There is already documentation there though much of it is out of date.
I think its because a git tree works well for code, but not for
documentation. Technically I'm even an advocate for developer
documentation on wikis too though.
> This has the advantage of having change log and matching kernel version.
With Ethernet I'd just stuff all new drivers into the wiki as they go
into linux-next, after all the drivers would be available immediately
even for use on older kernels, so the information would be up to date,
we could just annotate as per what kernel release what feature went or
what chipsets were supported. For example, see:
http://wireless.kernel.org/en/users/Drivers/ath9k#supported_chipsets
Luis
^ permalink raw reply
* [PATCH net-next-2.6] net-caif: Added missing lock validator constants
From: Alex Lorca @ 2010-06-05 18:15 UTC (permalink / raw)
To: Sjur Braendeland; +Cc: netdev, Alex Lorca
CAIF is using "xxx-AF_MAX" strings for the lock validator. It should use
its own strings.
Signed-off-by: Alex Lorca <alex.lorca@gmail.com>
---
net/core/sock.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/net/core/sock.c b/net/core/sock.c
index 2cf7f9f..f9ce0db 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -156,7 +156,7 @@ static const char *const af_family_key_strings[AF_MAX+1] = {
"sk_lock-27" , "sk_lock-28" , "sk_lock-AF_CAN" ,
"sk_lock-AF_TIPC" , "sk_lock-AF_BLUETOOTH", "sk_lock-IUCV" ,
"sk_lock-AF_RXRPC" , "sk_lock-AF_ISDN" , "sk_lock-AF_PHONET" ,
- "sk_lock-AF_IEEE802154",
+ "sk_lock-AF_IEEE802154", "sk_lock-AF_CAIF" ,
"sk_lock-AF_MAX"
};
static const char *const af_family_slock_key_strings[AF_MAX+1] = {
@@ -172,7 +172,7 @@ static const char *const af_family_slock_key_strings[AF_MAX+1] = {
"slock-27" , "slock-28" , "slock-AF_CAN" ,
"slock-AF_TIPC" , "slock-AF_BLUETOOTH", "slock-AF_IUCV" ,
"slock-AF_RXRPC" , "slock-AF_ISDN" , "slock-AF_PHONET" ,
- "slock-AF_IEEE802154",
+ "slock-AF_IEEE802154", "slock-AF_CAIF" ,
"slock-AF_MAX"
};
static const char *const af_family_clock_key_strings[AF_MAX+1] = {
@@ -188,7 +188,7 @@ static const char *const af_family_clock_key_strings[AF_MAX+1] = {
"clock-27" , "clock-28" , "clock-AF_CAN" ,
"clock-AF_TIPC" , "clock-AF_BLUETOOTH", "clock-AF_IUCV" ,
"clock-AF_RXRPC" , "clock-AF_ISDN" , "clock-AF_PHONET" ,
- "clock-AF_IEEE802154",
+ "clock-AF_IEEE802154", "clock-AF_CAIF" ,
"clock-AF_MAX"
};
--
1.6.4
^ permalink raw reply related
* [RFC] pm_qos: get rid of the allocation in pm_qos_add_request()
From: James Bottomley @ 2010-06-05 19:20 UTC (permalink / raw)
To: pm list; +Cc: markgross, netdev, alsa-devel, Takashi Iwai, Jaroslav Kysela
[alsa-devel says it's a moderated list, so feel free to drop before
replying]
Since every caller has to squirrel away the returned pointer anyway,
they might as well supply the memory area. This fixes a bug in a few of
the call sites where the returned pointer was dereferenced without
checking it for NULL (which gets returned if the kzalloc failed).
I'd like to hear how sound and netdev feels about this: it will add
about two more pointers worth of data to struct netdev and struct
snd_pcm_substream .. but I think it's worth it. If you're OK, I'll add
your acks and send through the pm tree.
This also looks to me like an android independent clean up (even though
it renders the request_add atomically callable). I also added include
guards to include/linux/pm_qos_params.h
James
---
drivers/net/e1000e/netdev.c | 17 ++++------
drivers/net/igbvf/netdev.c | 9 ++---
drivers/net/wireless/ipw2x00/ipw2100.c | 12 +++---
include/linux/netdevice.h | 2 +-
include/linux/pm_qos_params.h | 12 +++++--
include/sound/pcm.h | 2 +-
kernel/pm_qos_params.c | 55 ++++++++++++++++---------------
sound/core/pcm_native.c | 12 ++-----
8 files changed, 60 insertions(+), 61 deletions(-)
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
index 24507f3..47ea62f 100644
--- a/drivers/net/e1000e/netdev.c
+++ b/drivers/net/e1000e/netdev.c
@@ -2901,10 +2901,10 @@ static void e1000_configure_rx(struct e1000_adapter *adapter)
* dropped transactions.
*/
pm_qos_update_request(
- adapter->netdev->pm_qos_req, 55);
+ &adapter->netdev->pm_qos_req, 55);
} else {
pm_qos_update_request(
- adapter->netdev->pm_qos_req,
+ &adapter->netdev->pm_qos_req,
PM_QOS_DEFAULT_VALUE);
}
}
@@ -3196,9 +3196,9 @@ int e1000e_up(struct e1000_adapter *adapter)
/* DMA latency requirement to workaround early-receive/jumbo issue */
if (adapter->flags & FLAG_HAS_ERT)
- adapter->netdev->pm_qos_req =
- pm_qos_add_request(PM_QOS_CPU_DMA_LATENCY,
- PM_QOS_DEFAULT_VALUE);
+ pm_qos_add_request(&adapter->netdev->pm_qos_req,
+ PM_QOS_CPU_DMA_LATENCY,
+ PM_QOS_DEFAULT_VALUE);
/* hardware has been reset, we need to reload some things */
e1000_configure(adapter);
@@ -3263,11 +3263,8 @@ void e1000e_down(struct e1000_adapter *adapter)
e1000_clean_tx_ring(adapter);
e1000_clean_rx_ring(adapter);
- if (adapter->flags & FLAG_HAS_ERT) {
- pm_qos_remove_request(
- adapter->netdev->pm_qos_req);
- adapter->netdev->pm_qos_req = NULL;
- }
+ if (adapter->flags & FLAG_HAS_ERT)
+ pm_qos_remove_request(&adapter->netdev->pm_qos_req);
/*
* TODO: for power management, we could drop the link and
diff --git a/drivers/net/igbvf/netdev.c b/drivers/net/igbvf/netdev.c
index 5e2b2a8..5da569f 100644
--- a/drivers/net/igbvf/netdev.c
+++ b/drivers/net/igbvf/netdev.c
@@ -48,7 +48,7 @@
#define DRV_VERSION "1.0.0-k0"
char igbvf_driver_name[] = "igbvf";
const char igbvf_driver_version[] = DRV_VERSION;
-struct pm_qos_request_list *igbvf_driver_pm_qos_req;
+struct pm_qos_request_list igbvf_driver_pm_qos_req;
static const char igbvf_driver_string[] =
"Intel(R) Virtual Function Network Driver";
static const char igbvf_copyright[] = "Copyright (c) 2009 Intel Corporation.";
@@ -2902,8 +2902,8 @@ static int __init igbvf_init_module(void)
printk(KERN_INFO "%s\n", igbvf_copyright);
ret = pci_register_driver(&igbvf_driver);
- igbvf_driver_pm_qos_req = pm_qos_add_request(PM_QOS_CPU_DMA_LATENCY,
- PM_QOS_DEFAULT_VALUE);
+ pm_qos_add_request(igbvf_driver_pm_qos_req, PM_QOS_CPU_DMA_LATENCY,
+ PM_QOS_DEFAULT_VALUE);
return ret;
}
@@ -2918,8 +2918,7 @@ module_init(igbvf_init_module);
static void __exit igbvf_exit_module(void)
{
pci_unregister_driver(&igbvf_driver);
- pm_qos_remove_request(igbvf_driver_pm_qos_req);
- igbvf_driver_pm_qos_req = NULL;
+ pm_qos_remove_request(&igbvf_driver_pm_qos_req);
}
module_exit(igbvf_exit_module);
diff --git a/drivers/net/wireless/ipw2x00/ipw2100.c b/drivers/net/wireless/ipw2x00/ipw2100.c
index 0bd4dfa..7f0d98b 100644
--- a/drivers/net/wireless/ipw2x00/ipw2100.c
+++ b/drivers/net/wireless/ipw2x00/ipw2100.c
@@ -174,7 +174,7 @@ that only one external action is invoked at a time.
#define DRV_DESCRIPTION "Intel(R) PRO/Wireless 2100 Network Driver"
#define DRV_COPYRIGHT "Copyright(c) 2003-2006 Intel Corporation"
-struct pm_qos_request_list *ipw2100_pm_qos_req;
+struct pm_qos_request_list ipw2100_pm_qos_req;
/* Debugging stuff */
#ifdef CONFIG_IPW2100_DEBUG
@@ -1741,7 +1741,7 @@ static int ipw2100_up(struct ipw2100_priv *priv, int deferred)
/* the ipw2100 hardware really doesn't want power management delays
* longer than 175usec
*/
- pm_qos_update_request(ipw2100_pm_qos_req, 175);
+ pm_qos_update_request(&ipw2100_pm_qos_req, 175);
/* If the interrupt is enabled, turn it off... */
spin_lock_irqsave(&priv->low_lock, flags);
@@ -1889,7 +1889,7 @@ static void ipw2100_down(struct ipw2100_priv *priv)
ipw2100_disable_interrupts(priv);
spin_unlock_irqrestore(&priv->low_lock, flags);
- pm_qos_update_request(ipw2100_pm_qos_req, PM_QOS_DEFAULT_VALUE);
+ pm_qos_update_request(&ipw2100_pm_qos_req, PM_QOS_DEFAULT_VALUE);
/* We have to signal any supplicant if we are disassociating */
if (associated)
@@ -6669,8 +6669,8 @@ static int __init ipw2100_init(void)
if (ret)
goto out;
- ipw2100_pm_qos_req = pm_qos_add_request(PM_QOS_CPU_DMA_LATENCY,
- PM_QOS_DEFAULT_VALUE);
+ pm_qos_add_request(&ipw2100_pm_qos_req, PM_QOS_CPU_DMA_LATENCY,
+ PM_QOS_DEFAULT_VALUE);
#ifdef CONFIG_IPW2100_DEBUG
ipw2100_debug_level = debug;
ret = driver_create_file(&ipw2100_pci_driver.driver,
@@ -6692,7 +6692,7 @@ static void __exit ipw2100_exit(void)
&driver_attr_debug_level);
#endif
pci_unregister_driver(&ipw2100_pci_driver);
- pm_qos_remove_request(ipw2100_pm_qos_req);
+ pm_qos_remove_request(&ipw2100_pm_qos_req);
}
module_init(ipw2100_init);
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 40291f3..393555a 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -779,7 +779,7 @@ struct net_device {
*/
char name[IFNAMSIZ];
- struct pm_qos_request_list *pm_qos_req;
+ struct pm_qos_request_list pm_qos_req;
/* device name hash chain */
struct hlist_node name_hlist;
diff --git a/include/linux/pm_qos_params.h b/include/linux/pm_qos_params.h
index 8ba440e..d823cc0 100644
--- a/include/linux/pm_qos_params.h
+++ b/include/linux/pm_qos_params.h
@@ -1,8 +1,10 @@
+#ifndef _LINUX_PM_QOS_PARAMS_H
+#define _LINUX_PM_QOS_PARAMS_H
/* interface for the pm_qos_power infrastructure of the linux kernel.
*
* Mark Gross <mgross@linux.intel.com>
*/
-#include <linux/list.h>
+#include <linux/plist.h>
#include <linux/notifier.h>
#include <linux/miscdevice.h>
@@ -14,9 +16,12 @@
#define PM_QOS_NUM_CLASSES 4
#define PM_QOS_DEFAULT_VALUE -1
-struct pm_qos_request_list;
+struct pm_qos_request_list {
+ struct plist_node list;
+ int pm_qos_class;
+};
-struct pm_qos_request_list *pm_qos_add_request(int pm_qos_class, s32 value);
+void pm_qos_add_request(struct pm_qos_request_list *l, int pm_qos_class, s32 value);
void pm_qos_update_request(struct pm_qos_request_list *pm_qos_req,
s32 new_value);
void pm_qos_remove_request(struct pm_qos_request_list *pm_qos_req);
@@ -25,3 +30,4 @@ int pm_qos_request(int pm_qos_class);
int pm_qos_add_notifier(int pm_qos_class, struct notifier_block *notifier);
int pm_qos_remove_notifier(int pm_qos_class, struct notifier_block *notifier);
+#endif
diff --git a/include/sound/pcm.h b/include/sound/pcm.h
index dd76cde..6e3a297 100644
--- a/include/sound/pcm.h
+++ b/include/sound/pcm.h
@@ -366,7 +366,7 @@ struct snd_pcm_substream {
int number;
char name[32]; /* substream name */
int stream; /* stream (direction) */
- struct pm_qos_request_list *latency_pm_qos_req; /* pm_qos request */
+ struct pm_qos_request_list latency_pm_qos_req; /* pm_qos request */
size_t buffer_bytes_max; /* limit ring buffer size */
struct snd_dma_buffer dma_buffer;
unsigned int dma_buf_id;
diff --git a/kernel/pm_qos_params.c b/kernel/pm_qos_params.c
index 241fa79..f1d3d23 100644
--- a/kernel/pm_qos_params.c
+++ b/kernel/pm_qos_params.c
@@ -30,7 +30,6 @@
/*#define DEBUG*/
#include <linux/pm_qos_params.h>
-#include <linux/plist.h>
#include <linux/sched.h>
#include <linux/spinlock.h>
#include <linux/slab.h>
@@ -49,11 +48,6 @@
* or pm_qos_object list and pm_qos_objects need to happen with pm_qos_lock
* held, taken with _irqsave. One lock to rule them all
*/
-struct pm_qos_request_list {
- struct plist_node list;
- int pm_qos_class;
-};
-
enum pm_qos_type {
PM_QOS_MAX, /* return the largest value */
PM_QOS_MIN, /* return the smallest value */
@@ -195,6 +189,11 @@ int pm_qos_request(int pm_qos_class)
}
EXPORT_SYMBOL_GPL(pm_qos_request);
+static int pm_qos_request_active(struct pm_qos_request_list *req)
+{
+ return req->pm_qos_class != 0;
+}
+
/**
* pm_qos_add_request - inserts new qos request into the list
* @pm_qos_class: identifies which list of qos request to us
@@ -206,25 +205,22 @@ EXPORT_SYMBOL_GPL(pm_qos_request);
* element as a handle for use in updating and removal. Call needs to save
* this handle for later use.
*/
-struct pm_qos_request_list *pm_qos_add_request(int pm_qos_class, s32 value)
+void pm_qos_add_request(struct pm_qos_request_list *dep,
+ int pm_qos_class, s32 value)
{
- struct pm_qos_request_list *dep;
-
- dep = kzalloc(sizeof(struct pm_qos_request_list), GFP_KERNEL);
- if (dep) {
- struct pm_qos_object *o = pm_qos_array[pm_qos_class];
- int new_value;
-
- if (value == PM_QOS_DEFAULT_VALUE)
- new_value = o->default_value;
- else
- new_value = value;
- plist_node_init(&dep->list, new_value);
- dep->pm_qos_class = pm_qos_class;
- update_target(o, &dep->list, 0);
- }
+ struct pm_qos_object *o = pm_qos_array[pm_qos_class];
+ int new_value;
+
+ if (pm_qos_request_active(dep))
+ return;
- return dep;
+ if (value == PM_QOS_DEFAULT_VALUE)
+ new_value = o->default_value;
+ else
+ new_value = value;
+ plist_node_init(&dep->list, new_value);
+ dep->pm_qos_class = pm_qos_class;
+ update_target(o, &dep->list, 0);
}
EXPORT_SYMBOL_GPL(pm_qos_add_request);
@@ -286,7 +282,7 @@ void pm_qos_remove_request(struct pm_qos_request_list *pm_qos_req)
o = pm_qos_array[pm_qos_req->pm_qos_class];
update_target(o, &pm_qos_req->list, 1);
- kfree(pm_qos_req);
+ memset(pm_qos_req, 0, sizeof(*pm_qos_req));
}
EXPORT_SYMBOL_GPL(pm_qos_remove_request);
@@ -334,8 +330,12 @@ static int pm_qos_power_open(struct inode *inode, struct file *filp)
pm_qos_class = find_pm_qos_object_by_minor(iminor(inode));
if (pm_qos_class >= 0) {
- filp->private_data = (void *) pm_qos_add_request(pm_qos_class,
- PM_QOS_DEFAULT_VALUE);
+ struct pm_qos_request_list *req = kzalloc(GFP_KERNEL, sizeof(*req));
+ if (!req)
+ return -ENOMEM;
+
+ pm_qos_add_request(req, pm_qos_class, PM_QOS_DEFAULT_VALUE);
+ filp->private_data = req;
if (filp->private_data)
return 0;
@@ -347,8 +347,9 @@ static int pm_qos_power_release(struct inode *inode, struct file *filp)
{
struct pm_qos_request_list *req;
- req = (struct pm_qos_request_list *)filp->private_data;
+ req = filp->private_data;
pm_qos_remove_request(req);
+ kfree(req);
return 0;
}
diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c
index 303ac04..d3b8b51 100644
--- a/sound/core/pcm_native.c
+++ b/sound/core/pcm_native.c
@@ -451,13 +451,10 @@ static int snd_pcm_hw_params(struct snd_pcm_substream *substream,
snd_pcm_timer_resolution_change(substream);
runtime->status->state = SNDRV_PCM_STATE_SETUP;
- if (substream->latency_pm_qos_req) {
- pm_qos_remove_request(substream->latency_pm_qos_req);
- substream->latency_pm_qos_req = NULL;
- }
+ pm_qos_remove_request(&substream->latency_pm_qos_req);
if ((usecs = period_to_usecs(runtime)) >= 0)
- substream->latency_pm_qos_req = pm_qos_add_request(
- PM_QOS_CPU_DMA_LATENCY, usecs);
+ pm_qos_add_request(&substream->latency_pm_qos_req,
+ PM_QOS_CPU_DMA_LATENCY, usecs);
return 0;
_error:
/* hardware might be unuseable from this time,
@@ -512,8 +509,7 @@ static int snd_pcm_hw_free(struct snd_pcm_substream *substream)
if (substream->ops->hw_free)
result = substream->ops->hw_free(substream);
runtime->status->state = SNDRV_PCM_STATE_OPEN;
- pm_qos_remove_request(substream->latency_pm_qos_req);
- substream->latency_pm_qos_req = NULL;
+ pm_qos_remove_request(&substream->latency_pm_qos_req);
return result;
}
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox