Add some information useful for PCMCIA device driver authors to
Documentation/pcmcia/, and reference it in dmesg in case of hash mismatches.
Also add a reference to pcmciautils to Documentation/Changes. With recent
changes, you don't need to concern yourself with pcmcia-cs even if you have
PCMCIA hardware, so the example above the list needed to be adapted as well.
Add pcmcia_device_id table to pcmciamtd. The binding of anonymus cards (i.e.
those who do neither report MANFID, CARDID, FUNCID nor product strings) is
protected by a new config option.
This patch contains the following cleanups:
- make needlessly global code static
- remove the following unneeded EXPORT_SYMBOL's:
- ds.c: pcmcia_report_error
- ds.c: pcmcia_bus_type
Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
[PATCH] pcmcia: request CIS via firmware interface
Use the firmware method to load replacement CIS tables. It is recommended
that the /lib/firmware/cis/ points to /etc/pcmcia/cis or the other way round
so that both old-style cardmgr and new-style hotplug/firmware can access these
"overwrite" files
The "func_id"-based matching is very fuzzy and can lead to false positives.
Therefore, it should be tried to avoid relying on these matches. Until
most/all existing func_id-based matches are replaced by
manf_id/card_id/prod_id matches (a patch which will ask to send the
appropriate card information to the PCMCIA mailing list will be added once
other, more pressing issues are adressed), we need to emulate cardmgr
behaviour by allowing func_id matches if no manf_id/card_id/prod_id match
occurs. This can only be done in userspace because of modules possibly loaded
with long delays. So, add a per-device sysfs file for this purpose.
If a card doesn't provide _any_ information about itself, assume it is a
so-called "anonymous" card. pcmciamtd will bind to it if it is configured to
do so.
The one thing which surprises me in this patch that cis->Length needs to be
set to count+1. Without it, it doesn't work, but with it, it doesn't make
sense to me.
Ivan Kokshaysky [Mon, 27 Jun 2005 23:28:02 +0000 (16:28 -0700)]
[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>
Linus Torvalds [Tue, 28 Jun 2005 00:49:45 +0000 (17:49 -0700)]
Commit the manual part of the input layer merge.
git did actually warn me about the fact that I hadn't actually done an
"update-cache" on these two files, but the warning was at the bottom of
a list of all the files that _did_ change in the merge, so I never
noticed. My bad.
Alan Cox [Mon, 27 Jun 2005 22:24:31 +0000 (15:24 -0700)]
[PATCH] ide: sensible probing for PCI systems
Old ISA/VESA systems sometimes put tertiary IDE controllers at addresses
0x1e8, 0x168, 0x1e0 or 0x160. Linux thus probes these addresses on x86
systems. Unfortunately some PCI systems now use these addresses for other
purposes which leads to users seeing minute plus hangs during boot or even
crashes.
The following patch (again has been in Fedora for a while) only probes the
obscure legacy ISA ports on machinea that are pre-PCI. This seems to keep
everyone happy and if there is someone with that utterly weird corner case
the ide= command line still provides a get out of jail card.
Unsurprisingly we've not found anyone so affected.
Signed-off-by: Alan Cox <alan@redhat.com> Acked-by: Bartlomiej Zolnierkiewicz <B.Zolnierkiewicz@elka.pw.edu.pl> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Alan Cox [Mon, 27 Jun 2005 22:24:30 +0000 (15:24 -0700)]
[PATCH] ide: it8212 backport for Bartlomiej IDE
This lets you throw out the iteraid stuff that has ended up back in due
to stupid goings on in the IDE world. Its the same heavily tested code
shipped in Fedora/Red Hat products but without the other dependancies on
the Bartlomiej IDE layer.
Pre-requisite: the ide-disk patch I sent to handle pure LBA devices.
Obviously you lose things like hot unplug with the Bartlomiej IDE layer
at the moment but that won't matter to most users.
The patch does the following
- Add IT8211/12 to pci_ids.h
- Add Makefile/Kconfig entry
- Add it8212 driver
No core IDE code is touched by this diff
Embedded system testing and the ability to force raid mode off by David
Howells
Made possible by the ite reference code, documentation and also several
clarifications and pieces of assistance provided by ITE themselves
Signed-off-by: Alan Cox <alan@redhat.com> Acked-by: Bartlomiej Zolnierkiewicz <B.Zolnierkiewicz@elka.pw.edu.pl> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Alan Cox [Mon, 27 Jun 2005 22:24:29 +0000 (15:24 -0700)]
[PATCH] ide: fix crashes with hotplug serverworks
You can't install the base kernel on a Stratus box because of the overuse of
__init. Affects both IDE layers identically. It isn't the only misuser of
__init so more review of other drivers (or fixing ide_register code to know
about hotplug v non-hotplug chipsets) would be good.
Original issue found by Stratus and their patch was the inspiration for this
trivial one.
Signed-off-by: Alan Cox <alan@redhat.com> Acked-by: Bartlomiej Zolnierkiewicz <B.Zolnierkiewicz@elka.pw.edu.pl> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Alan Cox [Mon, 27 Jun 2005 22:24:27 +0000 (15:24 -0700)]
[PATCH] ide: fix the HPT366 driver layer
The highpoint driver is unreadable, buggy and crashes on some chipsets. The
-ac one is more readable (but not ideal) and doesn't crash all over the place.
Been in Fedora for some time.
Backported from the Fedora one to the old Bartlomiej IDE core. No other
dependencies.
Signed-off-by: Alan Cox <alan@redhat.com> Acked-by: Bartlomiej Zolnierkiewicz <B.Zolnierkiewicz@elka.pw.edu.pl> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Alan Cox [Mon, 27 Jun 2005 22:24:26 +0000 (15:24 -0700)]
[PATCH] ide: ide-generic, allow for capture of other unsupported devices
The ide-generic driver gives you DMA at bios tuned speed so can actually run a
lot of unsupported devices quite well. It has a pci table so that it doesn't
grab disks owned by other drivers but no way to override this. The patch adds
an option ide-generic-all which makes the driver grab everything going that is
IDE class.
The diff is messy because I put the special case as case 0 to make the if
conditional and long term maintenance easier.
This has been in Fedora for some time.
Signed-off-by: Alan Cox <alan@redhat.com> Acked-by: Bartlomiej Zolnierkiewicz <B.Zolnierkiewicz@elka.pw.edu.pl> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Rusty Lynch [Mon, 27 Jun 2005 22:17:15 +0000 (15:17 -0700)]
[PATCH] kprobes/ia64: refuse inserting kprobe on slot 1
Without the ability to atomically write 16 bytes, we can not update the
middle slot of a bundle, slot 1, unless we stop the machine first. This
patch will ensure the ability to robustly insert and remove a kprobe by
refusing to insert a kprobe on slot 1 until a mechanism is in place to
safely handle this case.
Rusty Lynch [Mon, 27 Jun 2005 22:17:15 +0000 (15:17 -0700)]
[PATCH] Return probe redesign: ppc64 specific implementation
The following is a patch provided by Ananth Mavinakayanahalli that implements
the new PPC64 specific parts of the new function return probe design.
NOTE: Since getting Ananth's patch, I changed trampoline_probe_handler()
to consume each of the outstanding return probem instances (feedback
on my original RFC after Ananth cut a patch), and also added the
arch_init() function (adding arch specific initialization.) I have
cross compiled but have not testing this on a PPC64 machine.
Changes include:
* Addition of kretprobe_trampoline to act as a dummy function for instrumented
functions to return to, and for the return probe infrastructure to place
a kprobe on on, gaining control so that the return probe handler
can be called, and so that the instruction pointer can be moved back
to the original return address.
* Addition of arch_init(), allowing a kprobe to be registered on
kretprobe_trampoline
* Addition of trampoline_probe_handler() which is used as the pre_handler
for the kprobe inserted on kretprobe_implementation. This is the function
that handles the details for calling the return probe handler function
and returning control back at the original return address
* Addition of arch_prepare_kretprobe() which is setup as the pre_handler
for a kprobe registered at the beginning of the target function by
kernel/kprobes.c so that a return probe instance can be setup when
a caller enters the target function. (A return probe instance contains
all the needed information for trampoline_probe_handler to do it's job.)
* Hooks added to the exit path of a task so that we can cleanup any left-over
return probe instances (i.e. if a task dies while inside a targeted function
then the return probe instance was reserved at the beginning of the function
but the function never returns so we need to mark the instance as unused.)
Rusty Lynch [Mon, 27 Jun 2005 22:17:12 +0000 (15:17 -0700)]
[PATCH] Return probe redesign: ia64 specific implementation
The following patch implements function return probes for ia64 using
the revised design. With this new design we no longer need to do some
of the odd hacks previous required on the last ia64 return probe port
that I sent out for comments.
Note that this new implementation still does not resolve the problem noted
by Keith Owens where backtrace data is lost after a return probe is hit.
Changes include:
* Addition of kretprobe_trampoline to act as a dummy function for instrumented
functions to return to, and for the return probe infrastructure to place
a kprobe on on, gaining control so that the return probe handler
can be called, and so that the instruction pointer can be moved back
to the original return address.
* Addition of arch_init(), allowing a kprobe to be registered on
kretprobe_trampoline
* Addition of trampoline_probe_handler() which is used as the pre_handler
for the kprobe inserted on kretprobe_implementation. This is the function
that handles the details for calling the return probe handler function
and returning control back at the original return address
* Addition of arch_prepare_kretprobe() which is setup as the pre_handler
for a kprobe registered at the beginning of the target function by
kernel/kprobes.c so that a return probe instance can be setup when
a caller enters the target function. (A return probe instance contains
all the needed information for trampoline_probe_handler to do it's job.)
* Hooks added to the exit path of a task so that we can cleanup any left-over
return probe instances (i.e. if a task dies while inside a targeted function
then the return probe instance was reserved at the beginning of the function
but the function never returns so we need to mark the instance as unused.)
Rusty Lynch [Mon, 27 Jun 2005 22:17:10 +0000 (15:17 -0700)]
[PATCH] Return probe redesign: x86_64 specific changes
The following patch contains the x86_64 specific changes for the new
return probe design. Changes include:
* Removing the architecture specific functions for querying a return probe
instance off a stack address
* Complete rework onf arch_prepare_kretprobe() and trampoline_probe_handler()
* Removing trampoline_post_handler()
* Adding arch_init() so that now we handle registering the return probe
trampoline instead of kernel/kprobes.c doing it
NOTE:
Note that with this new design, the dependency on calculating a pointer to
the task off the stack pointer no longer exist (resolving the problem of
interruption stacks as pointed out in the original feedback to this port.)
Rusty Lynch [Mon, 27 Jun 2005 22:17:09 +0000 (15:17 -0700)]
[PATCH] Return probe redesign: i386 specific changes
The following patch contains the i386 specific changes for the new
return probe design. Changes include:
* Removing the architecture specific functions for querying a return probe
instance off a stack address
* Complete rework onf arch_prepare_kretprobe() and trampoline_probe_handler()
* Removing trampoline_post_handler()
* Adding arch_init() so that now we handle registering the return probe
trampoline instead of kernel/kprobes.c doing it
The following is the second version of the function return probe patches
I sent out earlier this week. Changes since my last submission include:
* Fix in ppc64 code removing an unneeded call to re-enable preemption
* Fix a build problem in ia64 when kprobes was turned off
* Added another BUG_ON check to each of the architecture trampoline
handlers
My initial patch description ==>
From my experiences with adding return probes to x86_64 and ia64, and the
feedback on LKML to those patches, I think we can simplify the design
for return probes.
The following patch tweaks the original design such that:
* Instead of storing the stack address in the return probe instance, the
task pointer is stored. This gives us all we need in order to:
- find the correct return probe instance when we enter the trampoline
(even if we are recursing)
- find all left-over return probe instances when the task is going away
This has the side effect of simplifying the implementation since more
work can be done in kernel/kprobes.c since architecture specific knowledge
of the stack layout is no longer required. Specifically, we no longer have:
- arch_get_kprobe_task()
- arch_kprobe_flush_task()
- get_rp_inst_tsk()
- get_rp_inst()
- trampoline_post_handler() <see next bullet>
* Instead of splitting the return probe handling and cleanup logic across
the pre and post trampoline handlers, all the work is pushed into the
pre function (trampoline_probe_handler), and then we skip single stepping
the original function. In this case the original instruction to be single
stepped was just a NOP, and we can do without the extra interruption.
The new flow of events to having a return probe handler execute when a target
function exits is:
* At system initialization time, a kprobe is inserted at the beginning of
kretprobe_trampoline. kernel/kprobes.c use to handle this on it's own,
but ia64 needed to do this a little differently (i.e. a function pointer
is really a pointer to a structure containing the instruction pointer and
a global pointer), so I added the notion of arch_init(), so that
kernel/kprobes.c:init_kprobes() now allows architecture specific
initialization by calling arch_init() before exiting. Each architecture
now registers a kprobe on it's own trampoline function.
* register_kretprobe() will insert a kprobe at the beginning of the targeted
function with the kprobe pre_handler set to arch_prepare_kretprobe
(still no change)
* When the target function is entered, the kprobe is fired, calling
arch_prepare_kretprobe (still no change)
* In arch_prepare_kretprobe() we try to get a free instance and if one is
available then we fill out the instance with a pointer to the return probe,
the original return address, and a pointer to the task structure (instead
of the stack address.) Just like before we change the return address
to the trampoline function and mark the instance as used.
If multiple return probes are registered for a given target function,
then arch_prepare_kretprobe() will get called multiple times for the same
task (since our kprobe implementation is able to handle multiple kprobes
at the same address.) Past the first call to arch_prepare_kretprobe,
we end up with the original address stored in the return probe instance
pointing to our trampoline function. (This is a significant difference
from the original arch_prepare_kretprobe design.)
* Target function executes like normal and then returns to kretprobe_trampoline.
* kprobe inserted on the first instruction of kretprobe_trampoline is fired
and calls trampoline_probe_handler() (no change here)
* trampoline_probe_handler() consumes each of the instances associated with
the current task by calling the registered handler function and marking
the instance as unused until an instance is found that has a return address
different then the trampoline function.
(change similar to my previous ia64 RFC)
* If the task is killed with some left-over return probe instances (meaning
that a target function was entered, but never returned), then we just
free any instances associated with the task. (Not much different other
then we can handle this without calling architecture specific functions.)
There is a known problem that this patch does not yet solve where
registering a return probe flush_old_exec or flush_thread will put us
in a bad state. Most likely the best way to handle this is to not allow
registering return probes on these two functions.
(Significant change)
This patch series applies to the 2.6.12-rc6-mm1 kernel, and provides:
* kernel/kprobes.c changes
* i386 patch of existing return probes implementation
* x86_64 patch of existing return probe implementation
* ia64 implementation
* ppc64 implementation (provided by Ananth)
This patch implements the architecture independant changes for a reworking
of the kprobes based function return probes design. Changes include:
* Removing functions for querying a return probe instance off a stack address
* Removing the stack_addr field from the kretprobe_instance definition,
and adding a task pointer
* Adding architecture specific initialization via arch_init()
* Removing extern definitions for the architecture trampoline functions
(this isn't needed anymore since the architecture handles the
initialization of the kprobe in the return probe trampoline function.)
[PATCH] kprobes: fix single-step out of line - take2
Now that PPC64 has no-execute support, here is a second try to fix the
single step out of line during kprobe execution. Kprobes on x86_64 already
solved this problem by allocating an executable page and using it as the
scratch area for stepping out of line. Reuse that.
Signed-off-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Mike Miller [Mon, 27 Jun 2005 21:36:50 +0000 (14:36 -0700)]
[PATCH] cciss: remove partition info from CCISS_GETLUNINFO
This patch fulfills a promise I made to Christoph sometime back. I am
removing the partition info from the CCISS_GETLUNINFO ioctl as I was informed
my "driver had no damn business reading that structure." ;)
The application folks are to use /proc or /sys for partition info from now on.
I am only aware of a few apps that use this ioctl and I'm not sure they ever
used the partition info.
Signed-off-by: Mike Miller <mike.miller@hp.com> Acked-by: Jeff Garzik <jgarzik@pobox.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Mike Miller [Mon, 27 Jun 2005 21:36:49 +0000 (14:36 -0700)]
[PATCH] cciss: pci domain info pass 2
This is pass 2 of my patch to add pci domain info to an existing ioctl. This
time I insert the domain between dev_fn and board_id as Willy suggested and
change the var to unsigned short to ease Christoph's concerns. Although I
thought unsigned int was the correct var type for this. I also thought it
didn't matter where I inserted it in the structure.
Signed-off-by: Mike Miller <mike.miller@hp.com> Acked-by: Jeff Garzik <jgarzik@pobox.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Mike Miller [Mon, 27 Jun 2005 21:36:48 +0000 (14:36 -0700)]
[PATCH] cciss: pci id fix
This patch fixes a PCI ID I got wrong before. It also adds support for
another new SAS controller due out this summer. I didn't have a marketing
name prior to my last submission. Also modifies the copyright date range.
Signed-off-by: Mike Miller <mike.miller@hp.com> Acked-by: Jeff Garzik <jgarzik@pobox.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Roland Dreier [Mon, 27 Jun 2005 21:36:46 +0000 (14:36 -0700)]
[PATCH] IB: Fix race in sa_query
Use a copy of the id we'll return to the consumer so that we don't
dereference query->sa_query after calling send_mad(). A completion may
occur very quickly and end up freeing the query before we get to do
anything after send_mad().
Signed-off-by: Roland Dreier <rolandd@cisco.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Roland Dreier [Mon, 27 Jun 2005 21:36:45 +0000 (14:36 -0700)]
[PATCH] IB/mthca: Align FW command mailboxes to 4K
Future versions of Mellanox HCA firmware will require command mailboxes to be
aligned to 4K. Support this by using a pci_pool to allocate all mailboxes.
This has the added benefit of shrinking the source and text of mthca.
Signed-off-by: Roland Dreier <roland@topspin.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Roland Dreier [Mon, 27 Jun 2005 21:36:43 +0000 (14:36 -0700)]
[PATCH] IB/mthca: Move mthca_is_memfree checks
Make mthca_table_put() and mthca_table_put_range() NOPs if the device is not
mem-free, so that we don't have to have "if (mthca_is_memfree())" tests in the
callers of these functions. This makes our code more readable and
maintainable, and saves a couple dozen bytes of text in ib_mthca.ko as well.
Signed-off-by: Roland Dreier <roland@topspin.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Roland Dreier [Mon, 27 Jun 2005 21:36:42 +0000 (14:36 -0700)]
[PATCH] IB/mthca: Enable unreliable connected transport
Add support for unreliable connected (UC) transport to mthca driver:
- Add attributes for UC to modify QP table.
- Add support for posting UC work requests.
Signed-off-by: Roland Dreier <roland@topspin.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Roland Dreier [Mon, 27 Jun 2005 21:36:41 +0000 (14:36 -0700)]
[PATCH] IB/mthca: Set RDMA/atomic capabilities correctly
mthca apparently had the meanings of the max_rd_atomic and max_dest_rd_atomic
QP attributes backwards. max_rd_atomic limits the maximum number of
outstanding RDMA/atomic requests as an initiator (on a send queue), and
max_dest_rd_atomic specifies the resources allocated to handle RMDA/atomic
requests from the remote end of the connection. We were programming our QP
context with these values swapped.
Signed-off-by: Roland Dreier <roland@topspin.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Roland Dreier [Mon, 27 Jun 2005 21:36:40 +0000 (14:36 -0700)]
[PATCH] IB/mthca: Use dma_alloc_coherent instead of pci_alloc_consistent
Switch all allocations of coherent memory from pci_alloc_consistent() to
dma_alloc_coherent(), so that we can pass GFP_KERNEL. This should help when
the system is low on memory.
Signed-off-by: Roland Dreier <roland@topspin.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Andrea Arcangeli [Mon, 27 Jun 2005 21:36:36 +0000 (14:36 -0700)]
[PATCH] seccomp: tsc disable
I believe at least for seccomp it's worth to turn off the tsc, not just for
HT but for the L2 cache too. So it's up to you, either you turn it off
completely (which isn't very nice IMHO) or I recommend to apply this below
patch.
This has been tested successfully on x86-64 against current cogito
repository (i686 compiles so I didn't bother testing ;). People selling
the cpu through cpushare may appreciate this bit for a peace of mind.
There's no way to get any timing info anymore with this applied
(gettimeofday is forbidden of course). The seccomp environment is
completely deterministic so it can't be allowed to get timing info, it has
to be deterministic so in the future I can enable a computing mode that
does a parallel computing for each task with server side transparent
checkpointing and verification that the output is the same from all the 2/3
seller computers for each task, without the buyer even noticing (for now
the verification is left to the buyer client side and there's no
checkpointing, since that would require more kernel changes to track the
dirty bits but it'll be easy to extend once the basic mode is finished).
Eliminating a cold-cache read of the cr4 global variable will save one
cacheline during the tlb flush while making the code per-cpu-safe at the
same time. Thanks to Mikael Pettersson for noticing the tlb flush wasn't
per-cpu-safe.
The global tlb flush can run from irq (IPI calling do_flush_tlb_all) but
it'll be transparent to the switch_to code since the IPI won't make any
change to the cr4 contents from the point of view of the interrupted code
and since it's now all per-cpu stuff, it will not race. So no need to
disable irqs in switch_to slow path.
Signed-off-by: Andrea Arcangeli <andrea@cpushare.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>