Skip to content

Commit dfdf16e

Browse files
committed
Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
Pull SCSI updates from James Bottomley: "This consists of the usual driver updates (ufs, qla2xxx, tcmu, lpfc, hpsa, zfcp, scsi_debug) and minor bug fixes. We also have a huge docbook fix update like most other subsystems and no major update to the core (the few non trivial updates are either minor fixes or removing an unused feature [scsi_sdb_cache])" * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (307 commits) scsi: scsi_transport_srp: Sanitize scsi_target_block/unblock sequences scsi: ufs-mediatek: Apply DELAY_AFTER_LPM quirk to Micron devices scsi: ufs: Introduce device quirk "DELAY_AFTER_LPM" scsi: virtio-scsi: Correctly handle the case where all LUNs are unplugged scsi: scsi_debug: Implement tur_ms_to_ready parameter scsi: scsi_debug: Fix request sense scsi: lpfc: Fix typo in comment for ULP scsi: ufs-mediatek: Prevent LPM operation on undeclared VCC scsi: iscsi: Do not put host in iscsi_set_flashnode_param() scsi: hpsa: Correct ctrl queue depth scsi: target: tcmu: Make TMR notification optional scsi: target: tcmu: Implement tmr_notify callback scsi: target: tcmu: Fix and simplify timeout handling scsi: target: tcmu: Factor out new helper ring_insert_padding scsi: target: tcmu: Do not queue aborted commands scsi: target: tcmu: Use priv pointer in se_cmd scsi: target: Add tmr_notify backend function scsi: target: Modify core_tmr_abort_task() scsi: target: iscsi: Fix inconsistent debug message scsi: target: iscsi: Fix login error when receiving ...
2 parents d7806bb + bf1a28f commit dfdf16e

File tree

221 files changed

+7777
-3384
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

221 files changed

+7777
-3384
lines changed

