summaryrefslogtreecommitdiffstats
path: root/drivers/ieee1394/sbp2.c
Commit message (Collapse)AuthorAgeFilesLines
* ieee1394: sbp2: enforce s/g segment size limitStefan Richter2008-10-151-70/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. We don't need to round the SBP-2 segment size limit down to a multiple of 4 kB (0xffff -> 0xf000). It is only necessary to ensure quadlet alignment (0xffff -> 0xfffc). 2. Use dma_set_max_seg_size() to tell the DMA mapping infrastructure and the block IO layer about the restriction. This way we can remove the size checks and segment splitting in the queuecommand path. This assumes that no other code in the ieee1394 stack uses dma_map_sg() with conflicting requirements. It furthermore assumes that the controller device's platform actually allows us to set the segment size to our liking. Assert the latter with a BUG_ON(). 3. Also use blk_queue_max_segment_size() to tell the block IO layer about it. It cannot know it because our scsi_add_host() does not point to the FireWire controller's device. We can also uniformly use dma_map_sg() for the single segment case just like for the multi segment case, to further simplify the code. Also clean up how the page table is converted to big endian. Thanks to Grant Grundler and FUJITA Tomonori for advice. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
* ieee1394: sbp2: check for DMA mapping failuresStefan Richter2008-10-151-35/+59
| | | | Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
* ieee1394: sbp2: stricter dma_syncStefan Richter2008-10-151-34/+16
| | | | | | | | | | | Two dma_sync_single_for_cpu() were called in the wrong place. Luckily they were merely for DMA_TO_DEVICE, hence nobody noticed. Also reorder the matching dma_sync_single_for_device() a little bit so that they reside in the same functions as their counterparts. This also avoids syncing the s/g table for requests which don't use it. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
* ieee1394: sbp2: let nodemgr retry node updates during bus reset seriesStefan Richter2008-08-191-7/+18
| | | | | | | | | | | | | | | | | | sbp2 was too quick to report .update() to the ieee1394 core as failed. (Logged as "Failed to reconnect to sbp2 device!".) The core would then unbind sbp2 from the device. This is not justified if the .update() failed because another bus reset happened. We check this and tell the ieee1394 that .update() succeeded, and the core will call sbp2's .update() for the new bus reset as well. This improves reconnection/re-login especially on buses with several disks as they may issue bus resets in close succession when they come online. Tested by Damien Benoist. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
* ieee1394: sbp2: spin disks down on suspend and shutdownStefan Richter2008-07-141-0/+2
| | | | | | | | | | This instructs sd_mod to send START STOP UNIT on suspend and resume, and on driver unbinding or unloading (including when the system is shut down). We don't do this though if multiple initiators may log in to the target. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
* ieee1394: sbp2: fix spindown for PL-3507 and TSB42AA9 firmwaresStefan Richter2008-07-141-2/+18
| | | | | | | | | | | | | Reported by Tino Keitel: PL-3507 with firmware from Prolific does not spin down the disk on START STOP UNIT with power condition = 0 and start = 0. It does however work with power condition = 2 or 3. Also found while investigating this: DViCO Momobay CX-1 and FX-3A (TI TSB42AA9/A based) become unresponsive after START STOP UNIT with power condition = 0 and start = 0. They stay responsive if power condition is set when stopping the motor. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
* ieee1394: sbp2: use correct size of command descriptor blockStefan Richter2008-05-201-12/+8
| | | | | | | | | Boaz Harrosh wrote: > cmd->cmd_len is now guarantied to be set properly at all cases. > And some commands you want to support will not be set correctly > by COMMAND_SIZE(). Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
* ieee1394: replace remaining __FUNCTION__ occurrencesHarvey Harrison2008-04-181-2/+2
| | | | | | | | __FUNCTION__ is gcc-specific, use __func__ Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
* ieee1394: sbp2: relax SCSI DMA alignmentStefan Richter2008-04-181-5/+2
| | | | Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
* ieee1394: sbp2: fix for SYM13FW500 bridge (Datafab disk)Stefan Richter2008-03-141-0/+5
| | | | | | | | | | | | Fix I/O errors due to SYM13FW500's inability to handle larger request sizes. Reported by Piergiorgio Sartor <piergiorgio.sartor@nexgo.de> for firewire-sbp2 in https://bugzilla.redhat.com/show_bug.cgi?id=436879 This fix is necessary because sbp2's default request size limit has been lifted since 2.6.25-rc1. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> Signed-off-by: Jarod Wilson <jwilson@redhat.com>
* ieee1394: sbp2: fix rescan-scsi-busStefan Richter2008-02-191-0/+3
| | | | | | rescan-scsi-bus used to add SBP-2 targets which weren't there. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
* ieee1394: sbp2: add INQUIRY delay workaroundStefan Richter2008-02-161-0/+12
| | | | | | | | Add the same workaround as found in fw-sbp2 for feature parity and compatibility of the workarounds module parameter. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> Signed-off-by: Jarod Wilson <jwilson@redhat.com>
* ieee1394: sbp2: fix bogus s/g access changeStefan Richter2008-02-021-3/+2
| | | | | | | | | | sg_dma_len(sg) is invalid before the s/g list is DMA-mapped. This fixes a post 2.6.24 regression which prevents access to SBP-2 devices on several architectures, introduced by "ieee1394: sbp2: s/g list access cosmetics", commit 825f1df545ab0289185373b0eaf06fb0b3487422. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
* ieee1394: sbp2: raise default transfer size limitStefan Richter2008-01-301-11/+15
| | | | | | | | | | | | | | | | | | | | | | | This patch speeds up sbp2 a little bit --- but more importantly, it brings the behavior of sbp2 and fw-sbp2 closer to each other. Like fw-sbp2, sbp2 now does not limit the size of single transfers to 255 sectors anymore, unless told so by a blacklist flag or by module load parameters. Only very old bridge chips have been known to need the 255 sectors limit, and we have got one such chip in our hardwired blacklist. There certainly is a danger that more bridges need that limit; but I prefer to have this issue present in both fw-sbp2 and sbp2 rather than just one of them. An OXUF922 with 400GB 7200RPM disk on an S400 controller is sped up by this patch from 22.9 to 23.5 MB/s according to hdparm. The same effect could be achieved before by setting a higher max_sectors module parameter. On buses which use 1394b beta mode, sbp2 and fw-sbp2 will now achieve virtually the same bandwidth. Fw-sbp2 only remains faster on 1394a buses due to fw-core's gap count optimization. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
* ieee1394: sbp2: s/g list access cosmeticsStefan Richter2008-01-301-14/+12
| | | | | | | Replace sg->length by sg_dma_len(sg). Rename a variable for shorter line lengths and eliminate some superfluous local variables. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
* ieee1394: sbp2: prepare for s/g chainingStefan Richter2008-01-301-1/+1
| | | | Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
* [SCSI] relax scsi dma alignmentJames Bottomley2008-01-111-0/+6
| | | | | | | | | | | | | | This patch relaxes the default SCSI DMA alignment from 512 bytes to 4 bytes. I remember from previous discussions that usb and firewire have sector size alignment requirements, so I upped their alignments in the respective slave allocs. The reason for doing this is so that we don't get such a huge amount of copy overhead in bio_copy_user() for udev. (basically all inquiries it issues can now be directly mapped). Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
* cleanup asm/scatterlist.h includesAdrian Bunk2007-11-021-1/+1
| | | | | | | | | | | Not architecture specific code should not #include <asm/scatterlist.h>. This patch therefore either replaces them with #include <linux/scatterlist.h> or simply removes them if they were unused. Signed-off-by: Adrian Bunk <bunk@kernel.org> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
* [SG] Update drivers to use sg helpersJens Axboe2007-10-221-1/+1
| | | | Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
* ieee1394: sbp2: fix unsafe iteration over list of devicesStefan Richter2007-10-161-0/+15
| | | | | | | sbp2_host_reset and sbp2_handle_status_write are not serialized against sbp2_alloc_device and sbp2_remove_device. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
* ieee1394: sbp2: fix sbp2_remove_device for error casesStefan Richter2007-08-251-7/+7
| | | | | | | Bug found by Olaf Hering <olh@suse.de>: sbp2util_remove_command_orb_pool requires a valid lu->hi pointer. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
* ieee1394: revert "sbp2: enforce 32bit DMA mapping"Stefan Richter2007-08-021-5/+0
| | | | | | | | | | | | | Revert commit 0555659d63c285ceb7ead3115532e1b71b0f27a7 from 2.6.22-rc1. The dma_set_mask call somehow failed on a PowerMac G5, PPC64: http://lkml.org/lkml/2007/8/1/344 Should there ever occur a DMA mapping beyond the physical DMA range, a proper SBP-2 firmware will report transport errors. So let's leave it at that. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de> Tested-by: Olaf Hering <olh@suse.de>
* Merge master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6Linus Torvalds2007-07-151-71/+4
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (166 commits) [SCSI] ibmvscsi: convert to use the data buffer accessors [SCSI] dc395x: convert to use the data buffer accessors [SCSI] ncr53c8xx: convert to use the data buffer accessors [SCSI] sym53c8xx: convert to use the data buffer accessors [SCSI] ppa: coding police and printk levels [SCSI] aic7xxx_old: remove redundant GFP_ATOMIC from kmalloc [SCSI] i2o: remove redundant GFP_ATOMIC from kmalloc from device.c [SCSI] remove the dead CYBERSTORMIII_SCSI option [SCSI] don't build scsi_dma_{map,unmap} for !HAS_DMA [SCSI] Clean up scsi_add_lun a bit [SCSI] 53c700: Remove printk, which triggers because of low scsi clock on SNI RMs [SCSI] sni_53c710: Cleanup [SCSI] qla4xxx: Fix underrun/overrun conditions [SCSI] megaraid_mbox: use mutex instead of semaphore [SCSI] aacraid: add 51245, 51645 and 52245 adapters to documentation. [SCSI] qla2xxx: update version to 8.02.00-k1. [SCSI] qla2xxx: add support for NPIV [SCSI] stex: use resid for xfer len information [SCSI] Add Brownie 1200U3P to blacklist [SCSI] scsi.c: convert to use the data buffer accessors ...
| * [SCSI] Merge up to linux-2.6 headJames Bottomley2007-05-301-0/+1
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: drivers/scsi/jazz_esp.c Same changes made by both SCSI and SPARC trees: problem with UTF-8 conversion in the copyright. Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
| * | [SCSI] sbp2: convert to use the data buffer accessorsFUJITA Tomonori2007-05-271-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>
* | | ieee1394: sbp2: change some module parameters from int to boolStefan Richter2007-07-101-8/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is upwards compatible, except that integer values other than 0 or 1 are no longer accepted. But values like "Y", "N", "no", "nnoooh!" work now. Also, improve a comment on the serialize_io parameter and make the ORB_SET_EXCLUSIVE macro ultra-safe. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
* | | ieee1394: sbp2: offer SAM-conforming target port ID in sysfsStefan Richter2007-05-311-2/+29
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With "modprobe sbp2 long_ieee1394_id=y", the format of /sys/bus/scsi/devices/*:*:*:*/ieee1394_id is changed from e.g. 0001041010004beb:0:0 to 0001041010004beb:00042c:0000. The longer format fully conforms to object identifier sizes as per SAM(-2...4) and reflects what the SAM target port identifier is meant to contain: A Discovery ID allegedly specified by ISO/IEC 13213:1994 --- however there is no such thing; the authors of SAM probably meant Directory ID). Especially target nodes with multiple dynamically added targets may use Directory IDs to persistently identify target ports. The new format is independent of implementation details of nodemgr. Thus the same ieee1394_id attribute format can be implemented in the new firewire stack. The ieee1394_id is typically used to create persistently named links in /dev/disk/by-id. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
* | ieee1394: sbp2: include workqueue.hStefan Richter2007-05-271-0/+1
|/ | | | Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
* ieee1394: sbp2: include fixesAndrew Morton2007-04-301-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)
* ieee1394: sbp2: move some memory allocations into non-atomic contextStefan Richter2007-04-301-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>
* ieee1394: sbp2: optimize DMA direction of s/g tablesStefan Richter2007-04-301-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>
* ieee1394: sbp2: enforce 32bit DMA mappingStefan Richter2007-04-301-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>
* ieee1394: sbp2: lower block queue alignment requirementStefan Richter2007-02-081-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>
* ieee1394: sbp2: remove bogus "emulated" host flagStefan Richter2007-02-081-1/+0
| | | | | | There is no emulation going on here. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
* ieee1394: sbp2: use a better wildcard for blacklistStefan Richter2007-02-081-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>
* ieee1394: sbp2: fix probing of some DVD-ROM/RWsStefan Richter2007-01-101-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>
* ieee1394: sbp2: fix bogus dma mappingStefan Richter2006-12-301-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>
* ieee1394: sbp2: pass REQUEST_SENSE through to the targetStefan Richter2006-12-301-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>
* ieee1394: sbp2: code formatting around work_struct stuffStefan Richter2006-12-071-7/+9
| | | | | | Merge is finished, can bring the code in readable style again. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
* ieee1394: Consolidate driver registeringBen Collins2006-12-071-3/+1
| | | | | | | | | | | | | 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>
* ieee1394: sbp2: convert from PCI DMA to generic DMAStefan Richter2006-12-071-66/+60
| | | | | | API conversion without change in functionality Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
* ieee1394: sbp2: wrap two functions into oneStefan Richter2006-12-071-23/+7
| | | | | | Move the body of a function into its only caller. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
* ieee1394: sbp2: update comment on things to doStefan Richter2006-12-071-7/+19
| | | | | | Some people actually look at those comments. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
* ieee1394: sbp2: use list_move_tail()Stefan Richter2006-12-071-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>
* ieee1394: sbp2: more concise names for types and variablesStefan Richter2006-12-071-591/+567
| | | | | | | | | "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>
* ieee1394: sbp2: remove unused struct membersStefan Richter2006-12-071-19/+4
| | | | Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
* ieee1394: sbp2: proper unit in module parameter descriptionStefan Richter2006-12-071-1/+2
| | | | | | It's 2^20 bit/s, not 0.001 bit. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
* ieee1394: sbp2: clean up sbp2_ namespaceStefan Richter2006-12-071-119/+118
| | | | | | | 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>
* ieee1394: sbp2: some conditions in queue_command are unlikelyStefan Richter2006-12-071-5/+5
| | | | Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
* ieee1394: sbp2: remove superfluous commentsStefan Richter2006-12-071-308/+76
| | | | | | And update and reformat remaining comments. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
OpenPOWER on IntegriCloud