Age | Commit message (Collapse) | Author | Files | Lines |
|
This avoids any sysfs-related deadlock (or lockdep warning), such
as reported at http://lkml.org/lkml/2010/1/17/88 .
Reported-by: Ming Lei <[email protected]>
Tested-by: Wolfram Sang <[email protected]>
Signed-off-by: Dominik Brodowski <[email protected]>
|
|
Even though we weren't calling a blocking function within the dynid
spinlock, we do not need a spinlock here but can and should be using
a mutex.
Reported-by: Jiri Slaby <[email protected]>
Tested-by: Wolfram Sang <[email protected]>
Signed-off-by: Dominik Brodowski <[email protected]>
|
|
replace pcmcia_socket->lock and pcmcia_dev_list_lock by using the
per-socket "ops_mutex", as we do neither need different locks
nor a spinlock here.
Tested-by: Wolfram Sang <[email protected]>
Signed-off-by: Dominik Brodowski <[email protected]>
|
|
Protect the pccard_operations callback "set_mem_map" by a new
mutex ops_mutex. This mutex also protects the following values
in struct pcmcia_socket:
pccard_mem_map win[]
pccard_mem_map cis_mem
void __iomem *cis_virt
Tested-by: Wolfram Sang <[email protected]>
Signed-off-by: Dominik Brodowski <[email protected]>
|
|
If only CardBus cards are used, but not PCMCIA cards, we do not need
the extensive resource management functions provided for by
rsrc_nonstatic.c (~240K).
Tested-by: Wolfram Sang <[email protected]>
Signed-off-by: Dominik Brodowski <[email protected]>
|
|
The socket driver m8xx_pcmcia.c uses a static memory assignment,
but io_offset is set to 0. Therefore, it seems proper to use the
iodyn resource manager for this driver, as was previously the
case (before commit 80128ff79d282cf71b1819dbca9b8dd47d8ed3e8).
CC: Vitaly Bordug <[email protected]>
CC: Arnd Bergmann <[email protected]>
CC: Olof Johansson <[email protected]>
Signed-off-by: Dominik Brodowski <[email protected]>
|
|
At least no in-kernel CardBus-capable PCI driver makes use of the CIS
access functions. Therefore, it seems sensible to remove this unused
code, and cleanup cardbus.c a lot.
CC: Jesse Barnes <[email protected]>
CC: Linus Torvalds <[email protected]>
Tested-by: Wolfram Sang <[email protected]>
Signed-off-by: Dominik Brodowski <[email protected]>
|
|
During a suspend/resume cycle, an user may change the card in the
PCMCIA/CardBus slot. The pcmcia_core can at least look at the
socket state to check whether it is the same.
For PCMCIA devices, move the detection and handling of such a
change to ds.c.
For CardBus devices, the PCI hotplug interface doesn't offer a "rescan"
facility which also _removes_ devices no longer to be found behind a
bridge. Therefore, remove and re-add all devices unconditionally.
CC: Jesse Barnes <[email protected]>
CC: Linus Torvalds <[email protected]>
Tested-by: Wolfram Sang <[email protected]>
Signed-off-by: Dominik Brodowski <[email protected]>
|
|
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 <[email protected]>
|
|
Komuro pointed out that IRQ_FIRST_SHARED is not used at all in the
PCMCIA subsystem, so remove it. Also, remove two bogus assignments.
CC: Karsten Keil <[email protected]>
CC: [email protected]
CC: [email protected]
CC: Komuro <[email protected]>
Signed-off-by: Dominik Brodowski <[email protected]>
|
|
* git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6: (50 commits)
pcmcia: rework the irq_req_t typedef
pcmcia: remove deprecated handle_to_dev() macro
pcmcia: pcmcia_request_window() doesn't need a pointer to a pointer
pcmcia: remove unused "window_t" typedef
pcmcia: move some window-related code to pcmcia_ioctl.c
pcmcia: Change window_handle_t logic to unsigned long
pcmcia: Pass struct pcmcia_socket to pcmcia_get_mem_page()
pcmcia: Pass struct pcmcia_device to pcmcia_map_mem_page()
pcmcia: Pass struct pcmcia_device to pcmcia_release_window()
drivers/pcmcia: remove unnecessary kzalloc
pcmcia: correct handling for Zoomed Video registers in topic.h
pcmcia: fix printk formats
pcmcia: autoload module pcmcia
pcmcia/staging: update comedi drivers
PCMCIA: stop duplicating pci_irq in soc_pcmcia_socket
PCMCIA: ss: allow PCI IRQs > 255
PCMCIA: soc_common: remove 'dev' member from soc_pcmcia_socket
PCMCIA: soc_common: constify soc_pcmcia_socket ops member
PCMCIA: sa1111: remove duplicated initializers
PCMCIA: sa1111: wrap soc_pcmcia_socket to contain sa1111 specific data
...
|
|
Most of the irq_req_t typedef'd struct can be re-worked quite
easily:
(1) IRQInfo2 was unused in any case, so drop it.
(2) IRQInfo1 was used write-only, so drop it.
(3) Instance (private data to be passed to the IRQ handler):
Most PCMCIA drivers using pcmcia_request_irq() to actually
register an IRQ handler set the "dev_id" to the same pointer
as the "priv" pointer in struct pcmcia_device. Modify the two
exceptions (ipwireless, ibmtr_cs) to also work this waym and
set the IRQ handler's "dev_id" to p_dev->priv unconditionally.
(4) Handler is to be of type irq_handler_t.
(5) Handler != NULL already tells whether an IRQ handler is present.
Therefore, we do not need the IRQ_HANDLER_PRESENT flag in
irq_req_t.Attributes.
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: Jaroslav Kysela <[email protected]>
CC: Jiri Kosina <[email protected]>
CC: Karsten Keil <[email protected]>
for the Bluetooth parts: Acked-by: Marcel Holtmann <[email protected]>
Signed-off-by: Dominik Brodowski <[email protected]>
|
|
Update remaining users and remove deprecated handle_to_dev() macro
CC: Harald Welte <[email protected]>
CC: [email protected]
CC: [email protected]
CC: [email protected]
Signed-off-by: Dominik Brodowski <[email protected]>
|
|
pcmcia_request_window() only needs a pointer to struct pcmcia_device, not
a pointer to a pointer.
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: Jiri Kosina <[email protected]>
Acked-by: Karsten Keil <[email protected]> (for ISDN)
Signed-off-by: Dominik Brodowski <[email protected]>
|
|
Signed-off-by: Dominik Brodowski <[email protected]>
|
|
Logic changes based on top of the other patches:
This set of patches changed window_handle_t from being a pointer to an
unsigned long. The unsigned long is now a simple index into socket->win[].
Going from a pointer to unsigned long should leave the user space interface
unchanged unless I'm mistaken.
This change results in code that is less error prone and a user space
interface which is much cleaner and safer. A nice side effect is that we
are also are able to remove all members except one from window_t.
[ [email protected]:
Update to 2.6.31. Also, a plain "index" to socket->win[] does not
work, as several codepaths rely on "window_handle_t" being
non-zero if used. Therefore, set the window_handle_t to the
socket->win[] index + 1. ]
CC: [email protected]
Signed-off-by: Magnus Damm <[email protected]>
Signed-off-by: Dominik Brodowski <[email protected]>
|
|
No logic changes, just pass struct pcmcia_socket to pcmcia_get_mem_page()
[[email protected]: update to 2.6.31]
Signed-off-by: Magnus Damm <[email protected]>
Signed-off-by: Dominik Brodowski <[email protected]>
|
|
No logic changes, just pass struct pcmcia_device to pcmcia_map_mem_page()
[[email protected]: update to 2.6.31]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: Jiri Kosina <[email protected]>
Acked-by: Karsten Keil <[email protected]> (for ISDN)
Signed-off-by: Magnus Damm <[email protected]>
Signed-off-by: Dominik Brodowski <[email protected]>
|
|
No logic changes, just pass struct pcmcia_device to pcmcia_release_window().
[[email protected]: update to 2.6.31]
CC: [email protected]
CC: Jiri Kosina <[email protected]>
Signed-off-by: Magnus Damm <[email protected]>
Signed-off-by: Dominik Brodowski <[email protected]>
|
|
Signed-off-by: Russell King <[email protected]>
Signed-off-by: Dominik Brodowski <[email protected]>
|
|
As all in-tree drivers have been converted to not use cs_error() any more,
drop these functions and definitions, and update the Documentation.
Signed-off-by: Dominik Brodowski <[email protected]>
|
|
Remove the pcmcia_get_{first,next}_tuple() calls no longer needed by
(current) pcmcia device drivers.
Signed-off-by: Dominik Brodowski <[email protected]>
|
|
As a replacement to pcmcia_get_{first,next}_tuple() and
pcmcia_get_tuple_data(), three new -- and easier to use --
functions are added:
- pcmcia_get_tuple() to get the very first CIS entry of one
type.
- pcmcia_loop_tuple() to loop over all CIS entries of one type.
- pcmcia_get_mac_from_cis() to read out the hardware MAC address
from CISTPL_FUNCE.
Only a handful of drivers need these functions anyway, as most
CIS access is already handled by pcmcia_loop_config(), which
now shares the same backed (pccard_loop_tuple()) with
pcmcia_loop_tuple().
A pcmcia_get_mac_from_cis() bug noted by Komuro
<[email protected]> has been fixed in this revision.
Signed-off-by: Dominik Brodowski <[email protected]>
|
|
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 <[email protected]>
Acked-by: Dominik Brodowski <[email protected]>
Reported-by: Stephen J. Gowdy <[email protected]>
Tested-by: Jose Marino <[email protected]>
|
|
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 <[email protected]>
Cc: [email protected]
|
|
Physical addresses are currently represented as int or long types.
However, this does not work for processors like the PPC440EPx, which
is a 32-bit processor with a 36-bit address space. This patch uses
the phys_addr_t type, which correctly holds a 36-bit address on
this processor.
Signed-off-by: Steven A. Falco <[email protected]>
Signed-off-by: Wolfram Sang <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
|
|
cisinfo_t and cs_status_t are only used by the (deprecated) PCMCIA
ioctl. Therefore, move them out of the way.
Signed-off-by: Dominik Brodowski <[email protected]>
|
|
16-bit PCMCIA device handling function definitions are moved to ds.h.
Signed-off-by: Dominik Brodowski <[email protected]>
|
|
Since we're just parsing the tuple being passed to this function, we don't
need any device-specific information.
Also, remove the call to pcmcia_validate_cis() from pcmciamtd.c, since it
is already called by the PCMCIA core.
Signed-off-by: Dominik Brodowski <[email protected]>
|
|
16-bit PCMCIA device handling function definitions are moved to ds.h,
internal definitions to cs_internal.h.
Signed-off-by: Dominik Brodowski <[email protected]>
|
|
Wrap in #ifdef to include header just once, and wrap in another #ifdef
to avoid it being used in userspace. Also, format the header similar to
the other PCMCIA header files.
Signed-off-by: Dominik Brodowski <[email protected]>
|
|
By now, ioaddr_t should only be used by the deprecated ioctl, as it does not
correctly reflect the maximum ioport range at least on some architectures.
Signed-off-by: Dominik Brodowski <[email protected]>
|
|
The header file primarily used for (in-kernel) PCMCIA device drivers
also deserved a major cleanup. This header file also serves as the dumping
ground for all typedefs and definitions only used by the deprecated PCMCIA
ioctl and the deprecated PCMCIA userspace tools using this ioctl.
Signed-off-by: Dominik Brodowski <[email protected]>
|
|
The header file for use by (in-kernel) PCMCIA sockets deserved a major
cleanup. Some stuff only used by the pcmcia core modules was moved to
cs_internal.h
Signed-off-by: Dominik Brodowski <[email protected]>
|
|
Use dev_printk() in cs_error()-based error reporting. While this
function-turned-macro will hopefully go away soon, using dev_printk
simplifies the code much.
Signed-off-by: Dominik Brodowski <[email protected]>
|
|
Remoe the CS_ error codes. Drivers are expected to use default
error definitions (errno.h etc.).
Only one CS_ error code -- CS_IN_USE -- is used internally by the
(deprecated) pcmcia-cs userspace package. Therefore, keep this one
around so that it still compiles.
Signed-off-by: Dominik Brodowski <[email protected]>
|
|
CS_BAD_TUPLE was used to denote a bad tuple being passed to the parse
function. Therefore, replace it with -EINVAL and a verbose message.
Signed-off-by: Dominik Brodowski <[email protected]>
|
|
CS_BAD_ARGS mean a badly written driver or invalid userspace ioctl access,
so translate that to -EINVAL.
Signed-off-by: Dominik Brodowski <[email protected]>
|
|
These four error values mostly mean a badly written driver, so ds_dbg()
output and -EINVAL seems to be enough.
Signed-off-by: Dominik Brodowski <[email protected]>
|
|
CS_BAD_TYPE was only used in cs.c and already properly annotated by error
messages. CS_BAD_ATTRIBUTE and CS_BAD_PAGE mean a badly written driver, so
ds_dbg() output and -EINVAL seems to be enough.
(includes bugfix from and
Signed-off-by: Harvey Harrison <[email protected]>
)
Signed-off-by: Dominik Brodowski <[email protected]>
|
|
CS_NO_MORE_ITEMS is returned by the CIS tuple reading and parsing code if
the end of a tuple chain is reached. As at least one PCMCIA driver relies
on matching this return value, replace it with -ENOSPC which is now
uniquely used for this purpose within the in-kernel pcmcia subsystem.
CC: Russell King <[email protected]>
CC: [email protected]
CC: Michael Buesch <[email protected]>
Signed-off-by: Dominik Brodowski <[email protected]>
|
|
If a resource is already in use, mark it with -EBUSY. Same for cards already
asleep.
(includes a fix for a bug found by Larry Finger -- thanks!)
Signed-off-by: Dominik Brodowski <[email protected]>
|
|
This error code meant that trying to change the configuration after the
initialization phase is forbidden.
Signed-off-by: Dominik Brodowski <[email protected]>
|
|
CS_BAD_HANDLE means that something went badly wrong: no parameter was passed,
or the paramater passed wasn't the correct one. Therefore, replace it with
-EINVAL.
Signed-off-by: Dominik Brodowski <[email protected]>
|
|
It's only used by pcmcia_core when socket-related queries time out.
Signed-off-by: Dominik Brodowski <[email protected]>
|
|
It means that no card can be detected in the socket, so return -ENODEV
Signed-off-by: Dominik Brodowski <[email protected]>
|
|
They were either used to report that changing voltage is not allowed, or that
changing voltage failed.
Signed-off-by: Dominik Brodowski <[email protected]>
|
|
CS_UNSUPPORTED_MODE and CS_UNSUPPORTED_FUNCTION were mostly used to denote
trying to use PCMCIA functions on CardBus cards.
Signed-off-by: Dominik Brodowski <[email protected]>
|
|
CS_OUT_OF_RESOURCE was almost only used to note -ENOMEM situations.
Therefore, use -ENOMEM explicitely, and also print out warnings.
CC: [email protected]
Signed-off-by: Dominik Brodowski <[email protected]>
|
|
Deprecate unused CS_ error codes by replacing their definitions with
generic error messages, and removing them from the error_t lookup table.
Signed-off-by: Dominik Brodowski <[email protected]>
|