Skip to content

Commit 944aacb

Browse files
committed
Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
Pull SCSI fixes from James Bottomley: "Only one core change (and one in doc only) the rest are drivers. The one core fix is for some inline encrypting drives that can't handle encryption requests on non-data commands (like error handling ones); it saves the request level encryption parameters in the eh_save structure so they can be cleared for error handling and restored after it is completed" * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: ufs: host: mediatek: Make read-only array scale_us static const scsi: bfa: Update outdated comment scsi: mpt3sas: Update maintainer list scsi: ufs: core: Configure MCQ after link startup scsi: core: Fix error handler encryption support scsi: core: Correct documentation for scsi_test_unit_ready() scsi: ufs: dt-bindings: Fix several grammar errors
2 parents e0d4140 + 309a29b commit 944aacb

File tree

8 files changed

+40
-8
lines changed

8 files changed

+40
-8
lines changed

Documentation/devicetree/bindings/ufs/ufs-common.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ properties:
4848
enum: [1, 2]
4949
default: 2
5050
description:
51-
Number of lanes available per direction. Note that it is assume same
52-
number of lanes is used both directions at once.
51+
Number of lanes available per direction. Note that it is assumed that
52+
the same number of lanes are used in both directions at once.
5353

5454
vdd-hba-supply:
5555
description:

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14880,6 +14880,7 @@ LSILOGIC MPT FUSION DRIVERS (FC/SAS/SPI)
1488014880
M: Sathya Prakash <[email protected]>
1488114881
M: Sreekanth Reddy <[email protected]>
1488214882
M: Suganath Prabu Subramani <[email protected]>
14883+
M: Ranjan Kumar <[email protected]>
1488314884
1488414885
1488514886
S: Supported

drivers/scsi/bfa/bfa_fcs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1169,7 +1169,7 @@ bfa_fcs_fabric_vport_lookup(struct bfa_fcs_fabric_s *fabric, wwn_t pwwn)
11691169
* This function should be used only if there is any requirement
11701170
* to check for FOS version below 6.3.
11711171
* To check if the attached fabric is a brocade fabric, use
1172-
* bfa_lps_is_brcd_fabric() which works for FOS versions 6.3
1172+
* fabric->lps->brcd_switch which works for FOS versions 6.3
11731173
* or above only.
11741174
*/
11751175

