The PCMCIA layer calls pcmcia_parse_events both from user context and
IRQ context; the lock thus needs to be irqsave to avoid deadlocks
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
This must not be marked __init, as it is called from
au1x00_drv_pcmcia_probe.
Signed-off-by: Domen Puncer <domen.puncer@ultra.si>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Convert pcmcia_cs to use kthread instead of the deprecated
kernel_thread.
Signed-off-by: Serge E. Hallyn <serue@us.ibm.com>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
AT91 CF updates, mostly for power management:
- Add suspend/resume methods to the AT91 CF driver, disabling
non-wakeup IRQs during system suspend. The card detect IRQ
serves as a wakeup event source.
- Convert the driver to the more-current "platform_driver" style.
So inserting or removing a CF card will wake the system, unless that
has been disabled by updating the sysfs file; and there will be no
more warnings about spurious IRQs during suspend/resume cycles.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
The patch below adds support for the TI PCIxx12 CardBus controllers.
This seems to be sufficient to detect the cardbus bridge on an HP nc6320
and works with an orinoco wifi card.
Signed-off-by: Alex Williamson <alex.williamson@hp.com>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
The patch below cleans up the pcmcia code a bit on the IRQ side (I did
this while debugging the problem just so I could read wtf it was doing),
and also adds a warning and passes back the correct information when a
device asks for exclusive but gets given shared. This at least means the
dmesg dump of a problem triggered by this will have a signature to find.
Signed-off-by: Alan Cox <alan@redhat.com>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Fixup the subordinate number parent bridge of yenta Cardbus Bridges
before the PCI bus scan starts to make the cardbus cards which are
otherwise hidden for PCI scans work.
Signed-off-by: Bernhard Kaindl <bk@suse.de>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Power-up the card only after the socket is configured. power-down in
the old place. The point is not to power-up the card before the interrupt
routing is set up correctly.
Signed-off-by: Daniel Ritz <daniel.ritz@gmx.ch>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
* master.kernel.org:/pub/scm/linux/kernel/git/gregkh/pci-2.6:
[PATCH] i386: export memory more than 4G through /proc/iomem
[PATCH] 64bit Resource: finally enable 64bit resource sizes
[PATCH] 64bit Resource: convert a few remaining drivers to use resource_size_t where needed
[PATCH] 64bit resource: change pnp core to use resource_size_t
[PATCH] 64bit resource: change pci core and arch code to use resource_size_t
[PATCH] 64bit resource: change resource core to use resource_size_t
[PATCH] 64bit resource: introduce resource_size_t for the start and end of struct resource
[PATCH] 64bit resource: fix up printks for resources in misc drivers
[PATCH] 64bit resource: fix up printks for resources in arch and core code
[PATCH] 64bit resource: fix up printks for resources in pcmcia drivers
[PATCH] 64bit resource: fix up printks for resources in video drivers
[PATCH] 64bit resource: fix up printks for resources in ide drivers
[PATCH] 64bit resource: fix up printks for resources in mtd drivers
[PATCH] 64bit resource: fix up printks for resources in pci core and hotplug drivers
[PATCH] 64bit resource: fix up printks for resources in networks drivers
[PATCH] 64bit resource: fix up printks for resources in sound drivers
[PATCH] 64bit resource: C99 changes for struct resource declarations
Fixed up trivial conflict in drivers/ide/pci/cmd64x.c (the printk that
was changed by the 64-bit resources had been deleted in the meantime ;)
This patch-queue improves the generic IRQ layer to be truly generic, by adding
various abstractions and features to it, without impacting existing
functionality.
While the queue can be best described as "fix and improve everything in the
generic IRQ layer that we could think of", and thus it consists of many
smaller features and lots of cleanups, the one feature that stands out most is
the new 'irq chip' abstraction.
The irq-chip abstraction is about describing and coding and IRQ controller
driver by mapping its raw hardware capabilities [and quirks, if needed] in a
straightforward way, without having to think about "IRQ flow"
(level/edge/etc.) type of details.
This stands in contrast with the current 'irq-type' model of genirq
architectures, which 'mixes' raw hardware capabilities with 'flow' details.
The patchset supports both types of irq controller designs at once, and
converts i386 and x86_64 to the new irq-chip design.
As a bonus side-effect of the irq-chip approach, chained interrupt controllers
(master/slave PIC constructs, etc.) are now supported by design as well.
The end result of this patchset intends to be simpler architecture-level code
and more consolidation between architectures.
We reused many bits of code and many concepts from Russell King's ARM IRQ
layer, the merging of which was one of the motivations for this patchset.
This patch:
rename desc->handler to desc->chip.
Originally i did not want to do this, because it's a big patch. But having
both "desc->handler", "desc->handle_irq" and "action->handler" caused a
large degree of confusion and made the code appear alot less clean than it
truly is.
I have also attempted a dual approach as well by introducing a
desc->chip alias - but that just wasnt robust enough and broke
frequently.
So lets get over with this quickly. The conversion was done automatically
via scripts and converts all the code in the kernel.
This renaming patch is the first one amongst the patches, so that the
remaining patches can stay flexible and can be merged and split up
without having some big monolithic patch act as a merge barrier.
[akpm@osdl.org: build fix]
[akpm@osdl.org: another build fix]
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
locking init cleanups:
- convert " = SPIN_LOCK_UNLOCKED" to spin_lock_init() or DEFINE_SPINLOCK()
- convert rwlocks in a similar manner
this patch was generated automatically.
Motivation:
- cleanliness
- lockdep needs control of lock initialization, which the open-coded
variants do not give
- it's also useful for -rt and for lock debugging in general
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Based on a patch series originally from Vivek Goyal <vgoyal@in.ibm.com>
Cc: Vivek Goyal <vgoyal@in.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This is needed if we wish to change the size of the resource structures.
Based on an original patch from Vivek Goyal <vgoyal@in.ibm.com>
Cc: Vivek Goyal <vgoyal@in.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
The Badge4 PCMCIA driver was referencing structure elements which
had been renamed. Fix the missing renames.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
The result of pcmcia_get_socket() may be NULL but ds_event() uses it
without checking.
Coverity CID: 436.
Signed-off-by: Florin Malita <fmalita@gmail.com>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Fix some NULL dereferences in the pcmcia code when using old userland
tools.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
- Add new SA_PROBEIRQ which suppresses the new sharing-mismatch warning.
Some drivers like to use request_irq() to find an unused interrupt slot.
- Use it in i82365.c
- Kill unused SA_PROBE.
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Using the old ioctl interface together with cardbus card gives a NULL
pointer dereference since cardbus devices don't have a struct pcmcia_device.
also s->io[0].res can be NULL as well.
Fix is to move the pcmcia code after the cardbus code and to check for a null
pointer.
Signed-off-by: Daniel Ritz <daniel.ritz@gmx.ch>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
This patch updates "depends on" for PCMCIA_VRC4171.
CONFIG_VRC4171 has been removed, so replace it with CPU_VR41XX && ISA.
Signed-off-by: Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
As static maps do not have IO resources, this setting oopses. However, as
we do not ever read this value, we can safely remove it.
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
If we set dev_node to NULL too early, some drivers which used this to
determine whether unregister_netdev() needs to be called fail when removing
a PCMCIA card.
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
The comment of "pcmcia_load_firmware" is wrong: the
firmware(*.cis) files reside in /lib/firmware/ _not_
/lib/firmware/cis/ .
Signed-off-by: komurojun-mbn@nifty.com
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Use list_add instead of list_add_tail for pcmcia_device_add
so that second device of multi-function-card will be unloaded first.
Signed-off-by: komurojun-mbn@nifty.com
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Patch from Richard Purdie
Move platform_scoop_config from the SharpSL scoop PCMCIA driver to
the SCOOP driver. This avoids build failures when PCMCIA is not built
or is modular (scoop.c itself cannot be modular).
Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
The at91_cf driver got out of sync with certain changes in the PCMCIA
layer, notably getting rid of some duplication of data ... causing the
version merged to kernel.org to fail compiling.
This patch gives the at91_cf platform device a new iomem resource, using
it so this new pcmcia scheme works. It also cleans up some whitepsace
bugs that have accumulated over time (mostly too-long lines).
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
The boot cmdline is parsed in parse_early_param() and
parse_args(,unknown_bootoption).
And __setup() is used in obsolete_checksetup().
start_kernel()
-> parse_args()
-> unknown_bootoption()
-> obsolete_checksetup()
If __setup()'s callback (->setup_func()) returns 1 in
obsolete_checksetup(), obsolete_checksetup() thinks a parameter was
handled.
If ->setup_func() returns 0, obsolete_checksetup() tries other
->setup_func(). If all ->setup_func() that matched a parameter returns 0,
a parameter is seted to argv_init[].
Then, when runing /sbin/init or init=app, argv_init[] is passed to the app.
If the app doesn't ignore those arguments, it will warning and exit.
This patch fixes a wrong usage of it, however fixes obvious one only.
Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
If the driver for the primary pseudo device is removed from the device,
the secondary driver must be removed as well -- it cannot exist on its own.
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Instead of the two status values struct pcmcia_device->p_state and state,
use descriptive bitfields. Most value-checking in drivers was invalid, as
the core now only calls the ->remove() (a.k.a. detach) function in case the
attachement _and_ configuration was successful.
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Remove the unused DEV_RELEASE_PENDING flag, and move the DEV_SUSPEND flag
into the p_dev structure, and make use of it at the core level.
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
We can now make pcmcia_release_{io,irq} static.
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
dev_link_t * and client_handle_t both mean struct pcmcai_device * by now.
Therefore, remove all such indirections.
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Embed dev_link_t into struct pcmcia_device(), as they basically address the
same entity. The actual contents of dev_link_t will be cleaned up step by step.
This patch includes a bugfix from and signed-off-by Andrew Morton.
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Rename pcmcia_device.state (which is used in very few places) to p_state
in order to avoid a namespace collision when moving the deprecated
dev_link_t into struct pcmcia_device
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
As we do not allow setting Vcc in the pcmcia core, and Vpp1 and
Vpp2 can only be set to the same value, a lot of code can be
streamlined.
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Handle the _modifying_ operation sm91c92_cs requires in
pcmcia_modify_configuration, so that the only remaining users
of pcmcia_release_configuration() are within the pcmcia core
module.
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
In all but one case, the suspend and resume functions of PCMCIA drivers
contain mostly of calls to pcmcia_release_configuration() and
pcmcia_request_configuration(). Therefore, move this code out of the
drivers and into the core.
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Convert the remaining drivers which use pcmcia_release_io or
pcmcia_release_irq, and remove the EXPORT of these symbols.
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
pcmcia_disable_device(struct pcmcia_device *p_dev) performs the necessary
cleanups upon device or driver removal: it calls the appropriate
pcmcia_release_* functions, and can replace (most) of the current drivers'
_release() functions.
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
This patch adds support for the Compact Flash controller integrated in
the Atmel AT91RM9200 processor.
Signed-off-by: Andrew Victor <andrew@sanpeople.com
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
socket.functions is the number of functions, and so must be one larger
than the maximum function number.
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
BasePort, NumPorts and Attributes are or can be embedded in
struct resource, so remove them.
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
If the kernel is configured to not include the deprecated PCMCIA ioctl,
some code doesn't need to be built.
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Remove the compatibility wrappers, as they can (now) also be implemented
using macros. Please continue using these wrappers instead of new functions
until a new API has stabilized.
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Use mutexes in the PCMICA core, as they suffice for what needs to be done.
Includes a bugfix from and Signed-off-by Andrew Morton.
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Update the remaining users using the static lookup table of the PCMCIA
function configuration to use the struct pcmcia_device-contained pointer.
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Access the PCMCIA config_t struct (one per device function) using
a pointer in struct pcmcia_device, instead of looking them up in
an array.
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
config_t.Present is set to the same value as CardValues, which isn't modified
anywhere. Therefore, we can use only one of these two objects.
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
For some time, the core pcmcia drivers seem not to think single
character prod_ids are valid, thus preventing the "cleverly" named
"D" "Link DWL-650 11Mbps WLAN Card"
Before (as in 2.6.16):
PRODID_1=""
PRODID_2="Link DWL-650 11Mbps WLAN Card"
PRODID_3="Version 01.02"
PRODID_4=""
MANFID=0156,0002
FUNCID=6
After (with the patch)
PRODID_1="D"
PRODID_2="Link DWL-650 11Mbps WLAN Card"
PRODID_3="Version 01.02"
PRODID_4=""
MANFID=0156,0002
FUNCID=6
Signed-off-by: Janos Farkas <chexum@gmail.com>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
platform_get_irq*() now returns on -ENXIO when the resource cannot be
found. Ensure all users of platform_get_irq*() handle this error
appropriately.
Signed-off-by: David Vrabel <dvrabel@arcom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
The second pseudo multi-function device of a PCMCIA card may only be
configured once the first one is initialized. Therefore, delay the
registration of the second device until the first one is initialized.
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net
With the "power/state" sysfs interface being deprecated, make another
one available which is compatible to what was discussed on the linux
PM mailinglist.
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Patch from Richard Purdie
Change mainstone and sharpsl pxa2xx pcmcia drivers to use
platform_device_alloc which fixes a memory leak.
Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
kill the socket_shutdown()/shutdown_socket() confusion by making it
one single function. move cs_socket_put() in there. nicer to read and
smaller:
original:
text data bss dec hex filename
25181 1076 32 26289 66b1 drivers/pcmcia/pcmcia_core.ko
patched:
text data bss dec hex filename
24973 1076 32 26081 65e1 drivers/pcmcia/pcmcia_core.ko
Signed-off-by: Daniel Ritz <daniel.ritz@gmx.ch>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Export the stored values instead of re-reading everything in the socket
information sysfs files, and make them accessible to all users, not only
to root.
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
This adds PCMCIA support for both MPC885ADS and MPC866ADS.
This is established not together with FADS, because 885 does not have
io_block_mapping() for BCSR area.
Also, some cleanups done both for 885ADS and MBX.
Signed-off-by: Vitaly Bordug <vbordug@ru.mvista.com>
Signed-off-by: Marcelo Tosatti <marcelo.tosatti@cyclades.com>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
This fixes misconfiguration that could result in odd work of some old CF
cards.
Signed-off-by: Vitaly Bordug <vbordug@ru.mvista.com>
Signed-off-by: Marcelo Tosatti <marcelo.tosatti@cyclades.com>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Some PCMCIA sockets have statically mapped memory windows, but dynamically
mapped IO windows. Using the "nonstatic" socket library is inpractical for
them, as they do neither need a resource database (as we can trust the
kernel resource database on m68k and ppc) nor lots of other features of that
library. Let them get a small "iodyn" socket library (105 lines of code)
instead.
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Unify the EVENT_CARD_INSERTION and "attach" callbacks to one unified
probe() callback. As all in-kernel drivers are changed to this new
callback, there will be no temporary backwards-compatibility. Inside a
probe() function, each driver _must_ set struct pcmcia_device
*p_dev->instance and instance->handle correctly.
With these patches, the basic driver interface for 16-bit PCMCIA drivers
now has the classic four callbacks known also from other buses:
int (*probe) (struct pcmcia_device *dev);
void (*remove) (struct pcmcia_device *dev);
int (*suspend) (struct pcmcia_device *dev);
int (*resume) (struct pcmcia_device *dev);
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Unify the "detach" and REMOVAL_EVENT handlers to one "remove" function.
Old functionality is preserved, for the moment.
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Merge the suspend and resume methods for 16-bit PCMCIA cards into the
device model -- for both runtime power management and suspend to ram/disk.
Bugfix in ds.c by Richard Purdie
Signed-Off-By: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Move the suspend and resume methods out of the event handler, and into
special functions. Also use these functions for pre- and post-reset, as
almost all drivers already do, and the remaining ones can easily be
converted.
Bugfix to include/pcmcia/ds.c
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Make the bridge specific initialization code config options depending on
CONFIG_EMBEDDED. Config options for TI/EnE, Toshiba, Ricoh and O2Micro are
available. Disabling all of the specific tweaks cuts off more than half
of yenta_socket.ko.
Signed-off-by: Daniel Ritz <daniel.ritz@gmx.ch>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Also return a value if CONFIG_PCMCIA_PROBE is not set.
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Add a return value to pcmcia_validate_mem. Only if we have enough memory
available to map the CIS, we should proceed in trying to determine information
about the device.
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Don't waste cpu time in yenta interrupt handler when the interrupt was for
another device.
Signed-off-by: Daniel Ritz <daniel.ritz@gmx.ch>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Patch from Richard Purdie
The SL-Cxx00 devices have a power control register in SCOOP that is
shared by both CF and MMC/SD card slots. The CF reset code was resetting
this register leading to various lockups as the MMC power was suddenly
lost. This patch handles the CPR register in a more sensitive manner.
It also removes some unneeded collie specific calls as the reset code
handles this.
Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Leave the overloaded "hotplug" word to susbsystems which are handling
real devices. The driver core does not "plug" anything, it just exports
the state to userspace and generates events.
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This patch is for supporting IDE interface for M3A-2170(Mappi-III) board.
Signed-off-by: Mamoru Sakugawa <sakugawa@linux-m32r.org>
Signed-off-by: Hirokazu Takata <takata@linux-m32r.org>
Cc: Bartlomiej Zolnierkiewicz <B.Zolnierkiewicz@elka.pw.edu.pl>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Print out minimal information in dmesg whnever a CardBus or PCMCIA card
is inserted into or ejected from a slot. This will make debugging certain
types of bugs much easier, and is similar to output produced by other
hotpluggable buses.
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Use the new platform_device helpers in the i82365 driver to get rid of the
"device 'i823650' does not have a release() function" warning, and to solve
bug #3676.
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
The i82365 driver does not release all the resources when the device is not
found. This can cause an oops when reading /proc/ioports after module
unload.
Signed-off-by: Igor Popik <igor.popik@gmail.com>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
This patch removes almost all inclusions of linux/version.h. The 3
#defines are unused in most of the touched files.
A few drivers use the simple KERNEL_VERSION(a,b,c) macro, which is
unfortunatly in linux/version.h.
There are also lots of #ifdef for long obsolete kernels, this was not
touched. In a few places, the linux/version.h include was move to where
the LINUX_VERSION_CODE was used.
quilt vi `find * -type f -name "*.[ch]"|xargs grep -El '(UTS_RELEASE|LINUX_VERSION_CODE|KERNEL_VERSION|linux/version.h)'|grep -Ev '(/(boot|coda|drm)/|~$)'`
search pattern:
/UTS_RELEASE\|LINUX_VERSION_CODE\|KERNEL_VERSION\|linux\/\(utsname\|version\).h
Signed-off-by: Olaf Hering <olh@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Patch from Richard Purdie
The Sharp SL-Cxx00 models have a combined power control for the SD
and CF slot 0. This patch adds hooks to the scoop driver to allow
machines to provide a custom control function for this and such a
function is added for spitz/akita/borzoi.
It also moves the gpio init code into the machine files as this
is machine dependent and differs between some models. A couple of
warnings when compiling for collie are also fixed.
Signed-off-by: Richard Purdie
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
This is the remaining misc drivers/ part of the big kfree cleanup patch.
Remove pointless checks for NULL prior to calling kfree() in misc files in
drivers/.
Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
Acked-by: Aristeu Sergio Rozanski Filho <aris@cathedrallabs.org>
Acked-by: Roland Dreier <rolandd@cisco.com>
Acked-by: Pierre Ossman <drzeus@drzeus.cx>
Acked-by: Jean Delvare <khali@linux-fr.org>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Acked-by: Len Brown <len.brown@intel.com>
Acked-by: "Antonino A. Daplas" <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Add CONFIG_X86_32 for i386. This allows selecting options that only apply
to 32-bit systems.
(X86 && !X86_64) becomes X86_32
(X86 || X86_64) becomes X86
Signed-off-by: Brian Gerst <bgerst@didntduck.org>
Cc: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This adds support for pcmcia slot on sharp zaurus sl-5500.
pxa2xx_sharpsl.c thus becomes quite miss-named, but I guess that
is not worth fixing?
Signed-off-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Convert everyone who uses platform_bus_type to include
linux/platform_device.h.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Here is an uptodated version of the MPC8xx PCMCIA driver for v2.6,
addressing comments by Jeff and Dominik:
- use IO accessors instead of direct device memory referencing
- avoid usage of non-standard "uint/uchar" data types
- kill struct typedef's
Will submit it for inclusion once v2.6.14 is out.
Testing on 8xx platforms is more than welcome! Works like a charm
on our custom hardware (CONFIG_PRxK).
Cc: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
In PM v1, all devices were called at SUSPEND_DISABLE level. Then
all devices were called at SUSPEND_SAVE_STATE level, and finally
SUSPEND_POWER_DOWN level. However, with PM v2, to maintain
compatibility for platform devices, I arranged for the PM v2
suspend/resume callbacks to call the old PM v1 suspend/resume
callbacks three times with each level in order so that existing
drivers continued to work.
Since this is obsolete infrastructure which is no longer necessary,
we can remove it. Here's an (untested) patch to do exactly that.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Driver core: pass interface to class intreface methods
Pass interface as argument to add() and remove() class interface
methods. This way a subsystem can implement generic add/remove
handlers and then call interface-specific ones.
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Fix sparse warnings in arch/arm/kernel/module.c,
arch/arm/mm/consistent.c, drivers/pcmcia/sa1111_generic.c,
and platform support files.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
This fixes wrong comments, non-working debug subsystem, and some
potentially dangerous macros.
Signed-off-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
The pccardd thread has a race in it that it can shutdown in the
TASK_INTERRUPTIBLE state.
Make sure we mark ourselves runnable again as we remove ourselves from
the wait queue.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
(struct pcmcia_socket).tune_bridge only exists if CONFIG_CARDBUS is set
but building yenta_socket without CardBus is valid.
Signed-off-by: David Vrabel <dvrabel@arcom.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
It's pointless to include mach-types.h if you're not going to use
anything from it. These references were removed as a result of:
grep -lr 'asm/mach-types\.h' . | xargs grep -L 'machine_is_\|MACH_TYPE_\|MACHINE_START\|machine_type'
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Only start up nonstatic sockets if both IO and MEM resources are available.
Thanks to Russell King and Matthew Wilcox for tracking this down.
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Adds better support for the CB-710, CB-712, CB-720 and CB-722 bridges from EnE
Signed-off-by: Daniel Ritz <daniel.ritz@gmx.ch>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Support some more TI cardbus bridges. most of them are multifunction
devices which adds 1394 controllers, smartcard readers etc. this could
also help with the various problems with the XX21 controllers seen on the
linux-pcmcia list.
Signed-off-by: Daniel Ritz <daniel.ritz@gmx.ch>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
TCIC depends on ISA. It is used with ISA-bus system only.
Signed-off-by: komurojun-mbn@nifty.com
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
pci_set_power_state is not needed, as we call pci_enable_device() somewhere
else. Also, the resource we write to PCI_BASE_ADDRESS_0 needs to be converted
to bus-centric view first.
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
In interrupt probing (both ISA and PCI) the bridge control register is used
to change interrupt routing to ISA or PCI by changing bit 7. But this bit
only controls the routing of card functional interrupts, not the CSC
interrupts which are used for interrupt probing.
A bad side effect of messing with this register in yenta_probe_irq() is
that it can lead to irq storms if a card is inserted and already powered by
the BIOS.
Usage in yenta_sock_init() and yenta_config_init() seem to be fishy as well.
Signed-off-by: Daniel Ritz <daniel.ritz@gmx.ch>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Echo Audio cardbus products are known to be incompatible with EnE bridges.
in order to maybe solve the problem a EnE specific test bit has to be set,
another cleared...but other setups have a good chance to break when just
forcing the bits. so do the whole thingy automatically.
The patch adds a hook in cb_alloc() that allows special tuning for the
different chipsets. for ene just match the Echo products and set/clear the
test bits, defaults to do the same thing as w/o the patch to not break
working setups.
Signed-off-by: Daniel Ritz <daniel.ritz@gmx.ch>
Cc: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
In some cases, especially on modern laptops with a lot of PCI and
cardbus bridges, we're unable to assign correct secondary/subordinate
bus numbers to all cardbus bridges due to BIOS limitations unless
we are using "pci=assign-busses" boot option.
So some cardbus controllers may not have attached subordinate pci_bus
structure, and yenta driver must cope with it - just ignore such cardbus
bridges.
For example, see https://bugzilla.novell.com/show_bug.cgi?id=113778
Signed-off-by: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
More visible user information of scheduled feature removal.
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Add a devname parameter to the pcmcia_device structure, fills it with
"pcmcia<bus_id>" in pcmcia_device_add, and passes it to request_irq in
pcmcia_request_irq.
Signed-off-by: Brice Goglin <Brice.Goglin@ens-lyon.org>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This adds a socket driver for the OMAP CF controller; it's currently in use on
OSK boards.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
config_t->Vpp1, Vpp2 and Vcc are never read, so remove them.
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
client_t and CLIENT_MAGIC are unused, so remove them
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
extend cb_writel(), exca_writeb(), exca_writel() to do a read[lb]() after
the write[lb]() to avoid possible problem with PCI write posting.
Seems to fix Bug #5061.
Signed-off-by: Daniel Ritz <daniel.ritz@gmx.ch>
Cc: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
multifunction cards need to have the same irq assigned to both functions.
the code tries that but fails because ret is still set to CS_IN_USE which
results in the function having the CB irq assigned. yenta_set_socket then
just changes the irq routing to use the PCI interrupt but the first
functions irq handler is registered on an ISA interrupt. boom.
Signed-off-by: Daniel Ritz <daniel.ritz@gmx.ch>
Cc: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
- thread_done should only be completed when the wait_queue is installed.
- all wake up conditions should be checked before schedule()
this fixes a hang of rmmod in the sequence modprobe yenta_socket; rmmod
yenta_socket as reported by Andreas Steinmetz. w/o this rmmod yenta_socket
can hang on wait_for_completion() in pcmcia_unregister_socket()
Signed-off-by: Daniel Ritz <daniel.ritz@gmx.ch>
Cc: Dominik Brodowski <linux@brodo.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Share code between setup-bus.c and yenta_socket.c: use the write-out code of
resources to the bridge also in yenta_socket.c, as it provides useful debug
output. In addition, it fixes the bug that the CPU-centric resource view
might need to be transferred to the PCI-centric view: setup-bus.c does that,
while yenta-socket.c did not.
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This patch reduces the stack footprint of pcmcia_device_query() from 416 bytes
to 36 bytes.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
ToPIC95 brides (and maybe some other too) require to use the ExCA registers
to power up the socket if a 16bit card is pluged. allow socket drivers to
set a flag so that yenta does just that. also clean up yenta_get_status()
a bit to use the new yenta_get_power() function.
Side note: ToPIC97 bridges (at least in Rev.5 i have) don't require this.
Ryan Underwood <nemesis-lists@icequake.net> said:
According to the mail that David Hinds received from a Toshiba engineer,
ToPIC95 and 97 do require this, and ToPIC100 does not. Maybe you have a
later revision.
For all chips, 16-bit cards can be enabled through ExCA. So doesn't it
make sense just to make this the default behavior for all Toshiba chips,
to avoid corner cases showing up later?
Daniel responded:
I disagree with ryan to change anything for topic97 bridges. they work.
and I couldn't find (read google) any report of a topic97 breaking on
applying power with the CB registers.
I'm having several toshba notebooks at work (and home) with topic95,97,100
bridges. Only the ones with a topic95 didn't work.
Signed-off-by: Daniel Ritz <daniel.ritz@gmx.ch>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Patch from Richard Purdie
This patch updates the PCMCIA pxa2xx_sharpsl driver to support multiple scoop
devices by adding a scoop to pcmcia slot mapping structure. It adds platform
support for poodle, is known to work on spitz (which is dual slot) and
should also support collie with a minor amount of further work.
Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Patch from Richard Purdie
This change makes the soc pcmcia interfaces available earlier in the
boot process meaning devices like CF microdrives can be used for the
root filesystem.
Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
In yenta_socket, we default to using the resource setting of the CardBus
bridge. However, this is a PCI-bus-centric view of resources and thus needs
to be converted to generic resources first. Therefore, add a call to
pcibios_bus_to_resource() call in between. This function is a mere wrapper on
x86 and friends, however on some others it already exists, is added in this
patch (alpha, arm, ppc, ppc64) or still needs to be provided (parisc -- where
is its pcibios_resource_to_bus() ?).
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Recent changes (well, dating from 12 July) have broken cardbus on my
powerbook: I get 3 messages saying "no resource of type xxx available,
trying to continue", and if I plug in my wireless card, it complains
that there are no resources allocated to the card. This all worked in
2.6.12.
Looking at the code in yenta_socket.c, function yenta_allocate_res,
it's obvious what is wrong: if we get to line 639 (i.e. there wasn't a
usable preassigned resource), we will always flow through to line 668,
which is the printk that I was seeing, even if a resource was
successfully allocated. It looks to me as though there should be a
return statement after the two config_writel's in each of the 3
branches of the if statements, so that the function returns after
successfully setting up the resource.
The patch below adds these return statements, and with this patch,
cardbus works on my powerbook once again.
Signed-off-by: Paul Mackerras <paulus@samba.org>
Acked-by: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
The ordering of setting and clearing device_add_pending went wrong on some
occasions, causing multifunction cards only to be handled correctly on the
first insertion, not on subsequent ones.
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
ACPI is wrong. Devices should not release their IRQ's on suspend and
re-aquire them on resume. ACPI should just re-init the IRQ controller
instead of breaking most drivers very subtly.
Breakage reported by Hugh Dickins <hugh@veritas.com>
Undo: d8c4b4195c
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Older O2Micro bridges have problems with both read prefetch and write burst
depending on the combination of the chipset, bridge, cardbus card. safest is
to disable read prefetch and write burst on those old bridges.
Signed-off-by: Daniel Ritz <daniel.ritz@gmx.ch>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Debugging and description from: Noah Misch <noah@cs.caltech.edu>
When a driver calls pcmcia_request_irq with IRQ_HANDLE_PRESENT unset, it looks
for an open IRQ by request_irq()ing with a dummy handler and NULL dev_info.
free_irq uses dev_info as a key for identifying the handler to free among
those sharing an IRQ, so request_irq returns -EINVAL if dev_info is NULL and
the IRQ may be shared. That unknown error code is the -EINVAL.
It looks like only pcnet_cs and axnet_cs are affected. Most other drivers let
pcmcia_request_irq install their interrupt handlers. sym53c500_cs requests
its IRQ manually, but it cannot share an IRQ.
The appended patch changes pcmcia_request_irq to pass an arbitrary, unique,
non-NULL dev_info with the dummy handler.
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Avoid double iounmap of one address, and disable cis_virt if set_mem_map
failed.
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Get the au1000 PCMCIA socket drivers to work.
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>