Age | Commit message (Collapse) | Author | Files | Lines |
|
The phy code was using implicit sequencing between the PHY driver
and the UFS driver to implement certain hardware requirements.
Specifically, the PHY reset register in the UFS controller needs
to be deasserted before serdes start occurs in the PHY.
Before this change, the code was doing this by utilizing the two
phy callbacks, phy_init() and phy_poweron(), as "init step 1" and
"init step 2", where the UFS driver would deassert reset between
these two steps.
This makes it challenging to power off the regulators in suspend,
as regulators are initialized in init, not in poweron(), but only
poweroff() is called during suspend, not exit().
For UFS, move the actual firing up of the PHY to phy_poweron() and
phy_poweroff() callbacks, rather than init()/exit(). UFS calls
phy_poweroff() during suspend, so now all clocks and regulators for
the phy can be powered down during suspend.
QMP is a little tricky because the PHY is also shared with PCIe and
USB3, which have their own definitions for init() and poweron(). Rename
the meaty functions to _enable() and _disable() to disentangle from the
PHY core names, and then create two different ops structures: one for
UFS and one for the other PHY types.
In phy-qcom-ufs, remove the 'is_powered_on' and 'is_started' guards,
as the generic PHY code does the reference counting. The
14/20nm-specific init functions get collapsed into the generic power_on()
function, with the addition of a calibrate() callback specific to 14/20nm.
Signed-off-by: Evan Green <[email protected]>
Reviewed-by: Stephen Boyd <[email protected]>
Signed-off-by: Kishon Vijay Abraham I <[email protected]>
|
|
Move the PHY reset from ufs-qcom into the respective PHYs. This will
allow us to merge the two phases of UFS PHY initialization.
Signed-off-by: Evan Green <[email protected]>
Reviewed-by: Stephen Boyd <[email protected]>
Signed-off-by: Kishon Vijay Abraham I <[email protected]>
|
|
Expose a reset controller that the phy will later use to control its
own PHY reset in the UFS controller. This will enable the combining
of PHY init functionality into a single function.
Signed-off-by: Evan Green <[email protected]>
Reviewed-by: Stephen Boyd <[email protected]>
Signed-off-by: Kishon Vijay Abraham I <[email protected]>
|
|
When SCSI blk-mq is enabled, there is a bug in handling errors in
scsi_queue_rq. Specifically, the bug is not setting result field of
scsi_request correctly when the dispatch of the command has been
failed. Since the upper layer code including the sg_io ioctl expects to
receive any error status from result field of scsi_request, the error is
silently ignored and this could cause data corruptions for some
applications.
Fixes: d285203cf647 ("scsi: add support for a blk-mq based I/O path.")
Cc: <[email protected]>
Signed-off-by: Jaesoo Lee <[email protected]>
Reviewed-by: Hannes Reinecke <[email protected]>
Reviewed-by: Bart Van Assche <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
|
|
commit 84961f28e9d1 ("[SCSI] Don't add scsi_device for devices that return
PQ=1, PDT=0x1f") returns SCSI_SCAN_TARGET_PRESENT if inquiry returns PQ=1,
and PDT = 0x1f. However, from the scsi spec, it seemed setting PQ=1, and
PDT to the type it is capable to support, can also mean the device is not
connected. E.g. we see an IBM/2145 returns PQ=1 and PDT=0 for a non-mapped
lun (details attached at the end).
This patch changes the check condition a bit, so the check don't require
PTD to be 0x1f when PQ=1.
$ echo 0 0 1 > /sys/class/scsi_host/host1/scan
[ 2483.722186] scsi 1:0:0:1: scsi scan: INQUIRY pass 1 length 36
[ 2483.725687] scsi 1:0:0:1: scsi scan: INQUIRY successful with code 0x0
[ 2483.729171] scsi 1:0:0:1: scsi scan: INQUIRY pass 2 length 109
[ 2483.732481] scsi 1:0:0:1: scsi scan: INQUIRY successful with code 0x0
[ 2483.735911] scsi 1:0:0:1: Direct-Access IBM 2145 0000 PQ: 1 ANSI: 6
[ 2483.741282] scsi 1:0:0:1: Attached scsi generic sg2 type 0
$ tail /proc/scsi/scsi
Attached devices:
Host: scsi1 Channel: 00 Id: 00 Lun: 00
Vendor: IBM Model: 2145 Rev: 0000
Type: Direct-Access ANSI SCSI revision: 06
Host: scsi0 Channel: 00 Id: 00 Lun: 00
Vendor: IBM Model: 2145 Rev: 0000
Type: Direct-Access ANSI SCSI revision: 06
Host: scsi1 Channel: 00 Id: 00 Lun: 01
Vendor: IBM Model: 2145 Rev: 0000
Type: Direct-Access ANSI SCSI revision: 06
$ lsscsi
[0:0:0:0] disk IBM 2145 0000 /dev/sdb
[1:0:0:0] disk IBM 2145 0000 /dev/sda
[1:0:0:1] disk IBM 2145 0000 -
Signed-off-by: Li Zhong <[email protected]>
Reviewed-by: Bart Van Assche <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
|
|
Fix sparse warning:
drivers/scsi/megaraid/megaraid_sas_base.c:4652:1: warning:
symbol 'megasas_host_device_list_query' was not declared. Should it be static?
Signed-off-by: YueHaibing <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
|
|
If UFS device responds an unknown request response code, we can not know
what it was via logs because the code is replaced by "DID_ERROR << 16"
before log printing.
Fix this to provide precise request response code information for easier
issue breakdown.
Signed-off-by: Stanley Chu <[email protected]>
Reviewed-by: Tomas Winkler <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
|
|
Signed-off-by: Varun Prakash <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
|
|
To support vlan and bridge devices first find route using ifindex 0, if
route is not found through net device associated with input scsi host then
find route using ifindex of net device.
Signed-off-by: Varun Prakash <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
|
|
If cxgbi_device_find_by_netdev() returns NULL then find cxgbi device by MAC
address.
Signed-off-by: Varun Prakash <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
|
|
scsi_device's refcount is always grabbed in IO path.
Turns out it isn't necessary, because blk_queue_cleanup() will drain any
in-flight IOs, then cancel timeout/requeue work, and SCSI's requeue_work is
canceled too in __scsi_remove_device().
Also scsi_device won't go away until blk_cleanup_queue() is done.
So don't hold the refcount in IO path, especially the refcount isn't
required in IO path since blk_queue_enter() / blk_queue_exit() is
introduced in the legacy block layer.
Cc: Dongli Zhang <[email protected]>
Cc: James Smart <[email protected]>
Cc: Bart Van Assche <[email protected]>
Cc: [email protected],
Cc: Martin K . Petersen <[email protected]>,
Cc: Christoph Hellwig <[email protected]>,
Cc: James E . J . Bottomley <[email protected]>,
Cc: jianchao wang <[email protected]>
Reviewed-by: Bart Van Assche <[email protected]>
Reviewed-by: Hannes Reinecke <[email protected]>
Signed-off-by: Ming Lei <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
|
|
This patch fixes regression introduced by commit f8f97b0c5b7f ("scsi:
qla2xxx: Cleanups for NVRAM/Flash read/write path") where flash read/write
routine cleanup left out code which resulted into checksum failure leading
to use-after-free stack during driver load.
Following stack trace is seen in the log file
qla2xxx [0000:00:00.0]-0005: : QLogic Fibre Channel HBA Driver: 10.01.00.16-k.
qla2xxx [0000:00:0b.0]-001d: : Found an ISP2532 irq 11 iobase 0x0000000000f47f03.
qla2xxx [0000:00:0b.0]-00cd:8: ISP Firmware failed checksum.
qla2xxx [0000:00:0b.0]-00cf:8: Setup chip ****FAILED****.
qla2xxx [0000:00:0b.0]-00d6:8: Failed to initialize adapter - Adapter flags 2.
==================================================================
BUG: KASAN: use-after-free in __list_del_entry_valid+0x15/0xd0
Read of size 8 at addr ffff8880ca05a490 by task modprobe/857
CPU: 0 PID: 857 Comm: modprobe Not tainted 5.1.0-rc1-dbg+ #4
Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
Call Trace:
dump_stack+0x86/0xca
print_address_description+0x6c/0x234
? __list_del_entry_valid+0x15/0xd0
kasan_report.cold.3+0x1b/0x34
? __list_del_entry_valid+0x15/0xd0
? __kmem_cache_shutdown.cold.95+0xf5/0x176
? __list_del_entry_valid+0x15/0xd0
__asan_load8+0x54/0x90
__list_del_entry_valid+0x15/0xd0
dma_pool_destroy+0x4f/0x260
? dma_free_attrs+0xb4/0xd0
qla2x00_mem_free+0x529/0xcc0 [qla2xxx]
? kobject_put+0xdb/0x230
qla2x00_probe_one+0x2b5e/0x45f0 [qla2xxx]
? qla2xxx_pci_error_detected+0x210/0x210 [qla2xxx]
? match_held_lock+0x20/0x240
? find_held_lock+0xca/0xf0
? mark_held_locks+0x86/0xb0
? _raw_spin_unlock_irqrestore+0x52/0x60
? __pm_runtime_resume+0x5b/0xb0
? lockdep_hardirqs_on+0x185/0x260
? _raw_spin_unlock_irqrestore+0x52/0x60
? trace_hardirqs_on+0x24/0x130
? preempt_count_sub+0x13/0xc0
? _raw_spin_unlock_irqrestore+0x3d/0x60
pci_device_probe+0x154/0x1e0
really_probe+0x17d/0x540
? device_driver_attach+0x90/0x90
driver_probe_device+0x113/0x170
? device_driver_attach+0x90/0x90
device_driver_attach+0x88/0x90
__driver_attach+0xb5/0x190
bus_for_each_dev+0xf8/0x160
? subsys_dev_iter_exit+0x10/0x10
? kasan_check_read+0x11/0x20
? preempt_count_sub+0x13/0xc0
? _raw_spin_unlock+0x2c/0x50
driver_attach+0x26/0x30
bus_add_driver+0x238/0x2f0
driver_register+0xd7/0x150
__pci_register_driver+0xd5/0xe0
? 0xffffffffa06c8000
qla2x00_module_init+0x208/0x254 [qla2xxx]
do_one_initcall+0xc0/0x3c9
? trace_event_raw_event_initcall_finish+0x150/0x150
? __kasan_kmalloc.constprop.5+0xc7/0xd0
? kasan_unpoison_shadow+0x35/0x50
? kasan_poison_shadow+0x2f/0x40
? __asan_register_globals+0x5a/0x70
do_init_module+0x103/0x330
load_module+0x36df/0x3b70
? fsnotify+0x611/0x640
? module_frob_arch_sections+0x20/0x20
? kernel_read+0x74/0xa0
? kasan_check_write+0x14/0x20
? kernel_read_file+0x25e/0x320
? do_mmap+0x42c/0x6c0
__do_sys_finit_module+0x133/0x1c0
? __do_sys_finit_module+0x133/0x1c0
? __do_sys_init_module+0x210/0x210
? fput_many+0x1b/0xc0
? fput+0xe/0x10
? do_syscall_64+0x14/0x210
? entry_SYSCALL_64_after_hwframe+0x49/0xbe
__x64_sys_finit_module+0x3e/0x50
do_syscall_64+0x72/0x210
entry_SYSCALL_64_after_hwframe+0x49/0xbe
RIP: 0033:0x7f8bd5c03219
Code: 00 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 47 fc 0c 00 f7 d8 64 89 01 48
RSP: 002b:00007fff9d11de98 EFLAGS: 00000246 ORIG_RAX: 0000000000000139
RAX: ffffffffffffffda RBX: 000055ef21596b50 RCX: 00007f8bd5c03219
RDX: 0000000000000000 RSI: 000055ef21596570 RDI: 0000000000000004
RBP: 000055ef21596570 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000004 R11: 0000000000000246 R12: 0000000000000000
R13: 000055ef21596c80 R14: 0000000000040000 R15: 000055ef21596b50
Allocated by task 857:
save_stack+0x43/0xd0
__kasan_kmalloc.constprop.5+0xc7/0xd0
kasan_kmalloc+0x9/0x10
kmem_cache_alloc_trace+0x144/0x300
dma_pool_create+0xb5/0x3b0
qla2x00_mem_alloc+0xb98/0x1ad0 [qla2xxx]
qla2x00_probe_one+0xe28/0x45f0 [qla2xxx]
pci_device_probe+0x154/0x1e0
really_probe+0x17d/0x540
driver_probe_device+0x113/0x170
device_driver_attach+0x88/0x90
__driver_attach+0xb5/0x190
bus_for_each_dev+0xf8/0x160
driver_attach+0x26/0x30
bus_add_driver+0x238/0x2f0
driver_register+0xd7/0x150
__pci_register_driver+0xd5/0xe0
qla2x00_module_init+0x208/0x254 [qla2xxx]
do_one_initcall+0xc0/0x3c9
do_init_module+0x103/0x330
load_module+0x36df/0x3b70
__do_sys_finit_module+0x133/0x1c0
__x64_sys_finit_module+0x3e/0x50
do_syscall_64+0x72/0x210
entry_SYSCALL_64_after_hwframe+0x49/0xbe
Freed by task 857:
save_stack+0x43/0xd0
__kasan_slab_free+0x139/0x190
kasan_slab_free+0xe/0x10
kfree+0xf0/0x2c0
dma_pool_destroy+0x24c/0x260
qla2x00_mem_free+0x529/0xcc0 [qla2xxx]
qla2x00_free_device+0x167/0x1b0 [qla2xxx]
qla2x00_probe_one+0x2b28/0x45f0 [qla2xxx]
pci_device_probe+0x154/0x1e0
really_probe+0x17d/0x540
driver_probe_device+0x113/0x170
device_driver_attach+0x88/0x90
__driver_attach+0xb5/0x190
bus_for_each_dev+0xf8/0x160
driver_attach+0x26/0x30
bus_add_driver+0x238/0x2f0
driver_register+0xd7/0x150
__pci_register_driver+0xd5/0xe0
qla2x00_module_init+0x208/0x254 [qla2xxx]
do_one_initcall+0xc0/0x3c9
do_init_module+0x103/0x330
load_module+0x36df/0x3b70
__do_sys_finit_module+0x133/0x1c0
__x64_sys_finit_module+0x3e/0x50
do_syscall_64+0x72/0x210
entry_SYSCALL_64_after_hwframe+0x49/0xbe
The buggy address belongs to the object at ffff8880ca05a400
which belongs to the cache kmalloc-192 of size 192
The buggy address is located 144 bytes inside of
192-byte region [ffff8880ca05a400, ffff8880ca05a4c0)
The buggy address belongs to the page:
page:ffffea0003281680 count:1 mapcount:0 mapping:ffff88811bf03380 index:0x0 compound_mapcount: 0
flags: 0x4000000000010200(slab|head)
raw: 4000000000010200 0000000000000000 0000000c00000001 ffff88811bf03380
raw: 0000000000000000 0000000080200020 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
Memory state around the buggy address:
ffff8880ca05a380: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
ffff8880ca05a400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff8880ca05a480: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
^
ffff8880ca05a500: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffff8880ca05a580: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc
==================================================================
Fixes: f8f97b0c5b7f ("scsi: qla2xxx: Cleanups for NVRAM/Flash read/write path")
Reported-by: Bart Van Assche <[email protected]>
Tested-by: Bart Van Assche <[email protected]>
Signed-off-by: Himanshu Madhani <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
|
|
The qla2x00_set_fcport_state() function is not in the hot path so move its
definition from a .h into a .c file.
Cc: Himanshu Madhani <[email protected]>
Cc: Giridhar Malavali <[email protected]>
Reviewed-by: Johannes Thumshirn <[email protected]>
Acked-by: Himanshu Madhani <[email protected]>
Signed-off-by: Bart Van Assche <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
|
|
Casting a void pointer into another pointer before assigning the pointer to
a variable is not useful. Hence remove such casts.
Cc: Himanshu Madhani <[email protected]>
Cc: Giridhar Malavali <[email protected]>
Reviewed-by: Johannes Thumshirn <[email protected]>
Acked-by: Himanshu Madhani <[email protected]>
Signed-off-by: Bart Van Assche <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
|
|
The 'data_work' and 'data_work_free' member variables are set but never
used. Hence remove both member variables. See also commit 6bcbb3174caa
("qla2xxx: Fix incorrect tcm_qla2xxx_free_cmd use during TMR ABORT (v2)").
Cc: Himanshu Madhani <[email protected]>
Cc: Giridhar Malavali <[email protected]>
Reviewed-by: Johannes Thumshirn <[email protected]>
Acked-by: Himanshu Madhani <[email protected]>
Signed-off-by: Bart Van Assche <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
|
|
The <linux/io-64-nonatomic-lo-hi.h> header file is included because of the
readq() macro. Since that macro is only used in qla_nx.c, move that include
statement into qla_nx.c.
Cc: Himanshu Madhani <[email protected]>
Cc: Giridhar Malavali <[email protected]>
Reviewed-by: Johannes Thumshirn <[email protected]>
Acked-by: Himanshu Madhani <[email protected]>
Signed-off-by: Bart Van Assche <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
|
|
Since qla24xx_build_scsi_crc_2_iocbs() is only used inside a single source
file, declare this function static.
Cc: Himanshu Madhani <[email protected]>
Cc: Giridhar Malavali <[email protected]>
Reviewed-by: Johannes Thumshirn <[email protected]>
Acked-by: Himanshu Madhani <[email protected]>
Signed-off-by: Bart Van Assche <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
|
|
Reduce the size of the qla2xxx kernel module by moving an array definition
from a .h into a .c file.
Cc: Himanshu Madhani <[email protected]>
Cc: Giridhar Malavali <[email protected]>
Reviewed-by: Johannes Thumshirn <[email protected]>
Acked-by: Himanshu Madhani <[email protected]>
Signed-off-by: Bart Van Assche <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
|
|
Improve source code readability by inserting spaces where these are
required according to the coding standard. This patch only inserts
whitespace and does not make any other changes.
Cc: Himanshu Madhani <[email protected]>
Cc: Giridhar Malavali <[email protected]>
Reviewed-by: Johannes Thumshirn <[email protected]>
Acked-by: Himanshu Madhani <[email protected]>
Signed-off-by: Bart Van Assche <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
|
|
Improve source code readability by following the Linux kernel coding style
for pointer types. This patch only changes whitespace.
Cc: Himanshu Madhani <[email protected]>
Cc: Giridhar Malavali <[email protected]>
Reviewed-by: Johannes Thumshirn <[email protected]>
Acked-by: Himanshu Madhani <[email protected]>
Signed-off-by: Bart Van Assche <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
|
|
This patch improves readability of the qla2xxx source code.
Cc: Himanshu Madhani <[email protected]>
Cc: Giridhar Malavali <[email protected]>
Reviewed-by: Johannes Thumshirn <[email protected]>
Acked-by: Himanshu Madhani <[email protected]>
Signed-off-by: Bart Van Assche <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
|
|
Most but not all code in the qla2xxx driver uses tabs for indentation.
Make the qla2xxx code easier to read by using tabs consistently for
indentation. This patch improves conformance with the Linux kernel coding
style.
Cc: Himanshu Madhani <[email protected]>
Cc: Giridhar Malavali <[email protected]>
Reviewed-by: Johannes Thumshirn <[email protected]>
Acked-by: Himanshu Madhani <[email protected]>
Signed-off-by: Bart Van Assche <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
|
|
Currently we print expander PHY indexes in a mix of decimal and hex.
It is more consistent and also more convenient to read decimal, so
make this change.
We use width of 2 for expander and 1 for root PHYs prints.
Some lines which were needlessly spilling multiple lines are unified.
Signed-off-by: John Garry <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
|
|
When we discover the PHY is empty in sas_rediscover_dev(), the PHY
information (like negotiated linkrate) is not updated.
As such, for a user examining sysfs for that PHY, they would see
incorrect values:
root@(none)$ cd /sys/class/sas_phy/phy-0:0:20
root@(none)$ more negotiated_linkrate
3.0 Gbit
root@(none)$ echo 0 > enable
root@(none)$ more negotiated_linkrate
3.0 Gbit
So fix this, simply discover the PHY again, even though we know it's empty;
in the above example, this gives us:
root@(none)$ more negotiated_linkrate
Phy disabled
We must do this after unregistering the device associated with the PHY
(in sas_unregister_devs_sas_addr()).
Signed-off-by: John Garry <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
|
|
According to the SAS spec, an expander device shall transmit BROADCAST
(CHANGE) from at least one phy in each expander port other than the
expander port that is the cause for transmitting BROADCAST (CHANGE).
As such, for when the link is lost for a root PHY attached to an expander
PHY, we get no broadcast event.
This causes an issue for libsas, in that we will not revalidate the domain
for these events.
As a solution, for when a root PHY is formed or deformed from a root port,
insert a broadcast event to trigger a domain revalidation.
Signed-off-by: John Garry <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
|
|
When an expander PHY which was part of a wideport disconnects, we would see
a log like this from sas_rediscover():
[ 39.695554] sas: phy20 part of wide port with phy16
Here, phy20 is the PHY that disconnected, and phy16 is the lowest indexed
member PHY of the wideport.
The log implies the phy20 is still part of the wideport with phy16, so is
misleading or, at least, vague.
Improve the logs in SAS rediscovery by removing this log and adding a log
in sas_rediscover_dev() to tell what's really going on.
While we're at it, also make the logs in sas_find_bcast_dev() more
informative (and more consistent with the reset of the expander logs).
Signed-off-by: John Garry <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
|
|
unmatch fixing
Currently for fixing the linkrate matching during discovery such that the
linkrate of a SATA PHY does not exceed min pathway to initiator, we set the
SATA PHY programmed min linkrate to the same value as the programmed max
linkrate.
This is unnecessary, and we should be able to keep the same programmed min
linkrate if it is already lower than this new max programmed linkrate.
This patch makes that change.
In effect, this will not make much difference since we generally will
negotiate a linkrate at the programmed max linkrate, and the programmed min
linkrate will have no impact.
Signed-off-by: John Garry <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
|
|
Many times we use 8 for SAS address length, while we already have a macro
for this - SAS_ADDR_SIZE.
Replace instances of this with the macro. However, don't touch the SAS
address array sizes sas.h, as these are defined according to the SAS spec.
Some missing whitespaces are also added, and whitespace indentation
in sas_hash_addr() is also fixed (see sas_hash_addr()).
Signed-off-by: John Garry <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
|
|
Pull block fixes from Jens Axboe:
"Set of fixes that should go into this round. This pull is larger than
I'd like at this time, but there's really no specific reason for that.
Some are fixes for issues that went into this merge window, others are
not. Anyway, this contains:
- Hardware queue limiting for virtio-blk/scsi (Dongli)
- Multi-page bvec fixes for lightnvm pblk
- Multi-bio dio error fix (Jason)
- Remove the cache hint from the io_uring tool side, since we didn't
move forward with that (me)
- Make io_uring SETUP_SQPOLL root restricted (me)
- Fix leak of page in error handling for pc requests (Jérôme)
- Fix BFQ regression introduced in this merge window (Paolo)
- Fix break logic for bio segment iteration (Ming)
- Fix NVMe cancel request error handling (Ming)
- NVMe pull request with two fixes (Christoph):
- fix the initial CSN for nvme-fc (James)
- handle log page offsets properly in the target (Keith)"
* tag 'for-linus-20190412' of git://git.kernel.dk/linux-block:
block: fix the return errno for direct IO
nvmet: fix discover log page when offsets are used
nvme-fc: correct csn initialization and increments on error
block: do not leak memory in bio_copy_user_iov()
lightnvm: pblk: fix crash in pblk_end_partial_read due to multipage bvecs
nvme: cancel request synchronously
blk-mq: introduce blk_mq_complete_request_sync()
scsi: virtio_scsi: limit number of hw queues by nr_cpu_ids
virtio-blk: limit number of hw queues by nr_cpu_ids
block, bfq: fix use after free in bfq_bfqq_expire
io_uring: restrict IORING_SETUP_SQPOLL to root
tools/io_uring: remove IOCQE_FLAG_CACHEHIT
block: don't use for-inside-for in bio_for_each_segment_all
|
|
Do some minor tidy-up.
Signed-off-by: Xiang Chen <[email protected]>
Signed-off-by: John Garry <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
|
|
Currently we call hisi_sas_softreset_ata_disk() in
hisi_sas_I_T_nexus_reset().
If this fails for open reject reason, there is no reason to fail the IT
nexus reset, so only fail for TMF_RESP_FUNC_FAILED.
Some other strings spilled over multiple lines are reunited.
Signed-off-by: Luo Jiaxing <[email protected]>
Signed-off-by: John Garry <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
|
|
In the function of hisi_sas_init_device(), we added ops->hardreset() to
clear affiliation of STP target port or handle [STP pending] state.
Function hisi_sas_init_device() will be called when a device is found or
during controller reset. At controller reset, we call
hisi_sas_init_device() to re-init the disks, so calling hardreset() is
unnecessary and it also will cause some delay at controller reset.
Signed-off-by: Luo Jiaxing <[email protected]>
Signed-off-by: John Garry <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
|
|
This patch is to switch HW all error handling from PCI AER to MSI interrupt
due to non-standard PCI implementation. All HW errors which were being
reported through PCI AER can be reported through MSI interrupt also.
Do two things to complete the switch:
1. Notify FW to switch to MSI handling through ACPI DSM.
2. Add MSI handling for some hw errors, ECC errors and poison errors (we
also call some of them AXI reuser error). They were handled only through
PCI AER before.
For old FW reporting PCI AER events, the PCI AER handler will see that the
driver on longer support AER, and will leave the device in offlined state,
which is safe.
Signed-off-by: Xiaofei Tan <[email protected]>
Signed-off-by: John Garry <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
|
|
In commit 8b8d66531555 ("scsi: hisi_sas: make SAS address of SATA disks
unique"), we ensured that each SATA disk in the system has a unique SAS
address, even if it is fake. That was for v2 hw.
Add this for v3 hw.
Signed-off-by: Xiang Chen <[email protected]>
Signed-off-by: John Garry <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
|
|
In function hisi_sas_init_device(), the log is as follows when error for
hardreset:
hisi_sas_v3_hw 0000:74:02.0: SATA disk hardreset fail: 0xffffffed
Actually if hardreset failed, its return value is negative, so change the
print format from %x to %d.
Signed-off-by: Xiang Chen <[email protected]>
Signed-off-by: John Garry <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
|
|
In commit efdcad62e7b8 ("scsi: hisi_sas: Set PHY linkrate when
disconnected"), we use the sas_phy_data.enable flag to track whether the
PHY was enabled or not, so that we know if we should set the PHY negotiated
linkrate at SAS_LINK_RATE_UNKNOWN or SAS_PHY_DISABLED.
However, it is not proper to use sas_phy_data.enable, since it is only set
when libsas attempts to set the PHY disabled/enabled; hence, it may not
even have an initial value.
As a solution to this problem, introduce hisi_sas_phy.enable to track
whether the PHY is enabled or not, so that we can set the negotiated
linkrate properly when the PHY comes down.
Signed-off-by: John Garry <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
|
|
Currently there are two scenarioes which may cause PHY state of hardware
(which is 0) is inconsistent with the state held in software:
- Unplug SAS wire before get_phys_state when SAS controller reset, then the
interrupts of phy down are ignored, phy state is 0 before reset, and it
also gets 0 after reset, so phy down doesn't occur even if unplugged SAS
wire;
- For v3 hw later version, it will close bus when 2 bit ECC error occurs.
So if unplug SAS wire at that time, interrupts of phy down also not
occur. So at last it will cause host reset. It also get phy state 0
before and after reset, the same issue occurs.
To solve it, use hisi_sas_phy_down() directly in rescan topology function.
Signed-off-by: Xiang Chen <[email protected]>
Signed-off-by: John Garry <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
|
|
Add host reset interface to make it easier for testing the host reset
feature.
Signed-off-by: Xiang Chen <[email protected]>
Signed-off-by: John Garry <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
|
|
We have a few submissions for 5.2 that depend on fixes merged post
5.1-rc1. Merge the fixes branch into queue.
Signed-off-by: Martin K. Petersen <[email protected]>
|
|
Currently the FC-NVMe driver is leverating the SCSI FC transport class to
access the remote ports. Which means that all FC-NVMe remote ports will be
visible to the fc transport layer, but due to missing definitions the port
roles will always be 'unknown'. This patch adds the missing definitions to
the fc transport class to that the port roles are correctly displayed.
Signed-off-by: Hannes Reinecke <[email protected]>
Reviewed-by: James Smart <[email protected]>
Reviewed-by: Ewan D. Milne <[email protected]>
Reviewed-by: Giridhar Malavali <[email protected]>
Reviewed-by: Himanshu Madhani <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
|
|
The error return path via label rel_resource checks for a non-null skb
before free'ing it. However, skb is always null at this exit path, so the
null check and the free are redundant and can be removed. Removing this
allows the original goto's to rel_resource to be cleaned up; the first can
be replaced by a return of -EINVAL, the second can be replaced by a more
appropriate -ENOMEM return and fix a memory leak by freeing csk->atid.
Addresses-Coverity: ("Logically Dead Code")
Signed-off-by: Colin Ian King <[email protected]>
Reviewed-by: Dan Carpenter <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
|
|
Currently, an empty disk->events field tells the block layer not to
forward media change events to user space. This was done in commit
7c88a168da80 ("block: don't propagate unlisted DISK_EVENTs to userland")
in order to avoid events from "fringe" drivers to be forwarded to user
space. By doing so, the block layer lost the information which events
were supported by a particular block device, and most importantly,
whether or not a given device supports media change events at all.
Prepare for not interpreting the "events" field this way in the future
any more. This is done by adding an additional field "event_flags" to
struct gendisk, and two flag bits that can be set to have the device
treated like one that had the "events" field set to a non-zero value
before. This applies only to the sd and sr drivers, which are changed to
set the new flags.
The new flags are DISK_EVENT_FLAG_POLL to enforce polling of the device
for synchronous events, and DISK_EVENT_FLAG_UEVENT to tell the
blocklayer to generate udev events from kernel events.
In order to add the event_flags field to struct gendisk, the events
field is converted to an "unsigned short"; it doesn't need to hold
values bigger than 2 anyway.
This patch doesn't change behavior.
Reviewed-by: Christoph Hellwig <[email protected]>
Signed-off-by: Martin Wilck <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
|
|
When tag_set->nr_maps is 1, the block layer limits the number of hw queues
by nr_cpu_ids. No matter how many hw queues are used by virtio-scsi, as it
has (tag_set->nr_maps == 1), it can use at most nr_cpu_ids hw queues.
In addition, specifically for pci scenario, when the 'num_queues' specified
by qemu is more than maxcpus, virtio-scsi would not be able to allocate
more than maxcpus vectors in order to have a vector for each queue. As a
result, it falls back into MSI-X with one vector for config and one shared
for queues.
Considering above reasons, this patch limits the number of hw queues used
by virtio-scsi by nr_cpu_ids.
Reviewed-by: Stefan Hajnoczi <[email protected]>
Signed-off-by: Dongli Zhang <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
|
|
Only include those header files that are needed by the code in this source
file.
[mkp: include build fix from Bart for SPARC]
Cc: Himanshu Madhani <[email protected]>
Cc: Giridhar Malavali <[email protected]>
Signed-off-by: Bart Van Assche <[email protected]>
Acked-by: Himanshu Madhani <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
|
|
%pF and %pf are functionally equivalent to %pS and %ps conversion
specifiers. The former are deprecated, therefore switch the current users
to use the preferred variant.
The changes have been produced by the following command:
git grep -l '%p[fF]' | grep -v '^\(tools\|Documentation\)/' | \
while read i; do perl -i -pe 's/%pf/%ps/g; s/%pF/%pS/g;' $i; done
And verifying the result.
Link: http://lkml.kernel.org/r/[email protected]
Cc: Andy Shevchenko <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Sakari Ailus <[email protected]>
Acked-by: David Sterba <[email protected]> (for btrfs)
Acked-by: Mike Rapoport <[email protected]> (for mm/memblock.c)
Acked-by: Bjorn Helgaas <[email protected]> (for drivers/pci)
Acked-by: Rafael J. Wysocki <[email protected]>
Signed-off-by: Petr Mladek <[email protected]>
|
|
If scsi cmd sglist is not suitable for DDP then csiostor driver uses
preallocated buffers for DDP, because of this data copy is required from
DDP buffer to scsi cmd sglist before calling ->scsi_done().
Signed-off-by: Varun Prakash <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
|
|
registration order
Make sure that resources are only unregistered after the users of these
resources have been unregistered. Only unregister the character device if
registration of it succeeded.
Cc: Himanshu Madhani <[email protected]>
Cc: Giridhar Malavali <[email protected]>
Signed-off-by: Bart Van Assche <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
|
|
If module initialization fails after the character device has been
registered, unregister the character device. Additionally, avoid
duplicating error path code.
Cc: Himanshu Madhani <[email protected]>
Cc: Giridhar Malavali <[email protected]>
Fixes: 6a03b4cd78f3 ("[SCSI] qla2xxx: Add char device to increase driver use count") # v2.6.35.
Signed-off-by: Bart Van Assche <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
|
|
This patch makes the code easier to read but does not change any
functionality.
Cc: Himanshu Madhani <[email protected]>
Cc: Giridhar Malavali <[email protected]>
Signed-off-by: Bart Van Assche <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
|
|
Make qla2x00_process_response_queue() easier to read by splitting this
function. This patch does not change any functionality.
Cc: Himanshu Madhani <[email protected]>
Cc: Giridhar Malavali <[email protected]>
Signed-off-by: Bart Van Assche <[email protected]>
Acked-by: Himanshu Madhani <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
|