* Re: [PATCH] IPVS: ip_vs_sync.c: local functions should not be exposed globally
From: Julian Anastasov @ 2012-04-26 20:11 UTC (permalink / raw)
To: H Hartley Sweeten; +Cc: Linux Kernel, netdev, David S. Miller, Simon Horman
In-Reply-To: <201204261129.53927.hartleys@visionengravers.com>
Hello,
On Thu, 26 Apr 2012, H Hartley Sweeten wrote:
> Functions not referenced outside of a source file should be marked
> static to prevent it from being exposed globally.
>
> This quiets the sparse warnings:
>
> warning: symbol 'ip_vs_sync_conn_v0' was not declared. Should it be static?
>
> Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
> Cc: "David S. Miller" <davem@davemloft.net>
>
> ---
>
> diff --git a/net/netfilter/ipvs/ip_vs_sync.c b/net/netfilter/ipvs/ip_vs_sync.c
> index bf5e538..49a1fe8 100644
> --- a/net/netfilter/ipvs/ip_vs_sync.c
> +++ b/net/netfilter/ipvs/ip_vs_sync.c
> @@ -446,7 +446,7 @@ ip_vs_sync_buff_create_v0(struct netns_ipvs *ipvs)
> * Version 0 , could be switched in by sys_ctl.
> * Add an ip_vs_conn information into the current sync_buff.
> */
> -void ip_vs_sync_conn_v0(struct net *net, struct ip_vs_conn *cp)
> +static void ip_vs_sync_conn_v0(struct net *net, struct ip_vs_conn *cp)
The 3 patches for IPVS look correct but this change
is already not needed after one of our planned changes:
"ipvs: reduce sync rate with time thresholds"
Not sure how we will avoid the collision, may be
Simon will take only the other 2 changes? Or David will
take all changes and we have to rebase?
> {
> struct netns_ipvs *ipvs = net_ipvs(net);
> struct ip_vs_sync_mesg_v0 *m;
> --
Regards
--
Julian Anastasov <ja@ssi.bg>
^ permalink raw reply
* Re: [PATCH] b44: properly use pr_fmt()
From: David Miller @ 2012-04-26 20:07 UTC (permalink / raw)
To: mcgrof; +Cc: zambrano, netdev, linux-wireless, linux-bluetooth, arend, joe
In-Reply-To: <CAB=NE6VR6hPqoUmRH=YVr+MKu+Sn8tq2asv957zfD+SVWzk75A@mail.gmail.com>
From: "Luis R. Rodriguez" <mcgrof@do-not-panic.com>
Date: Thu, 26 Apr 2012 08:53:30 -0700
> OK I found no pr_fmt warnings at all for make allmodconfig ; make V=1
> ; on v3.4-rc4. For this and others reason stated then yes, this patch
> is simply bogus.
This is what I expected, thanks for sorting this out :-)
We're in the rally!
^ permalink raw reply
* Re: pull request: wireless-next 2012-04-26
From: David Miller @ 2012-04-26 20:06 UTC (permalink / raw)
To: linville; +Cc: linux-wireless, netdev
In-Reply-To: <20120426193444.GI16900@tuxdriver.com>
From: "John W. Linville" <linville@tuxdriver.com>
Date: Thu, 26 Apr 2012 15:34:44 -0400
> This is another batch of updates intended for 3.5...
>
> Nothing too special this round -- highlights include some iwlwifi
> refactoring, some ath9k refactoring, some rtlwifi refactoring, and
> some mac80211 mesh refactoring. It must be Springtime! Along with
> all the refactoring, there is the usual variety of random tweaks here
> and there in the wireless stack.
>
> Please let me know if there are problems!
Pulled, thanks John.
^ permalink raw reply
* [PATCH] net: smsc75xx: fix MDIO access
From: Stephane Fillod @ 2012-04-26 19:55 UTC (permalink / raw)
To: netdev; +Cc: steve.glendinning
* make MDIO read/write to work, the MII_ACCESS_BUSY bit was missing
to actually trigger the I/O. Rem: the smsc75xx is different from
the smsc95xx in that regard.
* fix PHY interrupt acknowledge, which needs a mdio_write
to clear PHY_INT_SRC instead of a usual read like in smsc95xx.
* fix bug in phy_init loop that was ignoring BMCR reset bit,
akin to smsc95xx's d946092000698fd204d82a9d239103c656fb63bf
* mark link down on startup and let PHY interrupt deal with carrier
changes, akin to 07d69d4238418746a7b85c5d05ec17c658a2a390
* declare the smsc75xx's MII as GMII capable
Tested on ARM/Omap3 with LAN7500-CEB.
Signed-off-by: Stephane Fillod <fillods@users.sf.net>
Cc: Steve Glendinning <steve.glendinning@shawell.net>
---
--- a/drivers/net/usb/smsc75xx.c
+++ b/drivers/net/usb/smsc75xx.c
@@ -32,7 +32,7 @@
#include "smsc75xx.h"
#define SMSC_CHIPNAME "smsc75xx"
-#define SMSC_DRIVER_VERSION "1.0.0"
+#define SMSC_DRIVER_VERSION "1.1.0"
#define HS_USB_PKT_SIZE (512)
#define FS_USB_PKT_SIZE (64)
#define DEFAULT_HS_BURST_CAP_SIZE (16 * 1024 + 5 * HS_USB_PKT_SIZE)
@@ -98,7 +98,7 @@ static int __must_check smsc75xx_read_re
if (unlikely(ret < 0))
netdev_warn(dev->net,
- "Failed to read register index 0x%08x", index);
+ "Failed to read register index 0x%08x: %d", index, ret);
le32_to_cpus(buf);
*data = *buf;
@@ -128,7 +128,7 @@ static int __must_check smsc75xx_write_r
if (unlikely(ret < 0))
netdev_warn(dev->net,
- "Failed to write register index 0x%08x", index);
+ "Failed to write register index 0x%08x: %d", index, ret);
kfree(buf);
@@ -171,7 +171,7 @@ static int smsc75xx_mdio_read(struct net
idx &= dev->mii.reg_num_mask;
addr = ((phy_id << MII_ACCESS_PHY_ADDR_SHIFT) & MII_ACCESS_PHY_ADDR)
| ((idx << MII_ACCESS_REG_ADDR_SHIFT) & MII_ACCESS_REG_ADDR)
- | MII_ACCESS_READ;
+ | MII_ACCESS_READ | MII_ACCESS_BUSY;
ret = smsc75xx_write_reg(dev, MII_ACCESS, addr);
check_warn_goto_done(ret, "Error writing MII_ACCESS");
@@ -185,6 +185,8 @@ static int smsc75xx_mdio_read(struct net
done:
mutex_unlock(&dev->phy_mutex);
+ netif_dbg(dev, drv, dev->net, "%s: id %x, idx %d, val=%04x",
+ __func__, phy_id, idx, ret);
return ret;
}
@@ -195,6 +197,9 @@ static void smsc75xx_mdio_write(struct n
u32 val, addr;
int ret;
+ netif_dbg(dev, drv, dev->net, "%s: id %x, idx %d, val=%04x",
+ __func__, phy_id, idx, regval);
+
mutex_lock(&dev->phy_mutex);
/* confirm MII not busy */
@@ -210,7 +215,7 @@ static void smsc75xx_mdio_write(struct n
idx &= dev->mii.reg_num_mask;
addr = ((phy_id << MII_ACCESS_PHY_ADDR_SHIFT) & MII_ACCESS_PHY_ADDR)
| ((idx << MII_ACCESS_REG_ADDR_SHIFT) & MII_ACCESS_REG_ADDR)
- | MII_ACCESS_WRITE;
+ | MII_ACCESS_WRITE | MII_ACCESS_BUSY;
ret = smsc75xx_write_reg(dev, MII_ACCESS, addr);
check_warn_goto_done(ret, "Error writing MII_ACCESS");
@@ -511,7 +516,11 @@ static int smsc75xx_link_reset(struct us
/* clear interrupt status */
ret = smsc75xx_mdio_read(dev->net, mii->phy_id, PHY_INT_SRC);
check_warn_return(ret, "Error reading PHY_INT_SRC");
+ smsc75xx_mdio_write(dev->net, mii->phy_id, PHY_INT_SRC, 0xffff);
+ if (!ret)
+ netif_dbg(dev, link, dev->net, "%s: spurious interrupt", __func__);
+
ret = smsc75xx_write_reg(dev, INT_STS, INT_STS_CLEAR_ALL);
check_warn_return(ret, "Error writing INT_STS");
@@ -643,7 +643,8 @@ static int smsc75xx_phy_initialize(struc
static int smsc75xx_phy_initialize(struct usbnet *dev)
{
- int bmcr, timeout = 0;
+ int bmcr, ret, timeout = 0;
+ u32 buf;
/* Initialize MII structure */
dev->mii.dev = dev->net;
@@ -651,17 +662,19 @@ static int smsc75xx_phy_initialize(struc
dev->mii.mdio_write = smsc75xx_mdio_write;
dev->mii.phy_id_mask = 0x1f;
dev->mii.reg_num_mask = 0x1f;
+ dev->mii.supports_gmii = 1;
dev->mii.phy_id = SMSC75XX_INTERNAL_PHY_ID;
/* reset phy and wait for reset to complete */
- smsc75xx_mdio_write(dev->net, dev->mii.phy_id, MII_BMCR, BMCR_RESET);
+ smsc75xx_mdio_write(dev->net, dev->mii.phy_id, MII_BMCR,
+ BMCR_RESET | BMCR_ANENABLE);
do {
msleep(10);
bmcr = smsc75xx_mdio_read(dev->net, dev->mii.phy_id, MII_BMCR);
check_warn_return(bmcr, "Error reading MII_BMCR");
timeout++;
- } while ((bmcr & MII_BMCR) && (timeout < 100));
+ } while ((bmcr & BMCR_RESET) && (timeout < 100));
if (timeout >= 100) {
netdev_warn(dev->net, "timeout on PHY Reset");
@@ -671,10 +684,17 @@ static int smsc75xx_phy_initialize(struc
smsc75xx_mdio_write(dev->net, dev->mii.phy_id, MII_ADVERTISE,
ADVERTISE_ALL | ADVERTISE_CSMA | ADVERTISE_PAUSE_CAP |
ADVERTISE_PAUSE_ASYM);
+ smsc75xx_mdio_write(dev->net, dev->mii.phy_id, MII_CTRL1000,
+ ADVERTISE_1000FULL);
+ /* write to clear */
+ smsc75xx_mdio_write(dev->net, dev->mii.phy_id, PHY_INT_SRC, 0xffff);
+ ret = smsc75xx_read_reg(dev, MAC_CR, &buf);
+ check_warn_return(ret, "Failed to read MAC_CR: %d", ret);
+
+ buf |= (MAC_CR_ADD | MAC_CR_ASD);
+ ret = smsc75xx_write_reg(dev, MAC_CR, buf);
+ check_warn_return(ret, "Failed to write MAC_CR: %d", ret);
- /* read to clear */
- smsc75xx_mdio_read(dev->net, dev->mii.phy_id, PHY_INT_SRC);
- check_warn_return(bmcr, "Error reading PHY_INT_SRC");
smsc75xx_mdio_write(dev->net, dev->mii.phy_id, PHY_INT_MASK,
PHY_INT_MASK_DEFAULT);
@@ -1211,7 +1211,7 @@ static const struct driver_info smsc75xx
.rx_fixup = smsc75xx_rx_fixup,
.tx_fixup = smsc75xx_tx_fixup,
.status = smsc75xx_status,
- .flags = FLAG_ETHER | FLAG_SEND_ZLP,
+ .flags = FLAG_ETHER | FLAG_SEND_ZLP | FLAG_LINK_INTR,
};
static const struct usb_device_id products[] = {
^ permalink raw reply
* pull request: wireless-next 2012-04-26
From: John W. Linville @ 2012-04-26 19:34 UTC (permalink / raw)
To: davem-fT/PcQaiUtIeIZ0/mPfg9Q
Cc: linux-wireless-u79uwXL29TY76Z2rM5mHXA,
netdev-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <20120425191418.GC16900-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 14582 bytes --]
commit d9b8ae6bd8c3304569a25079fcdbebaa28a48ee4
(This is the same as yesterday's request, but with the libertas
sched.h patch from Luis dropped.)
Dave,
This is another batch of updates intended for 3.5...
Nothing too special this round -- highlights include some iwlwifi
refactoring, some ath9k refactoring, some rtlwifi refactoring, and
some mac80211 mesh refactoring. It must be Springtime! Along with
all the refactoring, there is the usual variety of random tweaks here
and there in the wireless stack.
Please let me know if there are problems!
Thanks,
John
---
The following changes since commit 872f24dbc604ef585ea7eec73020dcdfaffd1956:
tipc: remove inline instances from C source files. (2012-04-24 00:41:03 -0400)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next.git for-davem
Amitkumar Karwar (1):
mwifiex: add support for Marvell USB8797 chipset
Andrei Emeltchenko (1):
mac80211: Adds clean sdata helper
Anisse Astier (2):
rt2800: debugfs register access: BBP is 256 bytes big
rt2800: add chipset revision RT5390R support
Bala Shanmugam (1):
cfg80211: Validate legacy rateset.
Ben Greear (2):
mac80211: Support on-channel scan option.
ath9k: Fix compile warnings when DEBUGFS is disabled.
Daniel Drake (1):
libertas CS: convert to asynchronous firmware loading
David Spinadel (4):
iwlwifi: Change disable calibration bit-set to enum
iwlwifi: Added foreward declaration for iwl_cfg in op_mode
iwlwifi: Remove inconsistent and redundant declaration
iwlwifi: Added debugfs calib disabled write
Don Fry (1):
iwlwifi: revert workaround to restore 1000 rx throughput
Emmanuel Grumbach (16):
iwlwifi: kill shrd->drv, driver points to transport
iwlwifi: op_mode holds its pointer to the transport
iwlwifi: op_mode holds its pointer to the config
iwlwifi: driver holds its pointer to the config
iwlwifi: transport holds its pointer to the config
iwlwifi: driver holds its pointer to the transport
iwlwifi: don't use shared for the logger any more
iwlwifi: remove the shared area
iwlwifi: remove unneeded includes
iwlwifi: split between AGG_ON and AGG_STARTING
iwlwifi: move iwl_rxon_context_id to user
iwlwifi: make a static inline to read the RF kill register
iwlwifi: first enable RF kill interrupt, then check register
iwlwifi: enable RF kill interrupt in start_hw
iwlwifi: check RF kill register when interrupts have been disabled
iwlwifi: provide proper API to disable all interrupts
Felix Fietkau (12):
ath9k: add possible wiphy interface combinations
libertas: add missing include
ath9k_hw: use standard SIFS time as reference for half/quarter channels
ath9k_hw: increase ACK timeout for half/quarter channels
ath9k_hw: set the PHY mode for half/quarter channels on AR9003
ath9k_hw: increase symbol overlap window for half/quarter channels
ath9k_hw: fix and clean up PHY activation delay
ath9k_hw: disable Tx IQ calibration on half/quarter channels
ath9k_hw: disable fast channel change when changing from/to half/quarter mode
ath9k_hw: increase tx abort timeout for half/quarter channels
mac80211: rename AP variable num_sta_authorized to num_mcast_sta
mac80211: fix num_mcast_sta counting issues
Gabor Juhos (1):
ath9k: fix TX power reporting on AR9003 chips
Helmut Schaa (1):
rt2x00: Use GFP_KERNEL for rx buffer allocation on USB devices
Javier Cardona (1):
mac80211: fixup for mesh TSF adjustment latency in Toffset setpoint
Johannes Berg (22):
iwlwifi: improve TX cache footprint
iwlwifi: properly set basic rates
iwlwifi: remove debugfs logspam
iwlwifi: move debugfs registration function declarations
iwlwifi: move iwl_have_debug_level
iwlwifi: clean up iwl-shared.h includes
iwlwifi: remove bt_siso_mode declaration
iwlwifi: move TIME_UNIT
iwlwifi: move iwl_cmd_echo_test
iwlwifi: remove traffic log
iwlwifi: remove TX/RX frame statistics
iwlwifi: remove duplicate iwlagn_mod_params declaration
iwlwifi: move driver defines to iwl-drv.h
iwlwifi: move PLCP defines to config
iwlwifi: move watchdog definitions to config
iwlwifi: move eeprom versions to HW files
iwlwifi: move antenna definitions to config
iwlwifi: move OTP defines
iwlwifi: clean up some hw file includes
iwlwifi: use direct calls for transport free
iwlwifi: clean up module parameters
iwlwifi: use new mac80211 queue scheme
John W. Linville (1):
Merge branch 'master' of git://git.kernel.org/.../linville/wireless-next into for-davem
Larry Finger (6):
rtlwifi: Move dig_t and ps_t structs
rtlwifi: Add dm structs to private structure
rtlwifi: rtl8192c: Convert driver to use private dm structs
rtlwifi: rtl8192c: Convert driver to use private ps_t struct
rtlwifi: rtl8192de: Convert driver to use private dm structs
rtlwifi: rtl8192se: Convert driver to use private dm struct
Michael Liang (1):
ath9k: don't strip mic on non-encrypted frames in tkip
Rajkumar Manoharan (2):
ath9k: simplify beacon configuration for beaconing vifs
ath9k_hw: remove ATH_BTCOEX_CFG_MCI
Sujith Manoharan (1):
ath9k: Fix IDLE Powersave
Thomas Pedersen (4):
mac80211: refactor mesh peer initialization
mac80211: refactor mesh peer rate handling
mac80211: don't set mesh peer ht caps if ht disabled
mac80211: fix STA channel width field
Wey-Yi Guy (3):
mac80211: declare ieee80211_ave_rssi as EXPORT
iwlwifi: include net/mac80211.h to avoid compiler error
mac80211: check for non-managed interface
Xose Vazquez Perez (2):
wireless: rt2x00: rt2800usb add more devices ids
wireless: rt2x00: rt2800usb more devices were identified
Zefir Kurtisi (2):
ath9k: make DFS detector pools SMP safe
ath9k: extend DFS detector stats in dfs_debugfs
drivers/net/wireless/ath/ath9k/ar5008_phy.c | 17 +-
drivers/net/wireless/ath/ath9k/ar9003_calib.c | 10 +-
drivers/net/wireless/ath/ath9k/ar9003_eeprom.c | 64 +-
drivers/net/wireless/ath/ath9k/ar9003_phy.c | 28 +-
drivers/net/wireless/ath/ath9k/ar9003_phy.h | 3 +
drivers/net/wireless/ath/ath9k/beacon.c | 4 +-
drivers/net/wireless/ath/ath9k/btcoex.c | 14 +-
drivers/net/wireless/ath/ath9k/btcoex.h | 1 -
drivers/net/wireless/ath/ath9k/dfs.c | 4 +
drivers/net/wireless/ath/ath9k/dfs_debug.c | 46 +
drivers/net/wireless/ath/ath9k/dfs_debug.h | 45 +-
drivers/net/wireless/ath/ath9k/dfs_pri_detector.c | 130 ++-
drivers/net/wireless/ath/ath9k/gpio.c | 21 +-
drivers/net/wireless/ath/ath9k/hw.c | 42 +-
drivers/net/wireless/ath/ath9k/hw.h | 5 +-
drivers/net/wireless/ath/ath9k/init.c | 21 +
drivers/net/wireless/ath/ath9k/mac.c | 10 +-
drivers/net/wireless/ath/ath9k/main.c | 105 +--
drivers/net/wireless/ath/ath9k/recv.c | 3 +-
drivers/net/wireless/iwlwifi/Makefile | 2 +-
drivers/net/wireless/iwlwifi/iwl-1000.c | 8 +-
drivers/net/wireless/iwlwifi/iwl-2000.c | 8 +-
drivers/net/wireless/iwlwifi/iwl-5000.c | 9 +-
drivers/net/wireless/iwlwifi/iwl-6000.c | 17 +-
drivers/net/wireless/iwlwifi/iwl-agn-calib.c | 9 +-
drivers/net/wireless/iwlwifi/iwl-agn-calib.h | 1 -
drivers/net/wireless/iwlwifi/iwl-agn-devices.c | 25 +-
drivers/net/wireless/iwlwifi/iwl-agn-hw.h | 11 +
drivers/net/wireless/iwlwifi/iwl-agn-lib.c | 42 +-
drivers/net/wireless/iwlwifi/iwl-agn-rs.c | 12 +-
drivers/net/wireless/iwlwifi/iwl-agn-rs.h | 36 +-
drivers/net/wireless/iwlwifi/iwl-agn-rx.c | 22 +-
drivers/net/wireless/iwlwifi/iwl-agn-rxon.c | 128 ++-
drivers/net/wireless/iwlwifi/iwl-agn-sta.c | 1 -
drivers/net/wireless/iwlwifi/iwl-agn-tt.c | 18 +-
drivers/net/wireless/iwlwifi/iwl-agn-tx.c | 61 +-
drivers/net/wireless/iwlwifi/iwl-agn.c | 308 ++----
drivers/net/wireless/iwlwifi/iwl-agn.h | 26 +-
drivers/net/wireless/iwlwifi/iwl-config.h | 28 +
drivers/net/wireless/iwlwifi/iwl-core.c | 297 ------
drivers/net/wireless/iwlwifi/iwl-core.h | 133 ---
drivers/net/wireless/iwlwifi/iwl-debug.c | 1 +
drivers/net/wireless/iwlwifi/iwl-debug.h | 34 +-
drivers/net/wireless/iwlwifi/iwl-debugfs.c | 309 ++-----
drivers/net/wireless/iwlwifi/iwl-dev.h | 99 +--
drivers/net/wireless/iwlwifi/iwl-drv.c | 151 +++-
drivers/net/wireless/iwlwifi/iwl-drv.h | 25 +-
drivers/net/wireless/iwlwifi/iwl-eeprom.c | 64 +-
drivers/net/wireless/iwlwifi/iwl-eeprom.h | 53 -
drivers/net/wireless/iwlwifi/iwl-fw.h | 1 +
drivers/net/wireless/iwlwifi/iwl-io.h | 1 -
drivers/net/wireless/iwlwifi/iwl-led.c | 21 +-
drivers/net/wireless/iwlwifi/iwl-mac80211.c | 88 +-
.../iwlwifi/{iwl-shared.h => iwl-modparams.h} | 78 +--
drivers/net/wireless/iwlwifi/iwl-op-mode.h | 2 +
drivers/net/wireless/iwlwifi/iwl-pci.c | 60 +-
drivers/net/wireless/iwlwifi/iwl-phy-db.c | 5 +-
drivers/net/wireless/iwlwifi/iwl-phy-db.h | 4 +-
drivers/net/wireless/iwlwifi/iwl-power.c | 19 +-
drivers/net/wireless/iwlwifi/iwl-power.h | 9 -
drivers/net/wireless/iwlwifi/iwl-scan.c | 13 +-
drivers/net/wireless/iwlwifi/iwl-testmode.c | 27 +-
drivers/net/wireless/iwlwifi/iwl-trans-pcie-int.h | 43 +-
drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c | 11 +-
drivers/net/wireless/iwlwifi/iwl-trans-pcie-tx.c | 35 +-
drivers/net/wireless/iwlwifi/iwl-trans-pcie.c | 184 ++--
drivers/net/wireless/iwlwifi/iwl-trans.h | 49 +-
drivers/net/wireless/iwlwifi/iwl-ucode.c | 25 +-
drivers/net/wireless/libertas/firmware.c | 1 +
drivers/net/wireless/libertas/if_cs.c | 88 +-
drivers/net/wireless/mwifiex/11n_aggr.c | 36 +-
drivers/net/wireless/mwifiex/Kconfig | 11 +
drivers/net/wireless/mwifiex/Makefile | 3 +
drivers/net/wireless/mwifiex/cmdevt.c | 63 +-
drivers/net/wireless/mwifiex/decl.h | 1 +
drivers/net/wireless/mwifiex/fw.h | 5 +
drivers/net/wireless/mwifiex/init.c | 64 +-
drivers/net/wireless/mwifiex/main.c | 26 +-
drivers/net/wireless/mwifiex/main.h | 20 +-
drivers/net/wireless/mwifiex/sta_cmd.c | 2 +-
drivers/net/wireless/mwifiex/sta_rx.c | 15 +-
drivers/net/wireless/mwifiex/sta_tx.c | 12 +-
drivers/net/wireless/mwifiex/txrx.c | 21 +-
drivers/net/wireless/mwifiex/usb.c | 1052 ++++++++++++++++++++
drivers/net/wireless/mwifiex/usb.h | 99 ++
drivers/net/wireless/mwifiex/util.c | 22 +
drivers/net/wireless/mwifiex/wmm.c | 18 +-
drivers/net/wireless/rt2x00/rt2800.h | 3 +-
drivers/net/wireless/rt2x00/rt2800lib.c | 12 +
drivers/net/wireless/rt2x00/rt2800usb.c | 25 +-
drivers/net/wireless/rt2x00/rt2x00.h | 2 +-
drivers/net/wireless/rt2x00/rt2x00dev.c | 4 +-
drivers/net/wireless/rt2x00/rt2x00lib.h | 2 +-
drivers/net/wireless/rt2x00/rt2x00pci.c | 2 +-
drivers/net/wireless/rt2x00/rt2x00queue.c | 6 +-
drivers/net/wireless/rt2x00/rt2x00usb.c | 2 +-
drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c | 290 +++---
drivers/net/wireless/rtlwifi/rtl8192c/dm_common.h | 35 -
drivers/net/wireless/rtlwifi/rtl8192c/phy_common.c | 1 +
drivers/net/wireless/rtlwifi/rtl8192ce/dm.h | 35 -
drivers/net/wireless/rtlwifi/rtl8192de/dm.c | 185 ++--
drivers/net/wireless/rtlwifi/rtl8192de/dm.h | 51 -
drivers/net/wireless/rtlwifi/rtl8192de/phy.c | 7 +-
drivers/net/wireless/rtlwifi/rtl8192se/dm.c | 156 ++--
drivers/net/wireless/rtlwifi/rtl8192se/dm.h | 44 -
drivers/net/wireless/rtlwifi/rtl8192se/phy.c | 7 +-
drivers/net/wireless/rtlwifi/wifi.h | 63 ++
include/net/mac80211.h | 8 +
net/mac80211/cfg.c | 19 +
net/mac80211/debugfs_netdev.c | 4 +-
net/mac80211/ieee80211_i.h | 5 +-
net/mac80211/iface.c | 19 +-
net/mac80211/main.c | 4 +-
net/mac80211/mesh.c | 19 +-
net/mac80211/mesh.h | 14 +-
net/mac80211/mesh_plink.c | 138 ++--
net/mac80211/mesh_sync.c | 2 +-
net/mac80211/rx.c | 2 +
net/mac80211/scan.c | 95 ++-
net/mac80211/sta_info.c | 12 +-
net/mac80211/tx.c | 2 +-
net/mac80211/util.c | 9 +-
net/wireless/nl80211.c | 3 +
123 files changed, 3467 insertions(+), 2565 deletions(-)
delete mode 100644 drivers/net/wireless/iwlwifi/iwl-core.c
delete mode 100644 drivers/net/wireless/iwlwifi/iwl-core.h
rename drivers/net/wireless/iwlwifi/{iwl-shared.h => iwl-modparams.h} (66%)
create mode 100644 drivers/net/wireless/mwifiex/usb.c
create mode 100644 drivers/net/wireless/mwifiex/usb.h
--
John W. Linville Someday the world will need a hero, and you
linville-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org might be all we have. Be ready.
[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply
* RE: wireless: mwifiex: initial commit for Marvell mwifiex driver
From: Bing Zhao @ 2012-04-26 19:25 UTC (permalink / raw)
To: Dan Carpenter; +Cc: netdev@vger.kernel.org
In-Reply-To: <20120426125102.GA14808@mwanda>
Hi Dan,
> On Wed, Apr 25, 2012 at 03:08:33PM -0700, Bing Zhao wrote:
> > > ->oui is only a 3 byte array so we're reading past the end for this
> > > comparison.
> >
> > I will fix the misuse of memcmp's.
> >
>
> So it wasn't really a bug right? Just a bit confusing.
That's right. I will submit a patch to fix the confusion.
>
> > By the way, could you please share with me how you check for this kind of errors?
> > Is it coccinelle? I tried with coccicheck but got "spatch.opt unknown option -D" error.
> >
>
> This was from a Smatch check that I haven't pushed yet.
Are you going to push it soon? I'm eager to use it checking my code.
Thanks,
Bing
>
> regards,
> dan carpenter
^ permalink raw reply
* Re: [PATCH 2/2] drop_monitor: Make updating data->skb smp safe
From: Eric Dumazet @ 2012-04-26 19:25 UTC (permalink / raw)
To: Neil Horman; +Cc: netdev, David Miller
In-Reply-To: <20120426191849.GA26072@hmsreliant.think-freely.org>
On Thu, 2012-04-26 at 15:18 -0400, Neil Horman wrote:
> On Thu, Apr 26, 2012 at 09:00:09PM +0200, Eric Dumazet wrote:
> > > * Grab the skb we're about to send
> > > */
> > > - skb = data->skb;
> > > + rcu_read_lock();
> > > + skb = rcu_dereference(data->skb);
> >
> > This protects nothing ...
> >
> Hmm, it doesn't really need to be protected either, I just added the read_lock
> to prevent any rcu_dereference from complaining about not holding the
> rcu_read_lock, but as I'm typing this, it occurs to me that that would make
> rcu_dereference_protected the call to use here. Thanks for kick starting me on
> that.
perfect ;)
^ permalink raw reply
* Re: [PATCH 1/2] drop_monitor: fix sleeping in invalid context warning
From: Neil Horman @ 2012-04-26 19:21 UTC (permalink / raw)
To: Eric Dumazet; +Cc: netdev, David Miller
In-Reply-To: <1335466889.2775.60.camel@edumazet-glaptop>
On Thu, Apr 26, 2012 at 09:01:29PM +0200, Eric Dumazet wrote:
> On Thu, 2012-04-26 at 14:47 -0400, Neil Horman wrote:
> > Eric Dumazet pointed out this warning in the drop_monitor protocol to me:
> >
> > [ 38.352571] BUG: sleeping function called from invalid context at kernel/mutex.c:85
> > [ 38.352576] in_atomic(): 1, irqs_disabled(): 0, pid: 4415, name: dropwatch
> > [ 38.352580] Pid: 4415, comm: dropwatch Not tainted 3.4.0-rc2+ #71
> > [ 38.352582] Call Trace:
> > [ 38.352592] [<ffffffff8153aaf0>] ? trace_napi_poll_hit+0xd0/0xd0
> > [ 38.352599] [<ffffffff81063f2a>] __might_sleep+0xca/0xf0
> > [ 38.352606] [<ffffffff81655b16>] mutex_lock+0x26/0x50
> > [ 38.352610] [<ffffffff8153aaf0>] ? trace_napi_poll_hit+0xd0/0xd0
> > [ 38.352616] [<ffffffff810b72d9>] tracepoint_probe_register+0x29/0x90
> > [ 38.352621] [<ffffffff8153a585>] set_all_monitor_traces+0x105/0x170
> > [ 38.352625] [<ffffffff8153a8ca>] net_dm_cmd_trace+0x2a/0x40
> > [ 38.352630] [<ffffffff8154a81a>] genl_rcv_msg+0x21a/0x2b0
> > [ 38.352636] [<ffffffff810f8029>] ? zone_statistics+0x99/0xc0
> > [ 38.352640] [<ffffffff8154a600>] ? genl_rcv+0x30/0x30
> > [ 38.352645] [<ffffffff8154a059>] netlink_rcv_skb+0xa9/0xd0
> > [ 38.352649] [<ffffffff8154a5f0>] genl_rcv+0x20/0x30
> > [ 38.352653] [<ffffffff81549a7e>] netlink_unicast+0x1ae/0x1f0
> > [ 38.352658] [<ffffffff81549d76>] netlink_sendmsg+0x2b6/0x310
> > [ 38.352663] [<ffffffff8150824f>] sock_sendmsg+0x10f/0x130
> > [ 38.352668] [<ffffffff8150abe0>] ? move_addr_to_kernel+0x60/0xb0
> > [ 38.352673] [<ffffffff81515f04>] ? verify_iovec+0x64/0xe0
> > [ 38.352677] [<ffffffff81509c46>] __sys_sendmsg+0x386/0x390
> > [ 38.352682] [<ffffffff810ffaf9>] ? handle_mm_fault+0x139/0x210
> > [ 38.352687] [<ffffffff8165b5bc>] ? do_page_fault+0x1ec/0x4f0
> > [ 38.352693] [<ffffffff8106ba4d>] ? set_next_entity+0x9d/0xb0
> > [ 38.352699] [<ffffffff81310b49>] ? tty_ldisc_deref+0x9/0x10
> > [ 38.352703] [<ffffffff8106d363>] ? pick_next_task_fair+0x63/0x140
> > [ 38.352708] [<ffffffff8150b8d4>] sys_sendmsg+0x44/0x80
> > [ 38.352713] [<ffffffff8165f8e2>] system_call_fastpath+0x16/0x1b
> >
> > It stems from holding a spinlock (trace_state_lock) while attempting to register
> > or unregister tracepoint hooks, making in_atomic() true in this context, leading
> > to the warning when the tracepoint calls might_sleep() while its taking a mutex.
> > Since we only use the trace_state_lock to prevent trace protocol state races, as
> > well as hardware stat list updates on an rcu write side, we can just convert the
> > spinlock to a mutex to avoid this problem.
> >
> > Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
> > Reported-by: Eric Dumazet <eric.dumazet@gmail.com>
> > CC: David Miller <davem@davemloft.net>
> > ---
> > net/core/drop_monitor.c | 14 +++++++-------
> > 1 files changed, 7 insertions(+), 7 deletions(-)
> >
> > diff --git a/net/core/drop_monitor.c b/net/core/drop_monitor.c
> > index 5c3c81a..04ce1dd 100644
> > --- a/net/core/drop_monitor.c
> > +++ b/net/core/drop_monitor.c
> > @@ -42,7 +42,7 @@ static void send_dm_alert(struct work_struct *unused);
> > * netlink alerts
> > */
> > static int trace_state = TRACE_OFF;
> > -static DEFINE_SPINLOCK(trace_state_lock);
> > +static DEFINE_MUTEX(trace_state_lock);
>
> Maybe rename it to trace_state_mutex ?
>
ACK, no problem
>
>
^ permalink raw reply
* Re: [PATCH 2/2] drop_monitor: Make updating data->skb smp safe
From: Neil Horman @ 2012-04-26 19:18 UTC (permalink / raw)
To: Eric Dumazet; +Cc: netdev, David Miller
In-Reply-To: <1335466809.2775.59.camel@edumazet-glaptop>
On Thu, Apr 26, 2012 at 09:00:09PM +0200, Eric Dumazet wrote:
> On Thu, 2012-04-26 at 14:47 -0400, Neil Horman wrote:
> > Eric Dumazet pointed out to me that the drop_monitor protocol has some holes in
> > its smp protections. Specifically, its possible to replace data->skb while its
> > being written. This patch corrects that by making data->skb and rcu protected
> > variable. That will prevent it from being overwritten while a tracepoint is
> > modifying it.
> >
> > Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
> > Reported-by: Eric Dumazet <eric.dumazet@gmail.com>
> > CC: David Miller <davem@davemloft.net>
> > ---
> > net/core/drop_monitor.c | 43 ++++++++++++++++++++++++++++++++-----------
> > 1 files changed, 32 insertions(+), 11 deletions(-)
> >
>
> Hi Neil
>
> I believe more work is needed on this patch
>
> > diff --git a/net/core/drop_monitor.c b/net/core/drop_monitor.c
> > index 04ce1dd..852e36b 100644
> > --- a/net/core/drop_monitor.c
> > +++ b/net/core/drop_monitor.c
> > @@ -46,7 +46,7 @@ static DEFINE_MUTEX(trace_state_lock);
> >
> > struct per_cpu_dm_data {
> > struct work_struct dm_alert_work;
> > - struct sk_buff *skb;
> > + struct sk_buff __rcu *skb;
> > atomic_t dm_hit_count;
> > struct timer_list send_timer;
> > };
> > @@ -79,29 +79,41 @@ static void reset_per_cpu_data(struct per_cpu_dm_data *data)
> > size_t al;
> > struct net_dm_alert_msg *msg;
> > struct nlattr *nla;
> > + struct sk_buff *skb;
> >
> > al = sizeof(struct net_dm_alert_msg);
> > al += dm_hit_limit * sizeof(struct net_dm_drop_point);
> > al += sizeof(struct nlattr);
> >
> > - data->skb = genlmsg_new(al, GFP_KERNEL);
> > - genlmsg_put(data->skb, 0, 0, &net_drop_monitor_family,
> > + skb = genlmsg_new(al, GFP_KERNEL);
>
> skb can be NULL here...
>
Good point, I'll add NULL checks
> > + genlmsg_put(skb, 0, 0, &net_drop_monitor_family,
> > 0, NET_DM_CMD_ALERT);
> > - nla = nla_reserve(data->skb, NLA_UNSPEC, sizeof(struct net_dm_alert_msg));
> > + nla = nla_reserve(skb, NLA_UNSPEC, sizeof(struct net_dm_alert_msg));
> > msg = nla_data(nla);
> > memset(msg, 0, al);
> > +
> > + /*
> > + * Don't need to lock this, since we are guaranteed to only
> > + * run this on a single cpu at a time
> > + */
> > + rcu_assign_pointer(data->skb, skb);
> > +
> > + synchronize_rcu();
> > +
> > atomic_set(&data->dm_hit_count, dm_hit_limit);
> > }
> >
> > static void send_dm_alert(struct work_struct *unused)
> > {
> > struct sk_buff *skb;
> > - struct per_cpu_dm_data *data = &__get_cpu_var(dm_cpu_data);
> > + struct per_cpu_dm_data *data = &get_cpu_var(dm_cpu_data);
> >
> > /*
> > * Grab the skb we're about to send
> > */
> > - skb = data->skb;
> > + rcu_read_lock();
> > + skb = rcu_dereference(data->skb);
>
> This protects nothing ...
>
Hmm, it doesn't really need to be protected either, I just added the read_lock
to prevent any rcu_dereference from complaining about not holding the
rcu_read_lock, but as I'm typing this, it occurs to me that that would make
rcu_dereference_protected the call to use here. Thanks for kick starting me on
that.
> > + rcu_read_unlock();
> >
>
>
>
> > /*
> > * Replace it with a new one
> > @@ -113,6 +125,7 @@ static void send_dm_alert(struct work_struct *unused)
> > */
> > genlmsg_multicast(skb, 0, NET_DM_GRP_ALERT, GFP_KERNEL);
> >
> > + put_cpu_var(dm_cpu_data);
> > }
> >
> > /*
> > @@ -123,9 +136,11 @@ static void send_dm_alert(struct work_struct *unused)
> > */
> > static void sched_send_work(unsigned long unused)
> > {
> > - struct per_cpu_dm_data *data = &__get_cpu_var(dm_cpu_data);
> > + struct per_cpu_dm_data *data = &get_cpu_var(dm_cpu_data);
> > +
> > + schedule_work_on(smp_processor_id(), &data->dm_alert_work);
> >
> > - schedule_work(&data->dm_alert_work);
> > + put_cpu_var(dm_cpu_data);
> > }
> >
> > static void trace_drop_common(struct sk_buff *skb, void *location)
> > @@ -134,9 +149,13 @@ static void trace_drop_common(struct sk_buff *skb, void *location)
> > struct nlmsghdr *nlh;
> > struct nlattr *nla;
> > int i;
> > - struct per_cpu_dm_data *data = &__get_cpu_var(dm_cpu_data);
> > + struct sk_buff *dskb;
> > + struct per_cpu_dm_data *data = &get_cpu_var(dm_cpu_data);
> >
> >
> > + rcu_read_lock();
> > + dskb = rcu_dereference(data->skb);
> > +
>
> dskb can be NULL here
>
ACK, I'll check that
> > if (!atomic_add_unless(&data->dm_hit_count, -1, 0)) {
> > /*
> > * we're already at zero, discard this hit
> > @@ -144,7 +163,7 @@ static void trace_drop_common(struct sk_buff *skb, void *location)
> > goto out;
> > }
> >
> > - nlh = (struct nlmsghdr *)data->skb->data;
> > + nlh = (struct nlmsghdr *)dskb->data;
> > nla = genlmsg_data(nlmsg_data(nlh));
> > msg = nla_data(nla);
> > for (i = 0; i < msg->entries; i++) {
> > @@ -158,7 +177,7 @@ static void trace_drop_common(struct sk_buff *skb, void *location)
> > /*
> > * We need to create a new entry
> > */
> > - __nla_reserve_nohdr(data->skb, sizeof(struct net_dm_drop_point));
> > + __nla_reserve_nohdr(dskb, sizeof(struct net_dm_drop_point));
> > nla->nla_len += NLA_ALIGN(sizeof(struct net_dm_drop_point));
> > memcpy(msg->points[msg->entries].pc, &location, sizeof(void *));
> > msg->points[msg->entries].count = 1;
> > @@ -170,6 +189,8 @@ static void trace_drop_common(struct sk_buff *skb, void *location)
> > }
> >
> > out:
> > + rcu_read_unlock();
> > + put_cpu_var(dm_cpu_data);
> > return;
> > }
> >
>
> Thanks
>
>
>
^ permalink raw reply
* Re: [PATCH 1/2] drop_monitor: fix sleeping in invalid context warning
From: Eric Dumazet @ 2012-04-26 19:01 UTC (permalink / raw)
To: Neil Horman; +Cc: netdev, David Miller
In-Reply-To: <1335466022-32661-2-git-send-email-nhorman@tuxdriver.com>
On Thu, 2012-04-26 at 14:47 -0400, Neil Horman wrote:
> Eric Dumazet pointed out this warning in the drop_monitor protocol to me:
>
> [ 38.352571] BUG: sleeping function called from invalid context at kernel/mutex.c:85
> [ 38.352576] in_atomic(): 1, irqs_disabled(): 0, pid: 4415, name: dropwatch
> [ 38.352580] Pid: 4415, comm: dropwatch Not tainted 3.4.0-rc2+ #71
> [ 38.352582] Call Trace:
> [ 38.352592] [<ffffffff8153aaf0>] ? trace_napi_poll_hit+0xd0/0xd0
> [ 38.352599] [<ffffffff81063f2a>] __might_sleep+0xca/0xf0
> [ 38.352606] [<ffffffff81655b16>] mutex_lock+0x26/0x50
> [ 38.352610] [<ffffffff8153aaf0>] ? trace_napi_poll_hit+0xd0/0xd0
> [ 38.352616] [<ffffffff810b72d9>] tracepoint_probe_register+0x29/0x90
> [ 38.352621] [<ffffffff8153a585>] set_all_monitor_traces+0x105/0x170
> [ 38.352625] [<ffffffff8153a8ca>] net_dm_cmd_trace+0x2a/0x40
> [ 38.352630] [<ffffffff8154a81a>] genl_rcv_msg+0x21a/0x2b0
> [ 38.352636] [<ffffffff810f8029>] ? zone_statistics+0x99/0xc0
> [ 38.352640] [<ffffffff8154a600>] ? genl_rcv+0x30/0x30
> [ 38.352645] [<ffffffff8154a059>] netlink_rcv_skb+0xa9/0xd0
> [ 38.352649] [<ffffffff8154a5f0>] genl_rcv+0x20/0x30
> [ 38.352653] [<ffffffff81549a7e>] netlink_unicast+0x1ae/0x1f0
> [ 38.352658] [<ffffffff81549d76>] netlink_sendmsg+0x2b6/0x310
> [ 38.352663] [<ffffffff8150824f>] sock_sendmsg+0x10f/0x130
> [ 38.352668] [<ffffffff8150abe0>] ? move_addr_to_kernel+0x60/0xb0
> [ 38.352673] [<ffffffff81515f04>] ? verify_iovec+0x64/0xe0
> [ 38.352677] [<ffffffff81509c46>] __sys_sendmsg+0x386/0x390
> [ 38.352682] [<ffffffff810ffaf9>] ? handle_mm_fault+0x139/0x210
> [ 38.352687] [<ffffffff8165b5bc>] ? do_page_fault+0x1ec/0x4f0
> [ 38.352693] [<ffffffff8106ba4d>] ? set_next_entity+0x9d/0xb0
> [ 38.352699] [<ffffffff81310b49>] ? tty_ldisc_deref+0x9/0x10
> [ 38.352703] [<ffffffff8106d363>] ? pick_next_task_fair+0x63/0x140
> [ 38.352708] [<ffffffff8150b8d4>] sys_sendmsg+0x44/0x80
> [ 38.352713] [<ffffffff8165f8e2>] system_call_fastpath+0x16/0x1b
>
> It stems from holding a spinlock (trace_state_lock) while attempting to register
> or unregister tracepoint hooks, making in_atomic() true in this context, leading
> to the warning when the tracepoint calls might_sleep() while its taking a mutex.
> Since we only use the trace_state_lock to prevent trace protocol state races, as
> well as hardware stat list updates on an rcu write side, we can just convert the
> spinlock to a mutex to avoid this problem.
>
> Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
> Reported-by: Eric Dumazet <eric.dumazet@gmail.com>
> CC: David Miller <davem@davemloft.net>
> ---
> net/core/drop_monitor.c | 14 +++++++-------
> 1 files changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/net/core/drop_monitor.c b/net/core/drop_monitor.c
> index 5c3c81a..04ce1dd 100644
> --- a/net/core/drop_monitor.c
> +++ b/net/core/drop_monitor.c
> @@ -42,7 +42,7 @@ static void send_dm_alert(struct work_struct *unused);
> * netlink alerts
> */
> static int trace_state = TRACE_OFF;
> -static DEFINE_SPINLOCK(trace_state_lock);
> +static DEFINE_MUTEX(trace_state_lock);
Maybe rename it to trace_state_mutex ?
^ permalink raw reply
* Re: [PATCH 2/2] drop_monitor: Make updating data->skb smp safe
From: Eric Dumazet @ 2012-04-26 19:00 UTC (permalink / raw)
To: Neil Horman; +Cc: netdev, David Miller
In-Reply-To: <1335466022-32661-3-git-send-email-nhorman@tuxdriver.com>
On Thu, 2012-04-26 at 14:47 -0400, Neil Horman wrote:
> Eric Dumazet pointed out to me that the drop_monitor protocol has some holes in
> its smp protections. Specifically, its possible to replace data->skb while its
> being written. This patch corrects that by making data->skb and rcu protected
> variable. That will prevent it from being overwritten while a tracepoint is
> modifying it.
>
> Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
> Reported-by: Eric Dumazet <eric.dumazet@gmail.com>
> CC: David Miller <davem@davemloft.net>
> ---
> net/core/drop_monitor.c | 43 ++++++++++++++++++++++++++++++++-----------
> 1 files changed, 32 insertions(+), 11 deletions(-)
>
Hi Neil
I believe more work is needed on this patch
> diff --git a/net/core/drop_monitor.c b/net/core/drop_monitor.c
> index 04ce1dd..852e36b 100644
> --- a/net/core/drop_monitor.c
> +++ b/net/core/drop_monitor.c
> @@ -46,7 +46,7 @@ static DEFINE_MUTEX(trace_state_lock);
>
> struct per_cpu_dm_data {
> struct work_struct dm_alert_work;
> - struct sk_buff *skb;
> + struct sk_buff __rcu *skb;
> atomic_t dm_hit_count;
> struct timer_list send_timer;
> };
> @@ -79,29 +79,41 @@ static void reset_per_cpu_data(struct per_cpu_dm_data *data)
> size_t al;
> struct net_dm_alert_msg *msg;
> struct nlattr *nla;
> + struct sk_buff *skb;
>
> al = sizeof(struct net_dm_alert_msg);
> al += dm_hit_limit * sizeof(struct net_dm_drop_point);
> al += sizeof(struct nlattr);
>
> - data->skb = genlmsg_new(al, GFP_KERNEL);
> - genlmsg_put(data->skb, 0, 0, &net_drop_monitor_family,
> + skb = genlmsg_new(al, GFP_KERNEL);
skb can be NULL here...
> + genlmsg_put(skb, 0, 0, &net_drop_monitor_family,
> 0, NET_DM_CMD_ALERT);
> - nla = nla_reserve(data->skb, NLA_UNSPEC, sizeof(struct net_dm_alert_msg));
> + nla = nla_reserve(skb, NLA_UNSPEC, sizeof(struct net_dm_alert_msg));
> msg = nla_data(nla);
> memset(msg, 0, al);
> +
> + /*
> + * Don't need to lock this, since we are guaranteed to only
> + * run this on a single cpu at a time
> + */
> + rcu_assign_pointer(data->skb, skb);
> +
> + synchronize_rcu();
> +
> atomic_set(&data->dm_hit_count, dm_hit_limit);
> }
>
> static void send_dm_alert(struct work_struct *unused)
> {
> struct sk_buff *skb;
> - struct per_cpu_dm_data *data = &__get_cpu_var(dm_cpu_data);
> + struct per_cpu_dm_data *data = &get_cpu_var(dm_cpu_data);
>
> /*
> * Grab the skb we're about to send
> */
> - skb = data->skb;
> + rcu_read_lock();
> + skb = rcu_dereference(data->skb);
This protects nothing ...
> + rcu_read_unlock();
>
> /*
> * Replace it with a new one
> @@ -113,6 +125,7 @@ static void send_dm_alert(struct work_struct *unused)
> */
> genlmsg_multicast(skb, 0, NET_DM_GRP_ALERT, GFP_KERNEL);
>
> + put_cpu_var(dm_cpu_data);
> }
>
> /*
> @@ -123,9 +136,11 @@ static void send_dm_alert(struct work_struct *unused)
> */
> static void sched_send_work(unsigned long unused)
> {
> - struct per_cpu_dm_data *data = &__get_cpu_var(dm_cpu_data);
> + struct per_cpu_dm_data *data = &get_cpu_var(dm_cpu_data);
> +
> + schedule_work_on(smp_processor_id(), &data->dm_alert_work);
>
> - schedule_work(&data->dm_alert_work);
> + put_cpu_var(dm_cpu_data);
> }
>
> static void trace_drop_common(struct sk_buff *skb, void *location)
> @@ -134,9 +149,13 @@ static void trace_drop_common(struct sk_buff *skb, void *location)
> struct nlmsghdr *nlh;
> struct nlattr *nla;
> int i;
> - struct per_cpu_dm_data *data = &__get_cpu_var(dm_cpu_data);
> + struct sk_buff *dskb;
> + struct per_cpu_dm_data *data = &get_cpu_var(dm_cpu_data);
>
>
> + rcu_read_lock();
> + dskb = rcu_dereference(data->skb);
> +
dskb can be NULL here
> if (!atomic_add_unless(&data->dm_hit_count, -1, 0)) {
> /*
> * we're already at zero, discard this hit
> @@ -144,7 +163,7 @@ static void trace_drop_common(struct sk_buff *skb, void *location)
> goto out;
> }
>
> - nlh = (struct nlmsghdr *)data->skb->data;
> + nlh = (struct nlmsghdr *)dskb->data;
> nla = genlmsg_data(nlmsg_data(nlh));
> msg = nla_data(nla);
> for (i = 0; i < msg->entries; i++) {
> @@ -158,7 +177,7 @@ static void trace_drop_common(struct sk_buff *skb, void *location)
> /*
> * We need to create a new entry
> */
> - __nla_reserve_nohdr(data->skb, sizeof(struct net_dm_drop_point));
> + __nla_reserve_nohdr(dskb, sizeof(struct net_dm_drop_point));
> nla->nla_len += NLA_ALIGN(sizeof(struct net_dm_drop_point));
> memcpy(msg->points[msg->entries].pc, &location, sizeof(void *));
> msg->points[msg->entries].count = 1;
> @@ -170,6 +189,8 @@ static void trace_drop_common(struct sk_buff *skb, void *location)
> }
>
> out:
> + rcu_read_unlock();
> + put_cpu_var(dm_cpu_data);
> return;
> }
>
Thanks
^ permalink raw reply
* [PATCH 2/2] drop_monitor: Make updating data->skb smp safe
From: Neil Horman @ 2012-04-26 18:47 UTC (permalink / raw)
To: netdev; +Cc: Neil Horman, David Miller
In-Reply-To: <1335466022-32661-1-git-send-email-nhorman@tuxdriver.com>
Eric Dumazet pointed out to me that the drop_monitor protocol has some holes in
its smp protections. Specifically, its possible to replace data->skb while its
being written. This patch corrects that by making data->skb and rcu protected
variable. That will prevent it from being overwritten while a tracepoint is
modifying it.
Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Reported-by: Eric Dumazet <eric.dumazet@gmail.com>
CC: David Miller <davem@davemloft.net>
---
net/core/drop_monitor.c | 43 ++++++++++++++++++++++++++++++++-----------
1 files changed, 32 insertions(+), 11 deletions(-)
diff --git a/net/core/drop_monitor.c b/net/core/drop_monitor.c
index 04ce1dd..852e36b 100644
--- a/net/core/drop_monitor.c
+++ b/net/core/drop_monitor.c
@@ -46,7 +46,7 @@ static DEFINE_MUTEX(trace_state_lock);
struct per_cpu_dm_data {
struct work_struct dm_alert_work;
- struct sk_buff *skb;
+ struct sk_buff __rcu *skb;
atomic_t dm_hit_count;
struct timer_list send_timer;
};
@@ -79,29 +79,41 @@ static void reset_per_cpu_data(struct per_cpu_dm_data *data)
size_t al;
struct net_dm_alert_msg *msg;
struct nlattr *nla;
+ struct sk_buff *skb;
al = sizeof(struct net_dm_alert_msg);
al += dm_hit_limit * sizeof(struct net_dm_drop_point);
al += sizeof(struct nlattr);
- data->skb = genlmsg_new(al, GFP_KERNEL);
- genlmsg_put(data->skb, 0, 0, &net_drop_monitor_family,
+ skb = genlmsg_new(al, GFP_KERNEL);
+ genlmsg_put(skb, 0, 0, &net_drop_monitor_family,
0, NET_DM_CMD_ALERT);
- nla = nla_reserve(data->skb, NLA_UNSPEC, sizeof(struct net_dm_alert_msg));
+ nla = nla_reserve(skb, NLA_UNSPEC, sizeof(struct net_dm_alert_msg));
msg = nla_data(nla);
memset(msg, 0, al);
+
+ /*
+ * Don't need to lock this, since we are guaranteed to only
+ * run this on a single cpu at a time
+ */
+ rcu_assign_pointer(data->skb, skb);
+
+ synchronize_rcu();
+
atomic_set(&data->dm_hit_count, dm_hit_limit);
}
static void send_dm_alert(struct work_struct *unused)
{
struct sk_buff *skb;
- struct per_cpu_dm_data *data = &__get_cpu_var(dm_cpu_data);
+ struct per_cpu_dm_data *data = &get_cpu_var(dm_cpu_data);
/*
* Grab the skb we're about to send
*/
- skb = data->skb;
+ rcu_read_lock();
+ skb = rcu_dereference(data->skb);
+ rcu_read_unlock();
/*
* Replace it with a new one
@@ -113,6 +125,7 @@ static void send_dm_alert(struct work_struct *unused)
*/
genlmsg_multicast(skb, 0, NET_DM_GRP_ALERT, GFP_KERNEL);
+ put_cpu_var(dm_cpu_data);
}
/*
@@ -123,9 +136,11 @@ static void send_dm_alert(struct work_struct *unused)
*/
static void sched_send_work(unsigned long unused)
{
- struct per_cpu_dm_data *data = &__get_cpu_var(dm_cpu_data);
+ struct per_cpu_dm_data *data = &get_cpu_var(dm_cpu_data);
+
+ schedule_work_on(smp_processor_id(), &data->dm_alert_work);
- schedule_work(&data->dm_alert_work);
+ put_cpu_var(dm_cpu_data);
}
static void trace_drop_common(struct sk_buff *skb, void *location)
@@ -134,9 +149,13 @@ static void trace_drop_common(struct sk_buff *skb, void *location)
struct nlmsghdr *nlh;
struct nlattr *nla;
int i;
- struct per_cpu_dm_data *data = &__get_cpu_var(dm_cpu_data);
+ struct sk_buff *dskb;
+ struct per_cpu_dm_data *data = &get_cpu_var(dm_cpu_data);
+ rcu_read_lock();
+ dskb = rcu_dereference(data->skb);
+
if (!atomic_add_unless(&data->dm_hit_count, -1, 0)) {
/*
* we're already at zero, discard this hit
@@ -144,7 +163,7 @@ static void trace_drop_common(struct sk_buff *skb, void *location)
goto out;
}
- nlh = (struct nlmsghdr *)data->skb->data;
+ nlh = (struct nlmsghdr *)dskb->data;
nla = genlmsg_data(nlmsg_data(nlh));
msg = nla_data(nla);
for (i = 0; i < msg->entries; i++) {
@@ -158,7 +177,7 @@ static void trace_drop_common(struct sk_buff *skb, void *location)
/*
* We need to create a new entry
*/
- __nla_reserve_nohdr(data->skb, sizeof(struct net_dm_drop_point));
+ __nla_reserve_nohdr(dskb, sizeof(struct net_dm_drop_point));
nla->nla_len += NLA_ALIGN(sizeof(struct net_dm_drop_point));
memcpy(msg->points[msg->entries].pc, &location, sizeof(void *));
msg->points[msg->entries].count = 1;
@@ -170,6 +189,8 @@ static void trace_drop_common(struct sk_buff *skb, void *location)
}
out:
+ rcu_read_unlock();
+ put_cpu_var(dm_cpu_data);
return;
}
--
1.7.7.6
^ permalink raw reply related
* [PATCH 1/2] drop_monitor: fix sleeping in invalid context warning
From: Neil Horman @ 2012-04-26 18:47 UTC (permalink / raw)
To: netdev; +Cc: Neil Horman, David Miller
In-Reply-To: <1335466022-32661-1-git-send-email-nhorman@tuxdriver.com>
Eric Dumazet pointed out this warning in the drop_monitor protocol to me:
[ 38.352571] BUG: sleeping function called from invalid context at kernel/mutex.c:85
[ 38.352576] in_atomic(): 1, irqs_disabled(): 0, pid: 4415, name: dropwatch
[ 38.352580] Pid: 4415, comm: dropwatch Not tainted 3.4.0-rc2+ #71
[ 38.352582] Call Trace:
[ 38.352592] [<ffffffff8153aaf0>] ? trace_napi_poll_hit+0xd0/0xd0
[ 38.352599] [<ffffffff81063f2a>] __might_sleep+0xca/0xf0
[ 38.352606] [<ffffffff81655b16>] mutex_lock+0x26/0x50
[ 38.352610] [<ffffffff8153aaf0>] ? trace_napi_poll_hit+0xd0/0xd0
[ 38.352616] [<ffffffff810b72d9>] tracepoint_probe_register+0x29/0x90
[ 38.352621] [<ffffffff8153a585>] set_all_monitor_traces+0x105/0x170
[ 38.352625] [<ffffffff8153a8ca>] net_dm_cmd_trace+0x2a/0x40
[ 38.352630] [<ffffffff8154a81a>] genl_rcv_msg+0x21a/0x2b0
[ 38.352636] [<ffffffff810f8029>] ? zone_statistics+0x99/0xc0
[ 38.352640] [<ffffffff8154a600>] ? genl_rcv+0x30/0x30
[ 38.352645] [<ffffffff8154a059>] netlink_rcv_skb+0xa9/0xd0
[ 38.352649] [<ffffffff8154a5f0>] genl_rcv+0x20/0x30
[ 38.352653] [<ffffffff81549a7e>] netlink_unicast+0x1ae/0x1f0
[ 38.352658] [<ffffffff81549d76>] netlink_sendmsg+0x2b6/0x310
[ 38.352663] [<ffffffff8150824f>] sock_sendmsg+0x10f/0x130
[ 38.352668] [<ffffffff8150abe0>] ? move_addr_to_kernel+0x60/0xb0
[ 38.352673] [<ffffffff81515f04>] ? verify_iovec+0x64/0xe0
[ 38.352677] [<ffffffff81509c46>] __sys_sendmsg+0x386/0x390
[ 38.352682] [<ffffffff810ffaf9>] ? handle_mm_fault+0x139/0x210
[ 38.352687] [<ffffffff8165b5bc>] ? do_page_fault+0x1ec/0x4f0
[ 38.352693] [<ffffffff8106ba4d>] ? set_next_entity+0x9d/0xb0
[ 38.352699] [<ffffffff81310b49>] ? tty_ldisc_deref+0x9/0x10
[ 38.352703] [<ffffffff8106d363>] ? pick_next_task_fair+0x63/0x140
[ 38.352708] [<ffffffff8150b8d4>] sys_sendmsg+0x44/0x80
[ 38.352713] [<ffffffff8165f8e2>] system_call_fastpath+0x16/0x1b
It stems from holding a spinlock (trace_state_lock) while attempting to register
or unregister tracepoint hooks, making in_atomic() true in this context, leading
to the warning when the tracepoint calls might_sleep() while its taking a mutex.
Since we only use the trace_state_lock to prevent trace protocol state races, as
well as hardware stat list updates on an rcu write side, we can just convert the
spinlock to a mutex to avoid this problem.
Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
Reported-by: Eric Dumazet <eric.dumazet@gmail.com>
CC: David Miller <davem@davemloft.net>
---
net/core/drop_monitor.c | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/net/core/drop_monitor.c b/net/core/drop_monitor.c
index 5c3c81a..04ce1dd 100644
--- a/net/core/drop_monitor.c
+++ b/net/core/drop_monitor.c
@@ -42,7 +42,7 @@ static void send_dm_alert(struct work_struct *unused);
* netlink alerts
*/
static int trace_state = TRACE_OFF;
-static DEFINE_SPINLOCK(trace_state_lock);
+static DEFINE_MUTEX(trace_state_lock);
struct per_cpu_dm_data {
struct work_struct dm_alert_work;
@@ -214,7 +214,7 @@ static int set_all_monitor_traces(int state)
struct dm_hw_stat_delta *new_stat = NULL;
struct dm_hw_stat_delta *temp;
- spin_lock(&trace_state_lock);
+ mutex_lock(&trace_state_lock);
if (state == trace_state) {
rc = -EAGAIN;
@@ -253,7 +253,7 @@ static int set_all_monitor_traces(int state)
rc = -EINPROGRESS;
out_unlock:
- spin_unlock(&trace_state_lock);
+ mutex_unlock(&trace_state_lock);
return rc;
}
@@ -296,12 +296,12 @@ static int dropmon_net_event(struct notifier_block *ev_block,
new_stat->dev = dev;
new_stat->last_rx = jiffies;
- spin_lock(&trace_state_lock);
+ mutex_lock(&trace_state_lock);
list_add_rcu(&new_stat->list, &hw_stats_list);
- spin_unlock(&trace_state_lock);
+ mutex_unlock(&trace_state_lock);
break;
case NETDEV_UNREGISTER:
- spin_lock(&trace_state_lock);
+ mutex_lock(&trace_state_lock);
list_for_each_entry_safe(new_stat, tmp, &hw_stats_list, list) {
if (new_stat->dev == dev) {
new_stat->dev = NULL;
@@ -312,7 +312,7 @@ static int dropmon_net_event(struct notifier_block *ev_block,
}
}
}
- spin_unlock(&trace_state_lock);
+ mutex_unlock(&trace_state_lock);
break;
}
out:
--
1.7.7.6
^ permalink raw reply related
* [PATCH 0/2] drop_monitor: misc fixes for some recently reported bugs
From: Neil Horman @ 2012-04-26 18:47 UTC (permalink / raw)
To: netdev; +Cc: Neil Horman, Eric Dumazet, David Miller
Hey-
Eric was using dropwatch recently and reported a few bugs to me that he
had noted. This short series should fix them all up.
Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
CC: Eric Dumazet <eric.dumazet@gmail.com>
CC: David Miller <davem@davemloft.net>
^ permalink raw reply
* Re: pull request: wireless-next 2012-04-25
From: John W. Linville @ 2012-04-26 18:41 UTC (permalink / raw)
To: David Miller
Cc: linux-wireless-u79uwXL29TY76Z2rM5mHXA,
netdev-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <20120425.163926.2209040699696617525.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
On Wed, Apr 25, 2012 at 04:39:26PM -0400, David Miller wrote:
> From: "John W. Linville" <linville-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org>
> Date: Wed, 25 Apr 2012 15:14:19 -0400
>
> > This is another batch of updates intended for 3.5...
> ...
> > Please let me know if there are problems!
>
> There are:
>
> From 792545c7bc5d6b922d3778dc602e557d64c83551 Mon Sep 17 00:00:00 2001
> From: "Luis R. Rodriguez" <mcgrof-3uybbJdB1yH774rrrx3eTA@public.gmane.org>
> Date: Mon, 23 Apr 2012 19:55:48 -0700
> Subject: [PATCH 88/88] libertas: include sched.h on firmware.c
>
> Do not assume we have our subsystem including this for us,
> at least for older kernels this is not true. Lets just be
> explicit about this requirement for the usage of wake_up().
>
> Signed-off-by: Luis R. Rodriguez <mcgrof-3uybbJdB1yH774rrrx3eTA@public.gmane.org>
> Signed-off-by: John W. Linville <linville-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org>
>
> This is bogus, wake_up() is defined in linux/wait.h, the whole
> point of the linux/sched.h split up is so that linux/sched.h
> includes could be removed and replaced with actual dependencies.
This is completely my bad. Anyway, Felix already added that include
in that file a few lines later in order to pick-up the definitions
for TASK_NORMAL and TASK_UNINTERRUPTIBLE. I'll just drop Luis's patch.
> Also, please don't accept any patches from Luis that add those
> #undef pr_fmt things to the atheros drivers.
>
> He tried to add it an ethernet driver, and I asked him to explain
> exactly why he's doing and that if it's appropriate then it's
> appropriate everywhere not just in a few specific drivers. He failed
> to respond to me, and therefore failed to explain the situation and
> address my concerned. And then I saw just today that he's submitting
> the same patch to wireless drivers. That's not acceptable.
>
> Thanks.
OK. I think the compat-wireless guys have found a different solution
anyway.
John
--
John W. Linville Someday the world will need a hero, and you
linville-2XuSBdqkA4R54TAoqtyWWQ@public.gmane.org might be all we have. Be ready.
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* [PATCH] IPVS: ip_vs_sync.c: local functions should not be exposed globally
From: H Hartley Sweeten @ 2012-04-26 18:29 UTC (permalink / raw)
To: Linux Kernel; +Cc: netdev, davem
Functions not referenced outside of a source file should be marked
static to prevent it from being exposed globally.
This quiets the sparse warnings:
warning: symbol 'ip_vs_sync_conn_v0' was not declared. Should it be static?
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: "David S. Miller" <davem@davemloft.net>
---
diff --git a/net/netfilter/ipvs/ip_vs_sync.c b/net/netfilter/ipvs/ip_vs_sync.c
index bf5e538..49a1fe8 100644
--- a/net/netfilter/ipvs/ip_vs_sync.c
+++ b/net/netfilter/ipvs/ip_vs_sync.c
@@ -446,7 +446,7 @@ ip_vs_sync_buff_create_v0(struct netns_ipvs *ipvs)
* Version 0 , could be switched in by sys_ctl.
* Add an ip_vs_conn information into the current sync_buff.
*/
-void ip_vs_sync_conn_v0(struct net *net, struct ip_vs_conn *cp)
+static void ip_vs_sync_conn_v0(struct net *net, struct ip_vs_conn *cp)
{
struct netns_ipvs *ipvs = net_ipvs(net);
struct ip_vs_sync_mesg_v0 *m;
^ permalink raw reply related
* [PATCH] IPVS: ip_vs_proto.c: local functions should not be exposed globally
From: H Hartley Sweeten @ 2012-04-26 18:26 UTC (permalink / raw)
To: Linux Kernel; +Cc: netdev, davem
Functions not referenced outside of a source file should be marked
static to prevent it from being exposed globally.
This quiets the sparse warnings:
warning: symbol '__ipvs_proto_data_get' was not declared. Should it be static?
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: "David S. Miller" <davem@davemloft.net>
---
diff --git a/net/netfilter/ipvs/ip_vs_proto.c b/net/netfilter/ipvs/ip_vs_proto.c
index 6eda11d..d5d1d92 100644
--- a/net/netfilter/ipvs/ip_vs_proto.c
+++ b/net/netfilter/ipvs/ip_vs_proto.c
@@ -153,7 +153,7 @@ EXPORT_SYMBOL(ip_vs_proto_get);
/*
* get ip_vs_protocol object data by netns and proto
*/
-struct ip_vs_proto_data *
+static struct ip_vs_proto_data *
__ipvs_proto_data_get(struct netns_ipvs *ipvs, unsigned short proto)
{
struct ip_vs_proto_data *pd;
^ permalink raw reply related
* [PATCH] IPVS: ip_vs_ftp.c: local functions should not be exposed globally
From: H Hartley Sweeten @ 2012-04-26 18:17 UTC (permalink / raw)
To: Linux Kernel; +Cc: netdev, davem
Functions not referenced outside of a source file should be marked
static to prevent it from being exposed globally.
This quiets the sparse warnings:
warning: symbol 'ip_vs_ftp_init' was not declared. Should it be static?
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: "David S. Miller" <davem@davemloft.net>
---
diff --git a/net/netfilter/ipvs/ip_vs_ftp.c b/net/netfilter/ipvs/ip_vs_ftp.c
index debb8c7..091bec9 100644
--- a/net/netfilter/ipvs/ip_vs_ftp.c
+++ b/net/netfilter/ipvs/ip_vs_ftp.c
@@ -483,7 +483,7 @@ static struct pernet_operations ip_vs_ftp_ops = {
.exit = __ip_vs_ftp_exit,
};
-int __init ip_vs_ftp_init(void)
+static int __init ip_vs_ftp_init(void)
{
int rv;
^ permalink raw reply related
* [PATCH] NFC: netlink.c: local variables should not be exposed globally
From: H Hartley Sweeten @ 2012-04-26 18:09 UTC (permalink / raw)
To: Linux Kernel
Cc: netdev, linux-wireless, lauro.venancio, aloisio.almeida, sameo,
davem
The variable ''nfc_genl_family' is only referenced in this file and
should be marked static to prevent it from being exposed globally.
Quites the sparse warning:
warning: symbol 'nfc_genl_family' was not declared. Should it be static?
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Lauro Ramos Venancio <lauro.venancio@openbossa.org>
Cc: Aloisio Almeida Jr <aloisio.almeida@openbossa.org>
Cc: Samuel Ortiz <sameo@linux.intel.com>
Cc: "David S. Miller" <davem@davemloft.net>
---
diff --git a/net/nfc/netlink.c b/net/nfc/netlink.c
index f1829f6..850485d 100644
--- a/net/nfc/netlink.c
+++ b/net/nfc/netlink.c
@@ -33,7 +33,7 @@ static struct genl_multicast_group nfc_genl_event_mcgrp = {
.name = NFC_GENL_MCAST_EVENT_NAME,
};
-struct genl_family nfc_genl_family = {
+static struct genl_family nfc_genl_family = {
.id = GENL_ID_GENERATE,
.hdrsize = 0,
.name = NFC_GENL_NAME,
^ permalink raw reply related
* [PATCH] NFC: hci/core.c: local variables should not be exposed globally
From: H Hartley Sweeten @ 2012-04-26 18:05 UTC (permalink / raw)
To: Linux Kernel
Cc: netdev, linux-wireless, lauro.venancio, aloisio.almeida, sameo,
davem
The variable 'hci_nfc_ops' is only referenced in this file and
should be marked static to prevent it from being exposed globally.
Quites the sparse warning:
warning: symbol 'hci_nfc_ops' was not declared. Should it be static?
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Lauro Ramos Venancio <lauro.venancio@openbossa.org>
Cc: Aloisio Almeida Jr <aloisio.almeida@openbossa.org>
Cc: Samuel Ortiz <sameo@linux.intel.com>
Cc: "David S. Miller" <davem@davemloft.net>
---
diff --git a/net/nfc/hci/core.c b/net/nfc/hci/core.c
index 86fd00d..0ce5ee4 100644
--- a/net/nfc/hci/core.c
+++ b/net/nfc/hci/core.c
@@ -605,7 +605,7 @@ static int hci_data_exchange(struct nfc_dev *nfc_dev, u32 target_idx,
return 0;
}
-struct nfc_ops hci_nfc_ops = {
+static struct nfc_ops hci_nfc_ops = {
.dev_up = hci_dev_up,
.dev_down = hci_dev_down,
.start_poll = hci_start_poll,
^ permalink raw reply related
* [PATCH] NFC: nci/ntf.c: quiet sparse noise about plain integer as NULL pointer
From: H Hartley Sweeten @ 2012-04-26 17:59 UTC (permalink / raw)
To: Linux Kernel
Cc: netdev, linux-wireless, lauro.venancio, aloisio.almeida, sameo,
davem
Pointers should be cleared with NULL, not 0.
Quiets a couple sparse warnings of the type:
warning: Using plain integer as NULL pointer
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Lauro Ramos Venancio <lauro.venancio@openbossa.org>
Cc: Aloisio Almeida Jr <aloisio.almeida@openbossa.org>
Cc: Samuel Ortiz <sameo@linux.intel.com>
Cc: "David S. Miller" <davem@davemloft.net>
---
diff --git a/net/nfc/nci/ntf.c b/net/nfc/nci/ntf.c
index 99e1632..cb26461 100644
--- a/net/nfc/nci/ntf.c
+++ b/net/nfc/nci/ntf.c
@@ -497,7 +497,7 @@ static void nci_rf_deactivate_ntf_packet(struct nci_dev *ndev,
/* drop partial rx data packet */
if (ndev->rx_data_reassembly) {
kfree_skb(ndev->rx_data_reassembly);
- ndev->rx_data_reassembly = 0;
+ ndev->rx_data_reassembly = NULL;
}
/* complete the data exchange transaction, if exists */
^ permalink raw reply related
* [PATCH] NFC: nci/lib.c: include header for exported symbol prototype
From: H Hartley Sweeten @ 2012-04-26 17:56 UTC (permalink / raw)
To: Linux Kernel
Cc: netdev, linux-wireless, lauro.venancio, aloisio.almeida, sameo,
davem
Include the header to pickup the exported symbol prototype.
Quites the sparse warning:
warning: symbol 'nci_to_errno' was not declared. Should it be static?
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Lauro Ramos Venancio <lauro.venancio@openbossa.org>
Cc: Aloisio Almeida Jr <aloisio.almeida@openbossa.org>
CC: Samuel Ortiz <sameo@linux.intel.com>
CC: "David S. Miller" <davem@davemloft.net>
---
diff --git a/net/nfc/nci/lib.c b/net/nfc/nci/lib.c
index 6a63e5e..6b7fd26 100644
--- a/net/nfc/nci/lib.c
+++ b/net/nfc/nci/lib.c
@@ -31,6 +31,7 @@
#include <linux/errno.h>
#include <net/nfc/nci.h>
+#include <net/nfc/nci_core.h>
/* NCI status codes to Unix errno mapping */
int nci_to_errno(__u8 code)
^ permalink raw reply related
* [PATCH] NFC: nci/data.c: quiet sparse noise about plain integer as NULL pointer
From: H Hartley Sweeten @ 2012-04-26 17:31 UTC (permalink / raw)
To: Linux Kernel
Cc: netdev, linux-wireless, lauro.venancio, aloisio.almeida, sameo,
davem
Pointers should be cleared with NULL, not 0.
Quiets a couple sparse warnings of the type:
warning: Using plain integer as NULL pointer
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Lauro Ramos Venancio <lauro.venancio@openbossa.org>
Cc: Aloisio Almeida Jr <aloisio.almeida@openbossa.org>
Cc: Samuel Ortiz <sameo@linux.intel.com>
Cc: "David S. Miller" <davem@davemloft.net>
---
diff --git a/net/nfc/nci/data.c b/net/nfc/nci/data.c
index a0bc326..76c48c5 100644
--- a/net/nfc/nci/data.c
+++ b/net/nfc/nci/data.c
@@ -49,7 +49,7 @@ void nci_data_exchange_complete(struct nci_dev *ndev, struct sk_buff *skb,
if (cb) {
ndev->data_exchange_cb = NULL;
- ndev->data_exchange_cb_context = 0;
+ ndev->data_exchange_cb_context = NULL;
/* forward skb to nfc core */
cb(cb_context, skb, err);
@@ -200,10 +200,10 @@ static void nci_add_rx_data_frag(struct nci_dev *ndev,
pr_err("error adding room for accumulated rx data\n");
kfree_skb(skb);
- skb = 0;
+ skb = NULL;
kfree_skb(ndev->rx_data_reassembly);
- ndev->rx_data_reassembly = 0;
+ ndev->rx_data_reassembly = NULL;
err = -ENOMEM;
goto exit;
@@ -216,7 +216,7 @@ static void nci_add_rx_data_frag(struct nci_dev *ndev,
/* third, free old reassembly */
kfree_skb(ndev->rx_data_reassembly);
- ndev->rx_data_reassembly = 0;
+ ndev->rx_data_reassembly = NULL;
}
if (pbf == NCI_PBF_CONT) {
^ permalink raw reply related
* Re: [PATCH net-next 2/5] be2net: Fix to allow setting of debug levels in the firmware.
From: Ben Hutchings @ 2012-04-26 17:29 UTC (permalink / raw)
To: Somnath Kotur; +Cc: netdev
In-Reply-To: <464dcb28-2450-4e0b-a30f-d8c9104bac86@exht1.ad.emulex.com>
On Thu, 2012-04-26 at 19:57 +0530, Somnath Kotur wrote:
> From: Somnath Kotur <somnath.kotur@emulex.com>
[...]
> @@ -893,6 +959,7 @@ const struct ethtool_ops be_ethtool_ops = {
> .set_pauseparam = be_set_pauseparam,
> .get_strings = be_get_stat_strings,
> .set_phys_id = be_set_phys_id,
> + .set_msglevel = be_set_msglevel,
> .get_sset_count = be_get_sset_count,
> .get_ethtool_stats = be_get_ethtool_stats,
> .get_regs_len = be_get_reg_len,
This operation is intended for controlling logging by the driver, and
the flags are defined in <linux/netdevice.h>. (Not exported to userland
yet, but ethtool knows their names.)
If your firmware supports some kind of logging then it may be reasonable
to have this control both driver and firmware, but not *just* the
firmware.
You should also implement the get_msglevel operation at the same time.
Ben.
--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply
* Re: [PATCH net-next 3/5] be2net: Fix to apply duplex value as unknown when link is down.
From: Ben Hutchings @ 2012-04-26 17:24 UTC (permalink / raw)
To: Somnath Kotur; +Cc: netdev
In-Reply-To: <cf78444f-636f-44c5-beb7-5626b8a3df17@exht1.ad.emulex.com>
On Thu, 2012-04-26 at 19:58 +0530, Somnath Kotur wrote:
> From: Somnath Kotur <somnath.kotur@emulex.com>
>
>
> Signed-off-by: Somnath Kotur <somnath.kotur@emulex.com>
> ---
> drivers/net/ethernet/emulex/benet/be_ethtool.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/net/ethernet/emulex/benet/be_ethtool.c b/drivers/net/ethernet/emulex/benet/be_ethtool.c
> index 5296df5..bb2add7 100644
> --- a/drivers/net/ethernet/emulex/benet/be_ethtool.c
> +++ b/drivers/net/ethernet/emulex/benet/be_ethtool.c
> @@ -618,7 +618,7 @@ static int be_get_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
> ecmd->supported = adapter->phy.supported;
> }
>
> - ecmd->duplex = DUPLEX_FULL;
> + ecmd->duplex = netif_carrier_ok(netdev) ? DUPLEX_FULL : -1;
> ecmd->phy_address = adapter->port_num;
>
> return 0;
I don't see any problem with reporting full-duplex all the time if you
don't support any half-duplex link modes. But we don't yet have
consistency between drivers in speed/duplex reporting while the link is
down, so I won't insist that that is the right thing to do.
However you should use DUPLEX_UNKNOWN rather than -1.
Ben.
--
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply
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