Documentation/ABI/testing/sysfs-driver-ufs

Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -883,3 +883,139 @@ Contact: Subhash Jadavani <[email protected]>
883883
Description: This entry shows the target state of an UFS UIC link
884884
for the chosen system power management level.
885885
The file is read only.
886+
887+
What: /sys/bus/platform/drivers/ufshcd/*/device_descriptor/wb_presv_us_en
888+
Date: June 2020
889+
Contact: Asutosh Das <[email protected]>
890+
Description: This entry shows if preserve user-space was configured
891+
The file is read only.
892+
893+
What: /sys/bus/platform/drivers/ufshcd/*/device_descriptor/wb_shared_alloc_units
894+
Date: June 2020
895+
Contact: Asutosh Das <[email protected]>
896+
Description: This entry shows the shared allocated units of WB buffer
897+
The file is read only.
898+
899+
What: /sys/bus/platform/drivers/ufshcd/*/device_descriptor/wb_type
900+
Date: June 2020
901+
Contact: Asutosh Das <[email protected]>
902+
Description: This entry shows the configured WB type.
903+
0x1 for shared buffer mode. 0x0 for dedicated buffer mode.
904+
The file is read only.
905+
906+
What: /sys/bus/platform/drivers/ufshcd/*/geometry_descriptor/wb_buff_cap_adj
907+
Date: June 2020
908+
Contact: Asutosh Das <[email protected]>
909+
Description: This entry shows the total user-space decrease in shared
910+
buffer mode.
911+
The value of this parameter is 3 for TLC NAND when SLC mode
912+
is used as WriteBooster Buffer. 2 for MLC NAND.
913+
The file is read only.
914+
915+
What: /sys/bus/platform/drivers/ufshcd/*/geometry_descriptor/wb_max_alloc_units
916+
Date: June 2020
917+
Contact: Asutosh Das <[email protected]>
918+
Description: This entry shows the Maximum total WriteBooster Buffer size
919+
which is supported by the entire device.
920+
The file is read only.
921+
922+
What: /sys/bus/platform/drivers/ufshcd/*/geometry_descriptor/wb_max_wb_luns
923+
Date: June 2020
924+
Contact: Asutosh Das <[email protected]>
925+
Description: This entry shows the maximum number of luns that can support
926+
WriteBooster.
927+
The file is read only.
928+
929+
What: /sys/bus/platform/drivers/ufshcd/*/geometry_descriptor/wb_sup_red_type
930+
Date: June 2020
931+
Contact: Asutosh Das <[email protected]>
932+
Description: The supportability of user space reduction mode
933+
and preserve user space mode.
934+
00h: WriteBooster Buffer can be configured only in
935+
user space reduction type.
936+
01h: WriteBooster Buffer can be configured only in
937+
preserve user space type.
938+
02h: Device can be configured in either user space
939+
reduction type or preserve user space type.
940+
The file is read only.
941+
942+
What: /sys/bus/platform/drivers/ufshcd/*/geometry_descriptor/wb_sup_wb_type
943+
Date: June 2020
944+
Contact: Asutosh Das <[email protected]>
945+
Description: The supportability of WriteBooster Buffer type.
946+
00h: LU based WriteBooster Buffer configuration
947+
01h: Single shared WriteBooster Buffer
948+
configuration
949+
02h: Supporting both LU based WriteBooster
950+
Buffer and Single shared WriteBooster Buffer
951+
configuration
952+
The file is read only.
953+
954+
What: /sys/bus/platform/drivers/ufshcd/*/flags/wb_enable
955+
Date: June 2020
956+
Contact: Asutosh Das <[email protected]>
957+
Description: This entry shows the status of WriteBooster.
958+
0: WriteBooster is not enabled.
959+
1: WriteBooster is enabled
960+
The file is read only.
961+
962+
What: /sys/bus/platform/drivers/ufshcd/*/flags/wb_flush_en
963+
Date: June 2020
964+
Contact: Asutosh Das <[email protected]>
965+
Description: This entry shows if flush is enabled.
966+
0: Flush operation is not performed.
967+
1: Flush operation is performed.
968+
The file is read only.
969+
970+
What: /sys/bus/platform/drivers/ufshcd/*/flags/wb_flush_during_h8
971+
Date: June 2020
972+
Contact: Asutosh Das <[email protected]>
973+
Description: Flush WriteBooster Buffer during hibernate state.
974+
0: Device is not allowed to flush the
975+
WriteBooster Buffer during link hibernate
976+
state.
977+
1: Device is allowed to flush the
978+
WriteBooster Buffer during link hibernate
979+
state
980+
The file is read only.
981+
982+
What: /sys/bus/platform/drivers/ufshcd/*/attributes/wb_avail_buf
983+
Date: June 2020
984+
Contact: Asutosh Das <[email protected]>
985+
Description: This entry shows the amount of unused WriteBooster buffer
986+
available.
987+
The file is read only.
988+
989+
What: /sys/bus/platform/drivers/ufshcd/*/attributes/wb_cur_buf
990+
Date: June 2020
991+
Contact: Asutosh Das <[email protected]>
992+
Description: This entry shows the amount of unused current buffer.
993+
The file is read only.
994+
995+
What: /sys/bus/platform/drivers/ufshcd/*/attributes/wb_flush_status
996+
Date: June 2020
997+
Contact: Asutosh Das <[email protected]>
998+
Description: This entry shows the flush operation status.
999+
00h: idle
1000+
01h: Flush operation in progress
1001+
02h: Flush operation stopped prematurely.
1002+
03h: Flush operation completed successfully
1003+
04h: Flush operation general failure
1004+
The file is read only.
1005+
1006+
What: /sys/bus/platform/drivers/ufshcd/*/attributes/wb_life_time_est
1007+
Date: June 2020
1008+
Contact: Asutosh Das <[email protected]>
1009+
Description: This entry shows an indication of the WriteBooster Buffer
1010+
lifetime based on the amount of performed program/erase cycles
1011+
01h: 0% - 10% WriteBooster Buffer life time used
1012+
...
1013+
0Ah: 90% - 100% WriteBooster Buffer life time used
1014+
The file is read only.
1015+
1016+
What: /sys/class/scsi_device/*/device/unit_descriptor/wb_buf_alloc_units
1017+
Date: June 2020
1018+
Contact: Asutosh Das <[email protected]>
1019+
Description: This entry shows the configured size of WriteBooster buffer.
1020+
0400h corresponds to 4GB.
1021+
The file is read only.

