aboutsummaryrefslogtreecommitdiffstats
path: root/firmware (unfollow)
AgeCommit message (Collapse)AuthorFilesLines
2009-12-06i2c-stub: Implement I2C block supportJean Delvare2-5/+29
This is required to test some drivers, for example at24. Signed-off-by: Jean Delvare <khali@linux-fr.org>
2009-12-06i2c: Refactor for_each callbacksJean Delvare1-48/+22
Functions i2c_do_add_adapter() and __attach_adapter() do essentially the same thing, differing only in how the parameters are passed. Same for i2c_do_add_adapter() and __detach_adapter(). Introduce wrappers to normalize the parameters, so that we do not have to duplicate the code. Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: David Brownell <dbrownell@users.sourceforge.net>
2009-12-06i2c-i801: Retry on lost arbitrationJean Delvare1-0/+3
The Intel 82801 is sometimes used on systems with a BMC connected. The BMC can access the SMBus, resulting in lost arbitration for the 82801. We should let i2c-core retry transactions for us in this case. Signed-off-by: Jean Delvare <khali@linux-fr.org>
2009-12-06i2c: Remove big kernel lock from i2cdev_openVincent Sanders1-16/+6
The BKL is held over a kmalloc so cannot protect anything beyond that. The two calls before the kmalloc have their own locking. Improve device open function by removing the now unnecessary ret variable Signed-off-by: Vincent Sanders <vince@simtec.co.uk> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Jean Delvare <khali@linux-fr.org>
2009-12-06ics932s401: Clean up detect functionJean Delvare1-22/+15
As kind is now hard-coded to -1, there is room for code clean-ups. Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: "Darrick J. Wong" <djwong@us.ibm.com>
2009-12-06i2c: Simplify i2c_detect_addressJean Delvare1-13/+9
The kind parameter of i2c_detect_address() always has value -1, so we can get rid of it. Next step is to update all i2c detect callback functions to get rid of this now useless parameter. Signed-off-by: Jean Delvare <khali@linux-fr.org>
2009-12-06i2c: Drop probe, ignore and force module parametersJean Delvare3-154/+46
The legacy probe and force module parameters are obsolete now, the same can be achieved using the new_device sysfs interface, which is both more flexible and cheaper (it is implemented by i2c-core rather than replicated in every driver module.) The legacy ignore module parameters can be dropped as well. Ignoring can be done by instantiating a "dummy" device at the problematic address. This is the first step of a huge cleanup to i2c-core's i2c_detect function, i2c.h's I2C_CLIENT_INSMOD* macros, and all drivers that made use of them. Signed-off-by: Jean Delvare <khali@linux-fr.org>
2009-12-06i2c: Add missing __devinit markers to old i2c adapter driversJean Delvare4-4/+4
These _setup functions are called from _probe so they can be marked __devinit. Signed-off-by: Jean Delvare <khali@linux-fr.org>
2009-12-06i2c: Bus drivers don't have to support I2C_M_REV_DIR_ADDRJean Delvare3-11/+0
I2C bus drivers don't have to support I2C_M_REV_DIR_ADDR. It is a deviation from the I2C specification, which only makes sense to implement when really needed. Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: Ben Dooks <ben-linux@fluff.org>
2009-12-06i2c: Prevent priority inversion on top of bus lockMika Kuoppala3-10/+10
Low priority thread holding the i2c bus mutex could block higher priority threads to access the bus resulting in unacceptable latencies. Change the mutex type to rt_mutex preventing priority inversion. Tested-by: Peter Ujfalusi <peter.ujfalusi@nokia.com> Signed-off-by: Mika Kuoppala <mika.kuoppala@nokia.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
2009-12-06i2c-voodoo3: DeleteJean Delvare5-338/+0
Superseded by tdfxfb. I2C/DDC support used to live in a separate driver but this caused driver conflicts. Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: Krzysztof Helt <krzysztof.h1@wp.pl>
2009-12-06i2c-powermac: Drop temporary name bufferJean Delvare1-6/+5
We no longer need to write the adapter name to a temporary buffer. We can write it directly to the i2c_adapter's name field. This is more efficient. Signed-off-by: Jean Delvare <khali@linux-fr.org> Tested-by: Michel Daenzer <michel@daenzer.net> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2009-12-06i2c-powermac: Include the i2c_adapter in struct pmac_i2c_busJean Delvare3-37/+9
Include the i2c_adapter in struct pmac_i2c_bus. This avoids memory fragmentation and allows for several code cleanups. Signed-off-by: Jean Delvare <khali@linux-fr.org> Tested-by: Michel Daenzer <michel@daenzer.net> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2009-12-06i2c-powermac: Log errorsJean Delvare1-5/+23
Log errors when they happen, otherwise we have no idea what went wrong. Signed-off-by: Jean Delvare <khali@linux-fr.org> Tested-by: Michel Daenzer <michel@daenzer.net> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Paul Mackerras <paulus@samba.org>
2009-12-06i2c-powermac: Refactor i2c_powermac_smbus_xferJean Delvare1-44/+41
I wanted to add some error logging to the i2c-powermac driver, but found that it was very difficult due to the way the i2c_powermac_smbus_xfer function is organized. Refactor the code in this function so that each low-level function is only called once. Signed-off-by: Jean Delvare <khali@linux-fr.org> Tested-by: Michel Daenzer <michel@daenzer.net> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Paul Mackerras <paulus@samba.org>
2009-12-06i2c-powermac: Reject unsupported I2C transactionsJean Delvare1-0/+6
The i2c-powermac driver doesn't support arbitrary multi-message I2C transactions, only SMBus ones. Make it clear by returning an error if a multi-message I2C transaction is attempted. This is better than only processing the first message, because most callers won't recover from the short transaction. Anyone wishing to issue multi-message transactions should use the SMBus API instead of the raw I2C API. Signed-off-by: Jean Delvare <khali@linux-fr.org> Tested-by: Michel Daenzer <michel@daenzer.net> Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Paul Mackerras <paulus@samba.org>
2009-12-06i2c/chips: Move ds1682 to drivers/miscWolfram Sang5-11/+11
As i2c/chips is deprecated, move ds1682 to a more apropriate location. Build tested. Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Acked-by: Grant Likely <grant.likely@secretlab.ca> Signed-off-by: Jean Delvare <khali@linux-fr.org>
2009-12-05avr32: Convert BUG() to use unreachable()David Daney1-1/+1
Use the new unreachable() macro instead of for(;;); Signed-off-by: David Daney <ddaney@caviumnetworks.com> Acked-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-12-05s390: Convert BUG() to use unreachable()David Daney1-1/+1
Use the new unreachable() macro instead of for(;;); Signed-off-by: David Daney <ddaney@caviumnetworks.com> Acked-by: Martin Schwidefsky <schwidefsky@de.ibm.com> CC: Heiko Carstens <heiko.carstens@de.ibm.com> CC: linux390@de.ibm.com CC: linux-s390@vger.kernel.org Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-12-05MIPS: Convert BUG() to use unreachable()David Daney1-3/+1
Use the new unreachable() macro instead of while(1); Signed-off-by: David Daney <ddaney@caviumnetworks.com> Acked-by: Ralf Baechle <ralf@linux-mips.org> CC: linux-mips@linux-mips.org Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-12-05x86: Convert BUG() to use unreachable()David Daney1-2/+2
Use the new unreachable() macro instead of for(;;);. When allyesconfig is built with a GCC-4.5 snapshot on i686 the size of the text segment is reduced by 3987 bytes (from 6827019 to 6823032). Signed-off-by: David Daney <ddaney@caviumnetworks.com> Acked-by: "H. Peter Anvin" <hpa@zytor.com> CC: Thomas Gleixner <tglx@linutronix.de> CC: Ingo Molnar <mingo@redhat.com> CC: x86@kernel.org Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-12-05Add support for GCC-4.5's __builtin_unreachable() to compiler.h (v2)David Daney2-0/+19
Starting with version 4.5, GCC has a new built-in function __builtin_unreachable() that can be used in places like the kernel's BUG() where inline assembly is used to transfer control flow. This eliminated the need for an endless loop in these places. The patch adds a new macro 'unreachable()' that will expand to either __builtin_unreachable() or an endless loop depending on the compiler version. Change from v1: Simplify unreachable() for non-GCC 4.5 case. Signed-off-by: David Daney <ddaney@caviumnetworks.com> Acked-by: Ralf Baechle <ralf@linux-mips.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-12-03x86, apic: Enable lapic nmi watchdog on AMD Family 11hMikael Pettersson1-1/+1
The x86 lapic nmi watchdog does not recognize AMD Family 11h, resulting in: NMI watchdog: CPU not supported As far as I can see from available documentation (the BKDM), family 11h looks identical to family 10h as far as the PMU is concerned. Extending the check to accept family 11h results in: Testing NMI watchdog ... OK. I've been running with this change on a Turion X2 Ultra ZM-82 laptop for a couple of weeks now without problems. Signed-off-by: Mikael Pettersson <mikpe@it.uu.se> Cc: Andreas Herrmann <andreas.herrmann3@amd.com> Cc: Joerg Roedel <joerg.roedel@amd.com> Cc: <stable@kernel.org> LKML-Reference: <19223.53436.931768.278021@pilspetsen.it.uu.se> Signed-off-by: Ingo Molnar <mingo@elte.hu>
2009-12-03GFS2: Fix glock refcount issuesSteven Whitehouse1-13/+8
This patch fixes some ref counting issues. Firstly by moving the point at which we drop the ref count after a dlm lock operation has completed we ensure that we never call gfs2_glock_hold() on a lock with a zero ref count. Secondly, by using atomic_dec_and_lock() in gfs2_glock_put() we ensure that at no time will a glock with zero ref count appear on the lru_list. That means that we can remove the check for this in our shrinker (which was racy). Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
2009-12-03writeback: remove unused nonblocking and congestion checks (gfs2)Wu Fengguang1-12/+0
No one is calling wb_writeback and write_cache_pages with wbc.nonblocking=1 any more. And lumpy pageout will want to do nonblocking writeback without the congestion wait. Signed-off-by: Wu Fengguang <fengguang.wu@intel.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
2009-12-03GFS2: drop rindex glock to refresh rindex listBenjamin Marzinski1-2/+6
When a gfs2 filesystem is grown, it needs to rebuild the rindex list to be able to use the new space. gfs2 does this when the rindex is marked not uptodate, which happens when the rindex glock is dropped. However, on a single node setup, there is never any reason to drop the rindex glock, so gfs2 never invalidates the the rindex. This patch makes gfs2 automatically drop the rindex glock after filesystem grows, so it can refresh the rindex list. Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
2009-12-03GFS2: Tag all metadata with jidSteven Whitehouse5-3/+13
There are two spare field in the header common to all GFS2 metadata. One is just the right size to fit a journal id in it, and this patch updates the journal code so that each time a metadata block is modified, we tag it with the journal id of the node which is performing the modification. The reason for this is that it should make it much easier to debug issues which arise if we can tell which node was the last to modify a particular metadata block. Since the field is updated before the block is written into the journal, each journal should only contain metadata which is tagged with its own journal id. The one exception to this is the journal header block, which might have a different node's id in it, if that journal was recovered by another node in the cluster. Thus each journal will contain a record of which nodes recovered it, via the journal header. The other field in the metadata header could potentially be used to hold information about what kind of operation was performed, but for the time being we just zero it on each transaction so that if we use it for that in future, we'll know that the information (where it exists) is reliable. I did consider using the other field to hold the journal sequence number, however since in GFS2's journaling we write the modified data into the journal and not the original data, this gives no information as to what action caused the modification, so I think we can probably come up with a better use for those 64 bits in the future. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
2009-12-03GFS2: Locking order fix in gfs2_check_blk_stateSteven Whitehouse1-4/+10
In some cases we already have the rindex lock when we enter this function. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
2009-12-03GFS2: Remove dirent_first() functionSteven Whitehouse1-33/+1
This function only had one caller left, and that caller only called it for leaf blocks, hence one branch of the "if" was never taken. In addition the call to get_left had already verified the metadata type, so the function can be reduced to a single line of code in its caller. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
2009-12-03GFS2: Display nobarrier option in /proc/mountsSteven Whitehouse1-0/+3
Since the default is barriers on, this only displays the nobarrier option when that is active. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
2009-12-03GFS2: add barrier/nobarrier mount optionsChristoph Hellwig3-0/+17
Currently gfs2 issues barrier unconditionally. There are various reasons to disable them, be that just for testing or for stupid devices flushing large battert backed caches. Add a nobarrier option that matches xfs and btrfs for this. Also add a symmetric barrier option to turn it back on at remount time. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
2009-12-03GFS2: remove division from new statfs codeBenjamin Marzinski1-8/+9
It's not necessary to do any 64bit division for the statfs sync code, so remove it. Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
2009-12-03GFS2: Improve statfs and quota usabilityBenjamin Marzinski5-10/+100
GFS2 now has three new mount options, statfs_quantum, quota_quantum and statfs_percent. statfs_quantum and quota_quantum simply allow you to set the tunables of the same name. Setting setting statfs_quantum to 0 will also turn on the statfs_slow tunable. statfs_percent accepts an integer between 0 and 100. Numbers between 1 and 100 will cause GFS2 to do any early sync when the local number of blocks free changes by at least statfs_percent from the totoal number of blocks free. Setting statfs_percent to 0 disables this. Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com> Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
2009-12-03GFS2: Use dquot_send_warning()Steven Whitehouse1-1/+9
This adds support to GFS2 to send quota warnings via netlink. Also it removes a stray \r which was left over from when the code used to print warnings on the console. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
2009-12-03VFS: Export dquot_send_warningSteven Whitehouse4-85/+114
Sending a message to userspace in a generic format to warn of events (e.g. quota exceeded) in the quota subsystem is a generically useful feature. This patch makes some minor changes to the send_message function from dquot.c renaming it quota_send_message, moving it to quota.c and exporting it for use by filesystems which do not use the dquot code. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
2009-12-03GFS2: Add set_xquota supportSteven Whitehouse1-26/+172
This patch adds the ability to set GFS2 quota limit and warning levels via the XFS quota API. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
2009-12-03GFS2: Add get_xquota supportSteven Whitehouse1-0/+43
This adds support for viewing the current GFS2 quota settings via the XFS quota API. The setting of quotas will be addressed in a later patch. Fields which are not supported here are left set to zero. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com> Reviewed-by: Bob Peterson <rpeterso@redhat.com>
2009-12-03GFS2: Clean up gfs2_adjust_quota() and do_glock()Steven Whitehouse1-56/+26
Both of these functions contained confusing and in one case duplicate code. This patch adds a new check in do_glock() so that we report -ENOENT if we are asked to sync a quota entry which doesn't exist. Due to the previous patch this is now reported correctly to userspace. Also there are a few new comments, and I hope that the code is easier to understand now. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
2009-12-03GFS2: Remove constant argument from qd_get()Steven Whitehouse1-4/+4
This function was only ever called with the "create" argument set to true, so we can remove it. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
2009-12-03GFS2: Remove constant argument from qdsb_get()Steven Whitehouse1-6/+6
The "create" argument to qdsb_get() was only ever set to true, so this patch removes that argument. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
2009-12-03GFS2: Add proper error reporting to quota sync via sysfsSteven Whitehouse1-4/+6
For some reason, the errors were not making it to userspace. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
2009-12-03GFS2: Add get_xstate quota functionSteven Whitehouse1-0/+23
This allows querying of the quota state via the XFS quota API. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
2009-12-03GFS2: Remove obsolete code in quota.cSteven Whitehouse2-17/+5
There is no point in testing for GLF_DEMOTE here, we might as well always release the glock at that point. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
2009-12-03GFS2: Hook gfs2_quota_sync into VFS via gfs2_quotactl_opsSteven Whitehouse4-0/+10
The plan is to add further operations to the gfs2_quotactl_ops in future patches. The sync operation is easy, so we start with that one. We plan to use the XFS quota control functions because they more closely match the GFS2 ones. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
2009-12-03GFS2: Alter arguments of gfs2_quota/statfs_syncSteven Whitehouse5-10/+12
These two functions are altered so that gfs2_quota_sync may in future be called directly from the VFS. The GFS2 superblock changes to a VFS super block and there is an addition of an int argument which is currently ignored. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
2009-12-03VFS: Use GFP_NOFS in posix_acl_from_xattr()Steven Whitehouse1-1/+1
GFS2 needs to call this from under a glock, so we need GFP_NOFS and I suspect that other filesystems might require this too. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
2009-12-03GFS2: Add cached ACLs supportSteven Whitehouse1-2/+25
The other patches in this series have been building towards being able to support cached ACLs like other filesystems. The only real difference with GFS2 is that we have to invalidate the cache when we drop a glock, but that is dealt with in earlier patches. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
2009-12-03GFS2: Clean up ACLsSteven Whitehouse5-100/+132
To prepare for support for caching of ACLs, this cleans up the GFS2 ACL support by pushing the xattr code back into xattr.c and changing the acl_get function into one which only returns ACLs so that we can drop the caching function into it shortly. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
2009-12-03GFS2: Use gfs2_set_mode() instead of munge_mode()Steven Whitehouse1-35/+11
These two functions do the same thing, so lets only use one of them. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
2009-12-03GFS2: Use forget_all_cached_acls()Steven Whitehouse1-1/+4
Invalidate all the cached ACLs when we drop the glock. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>