summaryrefslogtreecommitdiff
path: root/drivers/ieee1394/sbp2.c
Commit message (Collapse)AuthorAge
* block: Rename blk_queue_max_sectors to blk_queue_max_hw_sectorsMartin K. Petersen2010-02-26
| | | | | | | | | | | | | The block layer calling convention is blk_queue_<limit name>. blk_queue_max_sectors predates this practice, leading to some confusion. Rename the function to appropriately reflect that its intended use is to set max_hw_sectors. Also introduce a temporary wrapper for backwards compability. This can be removed after the merge window is closed. Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
* ieee1394: sbp2: remove a workaround for Momobay FX-3AStefan Richter2009-09-12
| | | | | | The inquiry delay is not necessary anymore in tests on a recent kernel. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
* Merge branch 'for-linus' of ↵Linus Torvalds2009-07-06
|\ | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6 * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6: ieee1394: sbp2: add support for disks >2 TB (and 16 bytes long CDBs) firewire: sbp2: add support for disks >2 TB (and 16 bytes long CDBs) firewire: core: do not DMA-map stack addresses
| * ieee1394: sbp2: add support for disks >2 TB (and 16 bytes long CDBs)Stefan Richter2009-07-02
| | | | | | | | | | | | | | | | | | Increase the command ORB data structure to transport up to 16 bytes long CDBs (instead of 12 bytes), and tell the SCSI mid layer about it. This is notably necessary for READ CAPACITY(16) and friends, i.e. support of large disks. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
* | ieee1394: remove driver_data direct access of struct deviceGreg Kroah-Hartman2009-06-15
|/ | | | | | | | | | | | | | In the near future, the driver core is going to not allow direct access to the driver_data pointer in struct device. Instead, the functions dev_get_drvdata() and dev_set_drvdata() should be used. These functions have been around since the beginning, so are backwards compatible with all older kernel versions. Cc: linux1394-devel@lists.sourceforge.net Acked-by: Stefan Richter <stefanr@s5r6.in-berlin.de> Cc: Ben Collins <ben.collins@ubuntu.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* ieee1394: constify device ID tablesStefan Richter2009-03-24
| | | | Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
* ieee1394: Storage class should be before const qualifierTobias Klauser2009-03-24
| | | | | | | | | | | 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: Stefan Richter <stefanr@s5r6.in-berlin.de>
* ieee1394: sbp2: follow up on "ieee1394: inherit ud vendor_id from node ↵Stefan Richter2009-03-24
| | | | | | vendor_id" Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
* ieee1394: sbp2: add workarounds for 2nd and 3rd generation iPodsStefan Richter2009-01-29
| | | | | | | | | | as per https://bugs.launchpad.net/bugs/294391. These got one sample of each iPod generation going. However there still occurred I/O stalls with the 3rd generation iPod which remain undiagnosed at the time of this writing. Acked-by: Jarod Wilson <jarod@redhat.com> Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
* ieee1394: sbp2: don't assume zero model_id or firmware_revision if there is noneStefan Richter2009-01-28
| | | | | | | | | | | | | | | | | | This makes sbp2 behave more like firewire-sbp2 which reports 0xff000000 as immediate value if there are no unit directory entries for model_id or firmware_revision. It does not reduce matches with the currently existing quirks table; the only zero entry there is for a device which actually does have a zero model_id. It only changes how model_id and firmware_revision are logged if they are missing. Other functionally unrelated changes: The model_id member of quirks list entries is renamed to model; the value (but not the effect) of SBP2_ROM_VALUE_WILDCARD is changed. Now this part of the source is identical with firewire-sbp2 for easier maintenance. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
* ieee1394: sbp2: fix payload limit at S1600 and S3200Stefan Richter2009-01-28
| | | | | | | | | | 1394-2008 clause 16.3.4.1 (1394b-2002 clause 16.3.1.1) defines tighter limits than 1394-2008 clause 6.2.2.3 (1394a-2000 clause 6.2.2.3). Our previously too large limit doesn't matter though if the controller reports its max_receive correctly. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
* ieee1394: sbp2: update a help stringStefan Richter2009-01-28
| | | | Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
* ieee1394: mark all hpsb_address_ops instances as constStefan Richter2009-01-04
| | | | | | These are never modified. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
* ieee1394: sbp2: fix race condition in state changeStefan Richter2008-11-29
| | | | | | | An intermediate transition from _RUNNING to _IN_SHUTDOWN could have been missed by the former code. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
* ieee1394: sbp2: another iPod mini quirk entryStefan Richter2008-11-25
| | | | | | | | Add another model ID of a broken firmware to prevent early I/O errors by acesses at the end of the disk. Reported at linux1394-user, http://marc.info/?t=122670842900002 Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
* ieee1394: sbp2: enforce s/g segment size limitStefan Richter2008-10-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-15
| | | | Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
* ieee1394: sbp2: stricter dma_syncStefan Richter2008-10-15
| | | | | | | | | | | 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-19
| | | | | | | | | | | | | | | | | | 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-14
| | | | | | | | | | 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-14
| | | | | | | | | | | | | 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-20
| | | | | | | | | 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-18
| | | | | | | | __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-18
| | | | Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
* ieee1394: sbp2: fix for SYM13FW500 bridge (Datafab disk)Stefan Richter2008-03-14
| | | | | | | | | | | | 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-19
| | | | | | 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-16
| | | | | | | | 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-02
| | | | | | | | | | 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-30
| | | | | | | | | | | | | | | | | | | | | | | 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-30
| | | | | | | 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-30
| | | | Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
* [SCSI] relax scsi dma alignmentJames Bottomley2008-01-11
| | | | | | | | | | | | | | 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-02
| | | | | | | | | | | 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-22
| | | | Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
* ieee1394: sbp2: fix unsafe iteration over list of devicesStefan Richter2007-10-16
| | | | | | | 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-25
| | | | | | | 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-02
| | | | | | | | | | | | | 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-15
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-30
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-31
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-27
|/ | | | Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
* ieee1394: sbp2: include fixesAndrew Morton2007-04-30
| | | | | | | | | | | | | | | | | | | | 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-30
| | | | | | | 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-30
| | | | | | | | | 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-30
| | | | | | | | | 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-08
| | | | | | | | | | | | | | | 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-08
| | | | | | 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-08
| | | | | | | 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>