Age | Commit message (Collapse) | Author | Files | Lines |
|
simplify checking for logical/physical devices
Reviewed-by: Scott Teel <[email protected]>
Reviewed-by: Justin Lindley <[email protected]>
Reviewed-by: Kevin Barnett <[email protected]>
Reviewed-by: Tomas Henzl <[email protected]>
Reviewed-by: Matthew R. Ochs <[email protected]>
Reviewed-by: Hannes Reinecke <[email protected]>
Signed-off-by: Don Brace <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
|
|
remove repeated calculation that checks for physical
or logical devices.
Reviewed-by: Scott Teel <[email protected]>
Reviewed-by: Justin Lindley <[email protected]>
Reviewed-by: Kevin Barnett <[email protected]>
Reviewed-by: Tomas Henzl <[email protected]>
Reviewed-by: Matthew R. Ochs <[email protected]>
Reviewed-by: Hannes Reinecke <[email protected]>
Signed-off-by: Don Brace <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
|
|
remove macros and cleanup device exposure checking
Reviewed-by: Scott Teel <[email protected]>
Reviewed-by: Justin Lindley <[email protected]>
Reviewed-by: Kevin Barnett <[email protected]>
Reviewed-by: Tomas Henzl <[email protected]>
Reviewed-by: Hannes Reinecke <[email protected]>
Signed-off-by: Don Brace <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
|
|
Reviewed-by: Scott Teel <[email protected]>
Reviewed-by: Justin Lindley <[email protected]>
Reviewed-by: Kevin Barnett <[email protected]>
Reviewed-by: Tomas Henzl <[email protected]>
Reviewed-by: Hannes Reinecke <[email protected]>
Signed-off-by: Don Brace <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
|
|
The driver is using two MACROs which seemingly are looking in
the wrong location for the device_flags returned from
CISS_REPORT_PHYS. Both MACROs, NON_DISK_PHYS_DEV and
PHYS_IOACCEL, are using the pointer returned from figure_lunaddrbytes
which is the address of the LUN.lunid element in
the extended CISS_REPORT_PHYS. But the MACROS are using offsets
beyond the range of the element (offset 17 of an 8 byte element).
These MACROs actually are looking at the correct location but
they fail static checker analysis. It also will not work
if any new elements are added to the extended LUN structure.
Change the code to use the structure elements directly
since this MACRO is only used in one location.
Reported-by: Dan Carpenter <[email protected]>
Reviewed-by: Scott Teel <[email protected]>
Reviewed-by: Justin Lindley <[email protected]>
Reviewed-by: Kevin Barnett <[email protected]>
Reviewed-by: Tomas Henzl <[email protected]>
Reviewed-by: Hannes Reinecke <[email protected]>
Signed-off-by: Don Brace <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
|
|
Set reset type in device_reset_handler to do either
logical unit reset for logical devices, or physical
target reset, for physical devices.
Reviewed-by: Scott Teel <[email protected]>
Reviewed-by: Justin Lindley <[email protected]>
Reviewed-by: Kevin Barnett <[email protected]>
Reviewed-by: Tomas Henzl <[email protected]>
Reviewed-by: Hannes Reinecke <[email protected]>
Signed-off-by: Don Brace <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
|
|
Fix a NULL pointer issue in the driver when devices are removed
during a reset.
Signed-off-by: Don Brace <[email protected]>
Reviewed-by: Hannes Reinecke <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
|
|
handle block counts of 0. Cleanup block and block count calculations.
Reviewed-by: Scott Teel <[email protected]>
Reviewed-by: Justin Lindley <[email protected]>
Reviewed-by: Kevin Barnett <[email protected]>
Reviewed-by: Tomas Henzl <[email protected]>
Reviewed-by: Hannes Reinecke <[email protected]>
Signed-off-by: Don Brace <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
|
|
Abandon and reschedule rescan process only if device inquiries
fail due to mem alloc failures, which are likely to occur for
all devices.
Otherwise, skip device if inquiry fails for other reasons,
and continue rescanning process for other devices.
Reviewed-by: Scott Teel <[email protected]>
Reviewed-by: Justin Lindley <[email protected]>
Reviewed-by: Kevin Barnett <[email protected]>
Reviewed-by: Tomas Henzl <[email protected]>
Signed-off-by: Don Brace <[email protected]>
Reviewed-by: Hannes Reinecke <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
|
|
Reviewed-by: Scott Teel <[email protected]>
Reviewed-by: Justin Lindley <[email protected]>
Reviewed-by: Kevin Barnett <[email protected]>
Reviewed-by: Tomas Henzl <[email protected]>
Reviewed-by; Hannes Reinecke <[email protected]>
Signed-off-by: Don Brace <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
|
|
Reviewed-by: Tomas Henzl <[email protected]>
Reviewed-by: Manoj Kumar <[email protected]>
Signed-off-by: Don Brace <[email protected]>
Reviewed-by: Hannes Reinecke <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
|
|
Check for NULLs.
Reviewed-by: Tomas Henzl <[email protected]>
Reviewed-by: Manoj Kumar <[email protected]>
Signed-off-by: Don Brace <[email protected]>
Reviewed-by: Hannes Reinecke <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
|
|
This member is used in calls to scsi_device_type.
It should be unsigned since the kernel checks for upper bounds
and it should never be negative.
Suggested-by: Tomas Henzl <[email protected]>
Suggested-by: Hannes Reinecke <[email protected]>
Suggested-by: Matthew R. Ochs <[email protected]>
Signed-off-by: Don Brace <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
|
|
This function is no longer used.
Reviewed-by: Tomas Henzl <[email protected]>
Reviewed-by: Hannes Reinecke <[email protected]>
Signed-off-by: Don Brace <[email protected]>
Reviewed-by: Manoj Kumar <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
|
|
pulling the rug out from under the reset handler
likewise for ioaccel_cmds_out
Reviewed-by: Hannes Reinecke <[email protected]>
Reviewed-by: Tomas Henzl <[email protected]>
Signed-off-by: Don Brace <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
|
|
This parameter was once used before scan_start was defined
but now it is no longer used.
Signed-off-by: Don Brace <[email protected]>
Reviewed-by: Tomas Henzl <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
|
|
Writing a number to /sys/bus/scsi/devices/<sdev>/queue_ramp_up_period
returns the value of that number instead of the number of bytes written.
This behavior can confuse programs expecting POSIX write() semantics.
Fix this by returning the number of bytes written instead.
Signed-off-by: Peter Oberparleiter <[email protected]>
Reviewed-by: Hannes Reinecke <[email protected]>
Cc: [email protected]
Reviewed-by: Matthew R. Ochs <[email protected]>
Reviewed-by: Ewan D. Milne <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
|
|
Export the RAW SCSI Inquiry to sysfs as binfile. This way the data can be used
by userland without the need to have and ioctl or use the sg_inq tool.
Here is an example of the provided data
linux:~ # hexdump /sys/class/scsi_device/1\:0\:0\:0/device/inquiry
0000000 8005 3205 001f 0000 4551 554d 2020 2020
0000010 4551 554d 4420 4456 522d 4d4f 2020 2020
0000020 2e32 2e33
0000024
Signed-off-by: Johannes Thumshirn <[email protected]>
Reviewed-by: Hannes Reinecke <[email protected]>
Reviewed-by: Christoph Hellwig <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
|
|
Signed-off-by: Sumit Saxena <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
|
|
The DELL PERC5 controller firmware does not list tape drives in response
to MR_DCMD_PD_LIST_QUERY. This causes tape drives not be exposed to the
OS when connected to a PERC5 controller.
This patch permits detection of tape drives connected to a PERC5
controller by exposing non-TYPE_DISK devices unconditionally.
Signed-off-by: Kashyap Desai <[email protected]>
Signed-off-by: Sumit Saxena <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
|
|
In sg_common_write(), we free the block request and return -ENODEV if
the device is detached in the middle of the SG_IO ioctl().
Unfortunately, sg_finish_rem_req() also tries to free srp->rq, so we
end up freeing rq->cmd in the already free rq object, and then free
the object itself out from under the current user.
This ends up corrupting random memory via the list_head on the rq
object. The most common crash trace I saw is this:
------------[ cut here ]------------
kernel BUG at block/blk-core.c:1420!
Call Trace:
[<ffffffff81281eab>] blk_put_request+0x5b/0x80
[<ffffffffa0069e5b>] sg_finish_rem_req+0x6b/0x120 [sg]
[<ffffffffa006bcb9>] sg_common_write.isra.14+0x459/0x5a0 [sg]
[<ffffffff8125b328>] ? selinux_file_alloc_security+0x48/0x70
[<ffffffffa006bf95>] sg_new_write.isra.17+0x195/0x2d0 [sg]
[<ffffffffa006cef4>] sg_ioctl+0x644/0xdb0 [sg]
[<ffffffff81170f80>] do_vfs_ioctl+0x90/0x520
[<ffffffff81258967>] ? file_has_perm+0x97/0xb0
[<ffffffff811714a1>] SyS_ioctl+0x91/0xb0
[<ffffffff81602afb>] tracesys+0xdd/0xe2
RIP [<ffffffff81281e04>] __blk_put_request+0x154/0x1a0
The solution is straightforward: just set srp->rq to NULL in the
failure branch so that sg_finish_rem_req() doesn't attempt to re-free
it.
Additionally, since sg_rq_end_io() will never be called on the object
when this happens, we need to free memory backing ->cmd if it isn't
embedded in the object itself.
KASAN was extremely helpful in finding the root cause of this bug.
Signed-off-by: Calvin Owens <[email protected]>
Acked-by: Douglas Gilbert <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
|
|
If MSI(X) interrupts are disabled via the kernel command line
(pci=nomsi), the pm8001 driver will kernel panic because it does not
detect that MSI interrupts are disabled and will soldier on and attempt to
configure MSI interrupts anyways. This leads to a kernel panic, most
likely because a required data structure is not available down the
line. Using the pci_msi_enabled() function in order to detect if MSI
interrupts are enabled before configuring them resolves this issue and
avoids a kernel panic when the module is loaded. Additionally, the
irq_vector structure must be initialized when legacy interrupts are
being used otherwise legacy interrupts will simply not function and
result in another panic.
Signed-off-by: Benjamin Rood <[email protected]>
Reviewed-by: Jack Wang <[email protected]>
Reviewed-by: Hannes Reinecke <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
|
|
The documentation for the 8070 and 8072 SPCv chip explicitly states that
a minimum of 500ms must elapse before issuing commands, otherwise the
SPCv may not process them and the firmware may get into an unrecoverable
state requiring a reboot. While the Linux guys will probably think this
is 'racy', it is called out in the chip documentation and inserting this
delay makes power management function properly.
Signed-off-by: Benjamin Rood <[email protected]>
Reviewed-by: Jack Wang <[email protected]>
Reviewed-by: Hannes Reinecke <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
|
|
ATTO adapters do not support this feature. If the firmware fails to be
ready, it should not check the examined registers in order to examine
the state of the feature in order to prevent undefined behavior.
Signed-off-by: Benjamin Rood <[email protected]>
Reviewed-by: Jack Wang <[email protected]>
Reviewed-by: Hannes Reinecke <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
|
|
PHY profiles are not saved in NVRAM on ATTO 12Gb SAS controllers.
Therefore, in order for the controller to function in a wide range of
configurations, the PHY profiles must be statically set. This patch
provides the necessary functionality to do so.
Signed-off-by: Benjamin Rood <[email protected]>
Reviewed-by: Jack Wang <[email protected]>
Reviewed-by: Hannes Reinecke <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
|
|
ATTO SAS controllers retrieve the SAS address from the NVRAM in a location
different from non-ATTO PMC Sierra SAS controllers. This patch makes the
necessary adjustments in order to retrieve the SAS address on these types
of adapters.
Signed-off-by: Benjamin Rood <[email protected]>
Reviewed-by: Jack Wang <[email protected]>
Reviewed-by: Hannes Reinecke <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
|
|
These PCI IDs allow the pm8001 driver to load against ATTO 12Gb SAS
controllers that use PMC Sierra 8070 and PMC Sierra 8072 SAS chips.
Signed-off-by: Benjamin Rood <[email protected]>
Reviewed-by: Jack Wang <[email protected]>
Reviewed-by: Hannes Reinecke <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
|
|
These SAS controllers support speeds up to 12Gb.
Signed-off-by: Benjamin Rood <[email protected]>
Reviewed-by: Jack Wang <[email protected]>
Reviewed-by: Hannes Reinecke <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
|
|
Previuosly, all PMC Sierra 80xx controllers are assumed to be a
motherboard controller, except if the subsystem vendor ID was equal to
PCI_VENDOR_ID_ADAPTEC. The driver then attempts to load PHY settings
from NVRAM. While this may be correct behavior for most controllers, it
does not work with Adaptec and ATTO controllers since they do not store
PHY settings in NVRAM and choose to use either custom PHY settings or
chip defaults. Loading random values from NVRAM may cause the
controllers to malfunction in this edge case.
Signed-off-by: Benjamin Rood <[email protected]>
Reviewed-by: Jack Wang <[email protected]>
Reviewed-by: Hannes Reinecke <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
|
|
This patch fixes an issue seen with an IBM 2145 (SVC) where, following an error
injection test which results in paths going offline, when they came
back online, the path would timeout the REPORT_LUNS issued during the
scan. This timeout situation continued until retries were expired, resulting in
falling back to a sequential LUN scan. Then, since the target responds
with PQ=1, PDT=0 for all possible LUNs, due to the way the sequential
LUN scan code works, we end up adding 512 LUNs for each target, when there
is really only a small handful of LUNs that are actually present.
This patch increases the timeout used on the REPORT_LUNS to 30 seconds.
This patch solves the issue of 512 non existent LUNs showing up after
this event.
Signed-off-by: Brian King <[email protected]>
Reviewed-by: Hannes Reinecke <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
|
|
Signed-off-by: Sumit Saxena <[email protected]>
Reviewed-by: Tomas Henzl <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
|
|
Signed-off-by: Sumit Saxena <[email protected]>
Reviewed-by: Tomas Henzl <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
|
|
This is an issue on SMAP enabled CPUs and 32 bit apps running on 64 bit
OS. Do not access user memory from kernel code. The SMAP bit restricts
accessing user memory from kernel code.
Cc: <[email protected]>
Signed-off-by: Sumit Saxena <[email protected]>
Signed-off-by: Kashyap Desai <[email protected]>
Reviewed-by: Tomas Henzl <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
|
|
Signed-off-by: Sumit Saxena <[email protected]>
Signed-off-by: Kashyap Desai <[email protected]>
Reviewed-by: Tomas Henzl <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
|
|
It may happen (kdump), that an interrupt is invoked just after the
setup_irqs function was called but before the tasklet was initialised.
At this phase the hw ints should have been disabled, but for unknown
reason this mechanism seems to not work properly.
From: Tomas Henzl <[email protected]>
Signed-off-by: Tomas Henzl <[email protected]>
Signed-off-by: Sumit Saxena <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
|
|
Signed-off-by: Sumit Saxena <[email protected]>
Signed-off-by: Kashyap Desai <[email protected]>
Reviewed-by: Tomas Henzl <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
|
|
Signed-off-by: Sumit Saxena <[email protected]>
Signed-off-by: Kashyap Desai <[email protected]>
Reviewed-by: Tomas Henzl <[email protected]>
Reviewed-by: Martin K. Petersen <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
|
|
Do not use PAGE_SIZE marco to calculate max_sectors per I/O
request. Driver code assumes PAGE_SIZE will be always 4096 which can
lead to wrongly calculated value if PAGE_SIZE is not 4096. This issue
was reported in Ubuntu Bugzilla Bug #1475166.
Cc: <[email protected]>
Signed-off-by: Sumit Saxena <[email protected]>
Signed-off-by: Kashyap Desai <[email protected]>
Reviewed-by: Tomas Henzl <[email protected]>
Reviewed-by: Martin K. Petersen <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
|
|
Signed-off-by: Sumit Saxena <[email protected]>
Signed-off-by: Kashyap Desai <[email protected]>
Reviewed-by: Tomas Henzl <[email protected]>
Reviewed-by: Martin K. Petersen <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
|
|
Signed-off-by: Sumit Saxena <[email protected]>
Signed-off-by: Kashyap Desai <[email protected]>
Reviewed-by: Tomas Henzl <[email protected]>
Reviewed-by: Martin K. Petersen <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
|
|
Remove PCI id based checks and use instance->ctrl_context to decide
whether controller is MFI-based or a Fusion adapter. Additionally,
Fusion adapters are divided into two categories: Thunderbolt and
Invader.
Signed-off-by: Sumit Saxena <[email protected]>
Signed-off-by: Kashyap Desai <[email protected]>
Reviewed-by: Tomas Henzl <[email protected]>
Reviewed-by: Martin K. Petersen <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
|
|
Expose non-disk (TAPE drive, CD-ROM) unconditionally.
Cc: <[email protected]>
Signed-off-by: Sumit Saxena <[email protected]>
Signed-off-by: Kashyap Desai <[email protected]>
Reviewed-by: Tomas Henzl <[email protected]>
Reviewed-by: Martin K. Petersen <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
|
|
Signed-off-by: Sumit Saxena <[email protected]>
Signed-off-by: Kashyap Desai <[email protected]>
Reviewed-by: Martin K. Petersen <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
|
|
Some of these code changes were proposed by David Binderman.
Removed redudant check of requestorId. Redundant condition:
instance.requestorId. Check for plasma firmware 1.11 are now
restructured to support only specific device id.
Signed-off-by: Sumit Saxena <[email protected]>
Signed-off-by: Kashyap Desai <[email protected]>
Reviewed-by: Martin K. Petersen <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
|
|
Syncro firmware supports round robin I/O switching on dual path. Driver
uses validHandles to check for dual path. However, it is supposed to
check for values > 1 (not > 2).
Signed-off-by: Sumit Saxena <[email protected]>
Signed-off-by: Kashyap Desai <[email protected]>
Reviewed-by: Martin K. Petersen <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
|
|
Print firmware events in human-readable form. This will help users track
any critical firmware events without special application support.
Sample syslogd output:
megaraid_sas 0000:02:00.0: 8619 (491648347s/0x0020/WARN) - Controller temperature threshold exceeded. This may indicate inadequate system cooling. Switching to low performance mode.
The format of logged events is:
"<pci_dev_id>: <sequence_number> (<timestamp>/<locale>/<class>) - <description>"
Signed-off-by: Sumit Saxena <[email protected]>
Signed-off-by: Kashyap Desai <[email protected]>
Reviewed-by: Martin K. Petersen <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
|
|
Fix the issue reported at:
http://marc.info/?l=linux-scsi&m=143694494104544&w=2
Try to do chip reset at driver load time. If firmware fails to reach
ready state, try chip reset using adp_reset() callback. For Fusion
adapters the call back was previously void. Provide a suitable reset
function.
Signed-off-by: Sumit Saxena <[email protected]>
Signed-off-by: Kashyap Desai <[email protected]>
Reviewed-by: Martin K. Petersen <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
|
|
Driver will expose max sge = 256 (earlier it was 64) if firmware
supports extended IO size (1M).
Signed-off-by: Sumit Saxena <[email protected]>
Signed-off-by: Kashyap Desai <[email protected]>
Reviewed-by: Martin Petersen <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
|
|
megasas_ioc_init_fusion
Signed-off-by: Sumit Saxena <[email protected]>
Signed-off-by: Kashyap Desai <[email protected]>
Reviewed-by: Martin Petersen <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
|
|
Implemented JBOD map which will provide quick access for JBOD path and
also provide sequence number. This will help hardware to fail command
to the FW in case of any sequence mismatch.
Fast Path I/O for JBOD will refer JBOD map (which has sequence number
per JBOD device) instead of RAID map. Previously, the driver used RAID
map to get device handle for fast path I/O and this not have sequence
number information. Now, driver will use JBOD map instead. As part of
error handling, if JBOD map is failed/not supported by firmware, driver
will continue using legacy behavior.
Now there will be three IO paths for JBOD (syspd):
- JBOD map with sequence number (Fast Path)
- RAID map without sequence number (Fast Path)
- FW path via h/w exception queue deliberately setup devhandle
0xFFFF (FW path).
Relevant data structures:
- Driver send new DCMD MR_DCMD_SYSTEM_PD_MAP_GET_INFO for this purpose.
- struct MR_PD_CFG_SEQ- This structure represent map of single physical
device.
- struct MR_PD_CFG_SEQ_NUM_SYNC- This structure represent whole JBOD
map in general(size, count of sysPDs configured, struct MR_PD_CFG_SEQ
of syspD with 0 index).
- JBOD sequence map size is: sizeof(struct MR_PD_CFG_SEQ_NUM_SYNC)
+ (sizeof(struct MR_PD_CFG_SEQ) * (MAX_PHYSICAL_DEVICES - 1)) which
is allocated while setting up JBOD map at driver load time.
Signed-off-by: Sumit Saxena <[email protected]>
Signed-off-by: Kashyap Desai <[email protected]>
Reviewed-by: Martin Petersen <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
|