Move the declaration of i2c-isa-only exported symbols to i2c-isa
itself, that's the best way to ensure nobody will attempt to use them.
Hopefully we'll get rid of the exports themselves soon anyway.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Add a new helper function to instantiate an i2c device. It is meant as a
replacement for i2c_new_device() when you don't know for sure at which
address your I2C/SMBus device lives. This happens frequently on TV
adapters for example, you know there is a tuner chip on the bus, but
depending on the exact board model and revision, it can live at different
addresses. So, the new i2c_new_probed_device() function will probe the bus
according to a list of addresses, and as soon as one of these addresses
responds, it will call i2c_new_device() on that one address.
This function will make it possible to port the old i2c drivers to the
new model quickly.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Add i2c_bit_add_numbered_bus(), which is equivalent to i2c_bit_add_bus
except that it calls i2c_add_numbered_adapter() at the end instead of
i2c_add_adapter().
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Make i2c-core.c obey Documentation/CodingStyle better by snugging
the EXPORT_SYMBOL declarations next to the relevant definitions.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
This adds a call, i2c_add_numbered_adapter(), registering an I2C adapter
with a specific bus number and then creating I2C device nodes for any
pre-declared devices on that bus. It builds on previous patches adding
I2C probe() and remove() support, and that pre-declaration of devices.
This completes the core support for "new style" I2C device drivers.
Those follow the standard driver model for binding devices to drivers
(using probe and remove methods) rather than a legacy model (where the
driver tries to autoconfigure each bus, and registers devices itself).
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
This provides partial support for new-style I2C driver binding. It builds
on "struct i2c_board_info" declarations that identify I2C devices on a given
board. This is needed on systems with I2C devices that can't be fully probed
and/or autoconfigured, such as many embedded Linux configurations where the
way a given I2C device is wired may affect how it must be used.
There are two models for declaring such devices:
* LATE -- using a public function i2c_new_device(). This lets modules
declare I2C devices found *AFTER* a given I2C adapter becomes available.
For example, a PCI card could create adapters giving access to utility
chips on that card, and this would be used to associate those chips with
those adapters.
* EARLY -- from arch_initcall() level code, using a non-exported function
i2c_register_board_info(). This copies the declarations *BEFORE* such
an i2c_adapter becomes available, arranging that i2c_new_device() will
be called later when i2c-core registers the relevant i2c_adapter.
For example, arch/.../.../board-*.c files would declare the I2C devices
along with their platform data, and I2C devices would behave much like
PNPACPI devices. (That is, both enumerate from board-specific tables.)
To match the exported i2c_new_device(), the previously-private function
i2c_unregister_device() is now exported.
Pending later patches using these new APIs, this is effectively a NOP.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
More update for new style driver support: add a remove() method, and
use it in the relevant code paths.
Again, nothing will use this yet since there's nothing to create devices
feeding this infrastructure.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
One of a series of I2C infrastructure updates to support enumeration using
the standard Linux driver model.
This patch updates probe() and associated hotplug/coldplug support, but
not remove(). Nothing yet _uses_ it to create I2C devices, so those
hotplug/coldplug mechanisms will be the only externally visible change.
This patch will be an overall NOP since the I2C stack doesn't yet create
clients/devices except as part of binding them to legacy drivers.
Some code is moved earlier in the source code, helping group more of the
per-device infrastructure in one place and simplifying handling per-device
attributes.
Terminology being adopted: "legacy drivers" create devices (i2c_client)
themselves, while "new style" ones follow the driver model (the i2c_client
is handed to the probe routine). It's an either/or thing; the two models
don't mix, and drivers that try mixing them won't even be registered.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Port the i2c-pca-isa driver to the new device driver model. I'm
using Rene Herman's new isa bus type, as it fits the needs nicely. One
benefit is that we can now give a proper parent to our i2c adapter.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Port the i2c-elektor driver to the new device driver model. I'm
using Rene Herman's new isa bus type, as it fits the needs nicely. One
benefit is that we can now give a proper parent to our i2c adapter.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
When unloading the driver, we really want to unregister the i2c adapter
before we power it off, rather than the other way around.
Also speed up the bus a bit when we can sense SCL. The slaves will
stretch the line as needed.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
The scx200_acb driver supports two kind of devices, PCI ones and ISA
ones. Even ISA ones are detected using the presence of a given PCI
device, and we get a reference to it, but never put it back, so we
have a leak. Fix it.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Initialize the fields of the i2c_adapter structure individually,
rather than copying a whole static template structure. This shaves
off 474 bytes or 14% (on i386) from the binary size.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Now that i2c-core lets the i2c bus drivers emulate the SMBus block read
and SMBus block process call transaction types, let's implement that in
the popular i2c bit-banging driver. This will also act as a reference
implementation for other bus drivers which want to do the same.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Let the I2C bus drivers emulate the SMBus Block Read and Block Process
Call transactions if they wish. This requires to define a new message
flag, which i2c-core will use to let the underlying I2C bus driver
know that the first received byte will specify the length of the read
message.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
The i2c-algo-bit driver doesn't behave well on read errors: it'll
bail out without even sending a stop condition on the bus, so the bus
will be stuck. So make sure that we always send a stop condition on
the bus before we leave. The best way to make sure is to always send
it at the end of function bit_xfer.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Rename dev_to_i2c_adapter() as to_i2c_adapter(), since the previous
syntax was a surprising and needless difference from normal naming
conventions in Linux.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
This patch is a minor cleanup/code shrink, using class infrastructure
in i2c-core to manage the i2c_adapter attribute.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
This shrinks the size of "struct i2c_client" by 40 bytes:
- Substantially shrinks the string used to identify the chip type
- The "flags" don't need to be so big
- Removes some internal padding
It also adds kerneldoc for that struct, explaining how "name" is really a
chip type identifier; it's otherwise potentially confusing.
Because the I2C_NAME_SIZE symbol was abused for both i2c_client.name
and for i2c_adapter.name, this needed to affect i2c_adapter too. The
adapters which used that symbol now use the more-obviously-correct
idiom of taking the size of that field.
JD: Shorten i2c_adapter.name from 50 to 48 bytes while we're here, to
avoid wasting space in padding.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Minor cleanup in i2c_register_driver(): use list_for_each_entry().
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Kill i2c_adapter_driver as it doesn't make sense and it prevents
further i2c-core cleanups. i2c_adapter devices are virtual devices
(ex-class devices) and as such they don't need a driver.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Kill i2c_adapter.class_dev. Instead, set the class of i2c_adapter.dev
to i2c_adapter_class, so that a symlink will be created for every
i2c_adapter in /sys/class/i2c-adapter.
The same change must be mirrored to i2c-isa as it duplicates some
of the i2c-core functionalities.
User-space tools and libraries might need some adjustments. In
particular, libsensors from lm_sensors 2.10.3 or later is required for
proper discovery of i2c adapter names after this change.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
The Marvell IDE interface on my machine would hit a BUG_ON() in
lib/iomem.c because it was calling ata_pci_init_one() specifying just a
single port on the host, but that would actually end up trying to
initialize two ports, the second one with bogus information.
This fixes "ata_pci_init_one()" so that it actually passes down the
n_ports variable that it got from the low-level driver to the host
allocation routine ("ata_host_alloc_pinfo()"), which results in the ATA
layer actually having the correct port number information.
And in order to make it all work, I also needed to fix a few places that
had incorrectly hard-coded the fact that a host always had exactly two
ports (both ata_pci_init_bmdma() and ata_request_legacy_irqs() would
just always iterate over both ports).
Acked-by: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Almost all users of pm_ops only support mem sleep, don't check in .valid and
don't reject any others in .prepare so users can be confused if they check
/sys/power/state, especially when new states are added (these would then
result in s-t-r although they're supposed to be something different).
This patch implements a generic pm_valid_only_mem function that is then
exported for users and puts it to use in almost all existing pm_ops.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Cc: David Brownell <david-b@pacbell.net>
Acked-by: Pavel Machek <pavel@ucw.cz>
Cc: linux-pm@lists.linux-foundation.org
Cc: Len Brown <lenb@kernel.org>
Acked-by: Russell King <rmk@arm.linux.org.uk>
Cc: Greg KH <greg@kroah.com>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6: (56 commits)
ieee1394: remove garbage from Kconfig
ieee1394: more help in Kconfig
ieee1394: ohci1394: Fix mistake in printk message.
ieee1394: ohci1394: remove unnecessary rcvPhyPkt bit flipping in LinkControl register
ieee1394: ohci1394: fix cosmetic problem in error logging
ieee1394: eth1394: send async streams at S100 on 1394b buses
ieee1394: eth1394: fix error path in module_init
ieee1394: eth1394: correct return codes in hard_start_xmit
ieee1394: eth1394: hard_start_xmit is called in atomic context
ieee1394: eth1394: some conditions are unlikely
ieee1394: eth1394: clean up fragment_overlap
ieee1394: eth1394: don't use alloc_etherdev
ieee1394: eth1394: omit useless set_mac_address callback
ieee1394: eth1394: CONFIG_INET is always defined
ieee1394: eth1394: allow MTU bigger than 1500
ieee1394: unexport highlevel_host_reset
ieee1394: eth1394: contain host reset
ieee1394: eth1394: shorter error messages
ieee1394: eth1394: correct a memset argument
ieee1394: eth1394: refactor .probe and .update
...
* 'for-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jikos/hid: (21 commits)
USB HID: don't warn on idVendor == 0
USB HID: add 'quirks' module parameter
USB HID: add support for dynamically-created quirks
USB HID: clarify static quirk handling as squirks
USB HID: encapsulate quirk handling into hid-quirks.c
USB HID: EMS USBII device needs HID_QUIRK_MULTI_INPUT
HID: update copyright and authorship macro
HID: introduce proper zeroing of unused bits in output reports
USB HID: add support for WiseGroup MP-8800 Quad Joypad
USB HID: add FF support for Logitech Force 3D Pro Joystick
USB HID: numlock quirk for dell W7658 keyboard
USB HID: Logitech MX3000 keyboard needs report descriptor quirk
USB HID: extend quirk for Logitech S510 keyboard
USB HID: usbkbd/usbmouse - handle errors when registering devices
USB HID: add QUIRK_HIDDEV for Belkin Flip KVM
HID: enable dead keys on a belkin wireless keyboard
USB HID: Thustmaster firestorm dual power v1 support
USB HID: specify explicit size for hid_blacklist.quirks
USB HID: fix retry & reset logic
USB HID: consolidate vendor/product ids
...
* master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6: (21 commits)
[IPV4] SNMP: Support OutMcastPkts and OutBcastPkts
[IPV4] SNMP: Support InMcastPkts and InBcastPkts
[IPV4] SNMP: Support InTruncatedPkts
[IPV4] SNMP: Support InNoRoutes
[SNMP]: Add definitions for {In,Out}BcastPkts
[TCP] FRTO: RFC4138 allows Nagle override when new data must be sent
[TCP] FRTO: Delay skb available check until it's mandatory
[XFRM]: Restrict upper layer information by bundle.
[TCP]: Catch skb with S+L bugs earlier
[PATCH] INET : IPV4 UDP lookups converted to a 2 pass algo
[L2TP]: Add the ability to autoload a pppox protocol module.
[SKB]: Introduce skb_queue_walk_safe()
[AF_IUCV/IUCV]: smp_call_function deadlock
[IPV6]: Fix slab corruption running ip6sic
[TCP]: Update references in two old comments
[XFRM]: Export SPD info
[IPV6]: Track device renames in snmp6.
[SCTP]: Fix sctp_getsockopt_local_addrs_old() to use local storage.
[NET]: Remove NETIF_F_INTERNAL_STATS, default to internal stats.
[NETPOLL]: Remove CONFIG_NETPOLL_RX
...
* 'for-linus' of git://git.kernel.dk/data/git/linux-2.6-block:
[PATCH] elevator: elv_list_lock does not need irq disabling
[BLOCK] Don't pin lots of memory in mempools
cfq-iosched: speedup cic rb lookup
ll_rw_blk: add io_context private pointer
cfq-iosched: get rid of cfqq hash
cfq-iosched: tighten queue request overlap condition
cfq-iosched: improve sync vs async workloads
cfq-iosched: never allow an async queue idling
cfq-iosched: get rid of ->dispatch_slice
cfq-iosched: don't pass unused preemption variable around
cfq-iosched: get rid of ->cur_rr and ->cfq_list
cfq-iosched: slice offset should take ioprio into account
[PATCH] cfq-iosched: style cleanups and comments
cfq-iosched: sort IDLE queues into the rbtree
cfq-iosched: sort RT queues into the rbtree
[PATCH] cfq-iosched: speed up rbtree handling
cfq-iosched: rework the whole round-robin list concept
cfq-iosched: minor updates
cfq-iosched: development update
cfq-iosched: improve preemption for cooperating tasks
This patch allows a name "pppox-proto-nnn" to be used in modprobe.conf
to autoload a PPPoX protocol nnn.
Signed-off-by: James Chapman <jchapman@katalix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Currently we scale the mempool sizes depending on memory installed
in the machine, except for the bio pool itself which sits at a fixed
256 entry pre-allocation.
There's really no point in "optimizing" this OOM path, we just need
enough preallocated to make progress. A single unit is enough, lets
scale it down to 2 just to be on the safe side.
This patch saves ~150kb of pinned kernel memory on a 32-bit box.
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Commit 404d5b185b changed the definition
of dev_dbg in the !DEBUG case from being a #define to being a static
inline. There was code in drivers/ps3/vuart.c to do exactly that,
which fails to compile now. This fixes it by removing the redefinition,
as the redefinition is now superfluous.
Signed-off-by: Paul Mackerras <paulus@samba.org>
Remove option of making booke_wdt into a kernel module. This watchdog
cannot be disabled. No point being a kernel module.
Signed-off-by: Dave Jiang <djiang@mvista.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
- s/Device Drivers/Controllers/
- clarify who needs pcilynx
- don't recommend Y for raw1394; M is typically used
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Fix the "attempting to setting" message in ohci1394.
Signed-off-by: Simon Arlott <simon@fire.lp0.eu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Remove the unneeded code that clears, sets and again clears the
rcvPhyPkt bit in the ohci1394 LinkControl register in ohci_initialize().
Signed-off-by: Bernhard Kauer <kauer@os.inf.tu-dresden.de>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
If posted write failed, an "Unhandled interrupt(s) 0x00000100" message
was logged by mistake.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
eth1394 did not work on buses consisting of S100B...S400B hardware
because it attempted to send GASP packets at S800.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
This patch fixes some error handlings in eth1394:
- check return value of kmem_cache_create()
- cleanup resources if hpsb_register_protocol() fails
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> (whitespace)
This patch actually doesn't change anything because there was always 0
== NETDEV_TX_OK returned before.
TODO: Return NETDEV_TX_BUSY in error case and test in different error
conditions.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
RFC 2734 says: "IP-capable nodes may operate with an MTU size larger
than the default [1500 octets], but the means by which a larger MTU is
configured are beyond the scope of this document."
Allow users to set an MTU bigger than 1500.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
highlevel_host_reset no longer has any modular users.
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Call only eth1394's own host reset handler from .tx_timeout, not the
reset hooks of all other IEEE 1394 drivers.
A minor drawback of this patch is that ether1394_host_reset by timeout
is not serialized against ether1394_host_reset by bus reset.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Move common code into an extra function. This implicitly adds a missing
node_info->fifo = CSR1212_INVALID_ADDR_SPACE; to .update.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Adjust white space and line wraps. Remove unnecessary parentheses and
braces, unused macros, and some of the more redundant comments.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
There is some common code between ether1394_open and ether1394_add_host
which can be moved to a separate helper function for a slightly smaller
eth1394 driver (-160 bytes on i386.)
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Until now, ieee1394 put an IP-over-1394 capability entry into each new
host's config ROM. As soon as the controller was initialized --- i.e.
right after modprobe ohci1394 --- this entry triggered a hotplug event
which typically caused auto-loading of eth1394.
This irritated or annoyed many users and distributors. Of course they
could blacklist eth1394, but then ieee1394 wrongly advertized IP-over-
1394 capability to the FireWire bus.
Therefore
- remove the offending kernel config option
IEEE1394_CONFIG_ROM_IP1394,
- let eth1394 add the ROM entry by itself, i.e. only after eth1394 was
loaded.
This fixes http://bugzilla.kernel.org/show_bug.cgi?id=7793 .
To emulate the behaviour of older kernels, simply add the following to
to /etc/modprobe.conf:
install ohci1394 /sbin/modprobe eth1394; \
/sbin/modprobe --ignore-install ohci1394
Note, autoloading of eth1394 when an _external_ IP-over-1394 capable
device is discovered is _not_ affected by this patch.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Shrinks eth1394.ko by about 5%.
Many of these functions have only one caller and are therefore auto-
inlined anyway.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Warn if hpsb_allocate_and_register_addrspace() failed.
Unregister the address space if something else failed.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
The comment says it all. This affects only asynchronous streams sent
via raw1394; the eth1394 driver has own code and needs an own fix.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Everytime when eth1394 or a libraw1394 client updates the configuration
ROM, a certain sysfs attribute cannot be added since it already exists.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
This is a coding style touch-up for ieee1394's handle_incoming_packet().
A preprocessor macro contained hardwired variable names and, even worse,
the 'break' keyword. This macro is now unrolled and removed.
Also, all 'break's which had the effect of a return are replaced by
return. And a FIXME comment is brought up to date.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
alpha:
drivers/ieee1394/iso.c: In function 'hpsb_iso_xmit_sync':
drivers/ieee1394/iso.c:440: error: invalid use of undefined type 'struct task_struct'
drivers/ieee1394/iso.c:440: error: 'TASK_INTERRUPTIBLE' undeclared (first use in this function)
drivers/ieee1394/iso.c:440: error: (Each undeclared identifier is reported only once
drivers/ieee1394/iso.c:440: error: for each function it appears in.)
drivers/ieee1394/iso.c:440: warning: implicit declaration of function 'signal_pending'
drivers/ieee1394/iso.c:440: error: invalid use of undefined type 'struct task_struct'
drivers/ieee1394/iso.c:440: warning: implicit declaration of function 'schedule'
drivers/ieee1394/iso.c: In function 'hpsb_iso_wake':
drivers/ieee1394/iso.c:562: error: 'TASK_INTERRUPTIBLE' undeclared (first use in this function)
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> (brought into alphabetic order)
drivers/ieee1394/ieee1394_transactions.c fails for me if CONFIG_SMP=n
gcc complains:
CC drivers/ieee1394/ieee1394_transactions.o
drivers/ieee1394/ieee1394_transactions.c: In function 'hpsb_get_tlabel':
drivers/ieee1394/ieee1394_transactions.c:183: error:
'TASK_INTERRUPTIBLE' undeclared (first use in this function)
drivers/ieee1394/ieee1394_transactions.c:183: error: (Each undeclared
identifier is reported only once
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> (added comment)
Fix printk format string:
drivers/ieee1394/ieee1394_core.c:702: warning: format '%d' expects type 'int', but argument 2 has type 'size_t'
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
This considerably reduces the memory requirements for a packet and
eliminates ieee1394's dependency on CONFIG_NET.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
This will point out firmware bugs.
I tested with 11 SBP-2 devices and one OS X PC and got these errors from
two old CD-RWs only.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Make unnecessarily generic code specific and thus simpler.
Shrink a lookup table from 128 to 16 bytes.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
The biggest chunk ever allocated by CSR1212_MALLOC is 1024 Bytes +
sizeof(struct csr1212_csr_rom_cache) big. Most of the time much
smaller data structures are allocated. Therefore vmalloc is a waste.
The one exception is csr1212_append_new_cache() which is called to
append a chunk of CSR1212_EXTENDED_ROM_SIZE + sizeof(struct
csr1212_csr_rom_cache) if the currently allocated ROM cache is too
small. CSR1212_EXTENDED_ROM_SIZE is generously defined as 256 kBytes.
In SVN commit 1220, Steve Kinneberg lowered this to 2 kBytes in the
config_rom_2.4 branch. This same commit also switched CSR1212_MALLOC
from kmalloc to vmalloc in the SVN trunk branch:
> r1220 | kberg | 2004-05-31 01:51:44 +0200 (Mon, 31 May 2004) | 13 lines
>
> CSR1212 Extended ROM bug fixes:
> trunk line changes:
> - Use vmalloc instead of kmalloc
> - Change delayed_reset_bus() to operate in a work_queue instead of a
> timer interrupt.
> - Fix hpsb_allocate_and_register_addrspace() to not allocate space
> on top of already allocated space.
> - Fix problems in csr1212.c filling ConfigROM images when extend
> ROMs are present.
> config-rom-2.4 changes:
> - Changed extended rom allocation from 256K to 8K.
(It was actually 2 kB, not 8 kB.)
> - Fix hpsb_allocate_and_register_addrspace() to not allocate space
> on top of already allocated space.
> - Fix problems in csr1212.c filling ConfigROM images when extend
> ROMs are present.
I am now setting CSR1212_EXTENDED_ROM_SIZE to 2 kB minus the overhead of
struct csr1212_csr_rom_cache. Note, this code path is not used by the
in-kernel drivers though. raw1394 could trigger it, but the respective
libraw1394 functions don't exist yet.
Furthermore, userspace programs can replace the entire local ROM via
raw1394. If kmalloc does not fulfill their needs --- well, tough luck.
I decree that nobody needs such huge extended ROMs. (Extended ROMs are
defined by IEEE 1212 clause 7.7.18. The spec does not impose
practically relevant restrictions on the size of extended ROM chunks.)
Another potentially demanding use of CSR1212_MALLOC is if external
FireWire devices come with Extended ROM entries. If they are too big
for kmalloc (or have been too big for vmalloc) we just fail to read
their ROM. This is quite unlikely though, to my knowledge.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
This small reorganization of public csr1212 functions saves one
exported symbol and a few bytes in the driver modules.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
csr1212 was written to be compiled either as part of the ieee1394 kernel
driver or of an anticipated IEEE 1212 userspace library. We now drop
support for the latter. The costs in terms of code footprint and depth
of abstraction are not countered by any actual benefit.
Also remove some obsolete #includes.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Delete unused code.
Make some extern functions static.
Remove superfluous inline keywords.
Move private definitions from csr1212.h to csr1212.c.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
drivers/ieee1394/sbp2.c: In function 'sbp2util_access_timeout':
drivers/ieee1394/sbp2.c:399: error: 'TASK_INTERRUPTIBLE' undeclared (first use in this function)
drivers/ieee1394/sbp2.c:399: error: (Each undeclared identifier is reported only once
drivers/ieee1394/sbp2.c:399: error: for each function it appears in.)
drivers/ieee1394/sbp2.c:399: warning: implicit declaration of function 'signal_pending'
drivers/ieee1394/sbp2.c:399: warning: implicit declaration of function 'schedule_timeout'
drivers/ieee1394/sbp2.c: In function 'sbp2_prep_command_orb_sg':
drivers/ieee1394/sbp2.c:1438: warning: implicit declaration of function 'page_address'
drivers/ieee1394/sbp2.c:1438: warning: passing argument 2 of 'dma_map_single' makes pointer from integer without a cast
drivers/ieee1394/sbp2.c: In function 'sbp2_handle_status_write':
drivers/ieee1394/sbp2.c:1842: error: 'TASK_INTERRUPTIBLE' undeclared (first use in this function)
Possibly due to changes in -mm, but this file should explicitly include the
headers for the stuff it uses.
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> (brought into alphabetic order)
When the command ORB pool is created, the ORB list won't be accessed
concurrently. Therefore we don't have to take the spinlock there.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Unlike the name suggests, "cmd->scatter_gather_element" holds only the
s/g table, not the actual s/g elements. Since the table is only read
but never written by the device, DMA_BIDIRECTIONAL can be replaced by
DMA_TO_DEVICE which may be cheaper on some architectures.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
In order to use OHCI-1394 physical DMA, all s/g elements, s/g tables,
ORBs, and response buffers have to reside within the first 4 GB of the
FireWire controller's physical address space. Set the correct mask for
DMA mappings.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
The members "dma_addr_t command_orb_dma" and "dma_addr_t sge_dma" of
sbp2.h::sbp2_command_info do not have to be aligned themselves --- only
the memory which they point to has to be.
The member "struct sbp2_command_orb command_orb" has to be aligned on
4 bytes boundary which is guaranteed because it contains u32 members.
The member "struct sbp2_unrestricted_page_table scatter_gather_element",
i.e. the SBP-2 s/g table, has to be aligned on 8 bytes boundary
according to the SBP-2 spec. This is not a requirement for FireWire
controllers but could be expected by SBP-2 targets.
I see no need to align the members command_orb and
scatter_gather_element on CPU cacheline boundaries. It could have
performance benefits, but on the other hand sbp2 has a somewhat wasteful
allocation scheme which should be optimized first before further tweaks
like cacheline alignments. (E.g. don't always allocate SG_ALL s/g table
elements.)
Note, before as well as after the patch, the code relies on the
assumption that memory alignment in the virtual address space is
preserved in the physical address space after DMA mapping.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
* 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6: (107 commits)
smc911x: fix compilation breakage wjen debug is on
[netdrvr] eexpress: minor corrections
add NAPI support to sb1250-mac.c
ixgb: ROUND_UP macro cleanup in drivers/net/ixgb
e1000: ROUND_UP macro cleanup in drivers/net/e1000
Generic HDLC sparse annotations
e100: Optionally use I/O mode only to access register space
e100: allow bad MAC address when running with invalid eeprom csum
ehea: fix for dlpar support
ehea: fix for sysfs entries
3C509: Remove unnecessary include of <linux/pm_legacy.h>
NetXen: Fix for vmalloc issues
NetXen: Fixes for Power PC architecture
NetXen: Port swap feature for multi port cards
NetXen: Removal of redundant macros
NetXen: Multi PCI support for Quad cards
NetXen: Removal of redundant argument passing
NetXen: Use multiple PCI functions
[netdrvr e100] experiment with doing RX in a similar manner to eepro100
[PATCH] ieee80211: add missing global needed by IEEE80211_DEBUG_XXXX
...
* 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev: (86 commits)
SPIN_LOCK_UNLOCKED cleanup in drivers/ata/pata_winbond.c
drivers/ata/pata_cmd640.c: fix build with CONFIG_PM=n
pata_hpt37x: Further small fixes
pata_hpt3x2n: Add HPT371N support and other bits
ata: printk warning fixes
libata: separate ATA_EHI_DID_RESET into DID_SOFTRESET and DID_HARDRESET
ahci: consolidate common port flags
ata_timing: ensure t->cycle is always correct
libata: add missing call to ->cable_detect() in new EH path
pata_amd: remove contamination added during cable_detect conversion
libata: Handle drives that require a spin-up command before first access
libata: HPA support
libata: kill probe_ent and related helpers
libata: convert the remaining PATA drivers to new init model
libata: convert the remaining SATA drivers to new init model
libata: convert ata_pci_init_native_mode() users to new init model
libata: convert drivers with combined SATA/PATA ports to new init model
libata: add init helpers including ata_pci_prepare_native_host()
libata: convert native PCI host handling to new init model
libata: convert legacy PCI host handling to new init model
...
* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6: (105 commits)
sonypi: use mutex instead of semaphore
sony-laptop: remove user visible camera controls as platform attributes
meye: make meye use sony-laptop instead of sonypi
sony-laptop: add a meye-usable include file for camera ops
sony-laptop: complete the motion eye camera support in sony-laptop
sonypi: try to detect if sony-laptop has already taken one of the known ioports
sonypi: suggest sonypi users to try sony-laptop instead
sony-laptop: add edge modem support (also called WWAN)
sony-laptop: add locking on accesses to the ioport and global vars
sony-laptop: add camera enable/disable parameter, better handle possible infinite loop
thinkpad-acpi: make drivers/misc/thinkpad_acpi:fan_mutex static
ACPI: thinkpad-acpi: add sysfs support to wan and bluetooth subdrivers
ACPI: thinkpad-acpi: add sysfs support to hotkey subdriver
ACPI: thinkpad-acpi: improve dock subdriver initialization
ACPI: thinkpad-acpi: improve debugging for acpi helpers
ACPI: thinkpad-acpi: improve fan control documentation
ACPI: thinkpad-acpi: map ENXIO to EINVAL for fan sysfs
ACPI: thinkpad-acpi: fix a fan watchdog invocation
ACPI: thinkpad-acpi: do not arm fan watchdog if it would not work
ACPI: thinkpad-acpi: add a fan-control feature master toggle
...
It turns out that there are broken devices out there that incorrectly
report VID/PID as 0x000, see http://lkml.org/lkml/2007/4/27/496
Therefore we should not confuse users by dumping warnings and stacktraces
in such situation. It is not possible to add quirks for such horribly
broken devices, but currently that's not needed.
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Herbert Xu conviced me that a new flag was overkill; every driver
currently overrides get_stats, so we might as well make the internal
one the default. If someone did fail to set get_stats, they would now
get all 0 stats instead of "No statistics available".
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Get rid of the CONFIG_NETPOLL_RX option completely since all the
dependencies have been removed long ago...
Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Acked-by: Jeff Garzik <jgarzik@pobox.com>
Acked-by: Matt Mackall <mpm@selenic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>