summaryrefslogtreecommitdiffstats
path: root/drivers
Commit message (Collapse)AuthorAgeFilesLines
* HID: Add support MacbookAir 4,1 keyboardNobuhiro Iwamatsu2011-10-033-0/+37
| | | | | | | Added USB device IDs and keyboard map for MacBookAir 4,1 keyboard. Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: hidraw: free list for all error in hidraw_openAmit Nagal2011-09-071-1/+2
| | | | | | | | In function hidraw_open struct hidraw_list *list should be freed for all error conditions. Signed-off-by: Amit Nagal <helloin.amit@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: unlock on error path in hid_device_probe()Dan Carpenter2011-08-241-3/+5
| | | | | | | | We recently introduced locking into this function, but we missed an error path which needs an unlock. Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: hid-debug: Show application usage for each collection.Jeff Brown2011-08-161-0/+5
| | | | | | Signed-off-by: jeffbrown@android.com Reviewed-by: Benjamin Tissoires <benjamin.tissoires@logitech.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* IHD: Support force feedback on MP-8866Sean Young2011-08-153-32/+38
| | | | | | | | Support force feedback on the Dual USB Force Feedback Joypad (MP-8866). Signed-off-by: Sean Young <sean@mess.org> Acked-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: add MacBookAir4,2 to hid_have_special_driver[]Jiri Kosina2011-08-101-0/+3
| | | | | | | Otherwise the generic driver wouldn't unbind from it and wouldn't let hid-apple to automatically take over. Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: add support for MacBookAir4,2 keyboard.Joshua V. Dillon2011-08-102-0/+12
| | | | | | | | | | Added USB device IDs for MacBookAir4,2 keyboard. Device constants were copied from the MacBookAir3,2 constants. The 4,2 device specification is reportedly unchanged from the 3,2 predecessor and seems to work well. Signed-off-by: Joshua V Dillon <jvdillon@gmail.com> Signed-off-by: Chase Douglas <chase.douglas@canonical.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: propagate return value correctly in hid_input_report()Jiri Kosina2011-08-101-2/+2
| | | | | | | | Fix a return value propagation that was omitted in David Herrmann's locking fix around hid_input_report(). Reported-by: David Herrmann <dh.herrmann@googlemail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: Fix race condition between driver core and ll-driverDavid Herrmann2011-08-101-7/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | HID low level drivers register new devices with the HID core which then adds the devices to the HID bus. The HID bus normally immediately probes an appropriate driver which then handles HID input for this device. The ll driver now uses the hid_input_report() function to report input events for a specific device. However, if the HID bus unloads the driver at the same time (for instance via a call to /sys/bus/hid/devices/<dev>/unbind) then the hdev->driver pointer may be used by hid_input_report() and hid_device_remove() at the same time which may cause hdev->driver to point to invalid memory. This fix adds a semaphore to every hid device which protects hdev->driver from asynchronous access. This semaphore is locked during driver *_probe and *_remove and also inside hid_input_report(). The *_probe and *_remove functions may sleep so the semaphore is good here, however, hid_input_report() is in atomic context and hence only uses down_trylock(). If it cannot acquire the lock it simply drops the input package. The low-level drivers report input events synchronously so hid_input_report() should never be entered twice at the same time on the same device. Hence, the lock should always be available. But if the driver is currently probed/removed then the lock is not available and dropping the package should be safe because this is what would have happened if the package arrived some milliseconds earlier/later. This also fixes another race condition while probing drivers: First the *_probe function of the driver is called and only if that succeeds, the related input device of hidinput is registered. If the low level driver reports input events after the *_probe function returned but before the input device is registered, then a NULL pointer dereference will occur. (Equivalently on driver remove function). This is not possible anymore, since the semaphore lock drops all incoming packages until the driver/device is fully initialized. Signed-off-by: David Herrmann <dh.herrmann@googlemail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: prodikeys: kfree() NULL pointer cleanupBojan Prtvar2011-08-041-4/+4
| | | | | | | | No need for freeing pm in case when it's not allocated. Reported-by: Julia Lawall <julia@diku.dk> Signed-off-by: Bojan Prtvar <prtvar.b@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* HID: zydacron: kfree() NULL pointer cleanupBojan Prtvar2011-08-041-3/+1
| | | | | | | Checking for NULL pointers before kfree() is redundant. Signed-off-by: Bojan Prtvar <prtvar.b@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* Merge branch 'for-linus' of ↵Linus Torvalds2011-07-239-70/+689
|\ | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap: regulator: Convert tps65023 to use regmap API regmap: Add SPI bus support regmap: Add I2C bus support regmap: Add generic non-memory mapped register access API
| * regulator: Convert tps65023 to use regmap APIMark Brown2011-07-232-70/+28
| | | | | | | | | | | | Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com> Acked-by: Grant Likely <grant.likely@secretlab.ca>
| * regmap: Add SPI bus supportMark Brown2011-07-233-1/+77
| | | | | | | | | | | | | | Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com> Acked-by: Wolfram Sang <w.sang@pengutronix.de> Acked-by: Grant Likely <grant.likely@secretlab.ca>
| * regmap: Add I2C bus supportMark Brown2011-07-233-0/+120
| | | | | | | | | | | | | | Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com> Acked-by: Wolfram Sang <w.sang@pengutronix.de> Acked-by: Grant Likely <grant.likely@secretlab.ca>
| * regmap: Add generic non-memory mapped register access APIMark Brown2011-07-235-0/+465
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are many places in the tree where we implement register access for devices on non-memory mapped buses, especially I2C and SPI. Since hardware designers seem to have settled on a relatively consistent set of register interfaces this can be effectively factored out into shared code. There are a standard set of formats for marshalling data for exchange with the device, with the actual I/O mechanisms generally being simple byte streams. We create an abstraction for marshaling data into formats which can be sent on the control interfaces, and create a standard method for plugging in actual transport underneath that. This is mostly a refactoring and renaming of the bottom level of the existing code for sharing register I/O which we have in ASoC. A subsequent patch in this series converts ASoC to use this. The main difference in interface is that reads return values by writing to a location provided by a pointer rather than in the return value, ensuring we can use the full range of the type for register data. We also use unsigned types rather than ints for the same reason. As some of the devices can have very large register maps the existing ASoC code also contains infrastructure for managing register caches. This cache work will be moved over in a future stage to allow for separate review, the current patch only deals with the physical I/O. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com> Acked-by: Greg Kroah-Hartman <gregkh@suse.de> Acked-by: Wolfram Sang <w.sang@pengutronix.de> Acked-by: Grant Likely <grant.likely@secretlab.ca>
* | Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6Linus Torvalds2011-07-2389-3180/+13262
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (77 commits) [SCSI] fix crash in scsi_dispatch_cmd() [SCSI] sr: check_events() ignore GET_EVENT when TUR says otherwise [SCSI] bnx2i: Fixed kernel panic due to illegal usage of sc->request->cpu [SCSI] bfa: Update the driver version to 3.0.2.1 [SCSI] bfa: Driver and BSG enhancements. [SCSI] bfa: Added support to query PHY. [SCSI] bfa: Added HBA diagnostics support. [SCSI] bfa: Added support for flash configuration [SCSI] bfa: Added support to obtain SFP info. [SCSI] bfa: Added support for CEE info and stats query. [SCSI] bfa: Extend BSG interface. [SCSI] bfa: FCS bug fixes. [SCSI] bfa: DMA memory allocation enhancement. [SCSI] bfa: Brocade-1860 Fabric Adapter vHBA support. [SCSI] bfa: Brocade-1860 Fabric Adapter PLL init fixes. [SCSI] bfa: Added Fabric Assigned Address(FAA) support [SCSI] bfa: IOC bug fixes. [SCSI] bfa: Enable ASIC block configuration and query. [SCSI] bnx2i: Updated copyright and bump version [SCSI] bnx2i: Modified to skip CNIC registration if iSCSI is not supported ... Fix up some trivial conflicts in: - drivers/scsi/bnx2fc/{bnx2fc.h,bnx2fc_fcoe.c}: Crazy broadcom version number conflicts - drivers/target/tcm_fc/tfc_cmd.c Just trivial cleanups done on adjacent lines
| * \ Merge branch 'scsi-fixes'James Bottomley2011-07-23240-1455/+25703
| |\ \
| | * | [SCSI] fix crash in scsi_dispatch_cmd()James Bottomley2011-07-211-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | USB surprise removal of sr is triggering an oops in scsi_dispatch_command(). What seems to be happening is that USB is hanging on to a queue reference until the last close of the upper device, so the crash is caused by surprise remove of a mounted CD followed by attempted unmount. The problem is that USB doesn't issue its final commands as part of the SCSI teardown path, but on last close when the block queue is long gone. The long term fix is probably to make sr do the teardown in the same way as sd (so remove all the lower bits on ejection, but keep the upper disk alive until last close of user space). However, the current oops can be simply fixed by not allowing any commands to be sent to a dead queue. Cc: stable@kernel.org Signed-off-by: James Bottomley <JBottomley@Parallels.com>
| | * | [SCSI] sr: check_events() ignore GET_EVENT when TUR says otherwiseKay Sievers2011-07-212-4/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some broken devices indicates that media has changed on every GET_EVENT_STATUS_NOTIFICATION. This translates into MEDIA_CHANGE uevent on every open() which lets udev run into a loop. Verify GET_EVENT result against TUR and if it generates spurious events for several times in a row, ignore the GET_EVENT events, and trust only the TUR status. This is the log of a USB stick with a (broken) fake CDROM drive: scsi 5:0:0:0: Direct-Access SanDisk U3 Cruzer Micro 8.02 PQ: 0 ANSI: 0 CCS sd 5:0:0:0: Attached scsi generic sg3 type 0 scsi 5:0:0:1: CD-ROM SanDisk U3 Cruzer Micro 8.02 PQ: 0 ANSI: 0 sd 5:0:0:0: [sdb] Attached SCSI removable disk sr2: scsi3-mmc drive: 48x/48x tray sr 5:0:0:1: Attached scsi CD-ROM sr2 sr 5:0:0:1: Attached scsi generic sg4 type 5 sr2: GET_EVENT and TUR disagree continuously, suppress GET_EVENT events sd 5:0:0:0: [sdb] 31777279 512-byte logical blocks: (16.2 GB/15.1 GiB) sd 5:0:0:0: [sdb] No Caching mode page present sd 5:0:0:0: [sdb] Assuming drive cache: write through sd 5:0:0:0: [sdb] No Caching mode page present sd 5:0:0:0: [sdb] Assuming drive cache: write through sdb: sdb1 -tj: Updated to consider only spurious GET_EVENT events among different types of disagreement and allow using TUR for kernel event polling after GET_EVENT is ignored. Reported-By: Markus Rathgeb maggu2810@googlemail.com Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Tejun Heo <tj@kernel.org> Cc: stable@kernel.org # >= v2.6.38, fixes udev busy looping w/ certain devices Signed-off-by: James Bottomley <JBottomley@Parallels.com>
| * | | [SCSI] bnx2i: Fixed kernel panic due to illegal usage of sc->request->cpuEddie Wai2011-07-211-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A kernel panic was observed when passing the sc->request->cpu = -1 to retrieve the per_cpu variable pointer: #0 [ffff880011203960] machine_kexec at ffffffff81022bc3 #1 [ffff8800112039b0] crash_kexec at ffffffff81088630 #2 [ffff880011203a80] __die at ffffffff8139ea20 #3 [ffff880011203aa0] no_context at ffffffff8102f3a7 #4 [ffff880011203ae0] __bad_area_nosemaphore at ffffffff8102f665 #5 [ffff880011203ba0] retint_signal at ffffffff8139dd1f #6 [ffff880011203cc8] bnx2i_indicate_kcqe at ffffffffa03dc4f2 #7 [ffff880011203da8] service_kcqes at ffffffffa03cb04f #8 [ffff880011203e68] cnic_service_bnx2x_kcq at ffffffffa03cb14a #9 [ffff880011203e88] cnic_service_bnx2x_bh at ffffffffa03cb1b3 The problem lies in the slow path sg_io (and perhaps sg_scsi_ioctl) call to blk_get_request->get_request/wait->blk_alloc_request->blk_rq_init which re-initializes the request->cpu to -1. There is no assignment for cpu from that to the request_fn call to low level drivers. When this happens, the sc->request->cpu will be using the init value of -1. This will create a kernel panic when it hits bnx2i because the code refers it to get the per_cpu variables ptr. This change is to put in a guard against that and also for cases when bio affinity/queue completion to the same cpu is not enabled. In those cases, the request->cpu will remain a -1 also. This bug was created from commit: b5cf6b63f73abdc051035f0050b367beeb2ef94c For the case when the blk layer did not setup the request->cpu, bnx2i will complete the sc with the current CPU of the thread. Signed-off-by: Eddie Wai <eddie.wai@broadcom.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
| * | | [SCSI] bfa: Update the driver version to 3.0.2.1Krishna Gudipati2011-06-291-1/+1
| | | | | | | | | | | | | | | | | | | | Signed-off-by: Krishna Gudipati <kgudipat@brocade.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
| * | | [SCSI] bfa: Driver and BSG enhancements.Krishna Gudipati2011-06-296-34/+100
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Added a new module parameter max_xfer_size to set the max_sectors in the scsi_host template. - Added logic to handle request_irq() failure so that msix vector resource is de-allocated immediately when failure happens. - BSG enhancements to collect vHBA releated info and port log. - Removed the workaround of incrementing the module refcnt on bsg request. Signed-off-by: Krishna Gudipati <kgudipat@brocade.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
| * | | [SCSI] bfa: Added support to query PHY.Krishna Gudipati2011-06-299-0/+867
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Added PHY sub-module. - Implemented interface to obtain stats and to read/update the fw from the PHY module. Signed-off-by: Krishna Gudipati <kgudipat@brocade.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
| * | | [SCSI] bfa: Added HBA diagnostics support.Krishna Gudipati2011-06-2911-9/+1665
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Added diagnostics sub-module to BFA. - Implemented interface to perform memtest/loopback test and some other diagnostics tests. Signed-off-by: Krishna Gudipati <kgudipat@brocade.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
| * | | [SCSI] bfa: Added support for flash configurationKrishna Gudipati2011-06-299-47/+910
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Added flash sub-module. - Implemented the interface to read/erase/update flash partition. Signed-off-by: Krishna Gudipati <kgudipat@brocade.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
| * | | [SCSI] bfa: Added support to obtain SFP info.Krishna Gudipati2011-06-298-0/+903
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Added SFP sub-module to BFA. - Added interface to collect sfp media info and sfp speed. Signed-off-by: Krishna Gudipati <kgudipat@brocade.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
| * | | [SCSI] bfa: Added support for CEE info and stats query.Krishna Gudipati2011-06-298-0/+683
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Added CEE sub-module. - Added support to collect stats/cee module info using BSG interface. Signed-off-by: Krishna Gudipati <kgudipat@brocade.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
| * | | [SCSI] bfa: Extend BSG interface.Krishna Gudipati2011-06-2911-7/+867
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Added support to collect driver/fw stats. - Added support to perform adapter/ioc enable, disable operations. Signed-off-by: Krishna Gudipati <kgudipat@brocade.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
| * | | [SCSI] bfa: FCS bug fixes.Krishna Gudipati2011-06-2912-55/+288
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Added logic to initiate a PLOGI to the target, while processing a LOGO from the same target in Direct attach mode. - Added logic to generate a FCCT Reject indicating unsupported command, upon receiving FCCT/FCGS requests. - Added logic to set the fcpim in offline state and avoid any PRLI retries if a PRLI response is a reject with a reason Command Not Supported. - Updated the FDMI Supported/Current speeds. - Added logic to wait for the response from the firmware before sending ACC to PLOGI and transitioning to subsequent states - while processing an Incoming PLOGI in online state. - Added a wait state in the fcs_vport state machine - For case where FDISC is in progress and we get a vport delete request we wait for fdisc response and will transition to the appropriate state based on rsp status, else its causing both driver/fw resources to be not freed. - Remove the fc_credit_recovery module param. Signed-off-by: Krishna Gudipati <kgudipat@brocade.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
| * | | [SCSI] bfa: DMA memory allocation enhancement.Krishna Gudipati2011-06-2913-569/+624
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Modified the design such that each BFA sub-module will provide the amount of DMA and KVA memory needed by it and queues the same request to the global dma and kva info queues. - During the memory allocation we iterate over this queue to allocate the dma and kva memory requested by sub-modules. - The change is needed to avoid requesting the aggregate amount of memory needed by all the BFA sub-modules as one contiguous chunk. Signed-off-by: Krishna Gudipati <kgudipat@brocade.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
| * | | [SCSI] bfa: Brocade-1860 Fabric Adapter vHBA support.Krishna Gudipati2011-06-2912-118/+278
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Introduced partitioning of the BFA resources. - Added h/w queue ID in CPE messages, firmware uses h/w queue ID from messages to pick a matching RME queue. - Added message header to bfa_reqq_produce(). h/w queue ID is set in the message header and firmware modules use h/w queue ID from message header instead of from cpqe event. - Made changes to allow using all 256 queues of Brocade-1860 asic. Previously only a single queue per queue group was used. - Added function tag to BFI message header. Only used by FC BFI messages. Used to translate host tag to firmware tag. bfa_lpuid() is changed to bfa_fn_lpu() that encodes both PCI function and port ID in BFI message header. Signed-off-by: Krishna Gudipati <kgudipat@brocade.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
| * | | [SCSI] bfa: Brocade-1860 Fabric Adapter PLL init fixes.Krishna Gudipati2011-06-299-132/+169
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - If flash controller is halted unconditionally, this results in illegal write access to flash controller register domain. Since flash controller registers are only accessible once s_clk is started - added logic to check for WGN status and halt flash controller only if it is already running. - Added check to wait for flash controller halt to be completed before proceeding with s_clk/l_clk initializations. - Removed unnecessary reset logic for PMM 1T memory and moved memory initialization after flash access enable. - Disable Brocade-1860 asic MBOX interrupt before PLL initialization. - Remove reset enable for S_CLK/L_CLK after both PLL initializations are complete. Signed-off-by: Krishna Gudipati <kgudipat@brocade.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
| * | | [SCSI] bfa: Added Fabric Assigned Address(FAA) supportKrishna Gudipati2011-06-2912-6/+466
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Updated/added data structures and definitions to support FAA protocol. - Modified the IOC state machine to support FAA. - Introduced FAA feature configuration - enable/disable/query. Signed-off-by: Krishna Gudipati <kgudipat@brocade.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
| * | | [SCSI] bfa: IOC bug fixes.Krishna Gudipati2011-06-295-34/+125
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Add logic to handle the case where PCI mapping goes away when IOCPF state machine is waiting for semaphore. - Added logic to unlock hw semaphore if the previos FW boot was from flash based and the current FW initialization attempt is from OS. - Added fix to update hbfails and hb_count stats during hwerror event. Signed-off-by: Krishna Gudipati <kgudipat@brocade.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
| * | | [SCSI] bfa: Enable ASIC block configuration and query.Krishna Gudipati2011-06-2910-9/+863
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Added ASIC block configuration APIs: - to create/delete/update the physical functions - to do adapter/port mode configuration - to query the current ASIC block configuration. Signed-off-by: Krishna Gudipati <kgudipat@brocade.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
| * | | [SCSI] bnx2i: Updated copyright and bump versionEddie Wai2011-06-297-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Bumped version from 2.6.2.3 to 2.7.0.3 Signed-off-by: Eddie Wai <eddie.wai@broadcom.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
| * | | [SCSI] bnx2i: Modified to skip CNIC registration if iSCSI is not supportedEddie Wai2011-06-291-14/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The init routine will now examine the cnic->max_iscsi_conn variable before registering to CNIC during ulp_init. Signed-off-by: Eddie Wai <eddie.wai@broadcom.com> Acked-by: Michael Chan <mchan@broadcom.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
| * | | [SCSI] bnx2i: Added the use of kthreads to handle SCSI cmd completionEddie Wai2011-06-294-35/+333
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch breaks the SCSI cmd completion into two parts: 1. The bh will allocate and queued work to the cmd specific CPU IO completion kthread. The CPU for the cmd is from the sc->request->cpu. 2. The CPU specific IO completion kthread will call the scsi_cmd_resp routine to do the actual cmd completion. In the normal case, these IO completion kthreads should complete before the blk IO times out at 60s. However, in the case when these kthreads are blocked for whatever reason and exceeded the timeout, the call to conn_destroy will have to iterate and exhaust all related work in the percpu work list for all online CPUs. This will guarantee the protection of the work->session and conn pointers before they get freed. Also modified the event coalescing formula to have at least the event_coal_min outstanding cmds in the pipeline so the SCSI producer would not get underrun. Also changed the following SCSI parameters: - can_queue from 1024 to 2048 - cmds_per_lun from 24 to 128 Signed-off-by: Eddie Wai <eddie.wai@broadcom.com> Acked-by: Benjamin Li <benli@broadcom.com> Acked-by: Michael Chan <mchan@broadcom.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
| * | | [SCSI] libiscsi_tcp: fix LLD data allocationMike Christie2011-06-291-11/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Have libiscsi_tcp have upper layers allocate the LLD data along with the iscsi_cls_conn struct, so it is refcounted. Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
| * | | [SCSI] iscsi_tcp: fix locking around iscsi sk user dataMike Christie2011-06-291-20/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | iscsi_sw_tcp_conn_restore_callbacks could have set the sk_user_data field to NULL then iscsi_sw_tcp_data_ready could read that and try to access the NULL pointer. This adds some checks for NULL sk_user_data in the sk callback functions and it uses the sk_callback_lock to set/get that sk_user_data field. Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
| * | | [SCSI] iscsi_ibft, be2iscsi, iscsi_boot: fix boot kobj data lifetime managementMike Christie2011-06-293-103/+129
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | be2iscsi passes the boot functions its phba object which is allocated in the shost, but iscsi_ibft passes in a object allocated for each item to display. The problem is that iscsi_boot_sysfs was managing the lifetime of the object passed in and doing a kfree on release. This causes a double free for be2iscsi which frees the shost in its pci_remove. This patch fixes the problem by adding a release callback which the drivers can call kfree or a put() type of function (needed for be2iscsi which will do a get/put on the shost). Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
| * | | [SCSI] iscsi_boot_sysfs: have this module check for null on destructionMike Christie2011-06-292-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This moves the check for NULL boot_sets to the iscsi_boot_sysfs module instead of having the drivers do it. Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
| * | | [SCSI] cxgb3i: fixed programing of the dma page sizesKaren Xie2011-06-291-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed missing programming of the pages sizes for DMA. Signed-off-by: Karen Xie <kxie@chelsio.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
| * | | [SCSI] fcoe: Rearrange fcoe port and NPIV port cleanupNeerav Parikh2011-06-291-37/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When NPIV port destroy handler is called it does not do all the cleanup required for the given NPIV port. This was happening as some of the lport cleanup moved to fcoe_interface_cleanup() routine, which is not called as part of the vport delete process. This patch rearranges the sequence in which the fcoe_if_destory() and fcoe_interface_cleanup() functions are being called from various places in the code. It now matches the sequence they are constructed during the create process for both N_Port as well as NPIV port. Tested-by: Ross Brattain <ross.b.brattain@intel.com> Signed-off-by: Neerav Parikh <Neerav.Parikh@intel.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
| * | | [SCSI] libfc: post reset event on lport resetVasu Dev2011-06-291-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Post an FCH_EVT_LIPRESET event on lport reset as as lport reset occurs on FIP cleat virtual link, this could be due to change in fcoe vlan and this event will allow user app fcoemon to switch to new fcoe vlan. Signed-off-by: Vasu Dev <vasu.dev@intel.com> Tested-by: Ross Brattain <ross.b.brattain@intel.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
| * | | [SCSI] tcm_fc: Fixing reference counting problem which was causing ft_sess ↵Kiran Patil2011-06-291-5/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | to be deleted. Problem: After fixing the issue in TCM core w.r.t LUN Reset (Task Management request) , ran into issue where during the completing of this LUN Reset command, reference count of "ft_sess" drops to zero which caused "sess" to be deleted. Fix: As part of handling task management request (e.g. LUN Reset), TCM core function "transport_generic_do_tmr" ends up calling ft_free_cmd which in turn calls "ft_sess_put" (which drops session's reference count by 1) and then frees ft_cmd. Then function "transport_generic_do_tmr" calls "transport_cmd_check_stop" which in turn also calls ft_free_cmd (which calls ft_sess_put - which drops reference count of sess by 1, hence reference count of sess becomes zero and session gets deleted). Fix is to just send response in case of tmr from function "ft_queue_resp_code" and not delete "ft_cmd" (means don't call ft_free_cmd). Earlier code was to send the response code and also free ft_cmd. ft_free_cmd will be freed later after sending response code as a result of "transport_cmd_check_stop" (which calls ft_release_cmd -> ft_free_cmd) being called from "transport_generic_do_tmr" after sening TMR response code. Notes/Dependencies: This bug was found after fixing NULL pointer access issue in TCM core (in LUN Reset codepath) Signed-off-by: Kiran Patil <kiran.patil@intel.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
| * | | [SCSI] libfc:Fix for exchange/seq loopup failure when FCoE stack is used as ↵Kiran Patil2011-06-291-2/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | target and connected to windows initaitor Problem: Linux based SW target (TCM) connected to windows initiator was unable to satisfy write request of size > 2K. Fix: Existing linux implememtation of FCoE stack is expecting sequence number to match w.r.t incoming framme. When DDP is used on target in response to write request from initiator, SW stack is notified only when last data frame arrives and only the pakcket header of last data frame is posted to NetRx queue of storage. When that last packet was processed in libfc:Exchange layer, implementation was expecting sequence number to match, but in this case sequence number which is embedded in FC Header is assigned by windows initaitor, hence due to sequence number mismatch post-processing which shall result into sending RSP is not done. Enhanced the code to utilize the sequence number of incoming last frame and process the packet so that, it will eventually complete the write request by sending write response (RSP) GOOD. Notes/Dependencies: This patch is validated using windows and linux initiator to make sure, it doesn't break anything. Signed-off-by: Kiran Patil <kiran.patil@intel.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
| * | | [SCSI] fcoe: Amends previous patch, Round-robin based selection of CPU for ↵Kiran Patil2011-06-291-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | post processing of incoming request for FCoE target Problem: Selection of RX queue on target is based on RX-ID. FCoE used 8 Net Rx queues. HW post the packets based on rx_id % num_rx_queue. Due to this has based filtering, only one CPU is busy servicing incoming request including post-processing of incoming request. This is gating factor because 1. Only one CPU is utilized 100% while others CPUs are not used at all. 2. CPU which received request assign "sequence' by selecting exchange from per CPU pool (num_ddp_context / num_online_cpus, approxi.). Due to which if if rate of incoming request is higher than rate of servicing request, existing code path end of sending "BUSY" response (SAM_STAT_BUSY because unable to allocate exchange). Fix: Fan-out incoming request to all other CPUs excluding the CPU which is receiving all incoiming request. This path also addresses, selecting same CPU based on rx_id from received frame for completion of the request such as "releasing exchange to the per CPU Pool". This fix is applicable for FCoE target since initiator code path already takes care of selecting CPU to complete post-processing of request once OX_ID is assigned. Notes: N/A Dependencines: N/A Signed-off-by: Kiran Patil <kiran.patil@intel.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
| * | | [SCSI] fcoe: Round-robin based selection of CPU for post-processing of ↵Kiran Patil2011-06-291-1/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | incoming commands Problem: Earlier mechanism of selection of CPU was, to select the same CPU which has received incoming request. Hence in case of rx_id = 0xFFFF, request was always posted to same NetRx queue, hence only 1 CPU is utilized for handling the command. It was also causing problem of "running out of exchanges from per CPU pool of exchanges (in case of DDP offload) Fix: Implemented new algo. to select CPU for post-processing of incoming commands when rx_id is unknown. This is simple Round robin algo. for CPU selection. Notes/Dependencies: N/A Signed-off-by: Kiran Patil <kiran.patil@intel.com> Signed-off-by: Robert Love <robert.w.love@intel.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>