History log of /drivers/pcmcia/yenta_socket.c
Revision Date Author Comments
2b2c5d8c1dff8ed42d6d841f56428c0ce2bd71b5 27-Dec-2011 Axel Lin <axel.lin@gmail.com> pcmcia: Convert to DEFINE_PCI_DEVICE_TABLE

Convert static struct pci_device_id *[] to static DEFINE_PCI_DEVICE_TABLE
tables. Also convert to use PCI_DEVICE macro for better readablity.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
90ab5ee94171b3e28de6bb42ee30b527014e0be7 13-Jan-2012 Rusty Russell <rusty@rustcorp.com.au> module_param: make bool parameters really bool (drivers & misc)

module_param(bool) used to counter-intuitively take an int. In
fddd5201 (mid-2009) we allowed bool or int/unsigned int using a messy
trick.

It's time to remove the int/unsigned int option. For this version
it'll simply give a warning, but it'll break next kernel version.

Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
631dd1a885b6d7e9f6f51b4e5b311c2bb04c323c 18-Oct-2010 Justin P. Mattock <justinmattock@gmail.com> Update broken web addresses in the kernel.

The patch below updates broken web addresses in the kernel

Signed-off-by: Justin P. Mattock <justinmattock@gmail.com>
Cc: Maciej W. Rozycki <macro@linux-mips.org>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Finn Thain <fthain@telegraphics.com.au>
Cc: Randy Dunlap <rdunlap@xenotime.net>
Cc: Matt Turner <mattst88@gmail.com>
Cc: Dimitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Mike Frysinger <vapier.adi@gmail.com>
Acked-by: Ben Pfaff <blp@cs.stanford.edu>
Acked-by: Hans J. Koch <hjk@linutronix.de>
Reviewed-by: Finn Thain <fthain@telegraphics.com.au>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
1ac71e5a35eebee60cdcf15b3980bd94498f037b 29-Jul-2010 Dominik Brodowski <linux@dominikbrodowski.net> pcmcia: convert pcmcia_request_configuration to pcmcia_enable_device

pcmcia_enable_device() now replaces pcmcia_request_configuration().
Instead of config_req_t, all necessary flags are either passed as
a parameter to pcmcia_enable_device(), or (in rare circumstances)
set in struct pcmcia_device -> flags.

With the last remaining user of include/pcmcia/cs.h gone, remove
all references.

CC: netdev@vger.kernel.org
CC: linux-wireless@vger.kernel.org
CC: linux-ide@vger.kernel.org
CC: linux-usb@vger.kernel.org
CC: laforge@gnumonks.org
CC: linux-mtd@lists.infradead.org
CC: alsa-devel@alsa-project.org
CC: linux-serial@vger.kernel.org
CC: Jiri Kosina <jkosina@suse.cz>
CC: linux-scsi@vger.kernel.org
Acked-by: Gustavo F. Padovan <padovan@profusion.mobi> (for drivers/bluetooth)
Tested-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
ac8b422838046ffc26be4874a3cbae0d313f4209 21-Jul-2010 Dominik Brodowski <linux@dominikbrodowski.net> pcmcia: remove cs_types.h

Remove cs_types.h which is no longer needed: Most definitions aren't
used at all, a few can be made away with, and two remaining definitions
(typedefs, unfortunatley) may be moved to more specific places.

CC: linux-ide@vger.kernel.org
CC: linux-usb@vger.kernel.org
CC: laforge@gnumonks.org
CC: linux-mtd@lists.infradead.org
CC: alsa-devel@alsa-project.org
CC: linux-serial@vger.kernel.org
Acked-by: Marcel Holtmann <marcel@holtmann.org> (for drivers/bluetooth/)
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
4f2d364b315191bf9f8659f7d221acdf5506a989 20-May-2010 Justin P. Mattock <justinmattock@gmail.com> pcmcia: yenta_socket.c Remove extra #ifdef CONFIG_YENTA_TI

Seems pointless to have two #ifdef's with the same
CONFIG_YENTA_TI. Remove the extra one and
move CARDBUS_TYPE_ENE with the others.

