Skip to content

Commit

Permalink
Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/g…
Browse files Browse the repository at this point in the history
…it/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
  • Loading branch information
Linus Torvalds committed Jul 17, 2017
2 parents cb0fbbf + 6f37e21 commit e8e9941
Show file tree
Hide file tree
Showing 12 changed files with 674 additions and 21 deletions.
11 changes: 7 additions & 4 deletions drivers/scsi/cxlflash/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -3401,9 +3401,10 @@ static int cxlflash_afu_debug(struct cxlflash_cfg *cfg,
if (is_write) {
req_flags |= SISL_REQ_FLAGS_HOST_WRITE;

rc = copy_from_user(kbuf, ubuf, ulen);
if (unlikely(rc))
if (copy_from_user(kbuf, ubuf, ulen)) {
rc = -EFAULT;
goto out;
}
}
}

Expand Down Expand Up @@ -3431,8 +3432,10 @@ static int cxlflash_afu_debug(struct cxlflash_cfg *cfg,
goto out;
}

if (ulen && !is_write)
rc = copy_to_user(ubuf, kbuf, ulen);
if (ulen && !is_write) {
if (copy_to_user(ubuf, kbuf, ulen))
rc = -EFAULT;
}
out:
kfree(buf);
dev_dbg(dev, "%s: returning rc=%d\n", __func__, rc);
Expand Down
10 changes: 5 additions & 5 deletions drivers/scsi/hisi_sas/hisi_sas_v2_hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -1693,7 +1693,7 @@ static int prep_ssp_v2_hw(struct hisi_hba *hisi_hba,

static int parse_trans_tx_err_code_v2_hw(u32 err_msk)
{
const u8 trans_tx_err_code_prio[] = {
static const u8 trans_tx_err_code_prio[] = {
TRANS_TX_OPEN_FAIL_WITH_IT_NEXUS_LOSS,
TRANS_TX_ERR_PHY_NOT_ENABLE,
TRANS_TX_OPEN_CNX_ERR_WRONG_DESTINATION,
Expand Down Expand Up @@ -1738,7 +1738,7 @@ static int parse_trans_tx_err_code_v2_hw(u32 err_msk)

static int parse_trans_rx_err_code_v2_hw(u32 err_msk)
{
const u8 trans_rx_err_code_prio[] = {
static const u8 trans_rx_err_code_prio[] = {
TRANS_RX_ERR_WITH_RXFRAME_CRC_ERR,
TRANS_RX_ERR_WITH_RXFIS_8B10B_DISP_ERR,
TRANS_RX_ERR_WITH_RXFRAME_HAVE_ERRPRM,
Expand Down Expand Up @@ -1784,7 +1784,7 @@ static int parse_trans_rx_err_code_v2_hw(u32 err_msk)

static int parse_dma_tx_err_code_v2_hw(u32 err_msk)
{
const u8 dma_tx_err_code_prio[] = {
static const u8 dma_tx_err_code_prio[] = {
DMA_TX_UNEXP_XFER_ERR,
DMA_TX_UNEXP_RETRANS_ERR,
DMA_TX_XFER_LEN_OVERFLOW,
Expand All @@ -1810,7 +1810,7 @@ static int parse_dma_tx_err_code_v2_hw(u32 err_msk)

static int parse_sipc_rx_err_code_v2_hw(u32 err_msk)
{
const u8 sipc_rx_err_code_prio[] = {
static const u8 sipc_rx_err_code_prio[] = {
SIPC_RX_FIS_STATUS_ERR_BIT_VLD,
SIPC_RX_PIO_WRSETUP_STATUS_DRQ_ERR,
SIPC_RX_FIS_STATUS_BSY_BIT_ERR,
Expand All @@ -1836,7 +1836,7 @@ static int parse_sipc_rx_err_code_v2_hw(u32 err_msk)

static int parse_dma_rx_err_code_v2_hw(u32 err_msk)
{
const u8 dma_rx_err_code_prio[] = {
static const u8 dma_rx_err_code_prio[] = {
DMA_RX_UNKNOWN_FRM_ERR,
DMA_RX_DATA_LEN_OVERFLOW,
DMA_RX_DATA_LEN_UNDERFLOW,
Expand Down
14 changes: 7 additions & 7 deletions drivers/scsi/isci/request.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ static void sci_task_request_build_ssp_task_iu(struct isci_request *ireq)
* @task_context:
*
*/
static void scu_ssp_reqeust_construct_task_context(
static void scu_ssp_request_construct_task_context(
struct isci_request *ireq,
struct scu_task_context *task_context)
{
Expand Down Expand Up @@ -425,7 +425,7 @@ static void scu_ssp_io_request_construct_task_context(struct isci_request *ireq,
u8 prot_type = scsi_get_prot_type(scmd);
u8 prot_op = scsi_get_prot_op(scmd);

scu_ssp_reqeust_construct_task_context(ireq, task_context);
scu_ssp_request_construct_task_context(ireq, task_context);

task_context->ssp_command_iu_length =
sizeof(struct ssp_cmd_iu) / sizeof(u32);
Expand Down Expand Up @@ -472,7 +472,7 @@ static void scu_ssp_task_request_construct_task_context(struct isci_request *ire
{
struct scu_task_context *task_context = ireq->tc;

scu_ssp_reqeust_construct_task_context(ireq, task_context);
scu_ssp_request_construct_task_context(ireq, task_context);

task_context->control_frame = 1;
task_context->priority = SCU_TASK_PRIORITY_HIGH;
Expand All @@ -495,7 +495,7 @@ static void scu_ssp_task_request_construct_task_context(struct isci_request *ire
* the command buffer is complete. none Revisit task context construction to
* determine what is common for SSP/SMP/STP task context structures.
*/
static void scu_sata_reqeust_construct_task_context(
static void scu_sata_request_construct_task_context(
struct isci_request *ireq,
struct scu_task_context *task_context)
{
Expand Down Expand Up @@ -562,7 +562,7 @@ static void scu_stp_raw_request_construct_task_context(struct isci_request *ireq
{
struct scu_task_context *task_context = ireq->tc;

scu_sata_reqeust_construct_task_context(ireq, task_context);
scu_sata_request_construct_task_context(ireq, task_context);

task_context->control_frame = 0;
task_context->priority = SCU_TASK_PRIORITY_NORMAL;
Expand Down Expand Up @@ -613,7 +613,7 @@ static void sci_stp_optimized_request_construct(struct isci_request *ireq,
struct scu_task_context *task_context = ireq->tc;

/* Build the STP task context structure */
scu_sata_reqeust_construct_task_context(ireq, task_context);
scu_sata_request_construct_task_context(ireq, task_context);

/* Copy over the SGL elements */
sci_request_build_sgl(ireq);
Expand Down Expand Up @@ -1401,7 +1401,7 @@ static enum sci_status sci_stp_request_pio_data_out_transmit_data(struct isci_re
* @data_buffer: The buffer of data to be copied.
* @length: The length of the data transfer.
*
* Copy the data from the buffer for the length specified to the IO reqeust SGL
* Copy the data from the buffer for the length specified to the IO request SGL
* specified data region. enum sci_status
*/
static enum sci_status
Expand Down
2 changes: 1 addition & 1 deletion drivers/scsi/libfc/fc_disc.c
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ static void fc_disc_gpn_ft_resp(struct fc_seq *sp, struct fc_frame *fp,
event = DISC_EV_FAILED;
}
if (error)
fc_disc_error(disc, fp);
fc_disc_error(disc, ERR_PTR(error));
else if (event != DISC_EV_NONE)
fc_disc_done(disc, event);
fc_frame_free(fp);
Expand Down
2 changes: 1 addition & 1 deletion drivers/scsi/qedf/qedf_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1227,7 +1227,7 @@ static void qedf_rport_event_handler(struct fc_lport *lport,

if (rdata->spp_type != FC_TYPE_FCP) {
QEDF_INFO(&(qedf->dbg_ctx), QEDF_LOG_DISC,
"Not offlading since since spp type isn't FCP\n");
"Not offloading since spp type isn't FCP\n");
break;
}
if (!(rdata->ids.roles & FC_RPORT_ROLE_FCP_TARGET)) {
Expand Down
17 changes: 17 additions & 0 deletions drivers/scsi/qedi/qedi.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,17 @@
#include <linux/qed/qed_iscsi_if.h>
#include <linux/qed/qed_ll2_if.h>
#include "qedi_version.h"
#include "qedi_nvm_iscsi_cfg.h"

#define QEDI_MODULE_NAME "qedi"

struct qedi_endpoint;

#ifndef GET_FIELD2
#define GET_FIELD2(value, name) \
(((value) & (name ## _MASK)) >> (name ## _OFFSET))
#endif

/*
* PCI function probe defines
*/
Expand Down Expand Up @@ -66,6 +72,11 @@ struct qedi_endpoint;
#define QEDI_HW_DMA_BOUNDARY 0xfff
#define QEDI_PATH_HANDLE 0xFE0000000UL

enum qedi_nvm_tgts {
QEDI_NVM_TGT_PRI,
QEDI_NVM_TGT_SEC,
};

struct qedi_uio_ctrl {
/* meta data */
u32 uio_hsi_version;
Expand Down Expand Up @@ -283,6 +294,8 @@ struct qedi_ctx {
void *bdq_pbl_list;
dma_addr_t bdq_pbl_list_dma;
u8 bdq_pbl_list_num_entries;
struct nvm_iscsi_cfg *iscsi_cfg;
dma_addr_t nvm_buf_dma;
void __iomem *bdq_primary_prod;
void __iomem *bdq_secondary_prod;
u16 bdq_prod_idx;
Expand Down Expand Up @@ -337,6 +350,10 @@ struct qedi_ctx {
bool use_fast_sge;

atomic_t num_offloads;
#define SYSFS_FLAG_FW_SEL_BOOT 2
#define IPV6_LEN 41
#define IPV4_LEN 17
struct iscsi_boot_kset *boot_kset;
};

struct qedi_work {
Expand Down
2 changes: 1 addition & 1 deletion drivers/scsi/qedi/qedi_fw.c
Original file line number Diff line number Diff line change
Expand Up @@ -1411,7 +1411,7 @@ static void qedi_tmf_work(struct work_struct *work)

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

Expand Down
Loading

0 comments on commit e8e9941

Please sign in to comment.