drivers/scsi/scsi_error.c

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1063,6 +1063,9 @@ void scsi_eh_prep_cmnd(struct scsi_cmnd *scmd, struct scsi_eh_save *ses,
10631063
unsigned char *cmnd, int cmnd_size, unsigned sense_bytes)
10641064
{
10651065
struct scsi_device *sdev = scmd->device;
1066+
#ifdef CONFIG_BLK_INLINE_ENCRYPTION
1067+
struct request *rq = scsi_cmd_to_rq(scmd);
1068+
#endif
10661069

10671070
/*
10681071
* We need saved copies of a number of fields - this is because
@@ -1114,6 +1117,18 @@ void scsi_eh_prep_cmnd(struct scsi_cmnd *scmd, struct scsi_eh_save *ses,
11141117
scmd->cmnd[1] = (scmd->cmnd[1] & 0x1f) |
11151118
(sdev->lun << 5 & 0xe0);
11161119

1120+
/*
1121+
* Encryption must be disabled for the commands submitted by the error handler.
1122+
* Hence, clear the encryption context information.
1123+
*/
1124+
#ifdef CONFIG_BLK_INLINE_ENCRYPTION
1125+
ses->rq_crypt_keyslot = rq->crypt_keyslot;
1126+
ses->rq_crypt_ctx = rq->crypt_ctx;
1127+
1128+
rq->crypt_keyslot = NULL;
1129+
rq->crypt_ctx = NULL;
1130+
#endif
1131+
11171132
/*
11181133
* Zero the sense buffer. The scsi spec mandates that any
11191134
* untransferred sense data should be interpreted as being zero.
@@ -1131,6 +1146,10 @@ EXPORT_SYMBOL(scsi_eh_prep_cmnd);
11311146
*/
11321147
void scsi_eh_restore_cmnd(struct scsi_cmnd* scmd, struct scsi_eh_save *ses)
11331148
{
1149+
#ifdef CONFIG_BLK_INLINE_ENCRYPTION
1150+
struct request *rq = scsi_cmd_to_rq(scmd);
1151+
#endif
1152+
11341153
/*
11351154
* Restore original data
11361155
*/
@@ -1143,6 +1162,11 @@ void scsi_eh_restore_cmnd(struct scsi_cmnd* scmd, struct scsi_eh_save *ses)
11431162
scmd->underflow = ses->underflow;
11441163
scmd->prot_op = ses->prot_op;
11451164
scmd->eh_eflags = ses->eh_eflags;
1165+
1166+
#ifdef CONFIG_BLK_INLINE_ENCRYPTION
1167+
rq->crypt_keyslot = ses->rq_crypt_keyslot;
1168+
rq->crypt_ctx = ses->rq_crypt_ctx;
1169+
#endif
11461170
}
11471171
EXPORT_SYMBOL(scsi_eh_restore_cmnd);
11481172

drivers/scsi/scsi_lib.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2459,7 +2459,7 @@ EXPORT_SYMBOL(scsi_mode_sense);
24592459
* @retries: number of retries before failing
24602460
* @sshdr: outpout pointer for decoded sense information.
24612461
*
2462-
* Returns zero if unsuccessful or an error if TUR failed. For
2462+
* Returns zero if successful or an error if TUR failed. For
24632463
* removable media, UNIT_ATTENTION sets ->changed flag.
24642464
**/
24652465
int

drivers/ufs/core/ufshcd.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10736,9 +10736,7 @@ static int ufshcd_add_scsi_host(struct ufs_hba *hba)
1073610736
if (is_mcq_supported(hba)) {
1073710737
ufshcd_mcq_enable(hba);
1073810738
err = ufshcd_alloc_mcq(hba);
10739-
if (!err) {
10740-
ufshcd_config_mcq(hba);
10741-
} else {
10739+
if (err) {
1074210740
/* Continue with SDB mode */
1074310741
ufshcd_mcq_disable(hba);
1074410742
use_mcq_mode = false;
@@ -11011,6 +11009,9 @@ int ufshcd_init(struct ufs_hba *hba, void __iomem *mmio_base, unsigned int irq)
1101111009
if (err)
1101211010
goto out_disable;
1101311011

11012+
if (hba->mcq_enabled)
11013+
ufshcd_config_mcq(hba);
11014+
1101411015
if (hba->quirks & UFSHCD_QUIRK_SKIP_PH_CONFIGURATION)
1101511016
goto initialized;
1101611017

drivers/ufs/host/ufs-mediatek.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1112,7 +1112,7 @@ static void ufs_mtk_setup_clk_gating(struct ufs_hba *hba)
11121112
unsigned long flags;
11131113
u32 ah_ms = 10;
11141114
u32 ah_scale, ah_timer;
1115-
u32 scale_us[] = {1, 10, 100, 1000, 10000, 100000};
1115+
static const u32 scale_us[] = {1, 10, 100, 1000, 10000, 100000};
11161116

11171117
if (ufshcd_is_clkgating_allowed(hba)) {
11181118
if (ufshcd_is_auto_hibern8_supported(hba) && hba->ahit) {

include/scsi/scsi_eh.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,12 @@ struct scsi_eh_save {
4141
unsigned char cmnd[32];
4242
struct scsi_data_buffer sdb;
4343
struct scatterlist sense_sgl;
44+
45+
/* struct request fields */
46+
#ifdef CONFIG_BLK_INLINE_ENCRYPTION
47+
struct bio_crypt_ctx *rq_crypt_ctx;
48+
struct blk_crypto_keyslot *rq_crypt_keyslot;
49+
#endif
4450
};
4551

4652
extern void scsi_eh_prep_cmnd(struct scsi_cmnd *scmd,

0 commit comments

Comments
 (0)