| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
r330876:
Fix ISP_FC_LIP and ISP_RESCAN on big-endian 64-bit systems.
For _IO() ioctls, addr is a pointer to uap->data which is a caddr_t.
When the caddr_t stores an int, dereferencing addr as an (int *) results
in truncation on little-endian 64-bit systems and corruption (owing to
extracting top bits) on big-endian 64-bit systems. In practice the
value of chan was probably always zero on systems of the latter type as
all such FreeBSD platforms use a register-based calling convention.
Reviewed by: mav
Obtained from: CheriBSD
Sponsored by: DARPA, AFRL
Differential Revision: https://reviews.freebsd.org/D14673
r330945:
Add opt_compat.h to isp(4) as required by r330876.
Notes:
svn path=/stable/10/; revision=331635
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
------------------------------------------------------------------------
r321622 | ken | 2017-07-27 09:33:57 -0600 (Thu, 27 Jul 2017) | 44 lines
Fix probing FC targets with hard addressing turned on.
This largely reverts FreeBSD SVN change 289937 from October 25th, 2015.
The intent of that change was to keep loop IDs persistent across
chip reinits.
The problem is that the change turned on the PREVLOOP /
PREV_ADDRESS bit (bit 7 in Firmware Options 2), which tells the
Qlogic chip to not participate in the loop if it can't get the
requested loop address. It also turned off soft addressing on 2400
(4Gb) and newer controllers.
The isp(4) driver defaults to loop address 0, and the tape drives
I have tested default to loop address 0 if hard addressing is turned
on. So when hard loop addressing is turned on on the drive, the isp(4)
driver just refuses to participate in the loop.
The solution is to largely revert that change. I left some elements
in place that are related to virtual ports, since they were new.
This does work with IBM tape drives with hard and soft addressing
turned on. I have tested it with 4Gb, 8Gb, and 16Gb controllers.
sys/dev/isp.c:
Largely revert FreeBSD SVN change 289937. I left the
ispmbox.h changes in place.
Don't use the PREV_ADDRESS bit on initialization. It tells
the chip to not participate if it can't get the requested
loop ID.
Do use soft addressing on 2400 and newer chips.
Use hard addressing when the user has requested a specific
initiator ID. (hint.isp.X.iid=N in /boot/loader.conf)
Leave some of the virtual port options from that change in
place, but don't turn on the PREV_ADDRESS bit.
Reviewed by: mav
Sponsored by: Spectra Logic
------------------------------------------------------------------------
r321623 | ken | 2017-07-27 09:51:56 -0600 (Thu, 27 Jul 2017) | 6 lines
Remove duplicate assignments from r321622.
Submitted by: mav
Sponsored by: Spectra Logic
------------------------------------------------------------------------
Notes:
svn path=/stable/10/; revision=321945
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Correct loop mode CRN resets to adhere to FCP-4 section 4.10
Prior to this change, the CRN (Command Reference Number) is reset on any
firmware LIP, LOOP DOWN, or LOOP RESET event in violation of FCP-4 which
specifies that the CRN should only be reset in response to a LIP Reset
(LIPyx) primitive. FCP-4 also indicates PLOGI/LOGO and PRLI/PRLO ELS
actions as conditions for resetting the CRN for the associated initiator
port.
These violations manifest themselves when the HBA is removed from the
loop, or a target device is removed (especially during an outstanding
command) without power cycling. If the HBA and and the target device
determine upon re-establishing the loop that no PLOGI or PRLI is
required, and the target does not issue a LIPxy to the initiator, the
CRN for the target will have been improperly reset by the isp driver. As
a result, the target port will silently ignore all FCP commands issued
during the device probe (which will time out) preventing the device from
attaching.
This change corrects thie CRN reset behavior in response to loop state
changes, also introduces CRN resets for the above mentioned ELS actions
as encountered through async PDB change events.
This change also adds cleanup of outstanding commands in isp_loop_dead()
that was previously missing.
sys/dev/isp/isp.c
Add the last login state to debug output when syncing the pdb
sys/dev/isp/isp_freebsd.c
Replace binary statement setting aborted ccb status in
isp_watchdog() with the XS_SETERR macro used elsewhere
In isp_loop_dead(), abort or complete pending commands as done
in isp_watchdog()
In isp_async(), segregate the ISPASYNC_LOOP_RESET action from
ISPASYNC_LIP, ISPASYNC_LOOP_DOWN, and ISPASYNC_LOOP_UP
fallthroughs, and only reset the CRN in the RESET case. Also add
checks to handle false LOOP RESET actions that do not have a
proper associated LIP primitive, and log the primitive in the
debug messages
In isp_async(), remove the goto from ISP_ASYNC_DEV_STAYED, and
only reset the CRN in the DEV_CHANGED action
In isp_async(), when processing an ISPASYNC_CHANGE_PDB status,
reset CRN(s) for the associated nphdl (or all ports) if the
change reason is some form of ELS login/logout. Also remove
assignment to fc since it is not used in the scope
sys/dev/isp/ispmbox.h
Add macro definition for the global N-Port handle, and correct a
macro typo 'PDB24XX_AE_PRLI_DONJE'
sys/dev/isp/ispvar.h
Add macros FCP_AL_DA_ALL, FCP_AL_PA, and FCP_IS_DEST_ALPD for
more legible code when determining if an AL_PD port matches the
portid for a given struct fcparam* by value or by virtue of the
AL_PD port being 0xFF
Submitted by: Reid Linnemann
Sponsored by: Spectra Logic
Notes:
svn path=/stable/10/; revision=318149
|
| |
|
|
| |
Notes:
svn path=/stable/10/; revision=317636
|
| |
|
|
| |
Notes:
svn path=/stable/10/; revision=317367
|
| |
|
|
|
|
|
| |
The code is so alike that it is pointless to keep it separate.
Notes:
svn path=/stable/10/; revision=317366
|
| |
|
|
| |
Notes:
svn path=/stable/10/; revision=317365
|
| |
|
|
| |
Notes:
svn path=/stable/10/; revision=317364
|
| |
|
|
| |
Notes:
svn path=/stable/10/; revision=317363
|
| |
|
|
| |
Notes:
svn path=/stable/10/; revision=317322
|
| |
|
|
|
|
|
| |
periph_links field belongs to periph drivers and must not be used here.
Notes:
svn path=/stable/10/; revision=316410
|
| |
|
|
| |
Notes:
svn path=/stable/10/; revision=316409
|
| |
|
|
|
|
|
|
|
|
| |
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.
Notes:
svn path=/stable/10/; revision=316407
|
| |
|
|
| |
Notes:
svn path=/stable/10/; revision=316405
|
| |
|
|
| |
Notes:
svn path=/stable/10/; revision=316403
|
| |
|
|
| |
Notes:
svn path=/stable/10/; revision=316401
|
| |
|
|
|
|
|
|
|
|
| |
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.
Notes:
svn path=/stable/10/; revision=316399
|
| |
|
|
| |
Notes:
svn path=/stable/10/; revision=316173
|
| |
|
|
|
|
|
|
| |
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.
Notes:
svn path=/stable/10/; revision=316169
|
| |
|
|
|
|
|
| |
It is chip-specific and has nothing to do with platform.
Notes:
svn path=/stable/10/; revision=316167
|
| |
|
|
| |
Notes:
svn path=/stable/10/; revision=316165
|
| |
|
|
|
|
|
| |
This code has nothing to do with specific platform.
Notes:
svn path=/stable/10/; revision=316163
|
| |
|
|
|
|
|
|
|
| |
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.
Notes:
svn path=/stable/10/; revision=316160
|
| |
|
|
| |
Notes:
svn path=/stable/10/; revision=316159
|
| |
|
|
| |
Notes:
svn path=/stable/10/; revision=316157
|
| |
|
|
| |
Notes:
svn path=/stable/10/; revision=316155
|
| |
|
|
|
|
|
| |
This unifies the code and removes some duplication.
Notes:
svn path=/stable/10/; revision=316153
|
| |
|
|
|
|
|
| |
ISPASYNC_TARGET_NOTIFY_ACK makes no sense without argument.
Notes:
svn path=/stable/10/; revision=316151
|
| |
|
|
|
|
|
| |
While there polish respective debug logging.
Notes:
svn path=/stable/10/; revision=316148
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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.
Notes:
svn path=/stable/10/; revision=316146
|
| |
|
|
| |
Notes:
svn path=/stable/10/; revision=316144
|
| |
|
|
| |
Notes:
svn path=/stable/10/; revision=316142
|
| |
|
|
| |
Notes:
svn path=/stable/10/; revision=316093
|
| |
|
|
|
|
|
|
|
|
| |
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.
Notes:
svn path=/stable/10/; revision=316091
|
| |
|
|
| |
Notes:
svn path=/stable/10/; revision=316089
|
| |
|
|
|
|
|
|
|
|
| |
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.
Notes:
svn path=/stable/10/; revision=316087
|
| |
|
|
|
|
|
| |
Remove NULL checks after M_WAITOK allocations from isp(4).
Notes:
svn path=/stable/10/; revision=316085
|
| |
|
|
| |
Notes:
svn path=/stable/10/; revision=316016
|
| |
|
|
| |
Notes:
svn path=/stable/10/; revision=315980
|
| |
|
|
| |
Notes:
svn path=/stable/10/; revision=315978
|
| |
|
|
|
|
|
|
| |
Interrupts are enabled as part of chip reset just during driver attach.
Later "enabling" of already enabled interrupts is useless.
Notes:
svn path=/stable/10/; revision=315976
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Always null-terminate ccb_pathinq.(sim_vid|hba_vid|dev_name)
The sim_vid, hba_vid, and dev_name fields of struct ccb_pathinq are
fixed-length strings. AFAICT the only place they're read is in
sbin/camcontrol/camcontrol.c, which assumes they'll be null-terminated.
However, the kernel doesn't null-terminate them. A bunch of copy-pasted code
uses strncpy to write them, and doesn't guarantee null-termination. For at
least 4 drivers (mpr, mps, ciss, and hyperv), the hba_vid field actually
overflows. You can see the result by doing "camcontrol negotiate da0 -v".
This change null-terminates those fields everywhere they're set in the
kernel. It also shortens a few strings to ensure they'll fit within the
16-character field.
PR: 215474
Reported by: Coverity
CID: 1009997 1010000 1010001 1010002 1010003 1010004 1010005
CID: 1331519 1010006 1215097 1010007 1288967 1010008 1306000
CID: 1211924 1010009 1010010 1010011 1010012 1010013 1010014
CID: 1147190 1010017 1010016 1010018 1216435 1010020 1010021
CID: 1010022 1009666 1018185 1010023 1010025 1010026 1010027
CID: 1010028 1010029 1010030 1010031 1010033 1018186 1018187
CID: 1010035 1010036 1010042 1010041 1010040 1010039
Notes:
svn path=/stable/10/; revision=315813
|
| |
|
|
| |
Notes:
svn path=/stable/10/; revision=314765
|
| |
|
|
|
|
|
|
| |
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.
Notes:
svn path=/stable/10/; revision=314759
|
| |
|
|
|
|
|
|
|
| |
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.
Notes:
svn path=/stable/10/; revision=314757
|
| |
|
|
|
|
|
| |
Every ATIO must complete with either successfully sent status or XPT_ABORT.
Notes:
svn path=/stable/10/; revision=314747
|
| |
|
|
| |
Notes:
svn path=/stable/10/; revision=314743
|
| |
|
|
| |
Notes:
svn path=/stable/10/; revision=314735
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- 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.
Notes:
svn path=/stable/10/; revision=314733
|
| |
|
|
|
|
|
|
|
| |
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.
Notes:
svn path=/stable/10/; revision=314731
|