Documentation/scsi/advansys.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ The following constants can be defined in the source file.
125125
c. klogd is started with the appropriate -c parameter
126126
(e.g. klogd -c 8)
127127

128-
This will cause printk() messages to be be displayed on the
128+
This will cause printk() messages to be displayed on the
129129
current console. Refer to the klogd(8) and syslogd(8) man pages
130130
for details.
131131

Documentation/scsi/scsi-parameters.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ parameters may be changed at runtime by the command
9494
(/proc/sys/dev/scsi/logging_level).
9595
There is also a nice 'scsi_logging_level' script in the
9696
S390-tools package, available for download at
97-
http://www-128.ibm.com/developerworks/linux/linux390/s390-tools-1.5.4.html
97+
https://github.com/ibm-s390-tools/s390-tools/blob/master/scripts/scsi_logging_level
9898

9999
scsi_mod.scan= [SCSI] sync (default) scans SCSI busses as they are
100100
discovered. async scans them in kernel threads,

MAINTAINERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2309,7 +2309,7 @@ F: drivers/pci/controller/dwc/pcie-qcom.c
23092309
F: drivers/phy/qualcomm/
23102310
F: drivers/power/*/msm*
23112311
F: drivers/reset/reset-qcom-*
2312-
F: drivers/scsi/ufs/ufs-qcom.*
2312+
F: drivers/scsi/ufs/ufs-qcom*
23132313
F: drivers/spi/spi-geni-qcom.c
23142314
F: drivers/spi/spi-qcom-qspi.c
23152315
F: drivers/spi/spi-qup.c

block/blk-pm.c

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,8 @@ EXPORT_SYMBOL(blk_pre_runtime_resume);
164164
*
165165
* Description:
166166
* Update the queue's runtime status according to the return value of the
167-
* device's runtime_resume function. If it is successfully resumed, process
168-
* the requests that are queued into the device's queue when it is resuming
169-
* and then mark last busy and initiate autosuspend for it.
167+
* device's runtime_resume function. If the resume was successful, call
168+
* blk_set_runtime_active() to do the real work of restarting the queue.
170169
*
171170
* This function should be called near the end of the device's
172171
* runtime_resume callback.
@@ -175,19 +174,13 @@ void blk_post_runtime_resume(struct request_queue *q, int err)
175174
{
176175
if (!q->dev)
177176
return;
178-
179-
spin_lock_irq(&q->queue_lock);
180177
if (!err) {
181-
q->rpm_status = RPM_ACTIVE;
182-
pm_runtime_mark_last_busy(q->dev);
183-
pm_request_autosuspend(q->dev);
178+
blk_set_runtime_active(q);
184179
} else {
180+
spin_lock_irq(&q->queue_lock);
185181
q->rpm_status = RPM_SUSPENDED;
182+
spin_unlock_irq(&q->queue_lock);
186183
}
187-
spin_unlock_irq(&q->queue_lock);
188-
189-
if (!err)
190-
blk_clear_pm_only(q);
191184
}
192185
EXPORT_SYMBOL(blk_post_runtime_resume);
193186

@@ -204,15 +197,25 @@ EXPORT_SYMBOL(blk_post_runtime_resume);
204197
* This function can be used in driver's resume hook to correct queue
205198
* runtime PM status and re-enable peeking requests from the queue. It
206199
* should be called before first request is added to the queue.
200+
*
201+
* This function is also called by blk_post_runtime_resume() for successful
202+
* runtime resumes. It does everything necessary to restart the queue.
207203
*/
208204
void blk_set_runtime_active(struct request_queue *q)
209205
{
210-
if (q->dev) {
211-
spin_lock_irq(&q->queue_lock);
212-
q->rpm_status = RPM_ACTIVE;
213-
pm_runtime_mark_last_busy(q->dev);
214-
pm_request_autosuspend(q->dev);
215-
spin_unlock_irq(&q->queue_lock);
216-
}
206+
int old_status;
207+
208+
if (!q->dev)
209+
return;
210+
211+
spin_lock_irq(&q->queue_lock);
212+
old_status = q->rpm_status;
213+
q->rpm_status = RPM_ACTIVE;
214+
pm_runtime_mark_last_busy(q->dev);
215+
pm_request_autosuspend(q->dev);
216+
spin_unlock_irq(&q->queue_lock);
217+
218+
if (old_status != RPM_ACTIVE)
219+
blk_clear_pm_only(q);
217220
}
218221
EXPORT_SYMBOL(blk_set_runtime_active);

