Skip to content

Commit e8e9941

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: "This is actually just a small set of mainly bug fixes for the original merge window code plus a few trivial updates and qedi boot from SAN support feature patch" * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: libfc: pass an error pointer to fc_disc_error() scsi: hisi_sas: make several const arrays static scsi: qla2xxx: Off by one in qlt_ctio_to_cmd() scsi: sg: fix SG_DXFER_FROM_DEV transfers scsi: virtio_scsi: always read VPD pages for multiqueue too scsi: qedf: fix spelling mistake: "offlading" -> "offloading" scsi: qedi: fix another spelling mistake: "alloction" -> "allocation" scsi: isci: fix typo in function names scsi: cxlflash: return -EFAULT if copy_from_user() fails scsi: qedi: Add support for Boot from SAN over iSCSI offload
2 parents cb0fbbf + 6f37e21 commit e8e9941

File tree

12 files changed

+674
-21
lines changed

12 files changed

+674
-21
lines changed

drivers/scsi/cxlflash/main.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3401,9 +3401,10 @@ static int cxlflash_afu_debug(struct cxlflash_cfg *cfg,
34013401
if (is_write) {
34023402
req_flags |= SISL_REQ_FLAGS_HOST_WRITE;
34033403

3404-
rc = copy_from_user(kbuf, ubuf, ulen);
3405-
if (unlikely(rc))
3404+
if (copy_from_user(kbuf, ubuf, ulen)) {
3405+
rc = -EFAULT;
34063406
goto out;
3407+
}
34073408
}
34083409
}
34093410

@@ -3431,8 +3432,10 @@ static int cxlflash_afu_debug(struct cxlflash_cfg *cfg,
34313432
goto out;
34323433
}
34333434

3434-
if (ulen && !is_write)
3435-
rc = copy_to_user(ubuf, kbuf, ulen);
3435+
if (ulen && !is_write) {
3436+
if (copy_to_user(ubuf, kbuf, ulen))
3437+
rc = -EFAULT;
3438+
}
34363439
out:
34373440
kfree(buf);
34383441
dev_dbg(dev, "%s: returning rc=%d\n", __func__, rc);

