aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ieee1394
AgeCommit message (Collapse)AuthorFilesLines
2007-05-27[SCSI] sbp2: convert to use the data buffer accessorsFUJITA Tomonori1-71/+4
- remove the unnecessary map_single path. - convert to use the new accessors for the sg lists and the parameters. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-05-10Merge branch 'juju' of ↵Linus Torvalds1-0/+2
git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6 * 'juju' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6: (138 commits) firewire: Convert OHCI driver to use standard goto unwinding for error handling. firewire: Always use parens with sizeof. firewire: Drop single buffer request support. firewire: Add a comment to describe why we split the sg list. firewire: Return SCSI_MLQUEUE_HOST_BUSY for out of memory cases in queuecommand. firewire: Handle the last few DMA mapping error cases. firewire: Allocate scsi_host up front and allocate the sbp2_device as hostdata. firewire: Provide module aliase for backwards compatibility. firewire: Add to fw-core-y instead of assigning fw-core-objs in Makefile. firewire: Break out shared IEEE1394 constant to separate header file. firewire: Use linux/*.h instead of asm/*.h header files. firewire: Uppercase most macro names. firewire: Coding style cleanup: no spaces after function names. firewire: Convert card_rwsem to a regular mutex. firewire: Clean up comment style. firewire: Use lib/ implementation of CRC ITU-T. CRC ITU-T V.41 firewire: Rename fw-device-cdev.c to fw-cdev.c and move header to include/linux. firewire: Future proof the iso ioctls by adding a handle for the iso context. firewire: Add read/write and size annotations to IOC numbers. ... Acked-by: Christoph Hellwig <hch@infradead.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-05-10[S390] Kconfig: refine depends statements.Martin Schwidefsky1-0/+1
Refine some depends statements to limit their visibility to the environments that are actually supported. Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
2007-05-09Fix occurrences of "the the "Michael Opdenacker1-1/+1
Signed-off-by: Michael Opdenacker <michael@free-electrons.com> Signed-off-by: Adrian Bunk <bunk@stusta.de>
2007-05-08header cleaning: don't include smp_lock.h when not usedRandy Dunlap3-3/+0
Remove includes of <linux/smp_lock.h> where it is not used/needed. Suggested by Al Viro. Builds cleanly on x86_64, i386, alpha, ia64, powerpc, sparc, sparc64, and arm (all 59 defconfigs). 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>
2007-05-02PCI: Cleanup the includes of <linux/pci.h>Jean Delvare1-1/+0
I noticed that many source files include <linux/pci.h> while they do not appear to need it. Here is an attempt to clean it all up. In order to find all possibly affected files, I searched for all files including <linux/pci.h> but without any other occurence of "pci" or "PCI". I removed the include statement from all of these, then I compiled an allmodconfig kernel on both i386 and x86_64 and fixed the false positives manually. My tests covered 66% of the affected files, so there could be false positives remaining. Untested files are: arch/alpha/kernel/err_common.c arch/alpha/kernel/err_ev6.c arch/alpha/kernel/err_ev7.c arch/ia64/sn/kernel/huberror.c arch/ia64/sn/kernel/xpnet.c arch/m68knommu/kernel/dma.c arch/mips/lib/iomap.c arch/powerpc/platforms/pseries/ras.c arch/ppc/8260_io/enet.c arch/ppc/8260_io/fcc_enet.c arch/ppc/8xx_io/enet.c arch/ppc/syslib/ppc4xx_sgdma.c arch/sh64/mach-cayman/iomap.c arch/xtensa/kernel/xtensa_ksyms.c arch/xtensa/platform-iss/setup.c drivers/i2c/busses/i2c-at91.c drivers/i2c/busses/i2c-mpc.c drivers/media/video/saa711x.c drivers/misc/hdpuftrs/hdpu_cpustate.c drivers/misc/hdpuftrs/hdpu_nexus.c drivers/net/au1000_eth.c drivers/net/fec_8xx/fec_main.c drivers/net/fec_8xx/fec_mii.c drivers/net/fs_enet/fs_enet-main.c drivers/net/fs_enet/mac-fcc.c drivers/net/fs_enet/mac-fec.c drivers/net/fs_enet/mac-scc.c drivers/net/fs_enet/mii-bitbang.c drivers/net/fs_enet/mii-fec.c drivers/net/ibm_emac/ibm_emac_core.c drivers/net/lasi_82596.c drivers/parisc/hppb.c drivers/sbus/sbus.c drivers/video/g364fb.c drivers/video/platinumfb.c drivers/video/stifb.c drivers/video/valkyriefb.c include/asm-arm/arch-ixp4xx/dma.h sound/oss/au1550_ac97.c I would welcome test reports for these files. I am fine with removing the untested files from the patch if the general opinion is that these changes aren't safe. The tested part would still be nice to have. Note that this patch depends on another header fixup patch I submitted to LKML yesterday: [PATCH] scatterlist.h needs types.h http://lkml.org/lkml/2007/3/01/141 Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: Badari Pulavarty <pbadari@us.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2007-04-30ieee1394: remove garbage from KconfigStefan Richter1-2/+0
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2007-04-30ieee1394: more help in KconfigStefan Richter1-8/+12
- 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>
2007-04-30ieee1394: ohci1394: Fix mistake in printk message.Simon Arlott1-1/+1
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>
2007-04-30ieee1394: ohci1394: remove unnecessary rcvPhyPkt bit flipping in LinkControl ↵Bernhard Kauer1-6/+2
register 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>
2007-04-30ieee1394: ohci1394: fix cosmetic problem in error loggingStefan Richter1-0/+1
If posted write failed, an "Unhandled interrupt(s) 0x00000100" message was logged by mistake. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2007-04-30ieee1394: eth1394: send async streams at S100 on 1394b busesStefan Richter1-5/+13
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>
2007-04-30ieee1394: eth1394: fix error path in module_initAkinobu Mita1-3/+12
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)
2007-04-30ieee1394: eth1394: correct return codes in hard_start_xmitStefan Richter1-18/+16
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>
2007-04-30ieee1394: eth1394: hard_start_xmit is called in atomic contextStefan Richter1-3/+2
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2007-04-30ieee1394: eth1394: some conditions are unlikelyStefan Richter1-4/+4
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2007-04-30ieee1394: eth1394: clean up fragment_overlapStefan Richter1-4/+4
offset > fi->offset + fi->len - 1 == !(offset < fi->offset + fi->len) offset + len - 1 < fi->offset == !(offset + len > fi->offset) !(A || B) == (!A && !B) Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2007-04-30ieee1394: eth1394: don't use alloc_etherdevStefan Richter1-15/+5
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2007-04-30ieee1394: eth1394: omit useless set_mac_address callbackStefan Richter1-13/+1
We can't reconfigure the MAC address, hence we don't need the callback. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2007-04-30ieee1394: eth1394: CONFIG_INET is always definedStefan Richter1-12/+4
because CONFIG_IEEE1394_ETH1394 depends on it. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2007-04-30ieee1394: eth1394: allow MTU bigger than 1500Stefan Richter1-15/+19
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>
2007-04-30ieee1394: unexport highlevel_host_resetAdrian Bunk1-1/+0
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>
2007-04-30ieee1394: eth1394: contain host resetStefan Richter1-4/+2
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>
2007-04-30ieee1394: eth1394: shorter error messagesStefan Richter1-24/+16
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2007-04-30ieee1394: eth1394: correct a memset argumentStefan Richter1-1/+1
The old argument calculated the correct value in a wrong way. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2007-04-30ieee1394: eth1394: refactor .probe and .updateStefan Richter1-32/+16
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>
2007-04-30ieee1394: eth1394: .probe and .update may sleepStefan Richter1-8/+4
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2007-04-30ieee1394: eth1394: coding styleStefan Richter2-244/+206
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>
2007-04-30ieee1394: eth1394: Move common recv_init code to helper functionJean Delvare1-40/+31
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>
2007-04-30ieee1394: eth1394: don't autoload by hotplug when ohci1394 startsStefan Richter5-86/+36
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>
2007-04-30ieee1394: eth1394: reduce excessive function inliningStefan Richter1-38/+36
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>
2007-04-30ieee1394: eth1394: clean up host removalStefan Richter1-17/+10
ether1394_add_host() guarantees that hi->dev != NULL if hi != NULL. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2007-04-30ieee1394: eth1394: unregister address space in failure caseStefan Richter1-7/+6
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>
2007-04-30ieee1394: send async streams at S100Stefan Richter1-0/+7
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>
2007-04-30ieee1394: SPIN_LOCK_UNLOCKED cleanupMilind Arun Choudhary1-1/+1
SPIN_LOCK_UNLOCKED cleanup,use DEFINE_SPINLOCK instead Signed-off-by: Milind Arun Choudhary <milindchoudhary@gmail.com> Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2007-04-30ieee1394: nodemgr: unify some error messagesStefan Richter1-8/+5
Shrinks object file size a little bit. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2007-04-30ieee1394: nodemgr: less noise in dmesgStefan Richter1-7/+8
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>
2007-04-30ieee1394: unroll a weird macroStefan Richter1-50/+41
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>
2007-04-30ieee1394: iso.c needs sched.hAndrew Morton1-0/+1
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)
2007-04-30ieee1394: some more includesStefan Richter2-0/+4
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2007-04-30ieee1394: ieee1394_transactions needs sched.hTorsten Kaiser1-0/+1
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)
2007-04-30ieee1394: ieee1394_core printk formatRandy Dunlap1-1/+1
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>
2007-04-30ieee1394: remove usage of skb_queue as packet queueStefan Richter6-169/+163
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>
2007-04-30ieee1394: csr1212: log if devices have CRC errors in their ROMStefan Richter1-18/+9
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>
2007-04-30ieee1394: csr1212: more sensible names for jump targetsStefan Richter1-10/+8
Code beneath two labels called "fail" is actually also reached in case of success. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2007-04-30ieee1394: csr1212: warn on unreachable codeStefan Richter1-2/+5
We want bugs to show themselves. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2007-04-30ieee1394: shrink csr1212_new_string_descriptor_leafStefan Richter1-77/+46
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>
2007-04-30ieee1394: csr1212: coding styleStefan Richter2-113/+133
Whitespace, line breaks, braces... Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2007-04-30ieee1394: replace vmalloc by kmalloc in csr1212Stefan Richter2-4/+6
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>
2007-04-30ieee1394: de-inline some functionsStefan Richter3-32/+33
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>
2007-04-30ieee1394: stricter error checks in csr1212Stefan Richter3-51/+34
return -EINVAL becomes BUG_ON in checks of function call parameters. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2007-04-30ieee1394: csr1212: rename some typesStefan Richter2-81/+74
Use u8, u32 etc. instead of u_int8_t, csr1212_quad_t etc. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2007-04-30ieee1394: drop csr1212's support for external compilationStefan Richter4-168/+84
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>
2007-04-30ieee1394: remove unused csr1212 codeStefan Richter2-480/+99
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>
2007-04-30ieee1394: small header cleanupStefan Richter2-2/+2
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2007-04-30ieee1394: move some comments from declaration to definitionStefan Richter18-239/+348
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2007-04-30ieee1394: remove declarations of nonexisting functionsStefan Richter3-14/+1
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2007-04-30ieee1394: sbp2: include fixesAndrew Morton1-0/+2
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)
2007-04-30ieee1394: sbp2: move some memory allocations into non-atomic contextStefan Richter1-15/+5
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>
2007-04-30ieee1394: sbp2: optimize DMA direction of s/g tablesStefan Richter1-6/+6
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>
2007-04-30ieee1394: sbp2: enforce 32bit DMA mappingStefan Richter1-0/+5
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>
2007-04-30ieee1394: sbp2: remove unnecessary alignments of struct membersStefan Richter1-4/+4
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>
2007-04-27IEEE1394: remove rwsem use from ieee1394 coreGreg Kroah-Hartman1-8/+0
The subsystem rwsem is not used by the driver core at all, so the use of it in the ieee1394 code doesn't make any sense. They might possibly want to use a local lock, but as most of these operations are already protected by a local lock, it really doesn't look like it would be needed. Cc: Ben Collins <bcollins@debian.org> Cc: Stefan Richter <stefanr@s5r6.in-berlin.de> Cc: linux1394-devel <linux1394-devel@lists.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2007-04-27uevent: use add_uevent_var() instead of open coding itEric Rannaud1-8/+6
Make use of add_uevent_var() instead of (often incorrectly) open coding it. Signed-off-by: Michael Ellerman <michael@ellerman.id.au> Signed-off-by: Eric Rannaud <eric.rannaud@gmail.com> Cc: Kay Sievers <kay.sievers@vrfy.org> Cc: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2007-04-25[SK_BUFF]: Introduce ip_hdr(), remove skb->nh.iphArnaldo Carvalho de Melo1-1/+1
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-25[SK_BUFF]: Introduce skb_mac_header()Arnaldo Carvalho de Melo1-1/+1
For the places where we need a pointer to the mac header, it is still legal to touch skb->mac.raw directly if just adding to, subtracting from or setting it to another layer header. This one also converts some more cases to skb_reset_mac_header() that my regex missed as it had no spaces before nor after '=', ugh. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-25[SK_BUFF]: Introduce skb_reset_mac_header(skb)Arnaldo Carvalho de Melo1-1/+1
For the common, open coded 'skb->mac.raw = skb->data' operation, so that we can later turn skb->mac.raw into a offset, reducing the size of struct sk_buff in 64bit land while possibly keeping it as a pointer on 32bit. This one touches just the most simple case, next will handle the slightly more "complex" cases. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2007-04-09ieee1394: change deprecation status of dv1394Stefan Richter2-5/+5
Nobody ported ffmpeg from dv1394 to rawiso yet, and there is no justification to remove dv1394 right now. Nevertheless, a strong deprecation of this ABI makes a lot of sense, especially as Kristian H's drivers shape up to be an attractive alternative to the existing ones. But we don't have a schedule at the moment. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2007-03-23ieee1394: fix oops on "modprobe -r ohci1394" after network class_device ↵Stefan Richter1-0/+3
conversion The networking subsystem has been converted from class_device to device but ieee1394 hasn't. This results in a 100% reproducible NULL pointer dereference if the ohci1394 driver module is unloaded while the eth1394 module is still loaded. http://lkml.org/lkml/2006/11/16/147 http://lkml.org/lkml/2007/3/14/4 This is a regression in 2.6.21-rc1. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> Tested-by: Ismail Dönmez <ismail@pardus.org.tr>
2007-03-09firewire: put old and new stack into same Kconfig submenuStefan Richter1-0/+2
Screenshot from "make menuconfig": ... ?????????????????????? IEEE 1394 (FireWire) support ??????????????????????? ? Arrow keys navigate the menu. <Enter> selects submenus --->. ? ... ? ??????????????????????????????????????????????????????????????????????? ? ? ? <M> IEEE 1394 (FireWire) support (JUJU alternative stack, experim? ? ? ? <M> Support for OHCI firewire host controllers ? ? ? ? <M> Support for storage devices (SBP-2 protocol driver) ? ? ? ? <M> IEEE 1394 (FireWire) support ? ? ? ? --- Subsystem Options ? ? ? ? [ ] Excessive debugging output ? ? ... ? <Select> < Exit > < Help > ? ??????????????????????????????????????????????????????????????????????????? Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2007-02-19Merge git://git.kernel.org/pub/scm/linux/kernel/git/bunk/trivialLinus Torvalds1-1/+1
* git://git.kernel.org/pub/scm/linux/kernel/git/bunk/trivial: (25 commits) Documentation/kernel-docs.txt update. arch/cris: typo in KERN_INFO Storage class should be before const qualifier kernel/printk.c: comment fix update I/O sched Kconfig help texts - CFQ is now default, not AS. Remove duplicate listing of Cris arch from README kbuild: more doc. cleanups doc: make doc. for maxcpus= more visible drivers/net/eexpress.c: remove duplicate comment add a help text for BLK_DEV_GENERIC correct a dead URL in the IP_MULTICAST help text fix the BAYCOM_SER_HDX help text fix SCSI_SCAN_ASYNC help text trivial documentation patch for platform.txt Fix typos concerning hierarchy Fix comment typo "spin_lock_irqrestore". Fix misspellings of "agressive". drivers/scsi/a100u2w.c: trivial typo patch Correct trivial typo in log2.h. Remove useless FIND_FIRST_BIT() macro from cardbus.c. ...
2007-02-19Merge branch 'for-linus' of ↵Linus Torvalds6-1/+80
ssh://master.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6 * 'for-linus' of ssh://master.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6: ieee1394: fix another deadlock in nodemgr ieee1394: cycle timer read extension for raw1394
2007-02-17Storage class should be before const qualifierTobias Klauser1-1/+1
The C99 specification states in section 6.11.5: The placement of a storage-class specifier other than at the beginning of the declaration specifiers in a declaration is an obsolescent feature. Signed-off-by: Tobias Klauser <tklauser@distanz.ch> Signed-off-by: Adrian Bunk <bunk@stusta.de>
2007-02-17ieee1394: fix another deadlock in nodemgrStefan Richter1-1/+2
A "modprobe ohci1394; sleep 1.5; modprobe -r ohci1394" could get stuck in uninterruptible state, especially if an external node was connected. http://bugzilla.kernel.org/show_bug.cgi?id=7792 Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2007-02-17ieee1394: cycle timer read extension for raw1394Pieter Palmers5-0/+78
This implements the simultaneous read of the isochronous cycle timer and the system clock (in usecs). This allows to express the exact receive time of an ISO packet as a system time with microsecond accuracy. http://bugzilla.kernel.org/show_bug.cgi?id=7773 The counterpart patch for libraw1394 can be found at http://thread.gmane.org/gmane.linux.kernel.firewire.devel/8934 Patch update (Stefan R.): Disable preemption and local interrupts. Prevent integer overflow. Add paranoid error checks and kerneldoc to hpsb_read_cycle_timer. Move it to other ieee1394_core high-level API functions. Change comments. Adjust whitespace. Rename struct _raw1394_cycle_timer. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> Acked-by: Pieter Palmers <pieterp@joow.be> Acked-by: Dan Dennedy <dan@dennedy.org>
2007-02-14[PATCH] remove many unneeded #includes of sched.hTim Schmielau3-3/+0
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>
2007-02-13i2c: Declare more i2c_adapter parent devicesJean Delvare1-0/+1
Declare the parent device of i2c_adapter devices each time we can easily do so. It makes the i2c_adapter appear at the right place in the device tree, rather than as a platform device. Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: David Brownell <dbrownell@users.sourceforge.net> Cc: Len Brown <len.brown@intel.com> Cc: Jordan Crouse <jordan.crouse@amd.com> Cc: Jody McIntyre <scjody@modernduck.com> Cc: Stefan Richter <stefanr@s5r6.in-berlin.de> Cc: v4l-dvb-maintainer@linuxtv.org Cc: Petr Vandrovec <vandrove@vc.cvut.cz>
2007-02-12[PATCH] mark struct file_operations const 3Arjan van de Ven3-3/+3
Many struct file_operations in the kernel can be "const". Marking them const moves these to the .rodata section, which avoids false sharing with potential dirty data. In addition it'll catch accidental writes at compile time to these shared resources. Signed-off-by: Arjan van de Ven <arjan@linux.intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-02-08ieee1394: fix host device registering when nodemgr disabledStefan Richter1-8/+16
Since my commit 8252bbb1363b7fe963a3eb6f8a36da619a6f5a65 in 2.6.20-rc1, host devices have a dummy driver attached. Alas the driver was not registered before use if ieee1394 was loaded with disable_nodemgr=1. This resulted in non-functional FireWire drivers or kernel lockup. http://bugzilla.kernel.org/show_bug.cgi?id=7942 Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2007-02-08ieee1394: video1394: DMA fixDavid Moore1-0/+8
This together with the phys_to_virt fix in lib/swiotlb.c::swiotlb_sync_sg fixes video1394 DMA on machines with DMA bounce buffers, especially Intel x86-64 machines with > 3GB RAM. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> Signed-off-by: David Moore <dcm@acm.org> Tested-by: Nicolas Turro <Nicolas.Turro@inrialpes.fr>
2007-02-08ieee1394: raw1394: prevent unloading of low-level driverStefan Richter1-19/+29
Unloading the low-level driver module of a FireWire host can lead to all sorts of trouble if a raw1394 userspace client is using the host. Just disallow it by incrementing the LLD's module reference count on a RAW1394_REQ_SET_CARD write operation. Decrement it when the file is closed. This feature wouldn't be relevant if "modprobe -r video1394" or "modprobe -r dv1394" didn't automatically unload ohci1394 too. http://bugzilla.kernel.org/show_bug.cgi?id=7701 Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> Signed-off-by: Dan Dennedy <dan@dennedy.org>
2007-02-08ieee1394: dv1394: tidy up card removalStefan Richter1-23/+13
small coding style touch-up and terser coding Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2007-02-08ieee1394: dv1394: fix CardBus card ejectionStefan Richter1-7/+5
Fix NULL pointer dereference on hot ejection of a FireWire card while dv1394 was loaded. http://bugzilla.kernel.org/show_bug.cgi?id=7121 I did not test card ejection with open /dev/dv1394 files yet. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2007-02-08ieee1394: sbp2: lower block queue alignment requirementStefan Richter1-2/+0
The old setting is copy & waste from usb-storage and doesn't apply to sbp2. There is only 4-byte alignment required for everything, except for S/G table elements which have to be 8-byte aligned according to the SBP-2 spec. (They happen to be ____cacheline_aligned in our implementation. Whether that's good is another question.) We now simply don't tune block queue alignment at all. The default alignment would surely never become anything else than a multiple of 4, else tons of calls to blk_queue_dma_alignment would have to be added everywhere in drivers/... Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2007-02-08ieee1394: sbp2: remove bogus "emulated" host flagStefan Richter1-1/+0
There is no emulation going on here. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2007-02-08ieee1394: save one word in struct hpsb_hostStefan Richter1-2/+2
hpsb_host.config_roms is a bitfield of which only one bit is currently used. hpsb_host.update_config_rom is only a Boolean. Neither one is accessed in hot code paths or with alignment requirements. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2007-02-08ieee1394: restore config ROM when resumingStefan Richter4-9/+12
After PM suspend + resume, the local configuration ROM was not restored. This prevented remote nodes from recognizing the resuming machine. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2007-02-08ieee1394: ohci1394: drop pcmcia-cs compatibility codeStefan Richter1-7/+2
#ifdef PCMCIA is only true if compiled inside pcmcia-cs, isn't it? Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2007-02-08ieee1394: nodemgr: check info_length in ROM header earlierStefan Richter1-3/+6
The whole ROM area which is covered by the crc_length field of the ROM header was fetched before the info_length field was checked for correct general ROM format. This might be wasteful or even dangerous with nodes with minimal ROM, nonstandard ROM, or corrupt ROM. Perform this check at the earliest opportunity. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2007-02-08the scheduled IEEE1394_OUI_DB removalAdrian Bunk7-7137/+0
This patch contains the scheduled IEEE1394_OUI_DB removal. Signed-off-by: Adrian Bunk <bunk@stusta.de> Update: Also remove drivers/ieee1394/.gitignore. Remove now unused struct members in drivers/ieee1394/nodemgr.h. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2007-02-08the scheduled IEEE1394_EXPORT_FULL_API removalAdrian Bunk2-29/+0
This patch contains the scheduled IEEE1394_EXPORT_FULL_API removal. Signed-off-by: Adrian Bunk <bunk@stusta.de> Update: Pull proper portion of feature-removal-schedule.txt. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2007-02-08ieee1394: sbp2: use a better wildcard for blacklistStefan Richter1-12/+8
0x000000 could be a valid value to match against, but anything bigger than 0xffffff cannot. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2007-02-08Add PCI class ID for firewire OHCI controllers.Kristian Høgsberg1-3/+1
Pull this define out of drivers/ieee1394/ohci1394.c and rename to match other PCI class defines. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2007-02-08ieee1394: modified csr1212_key_id_type_map to support lisightAndrea Guzzo1-3/+3
This patch applies a little change in csr1212.c to fix iSight (firewire digital camera) related issues (but maybe other firewire devices could also need such modification) The actual implementation of the "csr1212_key_id_type_map" table doesn't support some node types used by the iSight for the audio unit. This limit makes the csr scanning routine to never see the audio unit node , and consequently the iSight driver probe() routine to be never called and there is no way to hook an isight device when it is inserted. Signed-off-by: Andrea Guzzo <xant@xant.net> Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2007-01-10ieee1394: sbp2: fix probing of some DVD-ROM/RWsStefan Richter1-0/+2
Since commit 98e238cd42be6c0852da519303cf0182690f8d9f in Linux 2.6.19, "ieee1394: sbp2: don't prefer MODE SENSE 10", some FireWire DVD-ROMs and DVD-RWs were mistaken as CD-ROM because sr_mod now sent MODE SENSE 6. The MMC command set includes only MODE SENSE 10. http://bugzilla.kernel.org/show_bug.cgi?id=7800 This fix lets sbp2 switch scsi_device.use_10_for_rw on for MMC LUs. This should rather be done in the command set driver sr_mod, not in the sbp2 transport driver, and an according patch will follow for a next Linux release. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-30ieee1394: sbp2: fix bogus dma mappingStefan Richter1-33/+40
Need to use a PCI device, not a FireWire host device. Problem found by Andreas Schwab, mistake pointed out by Benjamin Herrenschmidt. http://ozlabs.org/pipermail/linuxppc-dev/2006-December/029595.html Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> Tested-by: Andreas Schwab <schwab@suse.de>
2006-12-30ieee1394: sbp2: pass REQUEST_SENSE through to the targetStefan Richter1-10/+0
Delete some incorrect code, left over from the initial driver submission in March 2001. SBP-2 targets should provide sense data via the SBP-2 status block (autosense). We have to pass the REQUEST_SENSE command through to targets which don't implement autosense, if there are any, and to accomodate application clients which use this command. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-10i2c: Discard the i2c algo del_bus wrappersJean Delvare1-1/+1
They are all only calling i2c_del_adapter, so we may as well do it directly. Signed-off-by: Jean Delvare <khali@linux-fr.org>
2006-12-08[PATCH] struct path: convert ieee1394Josef Sipek1-1/+1
Signed-off-by: Josef Sipek <jsipek@fsl.cs.sunysb.edu> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-12-07ieee1394: sbp2: code formatting around work_struct stuffStefan Richter1-7/+9
Merge is finished, can bring the code in readable style again. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07ieee1394: nodemgr: remove a kcallocStefan Richter1-46/+20
Was I sleepwalking when I wrote this? Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07ieee1394: conditionally export ieee1394_bus_typeStefan Richter1-0/+1
Follow-up to patch "Consolidate driver registering": Since I plan the lifetime of Linux 2.6.20 to be the deprecation phase of CONFIG_IEEE1394_EXPORT_FULL_API, it seems fair to keep all previously exported symbols available with this option until this phase is over. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07ieee1394: Consolidate driver registeringBen Collins8-27/+22
This patch consolidates some bookkeeping for driver registering. It closely models what pci_register_driver() does. The main addition is that the owner of the driver is set, so we get a proper symlink for /sys/bus/ieee1394/driver/*/module. Also moves setting of name and bus type into nodemgr. Because of this, we can remove the EXPORT_SYMBOL for ieee1394_bus_type, since it's now only used in ieee1394.ko. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07ieee1394: sbp2: convert from PCI DMA to generic DMAStefan Richter3-68/+62
API conversion without change in functionality Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07ieee1394: nodemgr: spaces to tabsStefan Richter1-49/+49
whitespace pedantry Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07ieee1394: nodemgr: fix deadlock in shutdownStefan Richter1-3/+18
If "modprobe ohci1394" was quickly followed by "modprobe -r ohci1394", say with 1 second pause in between, the modprobe -r got stuck in uninterruptible sleep in kthread_stop. At the same time the knodemgrd slept uninterruptibly in bus_rescan_devices_helper. That's because driver_detach took the semaphore of the PCI device and bus_rescan_devices_helper wanted to take the semaphore of the FireWire host device's parent, which is the same semaphore. This was a regression since Linux 2.6.16, commit bf74ad5bc41727d5f2f1c6bedb2c1fac394de731, "Hold the device's parent's lock during probe and remove". The fix (or workaround) adds a dummy driver to the hpsb_host device. Now bus_rescan_devices_helper won't scan the host device anymore. This doesn't hurt since we have no drivers which will bind to these devices and it is unlikely that there will ever be such a driver. The dummy driver is befittingly presented as a representation of ieee1394 itself. Fixes: http://bugzilla.kernel.org/show_bug.cgi?id=6706 Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07ieee1394: nodemgr: remove duplicate assignmentStefan Richter1-1/+1
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07sbp2: make 1bit bitfield unsignedLuca Tettamanti1-1/+1
A signed single-bit bitfield doesn't make much sense. Make it unsigned. Signed-off-by: Luca Tettamanti <kronos.it@gmail.com> Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07ieee1394: schedule *_oui sysfs attributes for removalStefan Richter1-1/+1
There is no manpower available to reform oui.db into a library for use in more kernel subsystems. The low ratio of usefulness to size and the occasional need to update oui.db from IEEE's official list suggest to drop oui.db. I plan to make a userspace script available which translates the remaining numeric sysfs attributes to names of organizations. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07ieee1394: schedule unused symbol exports for removalStefan Richter1-7/+2
This also means that former parts of ieee1394's API will be subject to change or removal. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07ieee1394: dv1394: schedule for feature removalStefan Richter2-9/+8
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07ieee1394: raw1394: defer feature removal of old isoch interfaceStefan Richter1-0/+17
Known to be affected: - libdc1394: prefers video1394 for now, old-style raw1394 support might be dropped eventually - OpenH323 PWLib, AVC video input module: uses libraw1394's old API Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07ieee1394: ohci1394: call PMac code in shutdown only for proper machinesStefan Richter1-1/+1
There has been an if(...) missing, for ages. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07ieee1394: ohci1394: reformat PPC_PMAC platform codeStefan Richter1-20/+14
Adjust whitespace and line lengths Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07ieee1394: ohci1394: add PPC_PMAC platform code to driver probeStefan Richter1-4/+15
Fixes http://bugzilla.kernel.org/show_bug.cgi?id=7431 iBook G3 threw a machine check exception and put the display backlight to full brightness after ohci1394 was unloaded and reloaded. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07ieee1394: sbp2: wrap two functions into oneStefan Richter1-23/+7
Move the body of a function into its only caller. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07ieee1394: sbp2: update comment on things to doStefan Richter1-7/+19
Some people actually look at those comments. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07ieee1394: sbp2: use list_move_tail()Stefan Richter1-2/+1
It's OK to reorder list_del() and sbp2util_free_command_dma() here. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07ieee1394: sbp2: more concise names for types and variablesStefan Richter2-598/+575
"struct scsi_id_instance_data" represents a logical unit. Rename it to "struct sbp2_lu", and "scsi_id" to "lu". Rename some other variables too. Wrap almost all lines after at most 80 columns. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07ieee1394: sbp2: remove unused struct membersStefan Richter2-25/+4
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07ieee1394: sbp2: proper unit in module parameter descriptionStefan Richter1-1/+2
It's 2^20 bit/s, not 0.001 bit. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07ieee1394: sbp2: clean up sbp2_ namespaceStefan Richter2-133/+132
Prepend sbp2*_ to anything globally defined in sbp2.c except for some macros. Strip sbp2_ from names of struct members. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07ieee1394: sbp2: some conditions in queue_command are unlikelyStefan Richter1-5/+5
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07ieee1394: sbp2: remove superfluous commentsStefan Richter2-355/+109
And update and reformat remaining comments. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07ieee1394: sbp2: delayed_work -> work_structStefan Richter2-16/+12
This work is not delayed. Also bring the code format in a state which reduces my work to merge pending sbp2 patchs. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07ieee1394: sbp2: coding style of some macrosStefan Richter1-77/+78
Adjust parentheses, indentation, line lengths. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07ieee1394: sbp2: remove debug macrosStefan Richter1-280/+20
No need to keep them in released sources. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07ieee1394: sbp2: consolidate log levelsStefan Richter1-19/+12
Replace some calls to SBP2_ERR and SBP2_WARN by SBP2_INFO. Remove logging macros SBP2_NOTICE and SBP2_WARN. Remove direct usage of HPSB_ logging macros. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07ieee1394: sbp2: remove duplicate codeStefan Richter1-11/+0
The same case is handled further below in sbp2scsi_complete_command. Note, the second version behaves slightly different but looks preferable. It's an extremely unlikely case by the way. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07ieee1394: sbp2: remove dead codeStefan Richter1-15/+0
This has been within #if 0 for a long time and is wrong anyway. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07ieee1394: sbp2: clean up function declarationsStefan Richter2-104/+86
Remove unnecessary function prototypes. Remove variable names from function prototypes. Move declarations from sbp2.h to sbp2.c. Move definitions of driver templates together near the top of sbp2.c. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07ieee1394: sbp2: remove irritating log messageStefan Richter1-2/+0
The queue depth can be read from /sys/bus/scsi/devices/*/queue_depth, so don't log it. And the hint about speed improvements is misleading, at least under current kernels. If serialization is switched off, read performance is typically increased by less than 10%. (I did not test write performance recently.) On the other hand, serialize_io=0 is not yet safe due to some implementation issues that are not trivial to fix. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07ohci1394: shortcut irq printingAlexey Dobriyan1-4/+2
To print irq number no need to transform to string using %d, then print using %s. Just use %d. Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
2006-12-07ieee1394: nodemgr: take it easy if bus_rescan_devices failsStefan Richter1-3/+2
This happens. No need to log a BUG trace. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07drivers/ieee1394/*: use kmemdup()Eric Sesterhenn2-4/+2
Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de> Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07ieee1394: ohci1394: proper log messages in suspend and resumeStefan Richter1-11/+15
- correct thinko in one of my last commits: cannot use PRINT macro with ohci == NULL - add log messages on ohci == NULL and on pci_enable_device != 0 - update log macros from patch "revert fail on error in suspend" to use PRINT and DBGMSG where possible Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07ieee1394: ohci1394: revert fail on error in suspendStefan Richter1-2/+11
Some errors during preparation for suspended state can be skipped with a warning instead of a failure of the whole suspend transition, notably an error in pci_set_power_state. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07ieee1394: only build OUI database files if config enabledRandy Dunlap1-1/+4
Only build IEEE1394 OUI database files if the config option is enabled. Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07ieee1394: fix printk format warningRandy Dunlap1-1/+1
Fix printk format warning: drivers/ieee1394/nodemgr.c:364: warning: long long unsigned int format, u64 arg (arg 3) Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07ieee1394: nodemgr: revise semaphore protection of driver core dataStefan Richter1-50/+92
- The list "struct class.children" is supposed to be protected by class.sem, not by class.subsys.rwsem. - nodemgr_remove_uds() iterated over nodemgr_ud_class.children without proper protection. This was never observed as a bug since the code is usually only accessed by knodemgrd. All knodemgrds are currently globally serialized. But userspace can trigger this code too by writing to /sys/bus/ieee1394/destroy_node. - Clean up access to the FireWire bus type's subsys.rwsem: Access it uniformly via ieee1394_bus_type. Shrink rwsem protected regions where possible. Expand them where necessary. The latter wasn't a problem so far because knodemgr is globally serialized. This should harden the interaction of ieee1394 with sysfs and lay ground for deserialized operation of multiple knodemgrds and for implementation of subthreads for parallelized scanning and probing. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07ieee1394: nodemgr: reflect which return values are errorsStefan Richter1-34/+30
Give better names to local variables. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07ieee1394: nodemgr: small fix after sysfs errors patchStefan Richter1-1/+1
One hunk in "ieee1394: handle sysfs errors" was wrong. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07dv1394: remove BKL contentionStefan Richter1-11/+3
Purges the one remaining call to lock_kernel() from the 1394 subsystem. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07video1394: remove BKL contentionDaniel Drake1-24/+6
video1394 does not need to take the BKL. The data structures shared between file_operations and interrupts are already protected through context-specific spinlocks. The only other danger is video1394_release() being called during another operation, however this cannot happen because release is only ever invoked when the last thread has closed the fd. Signed-off-by: Daniel Drake <ddrake@brontes3d.com> Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07video1394: small optimizations to frame retrieval codepathDaniel Drake1-8/+10
Add some GCC branch prediction optimizations to unlikely error/safety conditions in the ioctl handling code commonly called during an application's capture loop. Signed-off-by: Daniel Drake <ddrake@brontes3d.com> Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07ieee1394: handle sysfs errorsStefan Richter2-49/+118
Handle driver core errors with as much care as appropriate. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07ieee1394: coding style in hosts.cStefan Richter1-7/+11
Some 80-columns pedantry, and touch up of a // comment. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07ieee1394: lock smaller region by host_num_alloc mutexStefan Richter1-4/+1
We need the mutex only around the iteration over existing hosts. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07ieee1394: usecs_to_jiffies takes unsigned int argumentStefan Richter1-5/+3
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07ieee1394: ohci1394: suspend/resume cosmeticsStefan Richter1-78/+48
Reorder the definitions of ohci1394_pci_suspend and _resume. Remove redundant comments. Beautify return statements. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07ohci1394: steps to implement suspend/resumeBernhard Kaindl1-14/+78
I did a quick shot on what I described and the appended patch does the first thing needed for working suspend/resume in ohci1394 which is HW de- and re-initialisation. It works with suspend2disk on my Ricoh R5C552 IEEE 1394 Controller with the 2.6.17 kernel to the extent that if I call dvgrab --interactive after suspend2disk without unloading ohci1394, it does not lock up dvgrab with 100% CPU but properly connects to the camera, given that I first unplug and plug the camera after coming back from suspend. I guess that could be fixed by forcing a bus reset in the resume function. I cannot test suspend to RAM here at the moment and should follow the guidelines in Documentation/power/pci.txt also, so this is rather a quick report than a finished patch and there are some rough edges: However, with this patch, I have to unload at least some in-kernel users of ohci1394 like dv1394 or video1394 before suspending. Not doing that caused an Oops and a bad tasklet error, probably from not handling ISO tasklets during suspend/resume properly. Maybe these can be temporarily cleared or unregistered and re-registered for suspend/resume with help from the other layers or from the highlevel 1394 core, but I do not really know what these do. But this patch provides a useful base to start from and is already of much help for people which do not need dv1394 and video1394 or can unload them at least during suspend. I cannot test function with sbp2 at the moment, but raw1394 seems to work fine. Signed-off-by: Bernhard Kaindl <bk@fsfe.org> Update 1: merge with previous two ohci1394 suspend/resume patches Update 2: version for application on top of Linux 2.6.19-rc4 Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07ieee1394: raw1394: add comments on lock usageStefan Richter1-5/+5
Add a who-is-who about some locks and list heads in raw1394's struct definitions. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07ieee1394: sbp2: slightly reorder sbp2scsi_abortStefan Richter1-8/+2
Put the target's fetch agent into reset state before the underlying ORB DMA is unmapped and the ->done handler is called. It is highly unlikely but the target could access that ORB right before sbp2 sends the reset request. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07ieee1394: remove unused struct member from highlevel APIStefan Richter1-1/+0
struct hpsb_highlevel's struct module *owner is neither used by the IEEE 1394 core nor set by any of the in-tree drivers or the two out-of-tree highlevel drivers I know about (dfg1394, mem1394) --- nor is this member documented. An unscheduled removal seems acceptable. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-12-07[PATCH] Add include/linux/freezer.h and move definitions from sched.hNigel Cunningham1-0/+1
Move process freezing functions from include/linux/sched.h to freezer.h, so that modifications to the freezer or the kernel configuration don't require recompiling just about everything. [akpm@osdl.org: fix ueagle driver] Signed-off-by: Nigel Cunningham <nigel@suspend2.net> Cc: "Rafael J. Wysocki" <rjw@sisk.pl> Cc: Pavel Machek <pavel@ucw.cz> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-12-07[PATCH] slab: remove kmem_cache_tChristoph Lameter1-1/+1
Replace all uses of kmem_cache_t with struct kmem_cache. The patch was generated using the following script: #!/bin/sh # # Replace one string by another in all the kernel sources. # set -e for file in `find * -name "*.c" -o -name "*.h"|xargs grep -l $1`; do quilt add $file sed -e "1,\$s/$1/$2/g" $file >/tmp/$$ mv /tmp/$$ $file quilt refresh done The script was run like this sh replace kmem_cache_t "struct kmem_cache" Signed-off-by: Christoph Lameter <clameter@sgi.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-12-07[PATCH] slab: remove SLAB_KERNELChristoph Lameter4-11/+11
SLAB_KERNEL is an alias of GFP_KERNEL. Signed-off-by: Christoph Lameter <clameter@sgi.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-12-07[PATCH] slab: remove SLAB_ATOMICChristoph Lameter1-15/+15
SLAB_ATOMIC is an alias of GFP_ATOMIC Signed-off-by: Christoph Lameter <clameter@sgi.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-11-22WorkStruct: make allyesconfigDavid Howells4-18/+23
Fix up for make allyesconfig. Signed-Off-By: David Howells <dhowells@redhat.com>
2006-10-30[ETH1394]: Fix unaligned accesses.David S. Miller1-8/+12
Several u64 objects are derefernced in situations where the pointer is not guarenteed to be aligned correctly. Use get_unaligned() as needed. Thanks to Will Simoneau for lots of testing and debugging help. Signed-off-by: David S. Miller <davem@davemloft.net> Acked-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-10-29ieee1394: ohci1394: revert fail on error in suspendStefan Richter1-5/+14
Some errors during preparation for suspended state can be skipped with a warning instead of a failure of the whole suspend transition, notably an error in pci_set_power_state. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-10-08Merge branch 'upstream-linus' of ↵Linus Torvalds1-1/+1
git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6 * 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6: ieee1394: nodemgr: fix startup of knodemgrd
2006-10-08ieee1394: nodemgr: fix startup of knodemgrdStefan Richter1-1/+1
Revert a thinko in commit d2f119fe319528da8c76a1107459d6f478cbf28c: When knodemgrd starts, it needs to sleep until host->generation was incremented above its initial value of 0. My wrong logic caused it to start sending requests when the bus wasn't completely ready. Seen as "AT dma reset ctx=0, aborting transmission" messages in 2.6.19-rc1. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-10-05IRQ: Maintain regs pointer globally rather than passing to IRQ handlersDavid Howells2-4/+2
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)
2006-10-03Fix several typos in drivers/Matt LaPlante1-1/+1
Signed-off-by: Adrian Bunk <bunk@stusta.de>
2006-09-30Merge branch 'upstream-linus' of ↵Linus Torvalds29-1133/+1200
git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6 * 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6: (48 commits) ieee1394: raw1394: arm functions slept in atomic context ieee1394: sbp2: enable auto spin-up for all SBP-2 devices MAINTAINERS: updates to IEEE 1394 subsystem maintainership ieee1394: ohci1394: check for errors in suspend or resume set power state of firewire host during suspend ieee1394: ohci1394: more obvious endianess handling ieee1394: ohci1394: fix endianess bug in debug message ieee1394: sbp2: don't prefer MODE SENSE 10 ieee1394: nodemgr: grab class.subsys.rwsem in nodemgr_resume_ne ieee1394: nodemgr: fix rwsem recursion ieee1394: sbp2: more help in Kconfig ieee1394: sbp2: prevent rare deadlock in shutdown ieee1394: sbp2: update includes ieee1394: sbp2: better handling of transport errors ieee1394: sbp2: recheck node generation in sbp2_update ieee1394: sbp2: safer agent reset in error handlers ieee1394: sbp2: handle "sbp2util_node_write_no_wait failed" CONFIG_PM=n slim: drivers/ieee1394/ohci1394.c ieee1394: safer definition of empty macros video1394: add poll file operation support ...
2006-09-26i2c-algo-bit: Discard the mdelay data struct memberJean Delvare1-1/+0
i2c-algo-bit: Discard the mdelay data struct member The i2c_algo_bit_data structure has an mdelay member, which is not used by the algorithm code (the code has always been ifdef'd out.) Let's discard it to save some code and memory. Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br> Cc: Adrian Bunk <bunk@stusta.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-09-23ieee1394: raw1394: arm functions slept in atomic contextStefan Richter1-18/+16
Sleeping functions like copy_to_user were accessed inside spinlocks in raw1394's arm_register, arm_unregister, arm_get_buf, arm_set_buf. http://bugzilla.kernel.org/show_bug.cgi?id=7120 Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> Tested-by: David Trent <DTrent@piacton.com> (cherry picked from e575953ec17c3f5c1e738847d2d16c241bb99783 commit)
2006-09-17ieee1394: sbp2: enable auto spin-up for all SBP-2 devicesStefan Richter1-3/+1
This is a follow-up to patch "ieee1394: sbp2: enable auto spin-up for Maxtor disks". When I 'ejected' an OXUF922 based HDD from a Mac OS X box, it was spun down by the Mac and did not spin up by itself when attached to a Linux box right after that. The first SCSI command that required the bridge to access the drive ended in sda:<6>sd 18:0:0:0: Device not ready: <6>: Current: sense key: Not Ready Additional sense: Logical unit not ready, initializing cmd. required Therefore the flag which instructs scsi_mod to send START STOP UNIT with START=1 ("make medium ready") after such a condition is now enabled unconditionally for all FireWire storage devices. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-09-17ieee1394: ohci1394: check for errors in suspend or resumeStefan Richter1-6/+11
Some of the suspend and resume litany may fail. Tell the PCI core about it. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-09-17set power state of firewire host during suspendPavel Machek1-4/+6
Put firewire host controller in PCI Dx state for system suspend. (I was not able to measure any power savings, but it sounds like right thing to do, anyway.) Signed-off-by: Pavel Machek <pavel@suse.cz> Update by stefanr: Shuffle with existing PPC_PMAC code. Set power state in the resume hook too. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-09-17ieee1394: ohci1394: more obvious endianess handlingStefan Richter1-14/+13
Rename ohci1394's packet_swab to header_le32_to_cpu to better reflect what it actually does. Also, define a constant array as 'const' and check the array index properly. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-09-17ieee1394: ohci1394: fix endianess bug in debug messageStefan Richter1-1/+1
The transaction labels were misprinted int the debug printk "Packet received from node..." due two byte-swapping once too often. Affected were big endian machines, except UniNorth based ones. Fix tested by Wolfgang Pfeiffer. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-09-17ieee1394: sbp2: don't prefer MODE SENSE 10Stefan Richter1-1/+0
In the old days, sbp2 used to coerce all MODE SENSE commands into the 10 bytes version. When all command set conversions were removed from sbp2 several months ago, sdev->use_10_for_ms = 1 was added. Meaning, higher SCSI layers preferred the 10 bytes version but would try the 6 bytes version if the former failed. Recently, a problem with the 10 bytes version was discovered. An Initio INIC-1530 firmware accepted the 10 bytes version but replied with bogus data, showing the HDD incorrectly as write-protected. Since RBC actually mandates MODE SENSE (6), I checked which version was sent by Windows XP and Mac OS X 10.3 to an SBP-2 target hosted by Linux --- it was the 6 bytes version. (Exception: OS X sent the 10 bytes version to an MMC target. RBC and SBC got MODE SENSE (6).) Therefore, drop the use_10_for_ms flag from sbp2. Now the upper layers will try MODE SENSE (6) before MODE SENSE (10) on all SBP-2 devices. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-09-17ieee1394: nodemgr: grab class.subsys.rwsem in nodemgr_resume_neStefan Richter1-0/+2
nodemgr_resume_ne was iterating over nodemgr_ud_class.children without protection by nodemgr_ud_class.subsys.rwsem. FIXME: Shouldn't we rather use class->sem there, not class->subsys.rwsem? Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-09-17ieee1394: nodemgr: fix rwsem recursionStefan Richter1-4/+5
nodemgr_update_pdrv grabbed an rw semaphore (as reader) which was already taken by its caller's caller, nodemgr_probe_ne (as reader too). Reported by Miles Lane, call path pointed out by Arjan van de Ven. FIXME: Shouldn't we rather use class->sem there, not class->subsys.rwsem? Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-09-17ieee1394: sbp2: more help in KconfigStefan Richter1-2/+9
Add some pointers to SCSI to the configuration menu item of sbp2. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-09-17ieee1394: sbp2: prevent rare deadlock in shutdownStefan Richter2-11/+19
Scsi_remove_device() may go into uninterruptible sleep if blocked. Therefore sbp2_remove() unblocks the Scsi_Host before the device is requested to be removed. But there could be another 1394 bus reset after that which would block the host again. The 1394 subsystem won't call sbp2_update() concurrently to sbp2_remove(), which is why there is no chance for sbp2_remove() to be unblocked by sbp2_update(). The fix is to tell sbp2's bus reset handler when a device is to be shut down so that it skips scsi_block_requests() on that host. As before, any new commands after a reset without reconnect will be failed quickly by sbp2scsi_queuecommand(). In the long term, means to go without scsi_block_requests() should be found. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-09-17ieee1394: sbp2: update includesStefan Richter1-22/+27
Remove unused includes. Add missing includes, i.e. explicitly include all used headers. Sort includes alphabetically. Replace one call to signal_pending(current) to avoid to include headers just for this line. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-09-17ieee1394: sbp2: better handling of transport errorsStefan Richter2-8/+14
If the target signals a transport failure via status block, complete the request with DID_BUSY to indicate to the SCSI subsystem that the command may succeed when retried. Also log diagnostic information if the status block shows a transport related problem. It may point to hardware faults. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-09-17ieee1394: sbp2: recheck node generation in sbp2_updateStefan Richter1-5/+6
While sbp2_update() is doing its duties after a bus reset, another reset could happen. Don't accept new requests until the next undisturbed sbp2_update() or until sbp2_remove(). Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-09-17ieee1394: sbp2: safer agent reset in error handlersStefan Richter1-2/+2
The scsi_host_template's eh_abort_handler and eh_device_reset_handler are allowed to sleep. Use this to run sbp2_agent_reset in the more reliable mode which returns _after_ its write transaction was finished. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-09-17ieee1394: sbp2: handle "sbp2util_node_write_no_wait failed"Stefan Richter2-5/+69
Fix for http://bugzilla.kernel.org/show_bug.cgi?id=6948 Because sbp2 writes to the target's fetch agent's registers from within atomic context, it cannot sleep to guaranteedly get a free transaction label. This may repeatedly lead to "sbp2util_node_write_no_wait failed" and consequently to SCSI command abortion after timeout. A likely cause is that many queue_command softirqs may occur before khpsbpkt (the ieee1394 driver's thread which cleans up after finished transactions) is woken up to recycle tlabels. Sbp2 now schedules a workqueue job whenever sbp2_link_orb_command fails in sbp2util_node_write_no_wait. The job will reliably get a transaction label because it can sleep. We use the kernel-wide shared workqueue because it is unlikely that the job itself actually needs to sleep. In the improbable case that it has to sleep, it doesn't need to sleep long since the standard transaction timeout is 100ms. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-09-17CONFIG_PM=n slim: drivers/ieee1394/ohci1394.cAlexey Dobriyan1-2/+4
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: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-09-17ieee1394: safer definition of empty macrosStefan Richter7-19/+19
A deactivated macro, defined as "#define foo(bar)", will result in silent corruption if somebody forgets a semicolon after a call to foo. Replace it by "#define foo(bar) do {} while (0)" which will reveal any respective syntax errors. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-09-17video1394: add poll file operation supportDavid Moore1-1/+37
This patch adds support for the poll file operation to the video1394 driver. Signed-off-by: David Moore <dcm@acm.org> Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-09-17the scheduled removal of drivers/ieee1394/sbp2.c:force_inquiry_hackAdrian Bunk1-10/+0
This patch contains the scheduled removal of the force_inquiry_hack module parameter. Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-09-17Initialize ieee1394 early when built inAndi Kleen2-2/+4
This makes debugging with firescope easier. Signed-off-by: Andi Kleen <ak@suse.de> (original patch) Update: - no need for #ifdef MODULE - add comment in ieee1394_core, more verbose comment in ohci1394 Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> (update)
2006-09-17ieee1394: sbp2: convert sbp2util_down_timeout to waitqueueStefan Richter2-31/+24
The waitqueue API is used to replace a custom wait mechanism. Only one global waitqueue (instead of per-device waitqueues or completions) is added because there is usually just one waiter. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-09-17ieee1394: sbp2: more checks of status blockStefan Richter2-46/+38
- Add checks for the (very unlikely) cases that the target writes too little or too much status data or writes unsolicited status. - Indicate that these and similar conditions are unlikely(). - Check the 'resp' and 'sbp_status' fields for possible failure status. - Slightly optimize access macros for the status block bitfields. - Unify a few related log messages. TODO: Check if 'src'==1, then withhold the respective ORB from reuse until status for any subsequent ORB was received. This is an old bug whose fix requires more complex command queue handling. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-09-17ieee1394: sbp2: safer initialization of status fifoStefan Richter1-50/+30
Sbp2's copy of the status fifo was cleared when management ORBs or new command ORBs were prepared. The latter had potential for a race condition if the block layer's soft IRQ and the 1394 LLD's interrupt handler ran on different CPUs. It would also yield wrong status if a command was completed with non-zero completion status before other commands that had zero completion status, and no new command was enqueued in the meantime. Now, the status buffer is cleared right before it is written. Thus it ends up in the following simpler and safer access pattern: - sbp2_alloc_device: allocates and implicitly clears once, - sbp2_handle_status_write: clears, writes, and reads, - sbp2_query_logins, sbp2_login_device, sbp2_reconnect_device: read. The latter three do not race with sbp2_handle_status_write because of how the protocol works. As a tiny optimization, the first two quadlets of the status never need to be cleared. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-09-17ieee1394: sbp2: optimize DMA direction of command ORBsStefan Richter1-8/+8
Only the driver writes ORBs, the device just reads them. Therefore PCI_DMA_BIDIRECTIONAL can be replaced by PCI_DMA_TODEVICE which may be cheaper on some architectures. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-09-17ieee1394: sbp2: discard return value of sbp2_link_orb_commandStefan Richter2-10/+3
Since sbp2 is at the moment unable to do anything with the return value of sbp2_link_orb_command, just discard it. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-09-17ieee1394: sbp2: safer last_orb and next_ORB handlingStefan Richter2-55/+50
The sbp2 initiator has two ways to tell a target's fetch agent about new command ORBs: - Write the ORB's address to the ORB_POINTER register. This must not be done while the fetch agent is active. - Put the ORB's address into the previously submitted ORB's next_ORB field and write to the DOORBELL register. This may be done while the fetch agent is active or suspended. It must not be done while the fetch agent is in reset state. Sbp2 has a last_orb pointer which indicates in what way a new command should be announced. That pointer is concurrently accessed at various occasions. Furthermore, initiator and target are accessing the next_ORB field of ORBs concurrently and asynchronously. This patch does: - Protect all initiator accesses to last_orb by sbp2_command_orb_lock. - Add pci_dma_sync_single_for_device before a previously submitted ORB's next_ORB field is overwritten. - Insert a memory barrier between when next_ORB_lo and next_ORB_hi are overwritten. Next_ORB_hi must not be updated before next_ORB_lo. - Remove the rather unspecific and now superfluous qualifier "volatile" from the next_ORB fields. - Add comments on how last_orb is connected with what is known about the target's fetch agent's state. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-09-17ieee1394: remove #include <asm/semaphore.h>Stefan Richter3-3/+0
These includes in ieee1394_core and eth1394 are obsolete. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-09-17ieee1394: shrink tlabel pools, remove tpool semaphoresStefan Richter7-99/+102
This patch reduces the size of struct hpsb_host and also removes semaphores from ieee1394_transactions.c. On i386, struct hpsb_host shrinks from 10656 bytes to 6688 bytes. This is accomplished by - using a single wait_queue for hpsb_get_tlabel instead of many instances of semaphores, - using a single lock to serialize access to all tlabel pools (the protected code regions are small, i.e. lock contention very low), - omitting the sysfs attribute tlabels_allocations. Drawback: In the rare case that a process needs to sleep because all transaction labels for the node are temporarily exhausted, it is also woken up if a tlabel for a different node became free, checks for an available tlabel, and is put to sleep again. The check is not costly and the situation occurs extremely rarely. (Tlabels are typically only exhausted if there was no context switch to the khpsbpkt thread which recycles tlables.) Therefore the benefit of reduced tpool size outweighs this drawback. The sysfs attributes tlabels_free and tlabels_mask are not compiled anymore unless CONFIG_IEEE1394_VERBOSEDEBUG is set. The by far biggest member of struct hpsb_host, the struct csr_control csr (5272 bytes on i386), is now placed at the end of struct hpsb_host. Note, hpsb_get_tlabel calls the macro wait_event_interruptible with a condition argument which has a side effect (allocation of a tlabel and manipulation of the packet). This side effect happens only if the condition is true. The patch relies on wait_event_interruptible not evaluating the condition again after it became true. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-09-17ieee1394: merge from LinusStefan Richter2-2/+12
Conflicts: drivers/ieee1394/hosts.c Patch "lockdep: annotate ieee1394 skb-queue-head locking" was meddling with patch "ieee1394: fix kerneldoc of hpsb_alloc_host". Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
2006-08-27[PATCH] 1394: fix for recently added firewire patch that breaks things on ppcDanny Tholen1-2/+2
Recently a patch was added for preliminary suspend/resume handling on !PPC_PMAC. However, this broke both suspend and firewire on powerpc because it saves the pci state after the device has already been disabled. This moves the save state to before the pmac specific code. Signed-off-by: Danny Tholen <obiwan@mailmij.org> Cc: Stefan Richter <stefanr@s5r6.in-berlin.de> Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Ben Collins <bcollins@ubuntu.com> Cc: Jody McIntyre <scjody@modernduck.com> Cc: <stable@kernel.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-08-06[PATCH] ieee1394: sbp2: enable auto spin-up for Maxtor disksStefan Richter1-0/+3
At least Maxtor OneTouch III require a "start stop unit" command after auto spin-down before the next access can proceed. This patch activates the responsible code in scsi_mod for all Maxtor SBP-2 disks. https://bugzilla.novell.com/show_bug.cgi?id=183011 Maybe that should be done for all SBP-2 disks, but better be cautious. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> Cc: Jody McIntyre <scjody@modernduck.com> Cc: Ben Collins <bcollins@ubuntu.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-07-03[PATCH] lockdep: annotate ieee1394 skb-queue-head lockingIngo Molnar1-0/+10
ieee1394 reuses the skb infrastructure of the networking code, and uses two skb-head queues: ->pending_packet_queue and hpsbpkt_queue. The latter is used in the usual fashion: processed from a kernel thread. The other one, ->pending_packet_queue is also processed from hardirq context (f.e. in hpsb_bus_reset()), which is not what the networking code usually does (which completes from softirq or process context). This locking assymetry can be totally correct if done carefully, but it can also be dangerous if networking helper functions are reused, which could assume traditional networking use. It would probably be more robust to push this completion into a workqueue - but technically the code can be 100% correct, and lockdep has to be taught about it. The solution is to split the ->pending_packet_queue skb-head->lock class from the networking lock-class by using a private lock-validator key. Has no effect on non-lockdep kernels. Signed-off-by: Ingo Molnar <mingo@elte.hu> Cc: Stefan Richter <stefanr@s5r6.in-berlin.de> Cc: Jody McIntyre <scjody@modernduck.com> Cc: Ben Collins <bcollins@debian.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>