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>
There are two problems with the message about missing callback functions: it's
not written in correct English and it lacks newline at the end.
Signed-off-by: Pavel Roskin <proski@gnu.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>
Patch from Michael Gernoth
This patch lets the Jornada 720 PCMCIA-driver compile again. The
resulting driver has been tested on a Jornada with a CF-card, which
was mounted and accessed successfully.
Signed-off-by: Michael Gernoth <michael@gernoth.net>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
The current CardBus window allocation code in yenta_socket is unable to handle
the transparent PCI-bridge handling update in 2.6.13. We need to check _all_
resources of a given type to find the best one suitable for CardBus windows,
not just the first one.
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
If the CardBus windows were pre-configured and the CardBus bridge is behind a
transparent PCI-PCI bridge, pci_find_parent_resource() might return a
different resource than the real parent if it is called before the window is
determined. Therefore, move that call around.
Also fix return of value in void function.
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Drivers should do this:
.suspend()
pci_disable_device()
.resume()
pci_enable_device()
http://bugzilla.kernel.org/show_bug.cgi?id=3469
Signed-off-by: David Shaohua Li <shaohua.li@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
As a follow-up, we can allow the yenta-driver to be limited to PCMCIA
operation.
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
If probing for the correct interrupt fails on yenta bridges, the driver falls
back to polling for interrupt actions. However, CardBus cards cannot be used
then.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
As a follow-up, remove the inclusion of pcmcia/version.h in many files.
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>