aboutsummaryrefslogtreecommitdiff
path: root/drivers
AgeCommit message (Collapse)AuthorFilesLines
2012-03-28dm persistent data: remove redundant value_size arg from value_ptrJoe Thornber3-33/+29
Now that the value_size is held within every node of the btrees we can remove this argument from value_ptr(). For the last few months a BUG_ON has been checking this argument is the same as that held in the node. No issues were reported. So this is a safe change. Signed-off-by: Joe Thornber <[email protected]> Signed-off-by: Mike Snitzer <[email protected]> Signed-off-by: Alasdair G Kergon <[email protected]>
2012-03-28dm mpath: detect invalid map_contextJun'ichi Nomura1-14/+32
The map_context pointer should always be set. However, we have reports that upon requeuing it is not set correctly. So add set and clear functions with a BUG_ON() to track the issue properly. Signed-off-by: Jun'ichi Nomura <[email protected]> Cc: Mike Snitzer <[email protected]> Acked-by: Hannes Reinecke <[email protected]> Tested-by: Heiko Carstens <[email protected]> Acked-by: Dave Wysochanski <[email protected]> Signed-off-by: Alasdair G Kergon <[email protected]>
2012-03-28dm: clear bi_end_io on remapping failureHannes Reinecke1-0/+1
As a precaution, set bi_end_io to NULL when failing to remap. Signed-off-by: Hannes Reinecke <[email protected]> Signed-off-by: Alasdair G Kergon <[email protected]>
2012-03-28dm table: simplify call to free_devicesHannes Reinecke1-2/+1
free_devices in dm_table.c already uses list_for_each(), so we don't need to check if the list is empty. Signed-off-by: Hannes Reinecke <[email protected]> Signed-off-by: Alasdair G Kergon <[email protected]>
2012-03-28dm thin: correct commentsJoe Thornber1-1/+1
Remove documentation for unimplemented 'trim' message. I'd planned a 'trim' target message for shrinking thin devices, but this is better handled via the discard ioctl. Signed-off-by: Joe Thornber <[email protected]> Signed-off-by: Mike Snitzer <[email protected]> Signed-off-by: Alasdair G Kergon <[email protected]>
2012-03-28dm raid: no longer experimentalAlasdair G Kergon1-2/+2
The dm raid module (using md) is becoming the preferred way of creating long-lived mirrors through userspace LVM so remove the EXPERIMENTAL tag. Signed-off-by: Alasdair G Kergon <[email protected]>
2012-03-28dm uevent: no longer experimentalAlasdair G Kergon1-2/+2
Drop EXPERIMENTAL tag from dm-uevent. It's not changed for a while and some userspace tools are relying upon it. Signed-off-by: Alasdair G Kergon <[email protected]>
2012-03-28dm persistent data: fix btree rebalancing after removeJoe Thornber1-75/+99
When we remove an entry from a node we sometimes rebalance with it's two neighbours. This wasn't being done correctly; in some cases entries have to move all the way from the right neighbour to the left neighbour, or vice versa. This patch pretty much re-writes the balancing code to fix it. This code is barely used currently; only when you delete a thin device, and then only if you have hundreds of them in the same pool. Once we have discard support, which removes mappings, this will be used much more heavily. Signed-off-by: Joe Thornber <[email protected]> Cc: [email protected] Signed-off-by: Mike Snitzer <[email protected]> Signed-off-by: Alasdair G Kergon <[email protected]>
2012-03-28dm thin: fix stacked bi_next usageJoe Thornber1-51/+73
Avoid using the bi_next field for the holder of a cell when deferring bios because a stacked device below might change it. Store the holder in a new field in struct cell instead. When a cell is created, the bio that triggered creation (the holder) was added to the same bio list as subsequent bios. In some cases we pass this holder bio directly to devices underneath. If those devices use the bi_next field there will be trouble... This also simplifies some code that had to work out which bio was the holder. Signed-off-by: Joe Thornber <[email protected]> Cc: [email protected] Signed-off-by: Mike Snitzer <[email protected]> Signed-off-by: Alasdair G Kergon <[email protected]>
2012-03-28dm crypt: add missing error handlingMikulas Patocka1-12/+16
Always set io->error to -EIO when an error is detected in dm-crypt. There were cases where an error code would be set only if we finish processing the last sector. If there were other encryption operations in flight, the error would be ignored and bio would be returned with success as if no error happened. This bug is present in kcryptd_crypt_write_convert, kcryptd_crypt_read_convert and kcryptd_async_done. Signed-off-by: Mikulas Patocka <[email protected]> Cc: [email protected] Reviewed-by: Milan Broz <[email protected]> Signed-off-by: Alasdair G Kergon <[email protected]>
2012-03-28dm crypt: fix mempool deadlockMikulas Patocka1-6/+4
This patch fixes a possible deadlock in dm-crypt's mempool use. Currently, dm-crypt reserves a mempool of MIN_BIO_PAGES reserved pages. It allocates first MIN_BIO_PAGES with non-failing allocation (the allocation cannot fail and waits until the mempool is refilled). Further pages are allocated with different gfp flags that allow failing. Because allocations may be done in parallel, this code can deadlock. Example: There are two processes, each tries to allocate MIN_BIO_PAGES and the processes run simultaneously. It may end up in a situation where each process allocates (MIN_BIO_PAGES / 2) pages. The mempool is exhausted. Each process waits for more pages to be freed to the mempool, which never happens. To avoid this deadlock scenario, this patch changes the code so that only the first page is allocated with non-failing gfp mask. Allocation of further pages may fail. Signed-off-by: Mikulas Patocka <[email protected]> Cc: [email protected] Signed-off-by: Milan Broz <[email protected]> Signed-off-by: Alasdair G Kergon <[email protected]>
2012-03-28dm exception store: fix init error pathAndrei Warkentin1-1/+1
Call the correct exit function on failure in dm_exception_store_init. Signed-off-by: Andrei Warkentin <[email protected]> Acked-by: Mike Snitzer <[email protected]> Cc: [email protected] Signed-off-by: Alasdair G Kergon <[email protected]>
2012-03-28Remove all #inclusions of asm/system.hDavid Howells362-364/+4
Remove all #inclusions of asm/system.h preparatory to splitting and killing it. Performed with the following command: perl -p -i -e 's!^#\s*include\s*<asm/system[.]h>.*\n!!' `grep -Irl '^#\s*include\s*<asm/system[.]h>' *` Signed-off-by: David Howells <[email protected]>
2012-03-28Add #includes needed to permit the removal of asm/system.hDavid Howells2-0/+3
asm/system.h is a cause of circular dependency problems because it contains commonly used primitive stuff like barrier definitions and uncommonly used stuff like switch_to() that might require MMU definitions. asm/system.h has been disintegrated by this point on all arches into the following common segments: (1) asm/barrier.h Moved memory barrier definitions here. (2) asm/cmpxchg.h Moved xchg() and cmpxchg() here. #included in asm/atomic.h. (3) asm/bug.h Moved die() and similar here. (4) asm/exec.h Moved arch_align_stack() here. (5) asm/elf.h Moved AT_VECTOR_SIZE_ARCH here. (6) asm/switch_to.h Moved switch_to() here. Signed-off-by: David Howells <[email protected]>
2012-03-28Disintegrate asm/system.h for SparcDavid Howells4-0/+4
Disintegrate asm/system.h for Sparc. Signed-off-by: David Howells <[email protected]> cc: [email protected]
2012-03-28Disintegrate asm/system.h for S390David Howells3-0/+3
Disintegrate asm/system.h for S390. Signed-off-by: David Howells <[email protected]> cc: [email protected]
2012-03-28Disintegrate asm/system.h for CRISDavid Howells1-0/+1
Disintegrate asm/system.h for CRIS. Signed-off-by: David Howells <[email protected]> Acked-by: Jesper Nilsson <[email protected]> cc: [email protected]
2012-03-28Disintegrate asm/system.h for ARMDavid Howells3-0/+3
Disintegrate asm/system.h for ARM. Signed-off-by: David Howells <[email protected]> cc: Russell King <[email protected]> cc: [email protected]
2012-03-28Merge branch 'for-linus' of ↵Linus Torvalds2-286/+448
git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client Pull Ceph updates for 3.4-rc1 from Sage Weil: "Alex has been busy. There are a range of rbd and libceph cleanups, especially surrounding device setup and teardown, and a few critical fixes in that code. There are more cleanups in the messenger code, virtual xattrs, a fix for CRC calculation/checks, and lots of other miscellaneous stuff. There's a patch from Amon Ott to make inos behave a bit better on 32-bit boxes, some decode check fixes from Xi Wang, and network throttling fix from Jim Schutt, and a couple RBD fixes from Josh Durgin. No new functionality, just a lot of cleanup and bug fixing." * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client: (65 commits) rbd: move snap_rwsem to the device, rename to header_rwsem ceph: fix three bugs, two in ceph_vxattrcb_file_layout() libceph: isolate kmap() call in write_partial_msg_pages() libceph: rename "page_shift" variable to something sensible libceph: get rid of zero_page_address libceph: only call kernel_sendpage() via helper libceph: use kernel_sendpage() for sending zeroes libceph: fix inverted crc option logic libceph: some simple changes libceph: small refactor in write_partial_kvec() libceph: do crc calculations outside loop libceph: separate CRC calculation from byte swapping libceph: use "do" in CRC-related Boolean variables ceph: ensure Boolean options support both senses libceph: a few small changes libceph: make ceph_tcp_connect() return int libceph: encapsulate some messenger cleanup code libceph: make ceph_msgr_wq private libceph: encapsulate connection kvec operations libceph: move prepare_write_banner() ...
2012-03-29sh: intc: Fix up section mismatch for intc_ack_dataPaul Mundt1-3/+2
intc_ack_data is flagged as __init when it shouldn't be, causing section mismatches in non-init paths like intc_set_ack_handle(): WARNING: drivers/built-in.o(.text+0x5d760): Section mismatch in reference from the function intc_set_ack_handle() to the function .init.text:intc_ack_data() The function intc_set_ack_handle() references the function __init intc_ack_data(). This is often because intc_set_ack_handle lacks a __init annotation or the annotation of intc_ack_data is wrong. Reported-by: Kuninori Morimoto <[email protected]> Signed-off-by: Paul Mundt <[email protected]>
2012-03-28[SCSI] ipr: Driver version 2.5.3Brian King1-2/+2
Signed-off-by: Brian King <[email protected]> Signed-off-by: James Bottomley <[email protected]>
2012-03-28[SCSI] ipr: Increase alignment boundary of command blocksBrian King1-1/+1
The latest generation of ipr hardware performs best when command blocks are aligned to a boundary equal to the size of the command block. Ensure 512 byte alignment, since this is the largest size command block we can send. Signed-off-by: Brian King <[email protected]> Signed-off-by: James Bottomley <[email protected]>
2012-03-28[SCSI] ipr: Increase max concurrent oustanding commandsBrian King2-4/+23
Increase the total number of max concurrent outstanding commands for the most recent family of adapters in order to improve overall adapter performance. Signed-off-by: Brian King <[email protected]> Signed-off-by: James Bottomley <[email protected]>
2012-03-28[SCSI] ipr: Remove unnecessary memory barriersBrian King1-12/+4
The ipr driver added some memory barriers in order to ensure a PowerPC sync instruction was executed prior to sending a command to the adapter to ensure the command block was coherent with respect to the PCI bus's view of memory. However, some time ago, the powerpc architecture writel macros were changed to include the sync since most drivers don't properly handle this. So remove these memory barriers since they are not needed and result in executing twice as many sync instructions, which has a significant performance penalty. Signed-off-by: Brian King <[email protected]> Signed-off-by: James Bottomley <[email protected]>
2012-03-28[SCSI] ipr: Remove unnecessary interrupt clearing on new adaptersBrian King2-6/+17
The latest ipr hardware no longer requires the driver to issue any MMIOs to clear the interrupt so remove this to optimize performance. Signed-off-by: Brian King <[email protected]> Signed-off-by: James Bottomley <[email protected]>
2012-03-28[SCSI] ipr: Fix target id allocation re-use problemBrian King1-8/+9
For the latest ipr SAS adapters, target id's are a completely logical construct that are managed in the ipr driver. This fixes an issue that can arise if a device is deleted via sysfs. If a new device is then physically added, it will use the previous device's target id. If the host is then rescanned, the device that had been deleted, since it is using the same target id as the new device is using, will never be found, resulting in a missing device. Fix this by only freeing the target id only if the resource is actually gone. Signed-off-by: Brian King <[email protected]> Signed-off-by: James Bottomley <[email protected]>
2012-03-28[SCSI] atp870u, mpt2sas, qla4xxx use pci_dev->revisionSergei Shtylyov4-12/+6
commit 44c10138fd4bbc4b6d6bff0873c24902f2a9da65 (PCI: Change all drivers to use pci_device->revision) converted all drivers to use pci_dev->revision. Convert these three drivers which got missed. Signed-off-by: Sergei Shtylyov <[email protected]> Signed-off-by: James Bottomley <[email protected]>
2012-03-28drm/radeon: Only warn if the intra-domain offset actually exceeds the limit.Michel Dänzer1-1/+11
Fixes spurious warnings. Tested-by: Dave Jones <[email protected]> Tested-by: Steven Rostedt <[email protected]> Tested-by: Benjamin Herrenschmidt <[email protected]> Signed-off-by: Michel Dänzer <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
2012-03-28[SCSI] fcoe: Drop the rtnl_mutex before calling fcoe_ctlr_link_upRobert Love1-1/+5
The rtnl_lock is primarily used to serialize networking driver changes as well as to ensure that a networking driver is not removed when making changes to it. fcoe also uses the rtnl_lock to protect the fcoe hostlist. fcoe_create holds the rtnl_lock over the entirity of the routine including a the call to fcoe_ctlr_link_up. This causes the below deadlock because fcoe_ctlr_link_up acquires the fcoe_ctlr ctlr_mutex and this deadlocks with a libfcoe thread that acquires the fcoe_ctlr ctlr_mutex and then the rtnl_lock (to update a MAC address). This patch drops the rtnl_lock before calling fcoe_ctlr_link_up and therefore the deadlock is prevented. https://bugzilla.kernel.org/show_bug.cgi?id=42918 the existing dependency chain (in reverse order) is: -> #1 (&fip->ctlr_mutex){+.+...}: [<c1091f70>] lock_acquire+0x80/0x1b0 [<c147655d>] mutex_lock_nested+0x6d/0x340 [<f8970c32>] fcoe_ctlr_link_up+0x22/0x180 [libfcoe] [<f894620e>] fcoe_create+0x47e/0x6e0 [fcoe] [<f8973dd3>] fcoe_transport_create+0x143/0x250 [libfcoe] [<c10527e0>] param_attr_store+0x30/0x60 [<c1052696>] module_attr_store+0x26/0x40 [<c11a201e>] sysfs_write_file+0xae/0x100 [<c11449df>] vfs_write+0x8f/0x160 [<c1144cbd>] sys_write+0x3d/0x70 [<c147a0c4>] syscall_call+0x7/0xb -> #0 (rtnl_mutex){+.+.+.}: [<c109164b>] __lock_acquire+0x140b/0x1720 [<c1091f70>] lock_acquire+0x80/0x1b0 [<c147655d>] mutex_lock_nested+0x6d/0x340 [<c13a10c4>] rtnl_lock+0x14/0x20 [<f89445ac>] fcoe_update_src_mac+0x2c/0xb0 [fcoe] [<f8971712>] fcoe_ctlr_timer_work+0x712/0xb60 [libfcoe] [<c104fb69>] process_one_work+0x179/0x5d0 [<c10502f1>] worker_thread+0x121/0x2d0 [<c10550ed>] kthread+0x7d/0x90 [<c1481a82>] kernel_thread_helper+0x6/0x10 other info that might help us debug this: Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock(&fip->ctlr_mutex); lock(rtnl_mutex); lock(&fip->ctlr_mutex); lock(rtnl_mutex); *** DEADLOCK *** Signed-off-by: Robert Love <[email protected]> Signed-off-by: James Bottomley <[email protected]>
2012-03-28[SCSI] bfa: Update the driver version to 3.0.23.0Krishna Gudipati1-1/+1
Signed-off-by: Krishna Gudipati <[email protected]> Signed-off-by: James Bottomley <[email protected]>
2012-03-28[SCSI] bfa: BSG and User interface fixes.Krishna Gudipati4-22/+34
Made changes to set the rport maxfrsize param to use a value that is equal to or less than the Buffer-to-Buffer Receive Data_Field size specified in the Common Service Parameters. Increased the diag memtest timeout for the Brocade-1860 adapters. Made changes to enable valid port speed configuration check for all adapters. Made changes to increase the max hw segments in a request, in order to support larger data transfers from user space. Signed-off-by: Krishna Gudipati <[email protected]> Signed-off-by: James Bottomley <[email protected]>
2012-03-28[SCSI] bfa: Fix to avoid vport delete hang on request queue full scenario.Krishna Gudipati3-4/+9
Fixed the LPS (Logical Port Services) state machine to send a FDISC/FLOGI to the FW from the request queue wait state, when there is space available again on the request queue. Made changes to free the vport on LOGO/cleanup complete instead of free'ing it from vport_delete_handler in the module unload scenario. Signed-off-by: Krishna Gudipati <[email protected]> Signed-off-by: James Bottomley <[email protected]>
2012-03-28[SCSI] bfa: Move service parameter programming logic into firmware.Krishna Gudipati1-28/+0
Programming of the service parameters Tx credits etc., is now done in firmware. Remove the logic of sending the service parameters to firmware from driver. Signed-off-by: Krishna Gudipati <[email protected]> Signed-off-by: James Bottomley <[email protected]>
2012-03-28[SCSI] bfa: Revised Fabric Assigned Address(FAA) feature implementation.Krishna Gudipati10-380/+525
Made changes to the Fabric Assigned Address(FAA) feature implementation. Introduced the IOCFC state machine, which now handles the FAA logic, IOC and BFA sub-modules enablement. Removed un-wanted FAA enable/disable routines; FAA is enabled by default. Signed-off-by: Krishna Gudipati <[email protected]> Signed-off-by: James Bottomley <[email protected]>
2012-03-28[SCSI] bfa: Flash controller IOC pll init fixes.Krishna Gudipati2-45/+112
Made changes to resume the flash controller if it is halted before going ahead with flash controller pause/resume logic. Made changes to avoid clearing off the interrupts during the initial pll initialization. Signed-off-by: Krishna Gudipati <[email protected]> Signed-off-by: James Bottomley <[email protected]>
2012-03-28[SCSI] bfa: Serialize the IOC hw semaphore unlock logic.Krishna Gudipati1-12/+46
Made changes to ensure only the function that comes first will execute the IOC hw semaphore unlock logic. Used IOC init sem register to serialize execution of the unlock logic. Signed-off-by: Krishna Gudipati <[email protected]> Signed-off-by: James Bottomley <[email protected]>
2012-03-28[SCSI] bfa: Modify ISR to process pending completionsKrishna Gudipati1-3/+10
Made changes to the driver ISR to process any pending completions even if the RME bit is not set in the interrupt status register. Signed-off-by: Krishna Gudipati <[email protected]> Signed-off-by: James Bottomley <[email protected]>
2012-03-28[SCSI] bfa: Add fc host issue lip supportKrishna Gudipati1-1/+38
Signed-off-by: Krishna Gudipati <[email protected]> Signed-off-by: James Bottomley <[email protected]>
2012-03-28[SCSI] mpt2sas: remove extraneous sas_log_info messagesSathisha Nanjappa1-1/+1
This fix ensures that the IOP_LOGINFO_CODE_TASK_TERMINATED messages do not clutter the sas_log_info messages. Bugzilla 42142 - mpt2sas: Number specified in wrong base https://bugzilla.kernel.org/show_bug.cgi?id=42142 Signed-off-by: Sathisha Nanjappa <[email protected]> Acked-by: "Nandigama, Nagalakshmi" <[email protected]> Signed-off-by: James Bottomley <[email protected]>
2012-03-28[SCSI] libfc: fcoe_transport_create fails in single-CPU environmentSteven Clark1-2/+12
Starting fcoe fails at fcoe_transport_create when attempting to allocate a pool of 4K exchanges on a 64-bit single-CPU environment because the call to __alloc_percpu() is greater than the max of 32K. This patch reduces the number of exchanges to fit within the maximum allowed space. [ Whitespace problems fixed by Robert Love to satisfy chechpatch.pl ] Signed-off-by: Steven Clark <[email protected]> Signed-off-by: Robert Love <[email protected]> Signed-off-by: James Bottomley <[email protected]>
2012-03-28[SCSI] fcoe: reduce contention for fcoe_rx_list lock [v2]Neil Horman1-8/+14
There is potentially lots of contention for the rx_list_lock. On a cpu that is receiving lots of fcoe traffic, the softirq context has to add and release the lock for every frame it receives, as does the receiving per-cpu thread. We can reduce this contention somewhat by altering the per-cpu threads loop such that when traffic is detected on the fcoe_rx_list, we splice it to a temporary list. In this way, we can process multiple skbs while only having to acquire and release the fcoe_rx_list lock once. [ Braces around single statement while loop removed by Robert Love to satisfy checkpath.pl. ] Signed-off-by: Neil Horman <[email protected]> Acked-by: Vasu Dev <[email protected]> Signed-off-by: Robert Love <[email protected]> Signed-off-by: James Bottomley <[email protected]>
2012-03-28[SCSI] fcoe: remove frame dropping code from fcoe_percpu_cleanNeil Horman1-19/+3
commit e7a51997dad4e17395be1209970e18d2e9305b24 ([SCSI] fcoe: flush per-cpu thread work when destroying interface) added a skb flush to the fcoe_rx_list, which ensures that we push any pending frames on the list through the per-cpu receive thread. Because of this, its redundant to lock and scan the list first, dropping any arriving frames. Signed-off-by: Neil Horman <[email protected]> Acked-by: Vasu Dev <[email protected]> Signed-off-by: Robert Love <[email protected]> Signed-off-by: James Bottomley <[email protected]>
2012-03-28[SCSI] bnx2fc: Remove bh disable in softirq contextNeil Horman1-2/+2
As with the fcoe sw transport, the bnx2fc packet handler function runs only in softirq context. Theres no need to disable bottom halves here Signed-off-by: Neil Horman <[email protected]> Acked-by: Bhanu Prakash Gollapudi <[email protected]> Signed-off-by: Robert Love <[email protected]> Signed-off-by: James Bottomley <[email protected]>
2012-03-28[SCSI] foce: remove bh disable from fcoe sw transport rcv functionNeil Horman1-5/+5
The fcoe sw recive packet function (fcoe_rcv) only ever executes in softirq context. Given that, and the fact that no use of the fcoe_rx_list is made in irq context, its not necessecary to disable bottom halves while actually receiving the frame. Convert spin_*_bh calls in that function to their lock-only equivalents Signed-off-by: Neil Horman <[email protected]> Acked-by: Vasu Dev <[email protected]> Signed-off-by: Robert Love <[email protected]> Signed-off-by: James Bottomley <[email protected]>
2012-03-28[SCSI] libfcoe: Support extra MAC descriptor to be used as FCoE MACBhanu Prakash Gollapudi1-5/+23
Some switch implementations (eg., HP virtual connect FlexFabric) send two MAC descriptors in FIP FLOGI response, with first MAC descriptor (granted_mac) used as FPMA, and the second one (fcoe_mac) used as destination address for sending/receiving FCoE packets. fip_mac continues to be used for FIP traffic. This patch introduces fcoe_mac in fcoe_fcf structure. For regular switches, both fcoe_mac and fip_mac will be the same. For the switches that send additional MAC descriptor, fcoe_mac is updated. Signed-off-by: Bhanu Prakash Gollapudi <[email protected]> Signed-off-by: Robert Love <[email protected]> Signed-off-by: James Bottomley <[email protected]>
2012-03-28[SCSI] libfc: update fc_host mfs along with updating lport->mfsVasu Dev1-1/+9
Currently fc_host mfs is not getting updated in case its changed during FLOGI and that leaves fc_host to show its initial old value in sysfs, so instead have fc_host mfs updated along with updating lport mfs during FLOGI. Also in case of bad mfs during flogi, error out instead of continuing with flogi. [ Changes made by Robert Love: condition to '>=' and added printing of lport->mfs in DBG statement. FLOGI resp processing failed without being able to compare FCoE MFS 2112 against an incoming MFS of 2112 ] Signed-off-by: Vasu Dev <[email protected]> Tested-by: Ross Brattain <[email protected]> Signed-off-by: Robert Love <[email protected]> Signed-off-by: James Bottomley <[email protected]>
2012-03-28[SCSI] libfcoe: Do not sends FDISCs before FLOGI during CVLBhanu Prakash Gollapudi1-5/+5
When handling CVL with no Vx port descriptors, lports for NPIV ports are reset before issuing the ctlr_reset. This causes FDISCs to be issued before successful FLOGI. Fix it by resetting the controller before resetting the lports. Signed-off-by: Bhanu Prakash Gollapudi <[email protected]> Signed-off-by: Robert Love <[email protected]> Signed-off-by: James Bottomley <[email protected]>
2012-03-28[SCSI] fcoe: Ensure fcoe_recv_frame is always called in process contextNeil Horman1-17/+10
commit 859b7b649ab58ee5cbfb761491317d5b315c1b0f introduced the ability to call fcoe_recv_frame in softirq context. While this is beneficial to performance, its not safe to do, as it breaks the serialization of access to the lport structure (i.e. when an fcoe interface is being torn down, theres no way to serialize the teardown effort with the completion of receieve operations occuring in softirq context. As a result, lport (and other) data structures can be read and modified in parallel leading to corruption. Most notable is the vport list, which is protected by a mutex, that will cause a panic if a softirq receive while said mutex is locked. Additionaly, the ema_list, discussed here: http://lists.open-fcoe.org/pipermail/devel/2012-February/011947.html Can be corrupted if a list traversal occurs in softirq context at the same time as a list delete in process context. And generally the lport state variables will not be stable, and may lead to unpredictable results. The most direct fix is to remove the bits from the above commit that allowed fcoe_recv_frame to be called in softirq context. We just force all frames to be handled by the per-cpu rx threads. This will allow the fcoe_if_destroy's use of fcoe_percpu_clean to function properly, ensuring that no frames are being received while the lport is being torn down. Signed-off-by: Neil Horman <[email protected]> Reviewed-by: Vasu Dev <[email protected]> Signed-off-by: Robert Love <[email protected]> Signed-off-by: James Bottomley <[email protected]>
2012-03-28[SCSI] pm8001: Use spin_lock_irqsave() for task_state.Santosh Nayak1-8/+10
Signed-off-by: Santosh Nayak <[email protected]> Acked-by: Jack Wang <[email protected]> Signed-off-by: James Bottomley <[email protected]>
2012-03-28serial: sh-sci: fix a race of DMA submit_tx on transferYoshii Takashi1-5/+10
When DMA is enabled, sh-sci transfer begins with uart_start() sci_start_tx() if (cookie_tx < 0) schedule_work() Then, starts DMA when wq scheduled, -- (A) process_one_work() work_fn_rx() cookie_tx = desc->submit_tx() And finishes when DMA transfer ends, -- (B) sci_dma_tx_complete() async_tx_ack() cookie_tx = -EINVAL (possible another schedule_work()) This A to B sequence is not reentrant, since controlling variables (for example, cookie_tx above) are not queues nor lists. So, they must be invoked as A B A B..., otherwise results in kernel crash. To ensure the sequence, sci_start_tx() seems to test if cookie_tx < 0 (represents "not used") to call schedule_work(). But cookie_tx will not be set (to a cookie, also means "used") until in the middle of work queue scheduled function work_fn_tx(). This gap between the test and set allows the breakage of the sequence under the very frequently call of uart_start(). Another gap between async_tx_ack() and another schedule_work() results in the same issue, too. This patch introduces a new condition "cookie_tx == 0" just to mark it is "busy" and assign it within spin-locked region to fill the gaps. Signed-off-by: Takashi Yoshii <[email protected]> Reviewed-by: Guennadi Liakhovetski <[email protected]> Cc: [email protected] Signed-off-by: Paul Mundt <[email protected]>