[linux@dominikbrodowski.net: spelling & whitespace fixes]
Signed-off-by: Justin P. Mattock <justinmattock@gmail.com>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
02caa56e4b789b80ae7e0f0f0789f94b44ad32ef 21-May-2010 Dominik Brodowski <linux@dominikbrodowski.net> pcmcia: only keep saved I365_CSCINT flag if there is no PCI irq

Keeping the saved I365_CSCINT flag around breaks PCMCIA on some system,
and is only needed on a few systems to get PCMCIA to work. This patch
allows PCMCIA to work on both types, and it fixes
https://bugzilla.kernel.org/show_bug.cgi?id=16015

Reported-by: Justin P. Mattock <justinmattock@gmail.com>
CC: <stable@kernel.org>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
378b451ede192163780bb15b1ad0a913aa8ee4ae 30-Mar-2010 Dominik Brodowski <linux@dominikbrodowski.net> pcmcia: remove suspend-related comment from yenta_socket.c

While pci_set_power_state() is called by the PCI core
unconditionally on all PCI devices, it is not called on _any_
PCI bridge device. Therefore, it is not surprising calling
pci_set_power_state() on CardBus devices causes trouble.

CC: dbrownell@users.sourceforge.net
CC: gregkh@suse.de
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
5a0e3ad6af8660be21ca98a971cd00f331318c05 24-Mar-2010 Tejun Heo <tj@kernel.org> include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h

percpu.h is included by sched.h and module.h and thus ends up being
included when building most .c files. percpu.h includes slab.h which
in turn includes gfp.h making everything defined by the two files
universally available and complicating inclusion dependencies.

percpu.h -> slab.h dependency is about to be removed. Prepare for
this change by updating users of gfp and slab facilities include those
headers directly instead of assuming availability. As this conversion
needs to touch large number of source files, the following script is
used as the basis of conversion.

http://userweb.kernel.org/~tj/misc/slabh-sweep.py

The script does the followings.

* Scan files for gfp and slab usages and update includes such that
only the necessary includes are there. ie. if only gfp is used,
gfp.h, if slab is used, slab.h.

* When the script inserts a new include, it looks at the include
blocks and try to put the new include such that its order conforms
to its surrounding. It's put in the include block which contains
core kernel includes, in the same order that the rest are ordered -
alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
doesn't seem to be any matching order.

* If the script can't find a place to put a new include (mostly
because the file doesn't have fitting include block), it prints out
an error message indicating which .h file needs to be added to the
file.

The conversion was done in the following steps.

1. The initial automatic conversion of all .c files updated slightly
over 4000 files, deleting around 700 includes and adding ~480 gfp.h
and ~3000 slab.h inclusions. The script emitted errors for ~400
files.

2. Each error was manually checked. Some didn't need the inclusion,
some needed manual addition while adding it to implementation .h or
embedding .c file was more appropriate for others. This step added
inclusions to around 150 files.

3. The script was run again and the output was compared to the edits
from #2 to make sure no file was left behind.

4. Several build tests were done and a couple of problems were fixed.
e.g. lib/decompress_*.c used malloc/free() wrappers around slab
APIs requiring slab.h to be added manually.

5. The script was run on all .h files but without automatically
editing them as sprinkling gfp.h and slab.h inclusions around .h
files could easily lead to inclusion dependency hell. Most gfp.h
inclusion directives were ignored as stuff from gfp.h was usually
wildly available and often used in preprocessor macros. Each
slab.h inclusion directive was examined and added manually as
necessary.

6. percpu.h was updated not to include slab.h.

7. Build test were done on the following configurations and failures
were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
distributed build env didn't work with gcov compiles) and a few
more options had to be turned off depending on archs to make things
build (like ipr on powerpc/64 which failed due to missing writeq).

* x86 and x86_64 UP and SMP allmodconfig and a custom test config.
* powerpc and powerpc64 SMP allmodconfig
* sparc and sparc64 SMP allmodconfig
* ia64 SMP allmodconfig
* s390 SMP allmodconfig
* alpha SMP allmodconfig
* um on x86_64 SMP allmodconfig

