aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2010-02-17pcmcia: assert locking to struct pcmcia_deviceDominik Brodowski3-56/+129
Tested-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2010-02-17pcmcia: add locking documentationDominik Brodowski1-0/+92
Tested-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2010-02-17pcmcia: simplify lockingDominik Brodowski7-77/+51
replace pcmcia_socket->lock and pcmcia_dev_list_lock by using the per-socket "ops_mutex", as we do neither need different locks nor a spinlock here. Tested-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2010-02-17pcmcia: add locking to struct pcmcia_socket->pcmcia_state()Dominik Brodowski1-3/+30
Tested-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2010-02-17pcmcia: protect s->device_countDominik Brodowski1-7/+18
Tested-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2010-02-17pcmcia: properly lock skt->irq, skt->irq_maskDominik Brodowski2-0/+5
Tested-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2010-02-17pcmcia: lock ops->set_socketDominik Brodowski2-4/+29
As a side effect, socket_state_t socket; u_int state; u_int suspended_state; are properly protected now. Tested-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2010-02-17pcmcia: lock ops->set_io_map()Dominik Brodowski1-0/+10
As a side effect, io_window_t io[MAX_IO_WIN]; is explicitely protected now. Tested-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2010-02-17pcmcia: also lock fake and cache CIS by ops_mutexDominik Brodowski2-1/+23
Specifically, struct list_head cis_cache; size_t fake_cis_len; u8 *fake_cis; are protected. Tested-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2010-02-17pcmcia: add locking to set_mem_map()Dominik Brodowski5-5/+32
Protect the pccard_operations callback "set_mem_map" by a new mutex ops_mutex. This mutex also protects the following values in struct pcmcia_socket: pccard_mem_map win[] pccard_mem_map cis_mem void __iomem *cis_virt Tested-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2010-02-17pcmcia/i82365: fix typos in commentsWolfram Sang1-2/+2
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2010-02-17pcmcia/omap_cf: don't redefine SZ_2KUwe Kleine-König1-2/+0
This fixes: drivers/pcmcia/omap_cf.c:74:1: warning: "SZ_2K" redefined Since c1191b0 ([ARM] Kirkwood: create a mapping for the Security Accelerator SRAM) SZ_2K is defined in arch/arm/include/asm/sizes.h. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2010-02-17pcmcia/at91_cf: don't redefine SZ_2KUwe Kleine-König1-2/+0
This fixes: drivers/pcmcia/at91_cf.c:55:1: warning: "SZ_2K" redefined Since c1191b0 ([ARM] Kirkwood: create a mapping for the Security Accelerator SRAM) SZ_2K is defined in arch/arm/include/asm/sizes.h. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Acked-by: Andrew Victor <linux@maxim.org.za> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2010-02-17pcmcia/bfin_cf: don't check platform_get_irq's return value against zeroUwe Kleine-König1-1/+1
platform_get_irq returns -ENXIO on failure, so !irq was probably always true. Better use irq <= 0. Note that a return value of zero is still handled as error even though this could mean irq0. This is a followup to 305b3228f9ff4d59f49e6d34a7034d44ee8ce2f0 that changed the return value of platform_get_irq from 0 to -ENXIO on error. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Cc: David Vrabel <dvrabel@arcom.com> Cc: Greg Kroah-Hartman <gregkh@suse.de> Cc: Rafael J. Wysocki <rjw@sisk.pl> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2010-02-17pcmcia/yenta: add module parameter for O2 speedupsWolfram Sang2-16/+34
O2-bridges can do read prefetch and write burst. However, for some combinations of older bridges and cards, this causes problems, so it is disabled for those bridges. Now, as some users know their setup works with the speedups enabled, a new parameter is introduced to the driver. Now, a user can specifically enable or disable these features, while the default is what we have today: detect the bridge and decide accordingly. Fixes Bugzilla entry 15014. Simplify and unify the printouts, fix a whitespace issue while we are here. Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Tested-by: frodone@gmail.com [linux@dominikbrodowski.net: whitespace fixes] Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2010-02-17pcmcia: make Open Firmware device id constantMárton Németh2-2/+2
The match_table field of the struct of_device_id is constant in <linux/of_platform.h> so it is worth to make the initialization data also constant. The semantic match that finds this kind of pattern is as follows: (http://coccinelle.lip6.fr/) // <smpl> @r@ disable decl_init,const_decl_init; identifier I1, I2, x; @@ struct I1 { ... const struct I2 *x; ... }; @s@ identifier r.I1, y; identifier r.x, E; @@ struct I1 y = { .x = E, }; @c@ identifier r.I2; identifier s.E; @@ const struct I2 E[] = ... ; @depends on !c@ identifier r.I2; identifier s.E; @@ + const struct I2 E[] = ...; // </smpl> Signed-off-by: Márton Németh <nm127@freemail.hu> Cc: Julia Lawall <julia@diku.dk> Cc: cocci@diku.dk Acked-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2010-02-17cm4000_cs.c: Remove unnecessary castH Hartley Sweeten1-1/+1
The struct file 'private_data' member is a void *, the cast is not needed. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Harald Welte <laforge@gnumonks.org> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2010-02-17pcmcia: fix yenta dependency on PCCARD_NONSTATICMichal Marek1-3/+3
With CONFIG_PCMCIA=m and CONFIG_YENTA=y, we get drivers/built-in.o: In function `yenta_probe': yenta_socket.c:(.devinit.text+0x1e582): undefined reference to `pccard_nonstatic_ops' This is because select PCCARD_NONSTATIC if PCMCIA sets PCCARD_NONSTATIC = min(YENTA, PCMCIA). Change it to 'if PCMCIA!=n' to remove the upper limit. [linux@dominikbrodowski.net: propagate change to PCMICA_M8XX] Reported-by: Randy Dunlap <rdunlap@xenotime.net> Signed-off-by: Michal Marek <mmarek@suse.cz> Acked-by: Randy Dunlap <rdunlap@xenotime.net> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2010-02-17pcmcia: do not use resource manager on !PCMCIADominik Brodowski2-2/+12
If only CardBus cards are used, but not PCMCIA cards, we do not need the extensive resource management functions provided for by rsrc_nonstatic.c (~240K). Tested-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2010-02-17pcmcia: remove remaining rsrc_mgr indirectionsDominik Brodowski3-28/+23
Move rsrc_mgr indirections only used by the pcmcia module to the pcmcia module. Tested-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2010-02-17pcmcia: move cistpl.c into pcmcia moduleDominik Brodowski6-187/+183
As PCMCIA is the only real user of CIS access functions, include cistpl.c in the PCMCIA module, not in the PCMCIA & CardBus core module. Tested-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2010-02-17pcmcia: m8xx_pcmcia.c should use iodyn resource managerDominik Brodowski3-2/+3
The socket driver m8xx_pcmcia.c uses a static memory assignment, but io_offset is set to 0. Therefore, it seems proper to use the iodyn resource manager for this driver, as was previously the case (before commit 80128ff79d282cf71b1819dbca9b8dd47d8ed3e8). CC: Vitaly Bordug <vitb@kernel.crashing.org> CC: Arnd Bergmann <arnd@arndb.de> CC: Olof Johansson <olof@lixom.net> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2010-01-24pcmcia: m32r uses static socket resourcesDominik Brodowski2-3/+1
m32r_cfc sets the socket capabilities to SS_CAP_STATIC_MAP and also sets io_offset != 0. This means no calls to &pccard_nonstatic_ops went through. Therfore, replace it with &pccard_static_ops which is exactly for this case. CC: Mamoru Sakugawa <sakugawa@linux-m32r.org> CC: Hirokazu Takata <takata@linux-m32r.org> Tested-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2010-01-24pcmcia: remove some rsrc_mgr indirectionsDominik Brodowski3-26/+17
Remove rsrc_mgr indirections only used by pcmcia_resource.c Tested-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2010-01-24pcmcia: remove useless indirectionDominik Brodowski3-10/+2
As release_resoure_db() used to be called only from one place, and it's a two-line function, remove it. Tested-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2010-01-24pcmcia: do not lock socket driver module on card insertDominik Brodowski2-23/+10
Do not lock the socket driver module on card insert, as the PCMCIA core can handle a socket module removal, at least if we add a call to socket_remove() on pccardd()'s shutdown. Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2010-01-17pcmcia: do not lock socket driver module in pcmcia_get_socket()Dominik Brodowski1-7/+1
Do not lock the socket driver module in pcmcia_get_socket(), as the PCMCIA core can handle a socket module removal: In pcmcia_unregister_socket(), we explicitely wait for the last put_device() to succeed. Tested-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2010-01-17pcmcia: rsrc_nonstatic io memory probe improvementsDominik Brodowski1-60/+114
Add a lot of documentation to the rsrc_nonstatic io memory probe functions. Also, add a first memory probe call -- just checking whether request_resource() succeeds -- upon adding of resources. Tested-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2010-01-17pcmcia: call CIS cleanup from ds.cDominik Brodowski2-3/+3
As ds.c is the only real user of CIS access functions, call the cleanup functions from ds.c, too. Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2010-01-17pcmcia: CardBus doesn't need CIS accessDominik Brodowski3-335/+46
At least no in-kernel CardBus-capable PCI driver makes use of the CIS access functions. Therefore, it seems sensible to remove this unused code, and cleanup cardbus.c a lot. CC: Jesse Barnes <jbarnes@virtuousgeek.org> CC: Linus Torvalds <torvalds@linux-foundation.org> Tested-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2010-01-17pcmcia: improve check for same card in slot after resumeDominik Brodowski4-36/+47
During a suspend/resume cycle, an user may change the card in the PCMCIA/CardBus slot. The pcmcia_core can at least look at the socket state to check whether it is the same. For PCMCIA devices, move the detection and handling of such a change to ds.c. For CardBus devices, the PCI hotplug interface doesn't offer a "rescan" facility which also _removes_ devices no longer to be found behind a bridge. Therefore, remove and re-add all devices unconditionally. CC: Jesse Barnes <jbarnes@virtuousgeek.org> CC: Linus Torvalds <torvalds@linux-foundation.org> Tested-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2010-01-17pcmcia: cleanup pccard_validate_cis()Dominik Brodowski1-74/+81
Cleanup pccard_validate_cis() and make it return an error code on all failures, not merely on some failures. Tested-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2010-01-17pcmcia: validate CIS, not CIS cache.Dominik Brodowski3-10/+21
In pccard_validate_cis(), validate the card CIS, not the CIS cache. Also, destroy the CIS cache if pccard_validate_cis fails. Furthermore, do not remove the fake CIS in destroy_cis_cache() but do so explicitely in the code paths where it makes sense. Tested-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2010-01-17pcmcia: do not meddle with already assigned resourcesDominik Brodowski1-7/+0
Do not release any iomem resources already in use. Tested-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2010-01-17pcmcia: remove remaining unused IRQ_FIRST_SHARED parameterDominik Brodowski1-4/+2
Komuro pointed out correctly that I missed one IRQ_FIRST_SHARED parameter in smc91c92_cs.c, and that another line could be writter more beautifully. CC: netdev@vger.kernel.org CC: Komuro <komurojun-mbn@nifty.com> Tested-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2010-01-17pcmcia: make use of pcmcia_dev_resume() return valueDominik Brodowski1-2/+3
In runtime_resume(), do not throw away the return value of pcmcia_dev_resume(), for we can use it (at least) in pcmcia_store_pm_state(). This also fixes the pointless assignment previosly seen there, as noted by Dan Carpenter. CC: Dan Carpenter <error27@gmail.com> Tested-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
2010-01-15Merge branch 'for-linus/samsung' of git://git.fluff.org/bjdooks/linuxLinus Torvalds3-20/+21
* 'for-linus/samsung' of git://git.fluff.org/bjdooks/linux: ARM: MINI2440: Fixup __initdata usage ARM: MINI2440: Fix crash on boot due to improper __initdata qualifier ARM: SMDK6410: Specify no GPIO for B_PWR_5V regulator ARM: S3C: NAND: Check the existence of nr_map before copying
2010-01-15Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/bp/bpLinus Torvalds1-1/+1
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp: amd64_edac: Ensure index stays within bounds in amd64_get_scrub_rate
2010-01-15Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/inputLinus Torvalds14-121/+208
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: Input: sentelic - fix left/right horizontal scroll mapping Input: pmouse - move Sentelic probe down the list Input: add compat support for sysfs and /proc capabilities output Input: i8042 - add Dritek quirk for Acer Aspire 5610. Input: xbox - do not use GFP_KERNEL under spinlock Input: psmouse - fix Synaptics detection when protocol is disabled Input: bcm5974 - report ABS_MT events Input: davinci_keyscan - add device_enable method to platform data Input: evdev - be less aggressive about sending SIGIO notifies Input: atkbd - fix canceling event_work in disconnect Input: serio - fix potential deadlock when unbinding drivers Input: gf2k - fix &&/|| confusion in gf2k_connect()
2010-01-15Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mattst88/alpha-2.6Linus Torvalds2-2/+4
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mattst88/alpha-2.6: alpha: cpumask_of_node() should handle -1 as a node alpha: add myself as a maintainer, and drop mention of 2.4
2010-01-15Merge branch 'sh/for-2.6.33' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6Linus Torvalds2-1/+20
* 'sh/for-2.6.33' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6: serial: sh-sci: using correct fifo size for SCIF and SCIFA ports. sh: mach-ecovec24: Add motion sensor driver support.
2010-01-15inotify: only warn once for inotify problemsEric Paris1-1/+1
inotify will WARN() if it finds that the idr and the fsnotify internals somehow got out of sync. It was only supposed to do this once but due to this stupid bug it would warn every single time a problem was detected. Signed-off-by: Eric Paris <eparis@redhat.com> Cc: stable@kernel.org Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-01-15inotify: do not reuse watch descriptorsEric Paris1-2/+2
Since commit 7e790dd5fc937bc8d2400c30a05e32a9e9eef276 ("inotify: fix error paths in inotify_update_watch") inotify changed the manor in which it gave watch descriptors back to userspace. Previous to this commit inotify acted like the following: inotify_add_watch(X, Y, Z) = 1 inotify_rm_watch(X, 1); inotify_add_watch(X, Y, Z) = 2 but after this patch inotify would return watch descriptors like so: inotify_add_watch(X, Y, Z) = 1 inotify_rm_watch(X, 1); inotify_add_watch(X, Y, Z) = 1 which I saw as equivalent to opening an fd where open(file) = 1; close(1); open(file) = 1; seemed perfectly reasonable. The issue is that quite a bit of userspace apparently relies on the behavior in which watch descriptors will not be quickly reused. KDE relies on it, I know some selinux packages rely on it, and I have heard complaints from other random sources such as debian bug 558981. Although the man page implies what we do is ok, we broke userspace so this patch almost reverts us to the old behavior. It is still slightly racey and I have patches that would fix that, but they are rather large and this will fix it for all real world cases. The race is as follows: - task1 creates a watch and blocks in idr_new_watch() before it updates the hint. - task2 creates a watch and updates the hint. - task1 updates the hint with it's older wd - task removes the watch created by task2 - task adds a new watch and will reuse the wd originally given to task2 it requires moving some locking around the hint (last_wd) but this should solve it for the real world and be -stable safe. As a side effect this patch papers over a bug in the lib/idr code which is causing a large number WARN's to pop on people's system and many reports in kerneloops.org. I'm working on the root cause of that idr bug seperately but this should make inotify immune to that issue. Signed-off-by: Eric Paris <eparis@redhat.com> Cc: stable@kernel.org Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-01-15amd64_edac: Ensure index stays within bounds in amd64_get_scrub_rateRoel Kluin1-1/+1
Add a missing iterator variable thus fixing the conditional of the for-loop in amd64_get_scrub_rate(). Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
2010-01-15ARM: MINI2440: Fixup __initdata usageBen Dooks1-13/+13
Remove some of the __initdata tags which are currently inappropriate for platform_device and some of the platform data. These can be returned once support for copying platform devices and data is added. Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2010-01-15ARM: MINI2440: Fix crash on boot due to improper __initdata qualifierUri Yosef1-5/+5
This patch fix mini2440 crash on boot due to improper __initdata qualifier on mini2440_led1_pdata. Signed-off-by: Uri Yosef <uri.yosef@gmail.com> Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2010-01-15ARM: SMDK6410: Specify no GPIO for B_PWR_5V regulatorMark Brown1-0/+1
Since the fixed voltage regulator grew support for GPIO based enables and GPIO 0 is valid on some systems we need to specify that there is no valid GPIO enable control. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Ben Dooks <ben-linux@fluff.org>
2010-01-15serial: sh-sci: using correct fifo size for SCIF and SCIFA ports.Markus Pietrek1-1/+12
The sh-sci driver used the wrong fifosize for PORT_SCIFA and PORT_SCIF ports. If an incorrect size is used, the serial core will enforce an early shutdown on the port, especially with baudrates < 9600. Signed-off-by: Markus Pietrek <Markus.Pietrek@emtrion.de> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-15sh: mach-ecovec24: Add motion sensor driver support.NISHIMOTO Hiroki1-0/+8
This patch adds support for the lis3lv02d motion sensor connected via i2c on the Ecovec board. Tested with evtest. Signed-off-by: NISHIMOTO Hiroki <nishimoto.hiroki@renesas.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
2010-01-14alpha: cpumask_of_node() should handle -1 as a nodeAnton Blanchard1-0/+3
CC: Richard Henderson <rth@twiddle.net> CC: Ivan Kokshaysky <ink@jurassic.park.msu.ru> Signed-off-by: Matt Turner <mattst88@gmail.com> CC: linux-alpha@vger.kernel.org CC: Rusty Russell <rusty@rustcorp.com.au> CC: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Anton Blanchard <anton@samba.org>