aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/isp
Commit message (Collapse)AuthorAgeFilesLines
...
* Add brackets to fix incorrect macro expansion.Alexander Motin2017-03-241-1/+1
| | | | | | | | Reported by: Andreas Hollmann / PVS-Studio MFC after: 2 weeks Notes: svn path=/head/; revision=315913
* Unify initiator and target DMA setup and command sending.Alexander Motin2017-03-247-332/+114
| | | | | | | | | The code is so alike that it is pointless to keep it separate. MFC after: 2 weeks Notes: svn path=/head/; revision=315908
* isp field in struct isp_pcmd is also unused.Alexander Motin2017-03-231-1/+0
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=315870
* Remove write-only crn field from struct isp_pcmd.Alexander Motin2017-03-232-3/+0
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=315869
* Switch from using periph_links to sim_links.Alexander Motin2017-03-221-10/+10
| | | | | | | | | periph_links field belongs to periph drivers and must not be used here. MFC after: 2 weeks Notes: svn path=/head/; revision=315709
* Cleanup response queue processing.Alexander Motin2017-03-224-318/+153
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=315708
* Remove another remnants left after r246713.Alexander Motin2017-03-212-4/+0
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=315683
* Remove some dead code left after r246713.Alexander Motin2017-03-212-38/+3
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=315682
* Improve command timeout handling.Alexander Motin2017-03-214-36/+14
| | | | | | | | | | | | Let firmware do its best first, and if it can't, try software recovery. I would remove software timeout handler completely, but found bunch of complains on command timeout on sparc64 mailing list few years ago, so better be safe in case of interrupt loss. MFC after: 2 weeks Notes: svn path=/head/; revision=315681
* Remove questionable reqp->req_time access.Alexander Motin2017-03-211-4/+5
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=315678
* Clean/unify some macro usage.Alexander Motin2017-03-214-62/+51
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=315677
* Addition to r315579: drop the lock while allocating IRQs.Alexander Motin2017-03-211-0/+2
| | | | | | | MFC after: 12 days Notes: svn path=/head/; revision=315670
* Remove some more dead code.Alexander Motin2017-03-203-38/+8
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=315652
* Remove some useless code.Alexander Motin2017-03-193-16/+0
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=315587
* Add initial support for multiple MSI-X vectors.Alexander Motin2017-03-197-64/+119
| | | | | | | | | | | | For 24xx and above use 2 vectors (default and response queue). For 26xx and above use 3 vectors (default, response and ATIO queues). Due to global lock interrupt hardlers never run simultaneously now, but at least this allows to save one regitster read per interrupt. MFC after: 2 weeks Notes: svn path=/head/; revision=315579
* Remove hackish code delaying ATIOs to unknown virtual port.Alexander Motin2017-03-194-53/+28
| | | | | | | | | | Since we support RQSTYPE_RPT_ID_ACQ, that functionality is only useful in loop mode, which probably doesn't worth having this hack in 2017. MFC after: 2 weeks Notes: svn path=/head/; revision=315545
* Move <= 23xx PDB workaround to generic code.Alexander Motin2017-03-192-18/+29
| | | | | | | | | It is chip-specific and has nothing to do with platform. MFC after: 2 weeks Notes: svn path=/head/; revision=315536
* Remove some dead stuff.Alexander Motin2017-03-191-16/+5
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=315534
* Move 24xx RQSTYPE_NOTIFY handling to generic code.Alexander Motin2017-03-193-181/+156
| | | | | | | | | This code has nothing to do with specific platform. MFC after: 2 weeks Notes: svn path=/head/; revision=315533
* Reorganize RQSTYPE_NOTIFY handling for chips <= 23xx.Alexander Motin2017-03-182-191/+87
| | | | | | | | | | | There were two copies of the code: one in generic code was half-broken, and another in platform code was never called. Leave only one in generic code and working. MFC after: 2 weeks Notes: svn path=/head/; revision=315507
* Move RQSTYPE_ABTS_RCVD parsing into generic code.Alexander Motin2017-03-182-57/+51
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=315489
* Extend nt_lun to full 8 byte.Alexander Motin2017-03-183-11/+11
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=315488
* Remove dead remnants of SPI target.Alexander Motin2017-03-184-82/+0
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=315485
* Use isp_target_put_entry() in places where it can be.Alexander Motin2017-03-182-64/+35
| | | | | | | | | This unifies the code and removes some duplication. MFC after: 2 weeks Notes: svn path=/head/; revision=315482
* Do some notify acks cleanup.Alexander Motin2017-03-182-79/+74
| | | | | | | | | ISPASYNC_TARGET_NOTIFY_ACK makes no sense without argument. MFC after: 2 weeks Notes: svn path=/head/; revision=315478
* Remove not very useful ATIO/INOT stats.Alexander Motin2017-03-152-14/+9
| | | | | | | | | While there polish respective debug logging. MFC after: 2 weeks Notes: svn path=/head/; revision=315327
* Refactor interrupt handling.Alexander Motin2017-03-155-355/+198
| | | | | | | | | | | | | | | Instead of single isp_intr() function doing all possible magic, introduce four different functions to handle mailbox operation completions, async events, response and ATIO queues. The goal is to isolate different code paths to make code more readable, and to make easier support for multiple interrupt vectors. Even oldest hardware in many cases can identify what code path it should run on interrupt. Contemporary hardware can assign them to different interrupt vectors. MFC after: 2 weeks Notes: svn path=/head/; revision=315307
* Fix panic when SIM dereferenced before allocation.Alexander Motin2017-03-151-24/+25
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=315303
* Fix ancient bug from r84597, which broke 23xx after r315234.Alexander Motin2017-03-151-1/+1
| | | | | | | MFC after: 13 days Notes: svn path=/head/; revision=315298
* Remove some dead/broken code paths around async handlingAlexander Motin2017-03-144-50/+25
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=315279
* Remove tangled isp_mbox_continue() mechanism.Alexander Motin2017-03-144-270/+61
| | | | | | | | | | | | It was implemented to reduce context switches when uploading firmware to card's RAM. But this mechanism is not used last 10 years since all mbox operations are now polled, and it was never used for cards produced in last 15 years. Newer cards can use DMA to upload firmware. MFC after: 2 weeks Notes: svn path=/head/; revision=315273
* Remove dangerous and questionable isp_mboxcmd_qnw() call.Alexander Motin2017-03-141-17/+4
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=315236
* Improvements around attach, reset and detach.Alexander Motin2017-03-148-391/+314
| | | | | | | | | | | | This change fixes DMA resource leak on driver unload. Also it removes DMA resources allocation for hardcoded number of requests before fetching the real number from firmware. Also it prepares ground for more flexible IRQs allocation according to firmware capabilities. MFC after: 2 weeks Notes: svn path=/head/; revision=315234
* Remove remnant of r315163.Alexander Motin2017-03-141-1/+0
| | | | | | | MFC after: 13 days Notes: svn path=/head/; revision=315229
* Remove strange config_intrhook_establish() magic.Alexander Motin2017-03-122-46/+0
| | | | | | | | | | Interrupts are enabled as part of chip reset just during driver attach. Later "enabling" of already enabled interrupts is useless. MFC after: 2 weeks Notes: svn path=/head/; revision=315163
* Try to slight untangle I/O and loop status handling.Alexander Motin2017-03-123-50/+14
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=315161
* Remove code for unsupported FreeBSD versions.Alexander Motin2017-03-124-52/+1
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=315160
* Send TERMINATE to firmware when aborting active ATIO.Alexander Motin2017-02-273-7/+24
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=314326
* Return better error code in case of too long CDB.Alexander Motin2017-02-262-4/+6
| | | | | | | | | | Its more important for SPI HBAs, as they don't support CDBs above 12 bytes. The new error code makes CAM to fall back to alternative commands. MFC after: 2 weeks Notes: svn path=/head/; revision=314302
* Fix residual length reporting in target mode.Alexander Motin2017-02-262-28/+28
| | | | | | | | | | | This allows to properly handle cases when target wants to receive or send more data then initiator wants to send or receive. Previously in such cases isp(4) returned CAM_DATA_RUN_ERR, while now it returns resid > 0. MFC after: 2 weeks Notes: svn path=/head/; revision=314299
* Respecting r314204 tighten ATIO cleanup requirements.Alexander Motin2017-02-241-2/+7
| | | | | | | | | Every ATIO must complete with either successfully sent status or XPT_ABORT. MFC after: 2 weeks Notes: svn path=/head/; revision=314208
* Fix missing xpt_done() for ATIO/INOT on missing LUN.Alexander Motin2017-02-241-1/+2
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=314203
* Slightly polish isp_dump_atpd().Alexander Motin2017-02-221-1/+3
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=314088
* Fix multiple problems around LUN disable under load.Alexander Motin2017-02-223-456/+307
| | | | | | | | | | | | | | | | | | | | - Move private data about ATIOs/INOTs from per-LUN to per-channel data. This allows active commands to continue operation after LUN destruction. This also simplifies lookup of the data by tag in some situations. - Unify three restart_queue processing implementations. - Complete all ATIOs from restart_queue on LUN disable. - Delete ATIO private data when command completed or aborted, not depending on the ATIO being requeued, that was ugly hack and could never happen. CAM should always call ether XPT_CONT_TARGET_IO with status or XPT_ABORT. - Implement XPT_ABORT for queued ATIOs/INOTs to allow CAM do graceful shutdown, not depending on LUN disable, as it is done in ahd(4)/targ(4). - Unify isp_endcmd() arguments to make it more usable in generic code. - Remove never really used LUN state reference counter. MFC after: 2 weeks Notes: svn path=/head/; revision=314086
* Remove duplicate INOT allocation.Alexander Motin2017-02-211-43/+19
| | | | | | | | | | | For some reason isp_handle_platform_notify_fc() allocated INOT just before calling isp_handle_platform_target_tmf(), which also allocates INOT. It seems to be a braino introduced in r196008. MFC after: 2 weeks Notes: svn path=/head/; revision=314045
* Remove ancient __FreeBSD_version checks.Alexander Motin2017-02-212-15/+2
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=314038
* sys/dev: Replace zero with NULL for pointers.Pedro F. Giffuni2017-02-201-8/+8
| | | | | | | | | | | Makes things easier to read, plus architectures may set NULL to something different than zero. Found with: devel/coccinelle MFC after: 3 weeks Notes: svn path=/head/; revision=313982
* Remove broken remnants of obsolete INOT API.Alexander Motin2017-02-191-10/+0
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=313945
* Missed addition to r313936.Alexander Motin2017-02-191-0/+4
| | | | | | | | | CTIO waitq present only in ISP_TARGET_MODE. MFC after: 2 weeks Notes: svn path=/head/; revision=313937
* Move CTIO waitq from per-LUN to per-channel.Alexander Motin2017-02-192-25/+31
| | | | | | | | | | | | | All resources lack of which may put CTIO into the queue are either per-channel or potentially per-queue, but none of them are per-LUN. This is a first step to fix live LUN disabling. Before this change any CTIOs held in a queue in time of disabling were just leaked. MFC after: 2 weeks Notes: svn path=/head/; revision=313936