8. percpu.h modifications were reverted so that it could be applied as
a separate patch and serve as bisection point.

Given the fact that I had only a couple of failures from tests on step
6, I'm fairly confident about the coverage of this conversion patch.
If there is a breakage, it's likely to be something in one of the arch
headers which should be easily discoverable easily on most builds of
the specific arch.

Signed-off-by: Tejun Heo <tj@kernel.org>
Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
d7646f7632549124fe70fec8af834c7c1246f365 15-Mar-2010 Dominik Brodowski <linux@dominikbrodowski.net> pcmcia: use dev_pm_ops for class pcmcia_socket_class

Instead of requiring PCMCIA socket drivers to call various functions
during their (bus) resume and suspend functions, register an own
dev_pm_ops for this class. This fixes several suspend/resume bugs
seen on db1xxx-ss, and probably on some other socket drivers, too.

With regard to the asymmetry with only _noirq suspend, but split up
resume, please see bug 14334 and commit 9905d1b411946fb3 .

Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
0d3a940de51c47a3d6322537c8dce925db755477 06-Mar-2010 Jens Künzer <Jens.Kuenzer@fpga.homeip.net> pcmcia: re-route Cardbus IRQ to ISA on ti1130 bridges if necessary

As the PCI irq pin of the ti1130 pcmcia bridge is not connected (at
least on some old IBM Thinkpad 760ED notebooks), the Cardbus IRQ has
to be routed to an ISA irq.

Part 3 of a series to allow the ISA irq to be used for Cardbus devices
if the socket's PCI irq is unusable.

[linux@dominikbrodowski.net: split up the original patch, commit message,
cleanup]

Signed-off-by: Jens Kuenzer <Jens.Kuenzer@fpga.homeip.net>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
ba8819e991ac507fcbfa080eacdff3e7eea4dc03 06-Mar-2010 Jens Künzer <Jens.Kuenzer@fpga.homeip.net> pcmcia: allow for cb_irq to differ from pci_dev's irq in yenta_socket

cb_irq is presumed to be the same as the pci_dev's irq. This won't be
true any more as soon as we allow the ISA irq to be used for Cardbus
devices. Therefore, use the pci_dev's irq explicitely whenever we
care about it.

Part 2 of a series to allow the ISA irq to be used for Cardbus devices
if the socket's PCI irq is unusable.

[linux@dominikbrodowski.net: split up the original patch, commit message]

Signed-off-by: Jens Kuenzer <Jens.Kuenzer@fpga.homeip.net>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
28ca8dd71fc170090edca62cb8129625d01b7760 06-Mar-2010 Jens Künzer <Jens.Kuenzer@fpga.homeip.net> pcmcia: honor saved flags in yenta_socket's I365_CSCINT register

Instead of overwriting the I365_CSCINT register, save the old value and
merely change the bits we care about.

Part 1 of a series to allow the ISA irq to be used for Cardbus devices
if the socket's PCI irq is unusable.

[linux@dominikbrodowski.net: split up the original patch, commit message]

Signed-off-by: Jens Kuenzer <Jens.Kuenzer@fpga.homeip.net>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
f3d4ae431d819200bb61e943cb23572b10744e93 02-Feb-2010 Michal Pecio <michal.pecio@gmail.com> yenta_socket: ENE CB712 CardBus bridge needs special treatment with Echo Audio Indigo soundcards

Indigos are well known for distortions when running on some buggy ENE
controllers. There is a workaround in the yenta driver, but for some
reason it isn't activated on CB712. However, I own a laptop with such
chip and it seems that it also is affected - I can clearly hear occasional
cracks, especially under heavy network load, and in Windows XP the card is
completely unusable.

This simple change fixed things for me.

Addresses http://bugzilla.kernel.org/show_bug.cgi?id=15191

[linux@dominikbrodowski.net: extend it to the other ENE bridges]
Signed-off-by: Michal Pecio <michal.pecio@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
89a74ecccd1f78e51faf6287e5c0e93a92ac096e 23-Feb-2010 Bjorn Helgaas <bjorn.helgaas@hp.com> PCI: add pci_bus_for_each_resource(), remove direct bus->resource[] refs

