Skip to content

Commit e218711

Browse files
James BottomleyJames Bottomley
authored andcommitted
Merge branch 'misc' into for-next
2 parents 804c70c + 5ef104b commit e218711

File tree

6 files changed

+30
-34
lines changed

6 files changed

+30
-34
lines changed

drivers/scsi/fnic/fnic_fcs.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -145,16 +145,17 @@ void fnic_handle_link(struct work_struct *work)
145145
spin_unlock_irqrestore(&fnic->fnic_lock, flags);
146146
if (fnic->config.flags & VFCF_FIP_CAPABLE) {
147147
/* start FCoE VLAN discovery */
148-
fnic_fc_trace_set_data(
149-
fnic->lport->host->host_no,
150-
FNIC_FC_LE, "Link Status: DOWN_UP_VLAN",
151-
strlen("Link Status: DOWN_UP_VLAN"));
148+
fnic_fc_trace_set_data(fnic->lport->host->host_no,
149+
FNIC_FC_LE, "Link Status: DOWN_UP_VLAN",
150+
strlen("Link Status: DOWN_UP_VLAN"));
152151
fnic_fcoe_send_vlan_req(fnic);
152+
153153
return;
154154
}
155+
155156
FNIC_FCS_DBG(KERN_DEBUG, fnic->lport->host, "link up\n");
156157
fnic_fc_trace_set_data(fnic->lport->host->host_no, FNIC_FC_LE,
157-
"Link Status: DOWN_UP", strlen("Link Status: DOWN_UP"));
158+
"Link Status: DOWN_UP", strlen("Link Status: DOWN_UP"));
158159
fcoe_ctlr_link_up(&fnic->ctlr);
159160
} else {
160161
/* UP -> DOWN */

drivers/target/target_core_user.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ struct tcmu_tmr {
201201

202202
uint8_t tmr_type;
203203
uint32_t tmr_cmd_cnt;
204-
int16_t tmr_cmd_ids[];
204+
int16_t tmr_cmd_ids[] __counted_by(tmr_cmd_cnt);
205205
};
206206

207207
/*

drivers/ufs/core/ufshcd.c

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2715,27 +2715,23 @@ static int ufshcd_compose_devman_upiu(struct ufs_hba *hba,
27152715
* for SCSI Purposes
27162716
* @hba: per adapter instance
27172717
* @lrbp: pointer to local reference block
2718-
*
2719-
* Return: 0 upon success; < 0 upon failure.
27202718
*/
2721-
static int ufshcd_comp_scsi_upiu(struct ufs_hba *hba, struct ufshcd_lrb *lrbp)
2719+
static void ufshcd_comp_scsi_upiu(struct ufs_hba *hba, struct ufshcd_lrb *lrbp)
27222720
{
2721+
struct request *rq = scsi_cmd_to_rq(lrbp->cmd);
2722+
unsigned int ioprio_class = IOPRIO_PRIO_CLASS(req_get_ioprio(rq));
27232723
u8 upiu_flags;
2724-
int ret = 0;
27252724

27262725
if (hba->ufs_version <= ufshci_version(1, 1))
27272726
lrbp->command_type = UTP_CMD_TYPE_SCSI;
27282727
else
27292728
lrbp->command_type = UTP_CMD_TYPE_UFS_STORAGE;
27302729

2731-
if (likely(lrbp->cmd)) {
2732-
ufshcd_prepare_req_desc_hdr(lrbp, &upiu_flags, lrbp->cmd->sc_data_direction, 0);
2733-
ufshcd_prepare_utp_scsi_cmd_upiu(lrbp, upiu_flags);
2734-
} else {
2735-
ret = -EINVAL;
2736-
}
2737-
2738-
return ret;
2730+
ufshcd_prepare_req_desc_hdr(lrbp, &upiu_flags,
2731+
lrbp->cmd->sc_data_direction, 0);
2732+
if (ioprio_class == IOPRIO_CLASS_RT)
2733+
upiu_flags |= UPIU_CMD_FLAGS_CP;
2734+
ufshcd_prepare_utp_scsi_cmd_upiu(lrbp, upiu_flags);
27392735
}
27402736

27412737
/**
@@ -2823,8 +2819,6 @@ static int ufshcd_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd)
28232819
int err = 0;
28242820
struct ufs_hw_queue *hwq = NULL;
28252821

2826-
WARN_ONCE(tag < 0 || tag >= hba->nutrs, "Invalid tag %d\n", tag);
2827-
28282822
switch (hba->ufshcd_state) {
28292823
case UFSHCD_STATE_OPERATIONAL:
28302824
break;
@@ -5098,8 +5092,7 @@ static int ufshcd_slave_configure(struct scsi_device *sdev)
50985092
struct request_queue *q = sdev->request_queue;
50995093

51005094
blk_queue_update_dma_pad(q, PRDT_DATA_BYTE_COUNT_PAD - 1);
5101-
if (hba->quirks & UFSHCD_QUIRK_4KB_DMA_ALIGNMENT)
5102-
blk_queue_update_dma_alignment(q, SZ_4K - 1);
5095+
51035096
/*
51045097
* Block runtime-pm until all consumers are added.
51055098
* Refer ufshcd_setup_links().
@@ -5115,6 +5108,9 @@ static int ufshcd_slave_configure(struct scsi_device *sdev)
51155108
*/
51165109
sdev->silence_suspend = 1;
51175110

5111+
if (hba->vops && hba->vops->config_scsi_dev)
5112+
hba->vops->config_scsi_dev(sdev);
5113+
51185114
ufshcd_crypto_register(hba, q);
51195115

51205116
return 0;
@@ -6924,8 +6920,6 @@ static int __ufshcd_issue_tm_cmd(struct ufs_hba *hba,
69246920
spin_lock_irqsave(host->host_lock, flags);
69256921

69266922
task_tag = req->tag;
6927-
WARN_ONCE(task_tag < 0 || task_tag >= hba->nutmrs, "Invalid tag %d\n",
6928-
task_tag);
69296923
hba->tmf_rqs[req->tag] = req;
69306924
treq->upiu_req.req_header.task_tag = task_tag;
69316925

@@ -7499,8 +7493,6 @@ static int ufshcd_abort(struct scsi_cmnd *cmd)
74997493
bool outstanding;
75007494
u32 reg;
75017495

7502-
WARN_ONCE(tag < 0, "Invalid tag %d\n", tag);
7503-
75047496
ufshcd_hold(hba);
75057497

75067498
if (!is_mcq_enabled(hba)) {

drivers/ufs/host/ufs-exynos.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1511,6 +1511,11 @@ static int fsd_ufs_pre_link(struct exynos_ufs *ufs)
15111511
return 0;
15121512
}
15131513

1514+
static void exynos_ufs_config_scsi_dev(struct scsi_device *sdev)
1515+
{
1516+
blk_queue_update_dma_alignment(sdev->request_queue, SZ_4K - 1);
1517+
}
1518+
15141519
static int fsd_ufs_post_link(struct exynos_ufs *ufs)
15151520
{
15161521
int i;
@@ -1579,6 +1584,7 @@ static const struct ufs_hba_variant_ops ufs_hba_exynos_ops = {
15791584
.hibern8_notify = exynos_ufs_hibern8_notify,
15801585
.suspend = exynos_ufs_suspend,
15811586
.resume = exynos_ufs_resume,
1587+
.config_scsi_dev = exynos_ufs_config_scsi_dev,
15821588
};
15831589

15841590
static struct ufs_hba_variant_ops ufs_hba_exynosauto_vh_ops = {
@@ -1678,8 +1684,7 @@ static const struct exynos_ufs_drv_data exynos_ufs_drvs = {
16781684
UFSHCI_QUIRK_SKIP_RESET_INTR_AGGR |
16791685
UFSHCD_QUIRK_BROKEN_OCS_FATAL_ERROR |
16801686
UFSHCI_QUIRK_SKIP_MANUAL_WB_FLUSH_CTRL |
1681-
UFSHCD_QUIRK_SKIP_DEF_UNIPRO_TIMEOUT_SETTING |
1682-
UFSHCD_QUIRK_4KB_DMA_ALIGNMENT,
1687+
UFSHCD_QUIRK_SKIP_DEF_UNIPRO_TIMEOUT_SETTING,
16831688
.opts = EXYNOS_UFS_OPT_HAS_APB_CLK_CTRL |
16841689
EXYNOS_UFS_OPT_BROKEN_AUTO_CLK_CTRL |
16851690
EXYNOS_UFS_OPT_BROKEN_RX_SEL_IDX |

include/ufs/ufs.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,10 @@ enum upiu_response_transaction {
9898
UPIU_TRANSACTION_REJECT_UPIU = 0x3F,
9999
};
100100

101-
/* UPIU Read/Write flags */
101+
/* UPIU Read/Write flags. See also table "UPIU Flags" in the UFS standard. */
102102
enum {
103103
UPIU_CMD_FLAGS_NONE = 0x00,
104+
UPIU_CMD_FLAGS_CP = 0x04,
104105
UPIU_CMD_FLAGS_WRITE = 0x20,
105106
UPIU_CMD_FLAGS_READ = 0x40,
106107
};

include/ufs/ufshcd.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828

2929
#define UFSHCD "ufshcd"
3030

31+
struct scsi_device;
3132
struct ufs_hba;
3233

3334
enum dev_cmd_type {
@@ -371,6 +372,7 @@ struct ufs_hba_variant_ops {
371372
int (*get_outstanding_cqs)(struct ufs_hba *hba,
372373
unsigned long *ocqs);
373374
int (*config_esi)(struct ufs_hba *hba);
375+
void (*config_scsi_dev)(struct scsi_device *sdev);
374376
};
375377

376378
/* clock gating state */
@@ -596,11 +598,6 @@ enum ufshcd_quirks {
596598
*/
597599
UFSHCD_QUIRK_SKIP_DEF_UNIPRO_TIMEOUT_SETTING = 1 << 13,
598600

599-
/*
600-
* Align DMA SG entries on a 4 KiB boundary.
601-
*/
602-
UFSHCD_QUIRK_4KB_DMA_ALIGNMENT = 1 << 14,
603-
604601
/*
605602
* This quirk needs to be enabled if the host controller does not
606603
* support UIC command

0 commit comments

Comments
 (0)