Skip to content
  1. Aug 25, 2010
    • Dan Carpenter's avatar
      pxa168_eth: silence gcc warnings · b2bc8563
      Dan Carpenter authored
      
      
      Casting "pep->tx_desc_dma" to to a struct tx_desc pointer makes gcc
      complain:
      
      drivers/net/pxa168_eth.c:657: warning:
      	cast to pointer from integer of different size
      
      Signed-off-by: default avatarDan Carpenter <error27@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b2bc8563
    • Dan Carpenter's avatar
      pxa168_eth: update call to phy_mii_ioctl() · 4f2c8510
      Dan Carpenter authored
      
      
      The phy_mii_ioctl() function changed recently.  It now takes a struct
      ifreq pointer directly.
      
      Signed-off-by: default avatarDan Carpenter <error27@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4f2c8510
    • Dan Carpenter's avatar
      pxa168_eth: fix error handling in prope · 945c7c73
      Dan Carpenter authored
      
      
      A couple issues here:
      * Some resources weren't released.
      * If alloc_etherdev() failed it would have caused a NULL dereference
        because "pep" would be null when we checked "if (pep->clk)".
      * Also it's better to propagate the error codes from mdiobus_register()
        instead of just returning -ENOMEM.
      
      Signed-off-by: default avatarDan Carpenter <error27@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      945c7c73
    • Dan Carpenter's avatar
      pxa168_eth: remove unneeded null check · 4169591f
      Dan Carpenter authored
      
      
      "pep->pd" isn't checked consistently in this function.  For example it's
      dereferenced unconditionally on the next line after the end of the if
      condition.  This function is only called from pxa168_eth_probe() and
      pep->pd is always non-NULL so I removed the check.
      
      Signed-off-by: default avatarDan Carpenter <error27@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      4169591f
    • Anton Vorontsov's avatar
      phylib: Fix race between returning phydev and calling adjust_link · ef24b16b
      Anton Vorontsov authored
      
      
      It is possible that phylib will call adjust_link before returning
      from {,of_}phy_connect(), which may cause the following [very rare,
      though] oops upon reopening the device:
      
        Unable to handle kernel paging request for data at address 0x0000024c
        Oops: Kernel access of bad area, sig: 11 [#1]
        PREEMPT SMP NR_CPUS=2 LTT NESTING LEVEL : 0
        P1021 RDB
        Modules linked in:
        NIP: c0345dac LR: c0345dac CTR: c0345d84
        TASK = dffab6b0[30] 'events/0' THREAD: c0d24000 CPU: 0
        [...]
        NIP [c0345dac] adjust_link+0x28/0x19c
        LR [c0345dac] adjust_link+0x28/0x19c
        Call Trace:
        [c0d25f00] [000045e1] 0x45e1 (unreliable)
        [c0d25f30] [c036c158] phy_state_machine+0x3ac/0x554
        [...]
      
      Here is why. Drivers store phydev in their private structures, e.g.
      gianfar driver:
      
      static int init_phy(struct net_device *dev)
      {
      	...
      	priv->phydev = of_phy_connect(...);
      	...
      }
      
      So that adjust_link could retrieve it back:
      
      static void adjust_link(struct net_device *dev)
      {
      	...
      	struct phy_device *phydev = priv->phydev;
      	...
      }
      
      If the device has been opened before, then phydev->state is set to
      PHY_HALTED (or undefined if the driver didn't call phy_stop()).
      
      Now, phy_connect starts the PHY state machine before returning phydev to
      the driver:
      
      	phy_start_machine(phydev, NULL);
      
      	if (phydev->irq > 0)
      		phy_start_interrupts(phydev);
      
      	return phydev;
      
      The time between 'phy_start_machine()' and 'return phydev' is undefined.
      The start machine routine delays execution for 1 second, which is enough
      for most cases. But under heavy load, or if you're unlucky, it is quite
      possible that PHY state machine will execute before phy_connect()
      returns, and so adjust_link callback will try to dereference phydev,
      which is not yet ready.
      
      To fix the issue, simply initialize the PHY's state to PHY_READY during
      phy_attach(). This will ensure that phylib won't call adjust_link before
      phy_start().
      
      Signed-off-by: default avatarAnton Vorontsov <avorontsov@mvista.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      ef24b16b
    • Heiko Carstens's avatar
      caif-driver: add HAS_DMA dependency · 9dc002d8
      Heiko Carstens authored
      
      
      Fix this error on an s390 allyesconfig build:
      
      linux-2.6/drivers/net/caif/caif_spi.c:98:
          undefined reference to `dma_free_coherent'
      
      Cc: Sjur Braendeland <sjur.brandeland@stericsson.com>
      Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      9dc002d8
  2. Aug 24, 2010
  3. Aug 23, 2010
    • Randy Dunlap's avatar
      isdn/avm: fix build when PCMCIA is not enabled · 6a6d01d3
      Randy Dunlap authored
      
      
      Why wouldn't kconfig symbol ISDN_DRV_AVMB1_B1PCMCIA also depend on
      PCMCIA?
      
      Fix build for PCMCIA not enabled:
      
      ERROR: "b1_free_card" [drivers/isdn/hardware/avm/b1pcmcia.ko] undefined!
      ERROR: "b1ctl_proc_fops" [drivers/isdn/hardware/avm/b1pcmcia.ko] undefined!
      ERROR: "b1_reset_ctr" [drivers/isdn/hardware/avm/b1pcmcia.ko] undefined!
      ERROR: "b1_load_firmware" [drivers/isdn/hardware/avm/b1pcmcia.ko] undefined!
      ERROR: "b1_send_message" [drivers/isdn/hardware/avm/b1pcmcia.ko] undefined!
      ERROR: "b1_release_appl" [drivers/isdn/hardware/avm/b1pcmcia.ko] undefined!
      ERROR: "b1_register_appl" [drivers/isdn/hardware/avm/b1pcmcia.ko] undefined!
      ERROR: "b1_getrevision" [drivers/isdn/hardware/avm/b1pcmcia.ko] undefined!
      ERROR: "b1_detect" [drivers/isdn/hardware/avm/b1pcmcia.ko] undefined!
      ERROR: "b1_interrupt" [drivers/isdn/hardware/avm/b1pcmcia.ko] undefined!
      ERROR: "b1_alloc_card" [drivers/isdn/hardware/avm/b1pcmcia.ko] undefined!
      
      Signed-off-by: default avatarRandy Dunlap <randy.dunlap@oracle.com>
      Cc: Carsten Paeth <calle@calle.de>
      Cc: Karsten Keil <isdn@linux-pingi.de>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      6a6d01d3
    • Changli Gao's avatar
      header: fix broken headers for user space · 09cd2b99
      Changli Gao authored
      
      
      __packed is only defined in kernel space, so we should use
      __attribute__((packed)) for the code shared between kernel and user space.
      
      Two __attribute() annotations are replaced with __attribute__() too.
      
      Signed-off-by: default avatarChangli Gao <xiaosuo@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      09cd2b99
  4. Aug 20, 2010
  5. Aug 19, 2010
  6. Aug 18, 2010
    • Jarek Poplawski's avatar
      net: Fix a memmove bug in dev_gro_receive() · e5093aec
      Jarek Poplawski authored
      
      
      >Xin Xiaohui wrote:
      > I looked into the code dev_gro_receive(), found the code here:
      > if the frags[0] is pulled to 0, then the page will be released,
      > and memmove() frags left.
      > Is that right? I'm not sure if memmove do right or not, but
      > frags[0].size is never set after memove at least. what I think
      > a simple way is not to do anything if we found frags[0].size == 0.
      > The patch is as followed.
      ...
      
      This version of the patch fixes the bug directly in memmove.
      
      Reported-by: default avatar"Xin, Xiaohui" <xiaohui.xin@intel.com>
      Signed-off-by: default avatarJarek Poplawski <jarkao2@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      e5093aec
    • Eric Dumazet's avatar
      net sched: fix some kernel memory leaks · 1c40be12
      Eric Dumazet authored
      
      
      We leak at least 32bits of kernel memory to user land in tc dump,
      because we dont init all fields (capab ?) of the dumped structure.
      
      Use C99 initializers so that holes and non explicit fields are zeroed.
      
      Signed-off-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      1c40be12
    • Eric Dumazet's avatar
      netfilter: {ip,ip6,arp}_tables: avoid lockdep false positive · 001389b9
      Eric Dumazet authored
      After commit 24b36f01
      
       (netfilter: {ip,ip6,arp}_tables: dont block
      bottom half more than necessary), lockdep can raise a warning
      because we attempt to lock a spinlock with BH enabled, while
      the same lock is usually locked by another cpu in a softirq context.
      
      Disable again BH to avoid these lockdep warnings.
      
      Reported-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Diagnosed-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      001389b9
    • Johannes Berg's avatar
      iwlwifi: fix 3945 filter flags · 8b8ab9d5
      Johannes Berg authored
      Applying the filter flags directly as done since
      
      commit 3474ad63
      
      
      Author: Johannes Berg <johannes.berg@intel.com>
      Date:   Thu Apr 29 04:43:05 2010 -0700
      
          iwlwifi: apply filter flags directly
      
      broke 3945 under some unknown circumstances, as
      reported by Alex.
      
      Since I want to keep the direct application of
      filter flags on iwlagn, duplicate the code into
      both 3945 and agn and remove committing the
      RXON that broke things from the 3945 version.
      
      Cc: stable@kernel.org [2.6.35]
      Reported-by: default avatarAlex Romosan <romosan@sycorax.lbl.gov>
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      8b8ab9d5
    • John W. Linville's avatar
      ipw2100: don't sync status queue entries · c206a04f
      John W. Linville authored
      
      
      These are allocated with pci_alloc_consistent, so calling
      pci_dma_sync_single_for_cpu is incorrect usage of the API.  Remove this
      misuse and consequently avoid the following backtrace:
      
      WARNING: at lib/dma-debug.c:902 check_sync+0xce/0x43a()
      Hardware name: 2373HU6
      ipw2100 0000:02:02.0: DMA-API: device driver tries to sync DMA memory it has not allocated [device address=0x0000000034e88008] [size=8 bytes]
      Modules linked in: microcode ipw2100(+) snd_seq_device ppdev libipw nsc_ircc snd_pcm lib80211 video output irda parport_pc cfg80211 parport thinkpad_acpi e1000 iTCO_wdt crc_ccitt snd_timer iTCO_vendor_support snd i2c_i801 pcspkr rfkill soundcore joydev snd_page_alloc yenta_socket radeon ttm drm_kms_helper drm i2c_algo_bit i2c_core [last unloaded: scsi_wait_scan]
      Pid: 0, comm: swapper Tainted: G        W   2.6.35-wl+ #8
      Call Trace:
       [<c043aa42>] warn_slowpath_common+0x6a/0x7f
       [<c05d252a>] ? check_sync+0xce/0x43a
       [<c043aaca>] warn_slowpath_fmt+0x2b/0x2f
       [<c05d252a>] check_sync+0xce/0x43a
       [<c046189a>] ? print_lock_contention_bug+0x11/0xb2
       [<c05d2b6f>] debug_dma_sync_single_for_cpu+0x47/0x49
       [<c06cbd3c>] ? ehci_irq+0x31/0x331
       [<f82a224a>] ? ipw2100_irq_tasklet+0x24/0x5e9 [ipw2100]
       [<f82a224a>] ? ipw2100_irq_tasklet+0x24/0x5e9 [ipw2100]
       [<f82a221d>] pci_dma_sync_single_for_cpu.clone.1+0x42/0x4b [ipw2100]
       [<f82a23a2>] ipw2100_irq_tasklet+0x17c/0x5e9 [ipw2100]
       [<c043fd87>] tasklet_action+0x78/0xcb
       [<c0440293>] __do_softirq+0xc4/0x183
       [<c044038d>] do_softirq+0x3b/0x5f
       [<c04404d0>] irq_exit+0x3a/0x6d
       [<c0404423>] do_IRQ+0x8b/0x9f
       [<c04038b5>] common_interrupt+0x35/0x3c
       [<c062ecfa>] ? acpi_idle_enter_simple+0xfe/0x13c
       [<c045007b>] ? exit_itimers+0x2d/0x73
       [<c062ecfc>] ? acpi_idle_enter_simple+0x100/0x13c
       [<c070bf10>] cpuidle_idle_call+0x78/0xdc
       [<c040251c>] cpu_idle+0x9b/0xb7
       [<c07b1dd2>] rest_init+0xa6/0xab
       [<c0a4b96d>] start_kernel+0x389/0x38e
       [<c0a4b0c9>] i386_start_kernel+0xc9/0xd0
      
      Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
      c206a04f
  7. Aug 17, 2010