No functional change; this converts loops that iterate from 0 to
PCI_BUS_NUM_RESOURCES through pci_bus resource[] table to use the
pci_bus_for_each_resource() iterator instead.

This doesn't change the way resources are stored; it merely removes
dependencies on the fact that they're in a table.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
35169529093be3bbef70afd3c4125e35cece7e03 10-Jan-2010 Wolfram Sang <w.sang@pengutronix.de> pcmcia/yenta: add module parameter for O2 speedups

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>
471452104b8520337ae2fb48c4e61cd4896e025d 15-Dec-2009 Alexey Dobriyan <adobriyan@gmail.com> const: constify remaining dev_pm_ops

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
9fea84f46a821aa1ff2d034ffda8ad33bff48015 07-Dec-2009 Dominik Brodowski <linux@dominikbrodowski.net> pcmcia: CodingStyle fixes

Fix several CodingStyle issues in drivers/pcmcia/ . checkpatch.pl no longer
reports errors in the PCMCIA core. The remaining warnings mostly relate to
wrong indent -- PCMCIA historically used 4 spaces --, to lines over 80
characters and to hundreds of typedefs. The cleanup of those will follow
in the future.

Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
9905d1b411946fb3fb228e8c6529fd94afda8a92 03-Nov-2009 Rafael J. Wysocki <rjw@sisk.pl> PM / yenta: Split resume into early and late parts (rev. 4)

Commit 0c570cdeb8fdfcb354a3e9cd81bfc6a09c19de0c
(PM / yenta: Fix cardbus suspend/resume regression) caused resume to
fail on systems with two CardBus bridges. While the exact nature
of the failure is not known at the moment, it can be worked around by
splitting the yenta resume into an early part, executed during the
early phase of resume, that will only resume the socket and power it
up if there was a card in it during suspend, and a late part,
executed during "regular" resume, that will carry out all of the
remaining yenta resume operations.

Fixes http://bugzilla.kernel.org/show_bug.cgi?id=14334, which is a
listed regression from 2.6.31.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Acked-by: Dominik Brodowski <linux@dominikbrodowski.net>
Reported-by: Stephen J. Gowdy <gowdy@cern.ch>
Tested-by: Jose Marino <braket@hotmail.com>
0c570cdeb8fdfcb354a3e9cd81bfc6a09c19de0c 29-Sep-2009 Rafael J. Wysocki <rjw@sisk.pl> PM / yenta: Fix cardbus suspend/resume regression

Since 2.6.29 the PCI PM core have been restoring the standard
configuration registers of PCI devices in the early phase of
resume. In particular, PCI devices without drivers have been handled
this way since commit 355a72d75b3b4f4877db4c9070c798238028ecb5
(PCI: Rework default handling of suspend and resume). Unfortunately,
this leads to post-resume problems with CardBus devices which cannot
be accessed in the early phase of resume, because the sockets they
are on have not been woken up yet at that point.

To solve this problem, move the yenta socket resume to the early
phase of resume and, analogously, move the suspend of it to the late
phase of suspend. Additionally, remove some unnecessary PCI code
from the yenta socket's resume routine.

Fixes http://bugzilla.kernel.org/show_bug.cgi?id=13092, which is a
post-2.6.28 regression.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Reported-by: Florian <fs-kernelbugzilla@spline.de>
Cc: stable@kernel.org
827b4649d4626bf97b203b4bcd69476bb9b4e760 29-Sep-2009 Rafael J. Wysocki <rjw@sisk.pl> PM / PCMCIA: Drop second argument of pcmcia_socket_dev_suspend()

pcmcia_socket_dev_suspend() doesn't use its second argument, so it
may be dropped safely.

This change is necessary for the subsequent yenta suspend/resume fix.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Cc: stable@kernel.org
734f3fa18d460995c8621cf2331b7fba88c977ce 22-Sep-2009 Mike Frysinger <vapier@gentoo.org> pcmcia: yenta: add missing __devexit marking