drivers/firmware/qcom_scm.c

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -922,6 +922,107 @@ int qcom_scm_ocmem_unlock(enum qcom_scm_ocmem_client id, u32 offset, u32 size)
922922
}
923923
EXPORT_SYMBOL(qcom_scm_ocmem_unlock);
924924

925+
/**
926+
* qcom_scm_ice_available() - Is the ICE key programming interface available?
927+
*
928+
* Return: true iff the SCM calls wrapped by qcom_scm_ice_invalidate_key() and
929+
* qcom_scm_ice_set_key() are available.
930+
*/
931+
bool qcom_scm_ice_available(void)
932+
{
933+
return __qcom_scm_is_call_available(__scm->dev, QCOM_SCM_SVC_ES,
934+
QCOM_SCM_ES_INVALIDATE_ICE_KEY) &&
935+
__qcom_scm_is_call_available(__scm->dev, QCOM_SCM_SVC_ES,
936+
QCOM_SCM_ES_CONFIG_SET_ICE_KEY);
937+
}
938+
EXPORT_SYMBOL(qcom_scm_ice_available);
939+
940+
/**
941+
* qcom_scm_ice_invalidate_key() - Invalidate an inline encryption key
942+
* @index: the keyslot to invalidate
943+
*
944+
* The UFSHCI standard defines a standard way to do this, but it doesn't work on
945+
* these SoCs; only this SCM call does.
946+
*
947+
* Return: 0 on success; -errno on failure.
948+
*/
949+
int qcom_scm_ice_invalidate_key(u32 index)
950+
{
951+
struct qcom_scm_desc desc = {
952+
.svc = QCOM_SCM_SVC_ES,
953+
.cmd = QCOM_SCM_ES_INVALIDATE_ICE_KEY,
954+
.arginfo = QCOM_SCM_ARGS(1),
955+
.args[0] = index,
956+
.owner = ARM_SMCCC_OWNER_SIP,
957+
};
958+
959+
return qcom_scm_call(__scm->dev, &desc, NULL);
960+
}
961+
EXPORT_SYMBOL(qcom_scm_ice_invalidate_key);
962+
963+
/**
964+
* qcom_scm_ice_set_key() - Set an inline encryption key
965+
* @index: the keyslot into which to set the key
966+
* @key: the key to program
967+
* @key_size: the size of the key in bytes
968+
* @cipher: the encryption algorithm the key is for
969+
* @data_unit_size: the encryption data unit size, i.e. the size of each
970+
* individual plaintext and ciphertext. Given in 512-byte
971+
* units, e.g. 1 = 512 bytes, 8 = 4096 bytes, etc.
972+
*
973+
* Program a key into a keyslot of Qualcomm ICE (Inline Crypto Engine), where it
974+
* can then be used to encrypt/decrypt UFS I/O requests inline.
975+
*
976+
* The UFSHCI standard defines a standard way to do this, but it doesn't work on
977+
* these SoCs; only this SCM call does.
978+
*
979+
* Return: 0 on success; -errno on failure.
980+
*/
981+
int qcom_scm_ice_set_key(u32 index, const u8 *key, u32 key_size,
982+
enum qcom_scm_ice_cipher cipher, u32 data_unit_size)
983+
{
984+
struct qcom_scm_desc desc = {
985+
.svc = QCOM_SCM_SVC_ES,
986+
.cmd = QCOM_SCM_ES_CONFIG_SET_ICE_KEY,
987+
.arginfo = QCOM_SCM_ARGS(5, QCOM_SCM_VAL, QCOM_SCM_RW,
988+
QCOM_SCM_VAL, QCOM_SCM_VAL,
989+
QCOM_SCM_VAL),
990+
.args[0] = index,
991+
.args[2] = key_size,
992+
.args[3] = cipher,
993+
.args[4] = data_unit_size,
994+
.owner = ARM_SMCCC_OWNER_SIP,
995+
};
996+
void *keybuf;
997+
dma_addr_t key_phys;
998+
int ret;
999+
1000+
/*
1001+
* 'key' may point to vmalloc()'ed memory, but we need to pass a
1002+
* physical address that's been properly flushed. The sanctioned way to
1003+
* do this is by using the DMA API. But as is best practice for crypto
1004+
* keys, we also must wipe the key after use. This makes kmemdup() +
1005+
* dma_map_single() not clearly correct, since the DMA API can use
1006+
* bounce buffers. Instead, just use dma_alloc_coherent(). Programming
1007+
* keys is normally rare and thus not performance-critical.
1008+
*/
1009+
1010+
keybuf = dma_alloc_coherent(__scm->dev, key_size, &key_phys,
1011+
GFP_KERNEL);
1012+
if (!keybuf)
1013+
return -ENOMEM;
1014+
memcpy(keybuf, key, key_size);
1015+
desc.args[1] = key_phys;
1016+
1017+
ret = qcom_scm_call(__scm->dev, &desc, NULL);
1018+
1019+
memzero_explicit(keybuf, key_size);
1020+
1021+
dma_free_coherent(__scm->dev, key_size, keybuf, key_phys);
1022+
return ret;
1023+
}
1024+
EXPORT_SYMBOL(qcom_scm_ice_set_key);
1025+
9251026
/**
9261027
* qcom_scm_hdcp_available() - Check if secure environment supports HDCP.
9271028
*

drivers/firmware/qcom_scm.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,10 @@ extern int scm_legacy_call(struct device *dev, const struct qcom_scm_desc *desc,
103103
#define QCOM_SCM_OCMEM_LOCK_CMD 0x01
104104
#define QCOM_SCM_OCMEM_UNLOCK_CMD 0x02
105105

106+
#define QCOM_SCM_SVC_ES 0x10 /* Enterprise Security */
107+
#define QCOM_SCM_ES_INVALIDATE_ICE_KEY 0x03
108+
#define QCOM_SCM_ES_CONFIG_SET_ICE_KEY 0x04
109+
106110
#define QCOM_SCM_SVC_HDCP 0x11
107111
#define QCOM_SCM_HDCP_INVOKE 0x01
108112

