aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2011-03-28Btrfs: add btrfs_trim_fs() to handle FITRIMLi Dongyang5-1/+190
We take an free extent out from allocator, trim it, then put it back, but before we trim the block group, we should make sure the block group is cached, so plus a little change to make cache_block_group() run without a transaction. Signed-off-by: Li Dongyang <[email protected]> Signed-off-by: Chris Mason <[email protected]>
2011-03-28Btrfs: adjust btrfs_discard_extent() return errors and trimmed bytesLi Dongyang3-19/+31
Callers of btrfs_discard_extent() should check if we are mounted with -o discard, as we want to make fitrim to work even the fs is not mounted with -o discard. Also we should use REQ_DISCARD to map the free extent to get a full mapping, last we only return errors if 1. the error is not a EOPNOTSUPP 2. no device supports discard Signed-off-by: Li Dongyang <[email protected]> Signed-off-by: Chris Mason <[email protected]>
2011-03-28Btrfs: make btrfs_map_block() return entire free extent for each device of ↵Li Dongyang2-22/+129
RAID0/1/10/DUP btrfs_map_block() will only return a single stripe length, but we want the full extent be mapped to each disk when we are trimming the extent, so we add length to btrfs_bio_stripe and fill it if we are mapping for REQ_DISCARD. Signed-off-by: Li Dongyang <[email protected]> Signed-off-by: Chris Mason <[email protected]>
2011-03-28Btrfs: make update_reserved_bytes() publicLi Dongyang2-9/+9
Make the function public as we should update the reserved extents calculations after taking out an extent for trimming. Signed-off-by: Li Dongyang <[email protected]> Signed-off-by: Chris Mason <[email protected]>
2011-03-28btrfs: return EXDEV when linking from different subvolumesMark Fasheh1-1/+1
btrfs_link returns EPERM if a cross-subvolume link is attempted. However, in this case I believe EXDEV to be the more appropriate value. >From the link(2) man page: EXDEV oldpath and newpath are not on the same mounted file system. (Linux permits a file system to be mounted at multiple points, but link() does not work across different mount points, even if the same file system is mounted on both.) This matters because an application may have different behaviors based on return codes. Signed-off-by: Mark Fasheh <[email protected]> Signed-off-by: Chris Mason <[email protected]>
2011-03-28Btrfs: Per file/directory controls for COW and compressionLiu Bo4-7/+72
Data compression and data cow are controlled across the entire FS by mount options right now. ioctls are needed to set this on a per file or per directory basis. This has been proposed previously, but VFS developers wanted us to use generic ioctls rather than btrfs-specific ones. According to Chris's comment, there should be just one true compression method(probably LZO) stored in the super. However, before this, we would wait for that one method is stable enough to be adopted into the super. So I list it as a long term goal, and just store it in ram today. After applying this patch, we can use the generic "FS_IOC_SETFLAGS" ioctl to control file and directory's datacow and compression attribute. NOTE: - The compression type is selected by such rules: If we mount btrfs with compress options, ie, zlib/lzo, the type is it. Otherwise, we'll use the default compress type (zlib today). v1->v2: - rebase to the latest btrfs. v2->v3: - fix a problem, i.e. when a file is set NOCOW via mount option, then this NOCOW will be screwed by inheritance from parent directory. Signed-off-by: Liu Bo <[email protected]> Signed-off-by: Chris Mason <[email protected]>
2011-03-28Btrfs: add datacow flag in inode flagliubo1-0/+2
For datacow control, the corresponding inode flags are needed. This is for btrfs use. v1->v2: Change FS_COW_FL to another bit due to conflict with the upstream e2fsprogs Signed-off-by: Liu Bo <[email protected]> Signed-off-by: Chris Mason <[email protected]>
2011-03-28btrfs: use GFP_NOFS instead of GFP_KERNELMiao Xie1-2/+2
In the filesystem context, we must allocate memory by GFP_NOFS, or we may start another filesystem operation and make kswap thread hang up. Signed-off-by: Miao Xie <[email protected]> Signed-off-by: Chris Mason <[email protected]>
2011-03-28Btrfs: check return value of read_tree_block()Tsutomu Itoh3-0/+15
This patch is checking return value of read_tree_block(), and if it is NULL, error processing. Signed-off-by: Tsutomu Itoh <[email protected]> Signed-off-by: Chris Mason <[email protected]>
2011-03-28btrfs: properly access unaligned checksum bufferDavid Sterba1-1/+2
On Fri, Mar 18, 2011 at 11:56:53AM -0400, Chris Mason wrote: > Thanks for fielding this one. Does put_unaligned_le32 optimize away on > platforms with efficient access? It would be great if we didn't need > the #ifdef. (quicktest: assembly output is same for put_unaligned_le32 and direct assignment on my x86_64) I was originally following examples in Documentation/unaligned-memory-access.txt. From other code it seems to me that the define CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS is intended for larger portions of code. Macros/wrappers for {put,get}_unaligned* are chosen via arch/<arch>/include/asm/unaligned.h accordingly, therefore it's safe to use put_unaligned_le32 without the ifdef. dave Signed-off-by: Chris Mason <[email protected]>
2011-03-28Btrfs: cleanup some BUG_ON()Tsutomu Itoh9-23/+54
This patch changes some BUG_ON() to the error return. (but, most callers still use BUG_ON()) Signed-off-by: Tsutomu Itoh <[email protected]> Signed-off-by: Chris Mason <[email protected]>
2011-03-28Btrfs: add initial tracepoint support for btrfsliubo13-11/+727
Tracepoints can provide insight into why btrfs hits bugs and be greatly helpful for debugging, e.g dd-7822 [000] 2121.641088: btrfs_inode_request: root = 5(FS_TREE), gen = 4, ino = 256, blocks = 8, disk_i_size = 0, last_trans = 8, logged_trans = 0 dd-7822 [000] 2121.641100: btrfs_inode_new: root = 5(FS_TREE), gen = 8, ino = 257, blocks = 0, disk_i_size = 0, last_trans = 0, logged_trans = 0 btrfs-transacti-7804 [001] 2146.935420: btrfs_cow_block: root = 2(EXTENT_TREE), refs = 2, orig_buf = 29368320 (orig_level = 0), cow_buf = 29388800 (cow_level = 0) btrfs-transacti-7804 [001] 2146.935473: btrfs_cow_block: root = 1(ROOT_TREE), refs = 2, orig_buf = 29364224 (orig_level = 0), cow_buf = 29392896 (cow_level = 0) btrfs-transacti-7804 [001] 2146.972221: btrfs_transaction_commit: root = 1(ROOT_TREE), gen = 8 flush-btrfs-2-7821 [001] 2155.824210: btrfs_chunk_alloc: root = 3(CHUNK_TREE), offset = 1103101952, size = 1073741824, num_stripes = 1, sub_stripes = 0, type = DATA flush-btrfs-2-7821 [001] 2155.824241: btrfs_cow_block: root = 2(EXTENT_TREE), refs = 2, orig_buf = 29388800 (orig_level = 0), cow_buf = 29396992 (cow_level = 0) flush-btrfs-2-7821 [001] 2155.824255: btrfs_cow_block: root = 4(DEV_TREE), refs = 2, orig_buf = 29372416 (orig_level = 0), cow_buf = 29401088 (cow_level = 0) flush-btrfs-2-7821 [000] 2155.824329: btrfs_cow_block: root = 3(CHUNK_TREE), refs = 2, orig_buf = 20971520 (orig_level = 0), cow_buf = 20975616 (cow_level = 0) btrfs-endio-wri-7800 [001] 2155.898019: btrfs_cow_block: root = 5(FS_TREE), refs = 2, orig_buf = 29384704 (orig_level = 0), cow_buf = 29405184 (cow_level = 0) btrfs-endio-wri-7800 [001] 2155.898043: btrfs_cow_block: root = 7(CSUM_TREE), refs = 2, orig_buf = 29376512 (orig_level = 0), cow_buf = 29409280 (cow_level = 0) Here is what I have added: 1) ordere_extent: btrfs_ordered_extent_add btrfs_ordered_extent_remove btrfs_ordered_extent_start btrfs_ordered_extent_put These provide critical information to understand how ordered_extents are updated. 2) extent_map: btrfs_get_extent extent_map is used in both read and write cases, and it is useful for tracking how btrfs specific IO is running. 3) writepage: __extent_writepage btrfs_writepage_end_io_hook Pages are cirtical resourses and produce a lot of corner cases during writeback, so it is valuable to know how page is written to disk. 4) inode: btrfs_inode_new btrfs_inode_request btrfs_inode_evict These can show where and when a inode is created, when a inode is evicted. 5) sync: btrfs_sync_file btrfs_sync_fs These show sync arguments. 6) transaction: btrfs_transaction_commit In transaction based filesystem, it will be useful to know the generation and who does commit. 7) back reference and cow: btrfs_delayed_tree_ref btrfs_delayed_data_ref btrfs_delayed_ref_head btrfs_cow_block Btrfs natively supports back references, these tracepoints are helpful on understanding btrfs's COW mechanism. 8) chunk: btrfs_chunk_alloc btrfs_chunk_free Chunk is a link between physical offset and logical offset, and stands for space infomation in btrfs, and these are helpful on tracing space things. 9) reserved_extent: btrfs_reserved_extent_alloc btrfs_reserved_extent_free These can show how btrfs uses its space. Signed-off-by: Liu Bo <[email protected]> Signed-off-by: Chris Mason <[email protected]>
2011-03-28Btrfs: use RCU instead of a spinlock to protect the root nodeChris Mason1-19/+8
The pointer to the extent buffer for the root of each tree is protected by a spinlock so that we can safely read the pointer and take a reference on the extent buffer. But now that the extent buffers are freed via RCU, we can safely use rcu_read_lock instead. Signed-off-by: Chris Mason <[email protected]>
2011-03-28ARM: Suspend: Fix dependency of ARCH_SUSPEND_POSSIBLEKukjin Kim1-0/+1
The current mainline codes of ARCH_S5P64X0 and ARCH_S5P6442 can not support suspend to ram. So needs this for preventing build error on them. Cc: Russell King <[email protected]> Cc: Rafael J. Wysocki <[email protected]> Cc: Len Brown <[email protected]> Signed-off-by: Kukjin Kim <[email protected]>
2011-03-28ARM: SAMSUNG: Fix CPU idmaskKukjin Kim2-5/+5
This patch fixes CPU idmask of S5P64X0 and EXYNOS4210 and its comparison method because just want to use CPU id for it. Cc: Ben Dooks <[email protected]> Signed-off-by: Kukjin Kim <[email protected]>
2011-03-28ARM: EXYNOS4: Fix addruart macroThomas Abraham1-2/+2
Fix incorrect conditional execution of ldr instructions in addruart macro. Signed-off-by: Thomas Abraham <[email protected]> Signed-off-by: Abhilash Kesavan <[email protected]> Signed-off-by: Kukjin Kim <[email protected]>
2011-03-28ARM: EXYNOS4: Fix smsc9215 irq polarity on SMDKC210Jeongtae Park1-1/+1
This patch fixes smsc9215 irq ploarity configuration of SMDKC210. We can change type of EINT(5) as HIGH, but it's better to change IRQ output of smsc9215 as an active low because smsc's IRQ line has been pull-up. Signed-off-by: Jeongtae Park <[email protected]> Signed-off-by: Kukjin Kim <[email protected]>
2011-03-28ARM: EXYNOS4: Fix smsc9215 irq polarity on SMDKV310Jeongtae Park1-1/+1
This patch fixes smsc9215 irq ploarity configuration of SMDKV310. We can change type of EINT(5) as HIGH, but it's better to change IRQ output of smsc9215 as an active low because smsc's IRQ line has been pull-up. Signed-off-by: Jeongtae Park <[email protected]> Signed-off-by: Kukjin Kim <[email protected]>
2011-03-28ARM: EXYNOS4: Fix build warning on regarding SATA_AHCI_PLATFORMKukjin Kim2-2/+7
This patch fixes following build warnings. warning: (MACH_ARMLEX4210) selects SATA_AHCI_PLATFORM which has unmet direct dependencies (ATA) And adds EXYNOX4_DEV_AHCI for building machines which are not suppoort for AHCI feature on board. Signed-off-by: Kukjin Kim <[email protected]>
2011-03-28ARM: S5PV210: Remove duplicated inclusionHuang Weiyi1-1/+0
Remove duplicated #include('s) in arch/arm/mach-s5pv210/mach-smdkv210.c Signed-off-by: Huang Weiyi <[email protected]> Signed-off-by: Kukjin Kim <[email protected]>
2011-03-28ARM: S5PV210: Fix security engine interrupt namesVladimir Zapolskiy1-3/+3
This change is intended to correct security subsystem interrupt names for Samsung S5PV210 and S5PC110 SoCs. Signed-off-by: Vladimir Zapolskiy <[email protected]> Signed-off-by: Kukjin Kim <[email protected]>
2011-03-28ARM: S5P64X0: Fix iodesc array size for S5P6450Banajit Goswami1-1/+1
The array size parameter of iotable_init for S5P6450 is incorrect. Fix this by passing the correct length of s5p6450_iodesc table. Signed-off-by: Banajit Goswami <[email protected]> Signed-off-by: Kukjin Kim <[email protected]>
2011-03-28mach-ux500: configure board for the TPS61052 regulator v2Linus Walleij4-1/+48
This registers the TPS61052 regulator to the ux500 MOP/HREF boards. Cc: Samuel Ortiz <[email protected]> Cc: Liam Girdwood <[email protected]> Cc: Mark Brown <[email protected]> Cc: Ola Lilja <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2011-03-28eCryptfs: write lock requested keysRoberto Sassu2-7/+23
A requested key is write locked in order to prevent modifications on the authentication token while it is being used. Signed-off-by: Roberto Sassu <[email protected]> Signed-off-by: Tyler Hicks <[email protected]>
2011-03-28eCryptfs: move ecryptfs_find_auth_tok_for_sig() call before mutex_lockRoberto Sassu1-19/+19
The ecryptfs_find_auth_tok_for_sig() call is moved before the mutex_lock(s->tfm_mutex) instruction in order to avoid possible deadlocks that may occur by holding the lock on the two semaphores 'key->sem' and 's->tfm_mutex' in reverse order. Signed-off-by: Roberto Sassu <[email protected]> Signed-off-by: Tyler Hicks <[email protected]>
2011-03-28eCryptfs: verify authentication tokens before their useRoberto Sassu3-81/+135
Authentication tokens content may change if another requestor calls the update() method of the corresponding key. The new function ecryptfs_verify_auth_tok_from_key() retrieves the authentication token from the provided key and verifies if it is still valid before being used to encrypt or decrypt an eCryptfs file. Signed-off-by: Roberto Sassu <[email protected]> [tyhicks: Minor formatting changes] Signed-off-by: Tyler Hicks <[email protected]>
2011-03-28eCryptfs: modified size of keysig in the ecryptfs_key_sig structureRoberto Sassu2-1/+2
The size of the 'keysig' array is incremented of one byte in order to make room for the NULL character. The 'keysig' variable is used, in the function ecryptfs_generate_key_packet_set(), to find an authentication token with the given signature and is printed a debug message if it cannot be retrieved. Signed-off-by: Roberto Sassu <[email protected]> Signed-off-by: Tyler Hicks <[email protected]>
2011-03-28eCryptfs: removed num_global_auth_toks from ecryptfs_mount_crypt_statRoberto Sassu3-3/+0
This patch removes the 'num_global_auth_toks' field of the ecryptfs_mount_crypt_stat structure, used to count the number of items in the 'global_auth_tok_list' list. This variable is not needed because there are no checks based upon it. Signed-off-by: Roberto Sassu <[email protected]> Signed-off-by: Tyler Hicks <[email protected]>
2011-03-28eCryptfs: ecryptfs_keyring_auth_tok_for_sig() bug fixRoberto Sassu1-0/+1
The pointer '(*auth_tok_key)' is set to NULL in case request_key() fails, in order to prevent its use by functions calling ecryptfs_keyring_auth_tok_for_sig(). Signed-off-by: Roberto Sassu <[email protected]> Cc: <[email protected]> Signed-off-by: Tyler Hicks <[email protected]>
2011-03-28eCryptfs: Unlock page in write_begin error pathTyler Hicks1-0/+5
Unlock the page in error path of ecryptfs_write_begin(). This may happen, for example, if decryption fails while bring the page up-to-date. Cc: <[email protected]> Signed-off-by: Tyler Hicks <[email protected]>
2011-03-28ecryptfs: modify write path to encrypt page in writepageThieu Le6-30/+38
Change the write path to encrypt the data only when the page is written to disk in ecryptfs_writepage. Previously, ecryptfs encrypts the page in ecryptfs_write_end which means that if there are multiple write requests to the same page, ecryptfs ends up re-encrypting that page over and over again. This patch minimizes the number of encryptions needed. Signed-off-by: Thieu Le <[email protected]> [tyhicks: Changed NULL .drop_inode sop pointer to generic_drop_inode] Signed-off-by: Tyler Hicks <[email protected]>
2011-03-28eCryptfs: Remove ECRYPTFS_NEW_FILE crypt stat flagTyler Hicks3-27/+14
Now that grow_file() is not called in the ecryptfs_create() path, the ECRYPTFS_NEW_FILE flag is no longer needed. It helped ecryptfs_readpage() know not to decrypt zeroes that were read from the lower file in the grow_file() path. Signed-off-by: Tyler Hicks <[email protected]>
2011-03-28eCryptfs: Remove unnecessary grow_file() functionTyler Hicks2-23/+1
When creating a new eCryptfs file, the crypto metadata is written out and then the lower file was being "grown" with 4 kB of encrypted zeroes. I suspect that growing the encrypted file was to prevent an information leak that the unencrypted file was empty. However, the unencrypted file size is stored, in plaintext, in the metadata so growing the file is unnecessary. Signed-off-by: Tyler Hicks <[email protected]>
2011-03-28mach-ux500: provide ab8500 init vectorBengt Jonsson2-0/+179
This adds an ab8500 regulator initialization vector for the HREF/MOP500 series of boards. This also sets the display regulator to be on at boot so we don't loose our splash screen when the board comes up. Signed-off-by: Bengt Jonsson <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2011-03-28mach-ux500: board support for AB8500 GPIO driverBibek Basu3-2/+41
This is the board support patch for ab8500 gpio driver on mach-ux500.Patch implements 16 virtual IRQ mapped to 16 interrupt capable AB8500 GPIOs. Signed-off-by: Bibek Basu <[email protected]> [Modify for header file placement] Signed-off-by: Linus Walleij <[email protected]>
2011-03-28gpio: driver for 42 AB8500 GPIO pinsBibek Basu7-1/+605
To get rid of port expanders, the free GPIOs of ab8500 can be used. There are 42 GPIO pins. Out of which 16 are interrupt capable.This patch implements 16 virtual IRQ mapped to 16 interrupt capable AB8500 GPIOs. Signed-off-by: Bibek Basu <[email protected]> Acked-by: Grant Likely <[email protected]> [Renamed header file as per MFD structure] Signed-off-by: Linus Walleij <[email protected]>
2011-03-27net: fix ethtool->set_flags not intended -EINVAL return valueStanislaw Gruszka7-8/+24
After commit d5dbda23804156ae6f35025ade5307a49d1db6d7 "ethtool: Add support for vlan accleration.", drivers that have NETIF_F_HW_VLAN_TX, and/or NETIF_F_HW_VLAN_RX feature, but do not allow enable/disable vlan acceleration via ethtool set_flags, always return -EINVAL from that function. Fix by returning -EINVAL only if requested features do not match current settings and can not be changed by driver. Change any driver that define ethtool->set_flags to use ethtool_invalid_flags() to avoid similar problems in the future (also on drivers that do not have the problem). Tested with modified (to reproduce this bug) myri10ge driver. Cc: [email protected] # 2.6.37+ Signed-off-by: Stanislaw Gruszka <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2011-03-27mlx4_en: Fix loss of promiscuityHerbert Xu1-0/+3
The mlx4_en driver uses the combination stop_port/start_port in a number of places. Unfortunately that causes any promiscuous mode settings on the hardware to be lost. This patch fixes that problem. Signed-off-by: Herbert Xu <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2011-03-27tg3: Fix inline keyword usageJavier Martinez Canillas1-1/+1
The correct usage is "static inline void" not "static void inline". Signed-off-by: Javier Martinez Canillas <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2011-03-27tg3: use <linux/io.h> and <linux/uaccess.h> instead <asm/io.h> and ↵Javier Martinez Canillas1-2/+2
<asm/uaccess.h> It is proper style to include linux/foo.h instead asm/foo.h if both exist Signed-off-by: Javier Martinez Canillas <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2011-03-27net: use CHECKSUM_NONE instead of magic numberCesar Eduardo Barros2-2/+2
Two places in the kernel were doing skb->ip_summed = 0. Change both to skb->ip_summed = CHECKSUM_NONE, which is more readable. Signed-off-by: Cesar Eduardo Barros <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2011-03-27Net / jme: Do not use legacy PCI power managementRafael J. Wysocki1-14/+16
The jme driver uses the legacy PCI power management, so it has to do some PCI-specific things in its ->suspend() and ->resume() callbacks, which isn't necessary and should better be done by the PCI sybsystem-level power management code. It also doesn't use device wakeup flags correctly. Convert jme to the new PCI power management framework and make it let the PCI subsystem take care of all the PCI-specific aspects of device handling during system power transitions. Signed-off-by: Rafael J. Wysocki <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2011-03-27myri10ge: small rx_done refactoringStanislaw Gruszka1-14/+23
Avoid theoretical race condition regarding accessing dev->features NETIF_F_LRO flag, which is illustrated below. CPU1 CPU2 myri10ge_clean_rx_done(): myri10ge_set_flags(): or myri10ge_set_rx_csum(): if (dev->features & NETIF_F_LRO) setup lro dev->features |= NETIF_F_LRO or dev->features &= ~NETIF_F_LRO; if (dev->features & NETIF_F_LRO) flush lro On the way reduce myri10ge_rx_done() number of arguments and calls by moving mgp->small_bytes check into that function. That reduce code size from: text data bss dec hex filename 36644 248 100 36992 9080 drivers/net/myri10ge/myri10ge.o to: text data bss dec hex filename 36037 247 100 36384 8e20 drivers/net/myri10ge/myri10ge.o on my i686 system, what should also make myri10ge_clean_rx_done() being faster. Signed-off-by: Stanislaw Gruszka <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2011-03-27bridge: notify applications if address of bridge device changesstephen hemminger4-5/+13
The mac address of the bridge device may be changed when a new interface is added to the bridge. If this happens, then the bridge needs to call the network notifiers to tickle any other systems that care. Since bridge can be a module, this also means exporting the notifier function. Signed-off-by: Stephen Hemminger <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2011-03-27ipv4: Fix IP timestamp option (IPOPT_TS_PRESPEC) handling in ip_options_echo()Jan Luebbe1-3/+3
The current handling of echoed IP timestamp options with prespecified addresses is rather broken since the 2.2.x kernels. As far as i understand it, it should behave like when originating packets. Currently it will only timestamp the next free slot if: - there is space for *two* timestamps - some random data from the echoed packet taken as an IP is *not* a local IP This first is caused by an off-by-one error. 'soffset' points to the next free slot and so we only need to have 'soffset + 7 <= optlen'. The second bug is using sptr as the start of the option, when it really is set to 'skb_network_header(skb)'. I just use dptr instead which points to the timestamp option. Finally it would only timestamp for non-local IPs, which we shouldn't do. So instead we exclude all unicast destinations, similar to what we do in ip_options_compile(). Signed-off-by: Jan Luebbe <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2011-03-27can: c_can: Fix tx_bytes accountingJan Altenberg1-1/+1
The current SocketCAN implementation for the Bosch c_can cell doesn't account the TX bytes correctly, because it calls c_can_inval_msg_object() (which clears the msg ctrl register) before reading the DLC value: for (/* nix */; (priv->tx_next - priv->tx_echo) > 0; priv->tx_echo++) { msg_obj_no = get_tx_echo_msg_obj(priv); c_can_inval_msg_object(dev, 0, msg_obj_no); val = c_can_read_reg32(priv, &priv->regs->txrqst1); if (!(val & (1 << msg_obj_no))) { can_get_echo_skb(dev, msg_obj_no - C_CAN_MSG_OBJ_TX_FIRST); stats->tx_bytes += priv->read_reg(priv, &priv->regs->ifregs[0].msg_cntrl) & IF_MCONT_DLC_MASK; stats->tx_packets++; } } So, we will always read 0 for the DLC value and "ifconfig" will report *0* TX Bytes. The fix is quite easy: Just move c_can_inval_msg_object() to the end of the if() statement. So: * We only call c_can_inval_msg_object() if the message was actually transmitted * We read out the DLC value _before_ clearing the msg ctrl register Signed-off-by: Jan Altenberg <[email protected]> Acked-by: Kurt Van Dijck <[email protected]> Acked-by: Wolfgang Grandegger <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2011-03-27can: c_can_platform: fix irq check in probeMarc Kleine-Budde1-4/+5
This patch fixes the check in the probe function whether a IRQ was supplied to the driver. The original driver check the irq "struct resource *" against <= 0. Use "platform_get_irq" instead. Signed-off-by: Marc Kleine-Budde <[email protected]> Cc: Bhupesh Sharma <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2011-03-27can: c_can: disable one shot mode until driver is fixedMarc Kleine-Budde1-10/+4
This patch disables the one shot mode, until the driver has been fixed and tested to support it. > I'm quite sure I've seen a situation where msg_obj 17 "seemed" to be > pending, while msg_obj 18 and 19 already have been transmitted. But > in that case, I enabled ONESHOT for the can interface, which enables > the DA mode (automatic retransmission is disabled). Reported-by: Jan Altenberg <[email protected]> Signed-off-by: Marc Kleine-Budde <[email protected]> Signed-off-by: Kurt Van Dijck <[email protected]> Cc: Bhupesh Sharma <[email protected]> Acked-by: Wolfgang Grandegger <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2011-03-27can: make struct proto constOliver Hartkopp4-14/+12
can_ioctl is the only reason for struct proto to be non-const. script/check-patch.pl suggests struct proto be const. Setting the reference to the common can_ioctl() in all CAN protocols directly removes the need to make the struct proto writable in af_can.c Signed-off-by: Kurt Van Dijck <[email protected]> Signed-off-by: Oliver Hartkopp <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2011-03-27net: remove useless comments in net/core/dev.cAmerigo Wang1-54/+0
The code itself can explain what it is doing, no need these comments. Signed-off-by: WANG Cong <[email protected]> Signed-off-by: David S. Miller <[email protected]>