The remove member of the pci_driver yenta_cardbus_driver uses
__devexit_p(), so the remove function itself should be marked with
__devexit. Even more so considering the probe function is marked with
__devinit.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Cc: Daniel Ritz <daniel.ritz-ml@swissonline.ch>
Cc: Dominik Brodowski <linux@dominikbrodowski.net>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
852710d9fd9f2e59fcec65cc701867db4e801bc7 19-Jun-2009 Matthew Wilcox <willy@linux.intel.com> yenta: Use pci_claim_resource

Instead of open-coding pci_find_parent_resource and request_resource,
just call pci_claim_resource.

Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
dd797d81d3d7da31a50031f2741b93327ed22260 02-Aug-2008 Dominik Brodowski <linux@dominikbrodowski.net> pcmcia: use dev_printk and dev_dbg in yenta_socket

Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
78187865efa5aec5a28a200a39153f98d8f38d4d 11-Dec-2007 Randy Dunlap <randy.dunlap@oracle.com> pcmcia: fix kernel-doc comments

Fix kernel-doc comments in drivers/pcmcia/:

- ti113x.h does not contain kernel-doc, so don't use /** to begin a doc
comment
- yenta_socket.c: remove /** on non-kernel-doc comments;
escape the ':' in an "http:" comment so that it won't be treated as a
section heading;
- cs.c: remove /** on non-kernel-doc comments & add function parameter info
- ds.c: fix function parameter info

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
cd354f1ae75e6466a7e31b727faede57a1f89ca5 14-Feb-2007 Tim Schmielau <tim@physik3.uni-rostock.de> [PATCH] remove many unneeded #includes of sched.h

After Al Viro (finally) succeeded in removing the sched.h #include in module.h
recently, it makes sense again to remove other superfluous sched.h includes.
There are quite a lot of files which include it but don't actually need
anything defined in there. Presumably these includes were once needed for
macros that used to live in sched.h, but moved to other header files in the
course of cleaning it up.

To ease the pain, this time I did not fiddle with any header files and only
removed #includes from .c-files, which tend to cause less trouble.

Compile tested against 2.6.20-rc2 and 2.6.20-rc2-mm2 (with offsets) on alpha,
arm, i386, ia64, mips, powerpc, and x86_64 with allnoconfig, defconfig,
allmodconfig, and allyesconfig as well as a few randconfigs on x86_64 and all
configs in arch/arm/configs on arm. I also checked that no new warnings were
introduced by the patch (actually, some warnings are removed that were emitted
by unnecessarily included header files).

Signed-off-by: Tim Schmielau <tim@physik3.uni-rostock.de>
Acked-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
873733188a019acdb7fa253011cbdc0a8afd97f3 12-Sep-2006 Greg Kroah-Hartman <gregkh@suse.de> Driver core: convert pcmcia code to use struct device

Converts from using struct "class_device" to "struct device" making
everything show up properly in /sys/devices/ with symlinks from the
/sys/class directory.

Cc: <linux-pcmcia@lists.infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
4deb7c1ed2b622b565c5330b475adc5a6cea30da 20-Oct-2006 Jeff Garzik <jeff@garzik.org> [PATCH] PCMCIA: handle sysfs, PCI errors

Handle sysfs and PCI errors correctly.

Signed-off-by: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
f237de58b13bf65ba2f7fab896daacb92ae7ddef 20-Oct-2006 Alexey Dobriyan <adobriyan@gmail.com> [PATCH] CONFIG_PM=n slim: drivers/pcmcia/*

Remove some code which is unneeded if CONFIG_PM=n.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
7d12e780e003f93433d49ce78cfedf4b4c52adc5 05-Oct-2006 David Howells <dhowells@redhat.com> IRQ: Maintain regs pointer globally rather than passing to IRQ handlers

Maintain a per-CPU global "struct pt_regs *" variable which can be used instead
of passing regs around manually through all ~1800 interrupt handlers in the
Linux kernel.

The regs pointer is used in few places, but it potentially costs both stack
space and code to pass it around. On the FRV arch, removing the regs parameter
from all the genirq function results in a 20% speed up of the IRQ exit path
(ie: from leaving timer_interrupt() to leaving do_IRQ()).

Where appropriate, an arch may override the generic storage facility and do
something different with the variable. On FRV, for instance, the address is
maintained in GR28 at all times inside the kernel as part of general exception
handling.

Having looked over the code, it appears that the parameter may be handed down
through up to twenty or so layers of functions. Consider a USB character
device attached to a USB hub, attached to a USB controller that posts its
interrupts through a cascaded auxiliary interrupt controller. A character
device driver may want to pass regs to the sysrq handler through the input
layer which adds another few layers of parameter passing.

I've build this code with allyesconfig for x86_64 and i386. I've runtested the
main part of the code on FRV and i386, though I can't test most of the drivers.
I've also done partial conversion for powerpc and MIPS - these at least compile
with minimal configurations.

This will affect all archs. Mostly the changes should be relatively easy.
Take do_IRQ(), store the regs pointer at the beginning, saving the old one:

struct pt_regs *old_regs = set_irq_regs(regs);

And put the old one back at the end:

set_irq_regs(old_regs);

Don't pass regs through to generic_handle_irq() or __do_IRQ().

In timer_interrupt(), this sort of change will be necessary:

- update_process_times(user_mode(regs));
- profile_tick(CPU_PROFILING, regs);
+ update_process_times(user_mode(get_irq_regs()));
+ profile_tick(CPU_PROFILING);

I'd like to move update_process_times()'s use of get_irq_regs() into itself,
except that i386, alone of the archs, uses something other than user_mode().

Some notes on the interrupt handling in the drivers:

(*) input_dev() is now gone entirely. The regs pointer is no longer stored in
the input_dev struct.

(*) finish_unlinks() in drivers/usb/host/ohci-q.c needs checking. It does
something different depending on whether it's been supplied with a regs
pointer or not.

(*) Various IRQ handler function pointers have been moved to type
irq_handler_t.

Signed-Off-By: David Howells <dhowells@redhat.com>
(cherry picked from 1b16e7ac850969f38b375e511e3fa2f474a33867 commit)
dace145374b8e39aeb920304c358ab5e220341ab 02-Jul-2006 Thomas Gleixner <tglx@linutronix.de> [PATCH] irq-flags: misc drivers: Use the new IRQF_ constants

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
66005216074337e3925514456175b202f17e23ef 06-Jun-2006 Randy Dunlap <rdunlap@xenotime.net> [PATCH] pcmcia: fix kernel-doc function name

Fix kernel-doc function name spello.

Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
59e35ba1257903eaff5203f62f77554da02f5b63 09-May-2006 Alex Williamson <alex.williamson@hp.com> [PATCH] pcmcia: TI PCIxx12 CardBus controller support

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>
b435261b1e09bb2bb6acc4abbc7f6e3d885f9e62 30-May-2006 Bernhard Kaindl <bk@suse.de> [PATCH] yenta: fix hidden PCI bus numbers

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>
d250a4810402ec68f64802b66340a0e70c61cbd3 06-Mar-2006 Daniel Ritz <daniel.ritz-ml@swissonline.ch> [PATCH] yenta: do power-up only after socket is configured

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>
8084b372adac9c24ff7abdd939b2e8816e7b88a3 11-Dec-2005 Dominik Brodowski <linux@dominikbrodowski.net> [PATCH] pcmcia: kzalloc conversion

Convert users of kmalloc and memset to kzalloc

Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
63e7ebd06402951bc8863ba5b7bc9b9f42044849 03-Nov-2005 Daniel Ritz <daniel.ritz-ml@swissonline.ch> [PATCH] yenta: make bridge specific init code configurable

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>
9da4bc6d6a38c1c3d850c046d0aee324c1a2e52a 12-Nov-2005 Dominik Brodowski <linux@dominikbrodowski.net> [PATCH] pcmcia: remove get_socket callback

The .get_socket callback is never used by the PCMCIA core, therefore remove
it.

Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
e4115805cf2020da94e8bd1296243605cda487ff 20-Sep-2005 Daniel Ritz <daniel.ritz@gmx.ch> [PATCH] yenta: optimize interrupt handler

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>
030ee39c0fef49d7dcd32e71b1ca98fcc23e2a72 28-Oct-2005 Linus Torvalds <torvalds@g5.osdl.org> pcmcia: add socket register data to sysfs for yenta devices

It's simple, and it's a good debugging aid.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
f9cb8b71e7d6c858b1afe665fd0a09169fdf4390 25-Sep-2005 Daniel Ritz <daniel.ritz@gmx.ch> [PATCH] yenta: more ENE bridges

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>
6c1a10dba92cbacb58563f5eacf93807125b488a 20-Sep-2005 Daniel Ritz <daniel.ritz@gmx.ch> [PATCH] yenta: add support for more TI bridges

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>
8e5d17ebe41eb98a538ef13aad36da5136701aab 08-Sep-2005 Dominik Brodowski <linux@dominikbrodowski.net> [PATCH] yenta: tiny cleanup

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>
a413c09094e4df714c274690928dcf8125daf7e8 24-Aug-2005 Daniel Ritz <daniel.ritz@gmx.ch> [PATCH] yenta: don't mess with bridge control register

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>
8c3520d4eb3b1bbf2e45fbae8dcfb8db06d5e775 22-Aug-2005 Daniel Ritz <daniel.ritz@gmx.ch> [PATCH] yenta: auto-tune EnE bridges for CardBus cards

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>
5a23f34798f15838fe1b7f0fd7e5be388e08c2b2 14-Sep-2005 Linus Torvalds <torvalds@g5.osdl.org> Fix yenta error message when unable to find a bus assignment

And mention 'pci=assign-busses' as a possible fix.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
c7fb0b35ada6e0e691e70af5591a2006fbec85b5 14-Sep-2005 Ivan Kokshaysky <ink@jurassic.park.msu.ru> [PATCH] yenta oops fix

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>
c8751e4c0bd32ecb76434240a56a087fa223280c 09-Sep-2005 Daniel Ritz <daniel.ritz@gmx.ch> [PATCH] pcmcia/yenta: avoid PCI write posting problem

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>
b3743fa4442fc172e950ff0eaf6aa96e7d5ce9be 09-Sep-2005 Dominik Brodowski <linux@dominikbrodowski.net> [PATCH] yenta: share code with PCI core

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>
ea2f1590aaffbd02f1850c19c3895ff4d092c6e0 07-Sep-2005 Daniel Ritz <daniel.ritz@gmx.ch> [PATCH] yenta: make ToPIC95 bridges work with 16bit cards

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>
43c34735524d5b1c9b9e5d63b49dd4c1b394bde4 05-Aug-2005 Dominik Brodowski <linux@dominikbrodowski.net> [PATCH] pci and yenta: pcibios_bus_to_resource

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>
f7d1d23c301e0ce82c801f3b5800be6341752a1f 02-Aug-2005 Paul Mackerras <paulus@samba.org> [PATCH] Obvious bugfix for yenta resource allocation

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>
889371f61fd5bb914d0331268f12432590cf7e85 30-Jul-2005 Linus Torvalds <torvalds@g5.osdl.org> Revert "yenta free_irq on suspend"

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: d8c4b4195c7d664baf296818bf756775149232d3

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
90158b83204842c0108d744326868d91cc9c4dfd 24-Jul-2005 Rafael J. Wysocki <rjwysocki@sisk.pl> [ACPI] fix resume issues on Asus L5D

http://bugzilla.kernel.org/show_bug.cgi?id=4416

Signed-off-by: Rafael J. Wysocki <rjwysocki@sisk.pl>
Signed-off-by: Len Brown <len.brown@intel.com>
d8c4b4195c7d664baf296818bf756775149232d3 28-Jul-2005 Daniel Ritz <daniel.ritz@gmx.ch> [PATCH] yenta: free_irq() on suspend.

Resume doesn't seem to work without.

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>
eb0a90b4970d667e9ae9df538710f12b8e78e442 12-Jul-2005 Dominik Brodowski <linux@dominikbrodowski.net> [PATCH] yenta: allocate resource fixes

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>
278798357d4a8658067dc9ac399d8ffba8389f03 12-Jul-2005 Dominik Brodowski <linux@dominikbrodowski.net> [PATCH] yenta: same resources in same structs

drivers/pci/setup-bus.c enumerates the CardBus windows (bus->resources[])

Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
862104e56329babf0b9571281e9516fe6259dd17 12-Jul-2005 Dominik Brodowski <linux@dominikbrodowski.net> [PATCH] yenta: fix parent resource determination

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>
d58da590451cf6ae75379a2ebf96d3afb8d810d8 18-Mar-2005 David Shaohua Li <shaohua.li@intel.com> [ACPI] S3 Suspend to RAM: fix driver suspend/resume methods

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>
5bc6b68a103a6f4055890b5127ddca3a322751b0 08-Jul-2005 Russell King <rmk+pcmcia@arm.linux.org.uk> [PATCH] yenta: no CardBus if IRQ fails

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>
44670d2b50efd2443c3810239d6ea3fd02f8ef64 08-Jul-2005 Dominik Brodowski <linux@dominikbrodowski.net> [PATCH] pcmcia: remove references to pcmcia/version.h

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>
7925407aa02653ba462b1d8b0b1229b99aee5411 28-Jun-2005 Ivan Kokshaysky <ink@jurassic.park.msu.ru> [PATCH] pci: yenta cardbus fix

On Mon, Jun 20, 2005 at 07:15:34PM +1000, Grant Coady wrote:
> Yenta: CardBus bridge found at 0000:00:0b.0 [1179:0001]
> yenta 0000:00:0b.0: Preassigned resource 0 busy, reconfiguring...

In -mm1 the cardbus resources might be assigned in
pci_assign_unassigned_resources() pass. From your dmesg:
PCI: Bus 2, cardbus bridge: 0000:00:0b.0
IO window: 00002000-00002fff
IO window: 00003000-00003fff
PREFETCH window: 12000000-13ffffff
MEM window: 14000000-15ffffff

Then yenta_allocate_res() tries to assign these resources again and,
naturally, fails.

This adds check for already assigned cardbus resources.

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
fa912bcb06d5dc9525d8912a145db2bf4b7668c5 23-Jun-2005 Daniel Ritz <daniel.ritz@gmx.ch> [PATCH] yenta TI: turn off interrupts during card power-on #2

- make boot-up card recognition more reliable (ie. redo interrogation
always if there is no valid 'card inserted' state) (and yes, i saw it
happening on an o2micro controller that both CB_CBARD and CB_16BITCARD
bits were set at the same time)

- also redo interrogation before probing the ISA interrupts. it's safer
to do the probing with the socket in a clean state.

- make card insert detect more reliable. yenta_get_status() now returns
SS_PENDING as long as the card is not completley inserted and one of the
voltage bits is set. also !CB_CBARD doesn't mean CB_16BITCARD. there is
CB_NOTACARD as well, so make an explicit check for CB_16BITCARD.

- for TI bridges: disable IRQs during power-on. in all-serial and tied
interrupt mode the interrupts are always disabled for single-slot
controllers. for two-slot contollers the disabling is only done when the
other slot is empty. to force disabling there is a new module parameter
now: pwr_irqs_off=Y (which is a regression for working setups. that's
why it's an option, only use when required)

- modparm to disable ISA interrupt probing (isa_probe, defaults to on)

- remove unneeded code/cleanups (ie. merge yenta_events() into
yenta_interrupts())

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>
1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 17-Apr-2005 Linus Torvalds <torvalds@ppc970.osdl.org> Linux-2.6.12-rc2

Initial git repository build. I'm not bothering with the full history,
even though we have it. We can create a separate "historical" git
archive of that later if we want to, and in the meantime it's about
3.2GB when imported into git - space that would just make the early
git days unnecessarily complicated, when we don't have a lot of good
infrastructure for it.

Let it rip!