drivers/s390/scsi/zfcp_ccw.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,12 @@ static void zfcp_ccw_remove(struct ccw_device *cdev)
124124
return;
125125

126126
write_lock_irq(&adapter->port_list_lock);
127-
list_for_each_entry_safe(port, p, &adapter->port_list, list) {
127+
list_for_each_entry(port, &adapter->port_list, list) {
128128
write_lock(&port->unit_list_lock);
129-
list_for_each_entry_safe(unit, u, &port->unit_list, list)
130-
list_move(&unit->list, &unit_remove_lh);
129+
list_splice_init(&port->unit_list, &unit_remove_lh);
131130
write_unlock(&port->unit_list_lock);
132-
list_move(&port->list, &port_remove_lh);
133131
}
132+
list_splice_init(&adapter->port_list, &port_remove_lh);
134133
write_unlock_irq(&adapter->port_list_lock);
135134
zfcp_ccw_adapter_put(adapter); /* put from zfcp_ccw_adapter_by_cdev */
136135

drivers/s390/scsi/zfcp_erp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ static void zfcp_erp_action_ready(struct zfcp_erp_action *act)
6868
{
6969
struct zfcp_adapter *adapter = act->adapter;
7070

71-
list_move(&act->list, &act->adapter->erp_ready_head);
71+
list_move(&act->list, &adapter->erp_ready_head);
7272
zfcp_dbf_rec_run("erardy1", act);
7373
wake_up(&adapter->erp_ready_wq);
7474
zfcp_dbf_rec_run("erardy2", act);

drivers/s390/scsi/zfcp_fc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ unsigned int zfcp_fc_port_scan_backoff(void)
4848
{
4949
if (!port_scan_backoff)
5050
return 0;
51-
return get_random_int() % port_scan_backoff;
51+
return prandom_u32_max(port_scan_backoff);
5252
}
5353

5454
static void zfcp_fc_port_scan_time(struct zfcp_adapter *adapter)

0 commit comments

Comments
 (0)