drivers/scsi/hisi_sas/hisi_sas_v2_hw.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1693,7 +1693,7 @@ static int prep_ssp_v2_hw(struct hisi_hba *hisi_hba,
16931693

16941694
static int parse_trans_tx_err_code_v2_hw(u32 err_msk)
16951695
{
1696-
const u8 trans_tx_err_code_prio[] = {
1696+
static const u8 trans_tx_err_code_prio[] = {
16971697
TRANS_TX_OPEN_FAIL_WITH_IT_NEXUS_LOSS,
16981698
TRANS_TX_ERR_PHY_NOT_ENABLE,
16991699
TRANS_TX_OPEN_CNX_ERR_WRONG_DESTINATION,
@@ -1738,7 +1738,7 @@ static int parse_trans_tx_err_code_v2_hw(u32 err_msk)
17381738

17391739
static int parse_trans_rx_err_code_v2_hw(u32 err_msk)
17401740
{
1741-
const u8 trans_rx_err_code_prio[] = {
1741+
static const u8 trans_rx_err_code_prio[] = {
17421742
TRANS_RX_ERR_WITH_RXFRAME_CRC_ERR,
17431743
TRANS_RX_ERR_WITH_RXFIS_8B10B_DISP_ERR,
17441744
TRANS_RX_ERR_WITH_RXFRAME_HAVE_ERRPRM,
@@ -1784,7 +1784,7 @@ static int parse_trans_rx_err_code_v2_hw(u32 err_msk)
17841784

17851785
static int parse_dma_tx_err_code_v2_hw(u32 err_msk)
17861786
{
1787-
const u8 dma_tx_err_code_prio[] = {
1787+
static const u8 dma_tx_err_code_prio[] = {
17881788
DMA_TX_UNEXP_XFER_ERR,
17891789
DMA_TX_UNEXP_RETRANS_ERR,
17901790
DMA_TX_XFER_LEN_OVERFLOW,
@@ -1810,7 +1810,7 @@ static int parse_dma_tx_err_code_v2_hw(u32 err_msk)
18101810

18111811
static int parse_sipc_rx_err_code_v2_hw(u32 err_msk)
18121812
{
1813-
const u8 sipc_rx_err_code_prio[] = {
1813+
static const u8 sipc_rx_err_code_prio[] = {
18141814
SIPC_RX_FIS_STATUS_ERR_BIT_VLD,
18151815
SIPC_RX_PIO_WRSETUP_STATUS_DRQ_ERR,
18161816
SIPC_RX_FIS_STATUS_BSY_BIT_ERR,
@@ -1836,7 +1836,7 @@ static int parse_sipc_rx_err_code_v2_hw(u32 err_msk)
18361836

18371837
static int parse_dma_rx_err_code_v2_hw(u32 err_msk)
18381838
{
1839-
const u8 dma_rx_err_code_prio[] = {
1839+
static const u8 dma_rx_err_code_prio[] = {
18401840
DMA_RX_UNKNOWN_FRM_ERR,
18411841
DMA_RX_DATA_LEN_OVERFLOW,
18421842
DMA_RX_DATA_LEN_UNDERFLOW,

drivers/scsi/isci/request.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ static void sci_task_request_build_ssp_task_iu(struct isci_request *ireq)
213213
* @task_context:
214214
*
215215
*/
216-
static void scu_ssp_reqeust_construct_task_context(
216+
static void scu_ssp_request_construct_task_context(
217217
struct isci_request *ireq,
218218
struct scu_task_context *task_context)
219219
{
@@ -425,7 +425,7 @@ static void scu_ssp_io_request_construct_task_context(struct isci_request *ireq,
425425
u8 prot_type = scsi_get_prot_type(scmd);
426426
u8 prot_op = scsi_get_prot_op(scmd);
427427

428-
scu_ssp_reqeust_construct_task_context(ireq, task_context);
428+
scu_ssp_request_construct_task_context(ireq, task_context);
429429

430430
task_context->ssp_command_iu_length =
431431
sizeof(struct ssp_cmd_iu) / sizeof(u32);
@@ -472,7 +472,7 @@ static void scu_ssp_task_request_construct_task_context(struct isci_request *ire
472472
{
473473
struct scu_task_context *task_context = ireq->tc;
474474

475-
scu_ssp_reqeust_construct_task_context(ireq, task_context);
475+
scu_ssp_request_construct_task_context(ireq, task_context);
476476

477477
task_context->control_frame = 1;
478478
task_context->priority = SCU_TASK_PRIORITY_HIGH;
@@ -495,7 +495,7 @@ static void scu_ssp_task_request_construct_task_context(struct isci_request *ire
495495
* the command buffer is complete. none Revisit task context construction to
496496
* determine what is common for SSP/SMP/STP task context structures.
497497
*/
498-
static void scu_sata_reqeust_construct_task_context(
498+
static void scu_sata_request_construct_task_context(
499499
struct isci_request *ireq,
500500
struct scu_task_context *task_context)
501501
{
@@ -562,7 +562,7 @@ static void scu_stp_raw_request_construct_task_context(struct isci_request *ireq
562562
{
563563
struct scu_task_context *task_context = ireq->tc;
564564

565-
scu_sata_reqeust_construct_task_context(ireq, task_context);
565+
scu_sata_request_construct_task_context(ireq, task_context);
566566

567567
task_context->control_frame = 0;
568568
task_context->priority = SCU_TASK_PRIORITY_NORMAL;
@@ -613,7 +613,7 @@ static void sci_stp_optimized_request_construct(struct isci_request *ireq,
613613
struct scu_task_context *task_context = ireq->tc;
614614

615615
/* Build the STP task context structure */
616-
scu_sata_reqeust_construct_task_context(ireq, task_context);
616+
scu_sata_request_construct_task_context(ireq, task_context);
617617

618618
/* Copy over the SGL elements */
619619
sci_request_build_sgl(ireq);
@@ -1401,7 +1401,7 @@ static enum sci_status sci_stp_request_pio_data_out_transmit_data(struct isci_re
14011401
* @data_buffer: The buffer of data to be copied.
14021402
* @length: The length of the data transfer.
14031403
*
1404-
* Copy the data from the buffer for the length specified to the IO reqeust SGL
1404+
* Copy the data from the buffer for the length specified to the IO request SGL
14051405
* specified data region. enum sci_status
14061406
*/
14071407
static enum sci_status

drivers/scsi/libfc/fc_disc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,7 @@ static void fc_disc_gpn_ft_resp(struct fc_seq *sp, struct fc_frame *fp,
573573
event = DISC_EV_FAILED;
574574
}
575575
if (error)
576-
fc_disc_error(disc, fp);
576+
fc_disc_error(disc, ERR_PTR(error));
577577
else if (event != DISC_EV_NONE)
578578
fc_disc_done(disc, event);
579579
fc_frame_free(fp);

drivers/scsi/qedf/qedf_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1227,7 +1227,7 @@ static void qedf_rport_event_handler(struct fc_lport *lport,
12271227

12281228
if (rdata->spp_type != FC_TYPE_FCP) {
12291229
QEDF_INFO(&(qedf->dbg_ctx), QEDF_LOG_DISC,
1230-
"Not offlading since since spp type isn't FCP\n");
1230+
"Not offloading since spp type isn't FCP\n");
12311231
break;
12321232
}
12331233
if (!(rdata->ids.roles & FC_RPORT_ROLE_FCP_TARGET)) {

drivers/scsi/qedi/qedi.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,17 @@
2323
#include <linux/qed/qed_iscsi_if.h>
2424
#include <linux/qed/qed_ll2_if.h>
2525
#include "qedi_version.h"
26+
#include "qedi_nvm_iscsi_cfg.h"
2627

2728
#define QEDI_MODULE_NAME "qedi"
2829

2930
struct qedi_endpoint;
3031

32+
#ifndef GET_FIELD2
33+
#define GET_FIELD2(value, name) \
34+
(((value) & (name ## _MASK)) >> (name ## _OFFSET))
35+
#endif
36+
3137
/*
3238
* PCI function probe defines
3339
*/
@@ -66,6 +72,11 @@ struct qedi_endpoint;
6672
#define QEDI_HW_DMA_BOUNDARY 0xfff
6773
#define QEDI_PATH_HANDLE 0xFE0000000UL
6874

75+
enum qedi_nvm_tgts {
76+
QEDI_NVM_TGT_PRI,
77+
QEDI_NVM_TGT_SEC,
78+
};
79+
6980
struct qedi_uio_ctrl {
7081
/* meta data */
7182
u32 uio_hsi_version;
@@ -283,6 +294,8 @@ struct qedi_ctx {
283294
void *bdq_pbl_list;
284295
dma_addr_t bdq_pbl_list_dma;
285296
u8 bdq_pbl_list_num_entries;
297+
struct nvm_iscsi_cfg *iscsi_cfg;
298+
dma_addr_t nvm_buf_dma;
286299
void __iomem *bdq_primary_prod;
287300
void __iomem *bdq_secondary_prod;
288301
u16 bdq_prod_idx;
@@ -337,6 +350,10 @@ struct qedi_ctx {
337350
bool use_fast_sge;
338351

339352
atomic_t num_offloads;
353+
#define SYSFS_FLAG_FW_SEL_BOOT 2
354+
#define IPV6_LEN 41
355+
#define IPV4_LEN 17
356+
struct iscsi_boot_kset *boot_kset;
340357
};
341358

342359
struct qedi_work {

drivers/scsi/qedi/qedi_fw.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1411,7 +1411,7 @@ static void qedi_tmf_work(struct work_struct *work)
14111411

14121412
list_work = kzalloc(sizeof(*list_work), GFP_ATOMIC);
14131413
if (!list_work) {
1414-
QEDI_ERR(&qedi->dbg_ctx, "Memory alloction failed\n");
1414+
QEDI_ERR(&qedi->dbg_ctx, "Memory allocation failed\n");
14151415
goto abort_ret;
14161416
}
14171417

0 commit comments

Comments
 (0)