The length of Page 2 with Slider SFF is 0x2A4. Add reserved bits in
structure of Page 2.
Signed-off-by: Wen Xiong <wenxiong@linux.vnet.ibm.com>
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
This patch ensures that if __tool_init fails, we don't sleep and retry
if the tool is iprconfig. We only want to do this for the ipr daemons.
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
This patch filters out JBOD HDDs from showing up as devices for selection in
the device statistics menu. Without this patch, they are selectable, but return
without displaying any data.
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Allow VSET write cache to be enabled in bare metal mode.
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Reviewed-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
Fixes up iprconfig -c dump to show more details about the IOA. Also
fixes an issue where we could end up treating a RAID array as an
adapter resource which resulted in strange looking iprconfig menus
and possible iprinit failures.
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Older kernels on little endian systems had the device_id endian
swapped in sysfs. This has since been fixed up. This patch adds
support to iprinit to check for attributes saved using the old
endian swapped device id.
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
If a disk array has a saved queue depth, and the saved queue depth
is equal to the max supported queue depth for that disk array, init_vset_dev
will return early without changing the current queue depth and also
without even attempting to enable the VSET cache, if it is supported.
This was reported as an issue with the VSET cache not getting enabled
by iprinit at boot time. This fixes the early exit in this case to
make sure the queue depth gets set. It also moves the code in init_vset_dev
around to setup the VSET cache first. And thirdly, this also changes
ipr_set_ioa_attr to do the change cache parameters before setting the
other attributes to ensure it gets set properly.
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
If the iprinit daemon runs prior to the sg module being loaded,
it is not able to talk to the ipr adapters and do much of anything
that is useful. This was observed on a system where the adapter
write cache was not getting enabled at times during boot. This
modifies iprinit to check to see if the sg module is loaded
and also checks to see if its actually been bound to each
ipr adapter yet. If not, it makes iprinit wait for a bit
until this happens. Some distros load sg via a udev rule
which can happen in parallel to iprinit starting, so this
fixes this race. It also adds some informational logging
to make it easier to track when this indeed does occur in
case a system never loads the sg driver.
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Allow the option to disable verify on array rebuild, which greatly speeds up rebuild
time, to get enabled on single adapter configurations and enable this by default.
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Using the raid-create iprconfig command line option would sometimes
result in commands getting sent to the secondary adapter rather than
the primary adapter. This fixes that up.
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
ipr_device_lock(), ipr_device_unlock() and get_scsi_dev_data() all get
used outside of iprlib.c but they were missing a prototype in the
library header file. This patch adds it to silently the following
warnings:
../iprconfig.c: In function ‘wait_for_formatted_af_dasd’:
../iprconfig.c:240:14: warning: implicit declaration of function ‘get_scsi_dev_data’ [-Wimplicit-function-declaration]
num_devs = get_scsi_dev_data(&scsi_devs);
^~~~~~~~~~~~~~~~~
../iprconfig.c: In function ‘verify_device’:
../iprconfig.c:1711:6: warning: implicit declaration of function ‘ipr_device_lock’ [-Wimplicit-function-declaration]
if (ipr_device_lock(dev))
^~~~~~~~~~~~~~~
../iprconfig.c:1741:2: warning: implicit declaration of function ‘ipr_device_unlock’ [-Wimplicit-function-declaration]
ipr_device_unlock(dev);
^~~~~~~~~~~~~~~~~
Signed-off-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
If an IOA is missing its scsi_dev_data, we want to skip it and look for
other IOAs, instead of bailing out early.
This also fixes the compilation warning below:
../iprconfig.c: In function ‘update_all_ucodes’:
../iprconfig.c:15735:4: warning: ‘return’ with no value, in function returning non-void
return;
^~~~~~
../iprconfig.c:15725:12: note: declared here
static int update_all_ucodes(char **args, int num_args)
^~~~~~~~~~~~~~~~~
Signed-off-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Move the ses_*_time functions to the beginning of the iprlib.c file to
prevent warnings of implicit declaration.
../iprlib.c: In function ‘init_ses_dev’:
../iprlib.c:9777:3: warning: implicit declaration of function ‘ipr_ses_set_time’ [-Wimplicit-function-declaration]
ipr_ses_set_time(dev, t);
^~~~~~~~~~~~~~~~
Signed-off-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
In my system, Fedora 24, the library function basename() requires the
explicitly inclusion of libgen.h header file. Add it to avoid
the compilation warning below:
../iprconfig.c: In function ‘download_all_ucode’:
../iprconfig.c:11847:5: warning: implicit declaration of function ‘basename’ [-Wimplicit-function-declaration]
basename(dev->gen_name), lfw->version,
^~~~~~~~
Signed-off-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Commit da3fe0fc80 ("iprutils: Don't show RAID migration level for
secondary devices.") added an error message to
query_raid_levels_raid_migrate but didn't pass the disk name as a
parameter. This error triggers a warning and eventually segfaults
iprconfig.
This commit adds the missing parameter.
Signed-off-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
To show all slots of a drawer for concurrent maintenance, we need to get
the "dev" based on each slot id of the drawer. Skip the dev if dev is an
array or volume set when iterating the devs.
Signed-off-by: Wen Xiong <wenxiong@linux.vnet.ibm.com>
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
This patch fixes two issues. It changes how the known zeroed
state is tracked so that it works reliably on SIS64 adapters.
We previously had been relying on the bus/target/lun value
to be consistent when a JBOD disk was reformatted to a RAID
capable disk. This is true for SIS32 adapters, since this
tuple is tied to a physical location. For SIS64, however,
this tuple is generated by the ipr driver, so is often
not the same value when a JBOD is converted to RAID. Instead,
we change to always use the device_id attribute, which is
generated by the adapter based on the LUN WWN of the disk.
This patch also eliminates a hang that can occur when formatting
disks if a second iprconfig instance is started concurently.
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
The patch fixed the issue with Slider's hotplug disk.
Signed-off-by: Wen Xiong <wenxiong@linux.vnet.ibm.com>
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
This patch fixes a problem when formatting multiple disks, where either
another instance of iprconfig or iprinit or some similar tool ends up
calling evaluate_device before the issuing iprconfig does, resulting in
formatted devices that are not flagged as known zeroed. This adds some
locking around this function to ensure that does not happen.
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
The find_multipath_jbod is intended to return the alternate path
for the same device in a multipath configuration. However, it was
simply returning the first device that matched the device_id which
may have been the same device as the function parameter. This fixes
some issues and errors that can be seen when formatting JBOD disks.
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Ensure the known zeroed state gets saved in the adapter following
a format unit command from the command line.
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Since newer firmware versions now support tracking of the known zeroed state
for AF DASD disks, we don't need to warn the user about exiting iprconfig
when there are known zeroed disks if the adapter has this support.
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
This patch fixes some issues related to disk formatting. First,
it queries the disk to determine the optimal timeout to use for
a format command. This fixes format timeout issues on very large
capacity disks. Second, this also fixes up the 5xx/4k sector
size handling to ensure we don't end up mistakenly reformatting
drives to the wrong block size. This was primarily an issue
for drives that ended up in medium format corrupt and the subsequent
format then did the wrong thing.
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Fix a possible format timeout issue for large disks on little endian systems.
We need to byte swap the 2 byte timeout field.
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Display the /dev/sr device name for optical devices.
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Reviewed-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
Enhance iprsos to collect some missing log files.
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Reviewed-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
When formatting a JBOD disk to AF, we unbind the /dev/sd
device nodes prior to starting the format in order to
avoid strange errors from cropping up. Additionally, we
also flush the unused multipath device maps for the same
reason. When we delete a RAID array, although delete the
/dev/sd device nodes prior to deleting the RAID array,
we weren't flushing the unused multipaths, so let's do that.
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Reviewed-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
SPL-4 defines a couple of higher values for the negotiated link rates
that were not defined in iprutils, causing us to display the default
value "Enabled" for link rates higher than 6.0Gbps in
query-path-details. This was found when working with the drawer ESLS.
Signed-off-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
The iprutils init.d scripts require the redhat-lsb on RHEL 6 in order
to function. Add this as a dependency.
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Some new external drawers like ESLS have an internal clock, used by the
internal microcode. This patch enables iprinit to configure the clock
at boot time.
Signed-off-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
This patch added maximum queue depth in GUI when creating an array. Also
fixed some issues in query-qdepth and set-qdepth.
Signed-off-by: Wen Xiong <wenxiong@linux.vnet.ibm.com>
Signed-off-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
When user passed 0x0 to old firmwares, rebuild rate would be set to the
implementation default value, defined by SIS, and any further read to
Mode Page 0x24 would display 0x0 in the Rebuild Rate field. Newer
firmwares, on the other hand, will correctly set the rebuild rate to the
implementation defined value, but the Mode Page field will display the
configured value, instead of 0x0. This causes iprutils to believe the
new configuration has failed, and error out.
The Implementation defined value used by every IPR adapter out there is
the minimum rebuild rate possible, 2/16, which translates to 0x2 in the
Mode page field. This patch gives iprutils the notion of the minimum
rebuild rate, and supports this scenario, so we don't fail when the user
requests a rebuild rate of 0.
To avoid confusing the user, we also make the values go from 10 to 100
instead of 0-100. If the user wants to enable the default setting,
instead of typing 0, he needs to use 'default'.
Signed-off-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Some new enclosures, like ESLS only supports a limited buffer of 4k
bytes during SCSI Write Buffer calls. This means that doing a single
Write Buffer with mode 0Eh to download a large microcode will fail with
an Illegal Request. This patch adds a fallback mode to the Write Buffer
command in iprlib, allowing it to limit the buffer block size to 4K, in
case the single full write fails. If the device supports large buffers,
behavior remains unchanged, and iprlib can only issue a single write.
Signed-off-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
The use of gzclose_r() may break some builds depending on the version of zlib
that is being used. Since that function is identical to gzclose() apart from
some differences in static code linkage, we can swap them without any changes to
program behaviour.
Signed-off-by: Heitor Ricardo Alves de Siqueira <halves@linux.vnet.ibm.com>
Reviewed-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
When I pushed commit 855e7fd ("iprutils: Enable editor choice for new log system")
I had to manually merge them and ended up missing a couple of files which didn't get
pushed. This fixes that up.
Reported-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Although not usual, systemd binaries could be somewhere else other than
/usr/bin. This patch just remove this hard coded dependency.
This patch come from the Debian maintainer Colin Watson
<cjwatson@debian.org>
Signed-off-by: Breno Leitao <brenohl@br.ibm.com>
scsi_dev_data->device_id is a u64, so should be scanned with %llX rather
than %lX. On 32-bit big-endian systems I believe this will scan the
device_id into the wrong half of the 64-bit value.
This patch come from the Debian maintainer Colin Watson
<cjwatson@debian.org>
Signed-off-by: Breno Leitao <brenohl@br.ibm.com>
Support force-reload options, which is useful and it is required be by
Debian policy.
This patch come from the Debian maintainer Colin Watson
<cjwatson@debian.org>
Signed-off-by: Breno Leitao <brenohl@br.ibm.com>