Skip to content

Commit

Permalink
Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/gi…
Browse files Browse the repository at this point in the history
…t/jejb/scsi

Pull SCSI updates from James Bottomley:
 "This is mostly updates to the usual drivers: ufs, qedf, mpt3sas, lpfc,
  xfcp, hisi_sas, cxlflash, qla2xxx.

  In the absence of Nic, we're also taking target updates which are
  mostly minor except for the tcmu refactor.

  The only real core change to worry about is the removal of high page
  bouncing (in sas, storvsc and iscsi). This has been well tested and no
  problems have shown up so far"

* tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (268 commits)
  scsi: lpfc: update driver version to 12.0.0.4
  scsi: lpfc: Fix port initialization failure.
  scsi: lpfc: Fix 16gb hbas failing cq create.
  scsi: lpfc: Fix crash in blk_mq layer when executing modprobe -r lpfc
  scsi: lpfc: correct oversubscription of nvme io requests for an adapter
  scsi: lpfc: Fix MDS diagnostics failure (Rx < Tx)
  scsi: hisi_sas: Mark PHY as in reset for nexus reset
  scsi: hisi_sas: Fix return value when get_free_slot() failed
  scsi: hisi_sas: Terminate STP reject quickly for v2 hw
  scsi: hisi_sas: Add v2 hw force PHY function for internal ATA command
  scsi: hisi_sas: Include TMF elements in struct hisi_sas_slot
  scsi: hisi_sas: Try wait commands before before controller reset
  scsi: hisi_sas: Init disks after controller reset
  scsi: hisi_sas: Create a scsi_host_template per HW module
  scsi: hisi_sas: Reset disks when discovered
  scsi: hisi_sas: Add LED feature for v3 hw
  scsi: hisi_sas: Change common allocation mode of device id
  scsi: hisi_sas: change slot index allocation mode
  scsi: hisi_sas: Introduce hisi_sas_phy_set_linkrate()
  scsi: hisi_sas: fix a typo in hisi_sas_task_prep()
  ...
  • Loading branch information
Linus Torvalds committed Jun 10, 2018
2 parents 0c14e43 + 1b5c2cb commit 5f85942
Show file tree
Hide file tree
Showing 152 changed files with 7,234 additions and 2,017 deletions.
1 change: 1 addition & 0 deletions Documentation/driver-api/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ available subsections can be seen below.
edac
scsi
libata
target
mtdnand
miscellaneous
w1
Expand Down
2 changes: 1 addition & 1 deletion Documentation/driver-api/scsi.rst
Original file line number Diff line number Diff line change
Expand Up @@ -334,5 +334,5 @@ todo
~~~~

Parallel (fast/wide/ultra) SCSI, USB, SATA, SAS, Fibre Channel,
FireWire, ATAPI devices, Infiniband, I2O, iSCSI, Parallel ports,
FireWire, ATAPI devices, Infiniband, I2O, Parallel ports,
netlink...
64 changes: 64 additions & 0 deletions Documentation/driver-api/target.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
=================================
target and iSCSI Interfaces Guide
=================================

Introduction and Overview
=========================

TBD

Target core device interfaces
=============================

.. kernel-doc:: drivers/target/target_core_device.c
:export:

Target core transport interfaces
================================

.. kernel-doc:: drivers/target/target_core_transport.c
:export:

Target-supported userspace I/O
==============================

.. kernel-doc:: drivers/target/target_core_user.c
:doc: Userspace I/O

.. kernel-doc:: include/uapi/linux/target_core_user.h
:doc: Ring Design

iSCSI helper functions
======================

.. kernel-doc:: drivers/scsi/libiscsi.c
:export:


iSCSI boot information
======================

.. kernel-doc:: drivers/scsi/iscsi_boot_sysfs.c
:export:


iSCSI transport class
=====================

The file drivers/scsi/scsi_transport_iscsi.c defines transport
attributes for the iSCSI class, which sends SCSI packets over TCP/IP
connections.

.. kernel-doc:: drivers/scsi/scsi_transport_iscsi.c
:export:


iSCSI TCP interfaces
====================

.. kernel-doc:: drivers/scsi/iscsi_tcp.c
:internal:

.. kernel-doc:: drivers/scsi/libiscsi_tcp.c
:export:

2 changes: 1 addition & 1 deletion Documentation/ioctl/ioctl-number.txt
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ Code Seq#(hex) Include File Comments
'J' 00-1F drivers/scsi/gdth_ioctl.h
'K' all linux/kd.h
'L' 00-1F linux/loop.h conflict!
'L' 10-1F drivers/scsi/mpt2sas/mpt2sas_ctl.h conflict!
'L' 10-1F drivers/scsi/mpt3sas/mpt3sas_ctl.h conflict!
'L' 20-2F linux/lightnvm.h
'L' E0-FF linux/ppdd.h encrypted disk device driver
<http://linux01.gwdg.de/~alatham/ppdd.html>
Expand Down
1 change: 0 additions & 1 deletion MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -8446,7 +8446,6 @@ L: linux-scsi@vger.kernel.org
W: http://www.avagotech.com/support/
S: Supported
F: drivers/message/fusion/
F: drivers/scsi/mpt2sas/
F: drivers/scsi/mpt3sas/

LSILOGIC/SYMBIOS/NCR 53C8XX and 53C1010 PCI-SCSI drivers
Expand Down
12 changes: 12 additions & 0 deletions drivers/ata/libata-scsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -5054,6 +5054,18 @@ int ata_sas_port_init(struct ata_port *ap)
}
EXPORT_SYMBOL_GPL(ata_sas_port_init);

int ata_sas_tport_add(struct device *parent, struct ata_port *ap)
{
return ata_tport_add(parent, ap);
}
EXPORT_SYMBOL_GPL(ata_sas_tport_add);

void ata_sas_tport_delete(struct ata_port *ap)
{
ata_tport_delete(ap);
}
EXPORT_SYMBOL_GPL(ata_sas_tport_delete);

/**
* ata_sas_port_destroy - Destroy a SATA port allocated by ata_sas_port_alloc
* @ap: SATA port to destroy
Expand Down
2 changes: 2 additions & 0 deletions drivers/hv/ring_buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,8 @@ int hv_ringbuffer_init(struct hv_ring_buffer_info *ring_info,
ring_info->ring_buffer->feature_bits.value = 1;

ring_info->ring_size = page_cnt << PAGE_SHIFT;
ring_info->ring_size_div10_reciprocal =
reciprocal_value(ring_info->ring_size / 10);
ring_info->ring_datasize = ring_info->ring_size -
sizeof(struct hv_ring_buffer);

Expand Down
4 changes: 2 additions & 2 deletions drivers/message/fusion/lsi/mpi_cnfg.h
Original file line number Diff line number Diff line change
Expand Up @@ -1802,13 +1802,13 @@ typedef struct _CONFIG_PAGE_FC_PORT_0
#define MPI_FCPORTPAGE0_SUPPORT_CLASS_2 (0x00000002)
#define MPI_FCPORTPAGE0_SUPPORT_CLASS_3 (0x00000004)

#define MPI_FCPORTPAGE0_SUPPORT_SPEED_UKNOWN (0x00000000) /* (SNIA)HBA_PORTSPEED_UNKNOWN 0 Unknown - transceiver incapable of reporting */
#define MPI_FCPORTPAGE0_SUPPORT_SPEED_UNKNOWN (0x00000000) /* (SNIA)HBA_PORTSPEED_UNKNOWN 0 Unknown - transceiver incapable of reporting */
#define MPI_FCPORTPAGE0_SUPPORT_1GBIT_SPEED (0x00000001) /* (SNIA)HBA_PORTSPEED_1GBIT 1 1 GBit/sec */
#define MPI_FCPORTPAGE0_SUPPORT_2GBIT_SPEED (0x00000002) /* (SNIA)HBA_PORTSPEED_2GBIT 2 2 GBit/sec */
#define MPI_FCPORTPAGE0_SUPPORT_10GBIT_SPEED (0x00000004) /* (SNIA)HBA_PORTSPEED_10GBIT 4 10 GBit/sec */
#define MPI_FCPORTPAGE0_SUPPORT_4GBIT_SPEED (0x00000008) /* (SNIA)HBA_PORTSPEED_4GBIT 8 4 GBit/sec */

#define MPI_FCPORTPAGE0_CURRENT_SPEED_UKNOWN MPI_FCPORTPAGE0_SUPPORT_SPEED_UKNOWN
#define MPI_FCPORTPAGE0_CURRENT_SPEED_UNKNOWN MPI_FCPORTPAGE0_SUPPORT_SPEED_UNKNOWN
#define MPI_FCPORTPAGE0_CURRENT_SPEED_1GBIT MPI_FCPORTPAGE0_SUPPORT_1GBIT_SPEED
#define MPI_FCPORTPAGE0_CURRENT_SPEED_2GBIT MPI_FCPORTPAGE0_SUPPORT_2GBIT_SPEED
#define MPI_FCPORTPAGE0_CURRENT_SPEED_10GBIT MPI_FCPORTPAGE0_SUPPORT_10GBIT_SPEED
Expand Down
2 changes: 1 addition & 1 deletion drivers/message/fusion/mptbase.c
Original file line number Diff line number Diff line change
Expand Up @@ -7600,7 +7600,7 @@ mpt_display_event_info(MPT_ADAPTER *ioc, EventNotificationReply_t *pEventReply)

snprintf(evStr, EVENT_DESCR_STR_SZ,
"SAS Initiator Device Table Overflow: max initiators=%02d "
"current initators=%02d",
"current initiators=%02d",
max_init, current_init);
break;
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/message/fusion/mptfc.c
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,7 @@ mptfc_display_port_link_speed(MPT_ADAPTER *ioc, int portnum, FCPortPage0_t *pp0d
state = pp0dest->PortState;

if (state != MPI_FCPORTPAGE0_PORTSTATE_OFFLINE &&
new_speed != MPI_FCPORTPAGE0_CURRENT_SPEED_UKNOWN) {
new_speed != MPI_FCPORTPAGE0_CURRENT_SPEED_UNKNOWN) {

old = old_speed == MPI_FCPORTPAGE0_CURRENT_SPEED_1GBIT ? "1 Gbps" :
old_speed == MPI_FCPORTPAGE0_CURRENT_SPEED_2GBIT ? "2 Gbps" :
Expand Down
2 changes: 1 addition & 1 deletion drivers/message/fusion/mptlan.c
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,7 @@ mpt_lan_send_reply(struct net_device *dev, LANSendReply_t *pSendRep)
}

/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
static int
static netdev_tx_t
mpt_lan_sdu_send (struct sk_buff *skb, struct net_device *dev)
{
struct mpt_lan_priv *priv = netdev_priv(dev);
Expand Down
2 changes: 1 addition & 1 deletion drivers/message/fusion/mptsas.c
Original file line number Diff line number Diff line change
Expand Up @@ -4320,7 +4320,7 @@ mptsas_hotplug_work(MPT_ADAPTER *ioc, struct fw_event_work *fw_event,
if (ioc->raid_data.pIocPg2->RaidVolume[i].VolumeID ==
hot_plug_info->id) {
printk(MYIOC_s_WARN_FMT "firmware bug: unable "
"to add hidden disk - target_id matchs "
"to add hidden disk - target_id matches "
"volume_id\n", ioc->name);
mptsas_free_fw_event(ioc, fw_event);
return;
Expand Down
1 change: 0 additions & 1 deletion drivers/net/hyperv/hyperv_net.h
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,6 @@ struct netvsc_device;
struct net_device_context;

extern u32 netvsc_ring_bytes;
extern struct reciprocal_value netvsc_ring_reciprocal;

struct netvsc_device *netvsc_device_add(struct hv_device *device,
const struct netvsc_device_info *info);
Expand Down
18 changes: 3 additions & 15 deletions drivers/net/hyperv/netvsc.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
#include <linux/vmalloc.h>
#include <linux/rtnetlink.h>
#include <linux/prefetch.h>
#include <linux/reciprocal_div.h>

#include <asm/sync_bitops.h>

Expand Down Expand Up @@ -635,17 +634,6 @@ void netvsc_device_remove(struct hv_device *device)
#define RING_AVAIL_PERCENT_HIWATER 20
#define RING_AVAIL_PERCENT_LOWATER 10

/*
* Get the percentage of available bytes to write in the ring.
* The return value is in range from 0 to 100.
*/
static u32 hv_ringbuf_avail_percent(const struct hv_ring_buffer_info *ring_info)
{
u32 avail_write = hv_get_bytes_to_write(ring_info);

return reciprocal_divide(avail_write * 100, netvsc_ring_reciprocal);
}

static inline void netvsc_free_send_slot(struct netvsc_device *net_device,
u32 index)
{
Expand Down Expand Up @@ -694,8 +682,8 @@ static void netvsc_send_tx_complete(struct net_device *ndev,
struct netdev_queue *txq = netdev_get_tx_queue(ndev, q_idx);

if (netif_tx_queue_stopped(txq) &&
(hv_ringbuf_avail_percent(&channel->outbound) > RING_AVAIL_PERCENT_HIWATER ||
queue_sends < 1)) {
(hv_get_avail_to_write_percent(&channel->outbound) >
RING_AVAIL_PERCENT_HIWATER || queue_sends < 1)) {
netif_tx_wake_queue(txq);
ndev_ctx->eth_stats.wake_queue++;
}
Expand Down Expand Up @@ -802,7 +790,7 @@ static inline int netvsc_send_pkt(
struct netdev_queue *txq = netdev_get_tx_queue(ndev, packet->q_idx);
u64 req_id;
int ret;
u32 ring_avail = hv_ringbuf_avail_percent(&out_channel->outbound);
u32 ring_avail = hv_get_avail_to_write_percent(&out_channel->outbound);

nvmsg.hdr.msg_type = NVSP_MSG1_TYPE_SEND_RNDIS_PKT;
if (skb)
Expand Down
3 changes: 0 additions & 3 deletions drivers/net/hyperv/netvsc_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
#include <linux/slab.h>
#include <linux/rtnetlink.h>
#include <linux/netpoll.h>
#include <linux/reciprocal_div.h>

#include <net/arp.h>
#include <net/route.h>
Expand All @@ -59,7 +58,6 @@ static unsigned int ring_size __ro_after_init = 128;
module_param(ring_size, uint, 0444);
MODULE_PARM_DESC(ring_size, "Ring buffer size (# of pages)");
unsigned int netvsc_ring_bytes __ro_after_init;
struct reciprocal_value netvsc_ring_reciprocal __ro_after_init;

static const u32 default_msg = NETIF_MSG_DRV | NETIF_MSG_PROBE |
NETIF_MSG_LINK | NETIF_MSG_IFUP |
Expand Down Expand Up @@ -2130,7 +2128,6 @@ static int __init netvsc_drv_init(void)
ring_size);
}
netvsc_ring_bytes = ring_size * PAGE_SIZE;
netvsc_ring_reciprocal = reciprocal_value(netvsc_ring_bytes);

ret = vmbus_driver_register(&netvsc_drv);
if (ret)
Expand Down
90 changes: 73 additions & 17 deletions drivers/s390/scsi/zfcp_dbf.c
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,8 @@ void zfcp_dbf_rec_trig(char *tag, struct zfcp_adapter *adapter,
struct list_head *entry;
unsigned long flags;

lockdep_assert_held(&adapter->erp_lock);

if (unlikely(!debug_level_enabled(dbf->rec, level)))
return;

Expand Down Expand Up @@ -599,16 +601,18 @@ void zfcp_dbf_san_in_els(char *tag, struct zfcp_fsf_req *fsf)
}

/**
* zfcp_dbf_scsi - trace event for scsi commands
* @tag: identifier for event
* @sc: pointer to struct scsi_cmnd
* @fsf: pointer to struct zfcp_fsf_req
* zfcp_dbf_scsi_common() - Common trace event helper for scsi.
* @tag: Identifier for event.
* @level: trace level of event.
* @sdev: Pointer to SCSI device as context for this event.
* @sc: Pointer to SCSI command, or NULL with task management function (TMF).
* @fsf: Pointer to FSF request, or NULL.
*/
void zfcp_dbf_scsi(char *tag, int level, struct scsi_cmnd *sc,
struct zfcp_fsf_req *fsf)
void zfcp_dbf_scsi_common(char *tag, int level, struct scsi_device *sdev,
struct scsi_cmnd *sc, struct zfcp_fsf_req *fsf)
{
struct zfcp_adapter *adapter =
(struct zfcp_adapter *) sc->device->host->hostdata[0];
(struct zfcp_adapter *) sdev->host->hostdata[0];
struct zfcp_dbf *dbf = adapter->dbf;
struct zfcp_dbf_scsi *rec = &dbf->scsi_buf;
struct fcp_resp_with_ext *fcp_rsp;
Expand All @@ -620,16 +624,28 @@ void zfcp_dbf_scsi(char *tag, int level, struct scsi_cmnd *sc,

memcpy(rec->tag, tag, ZFCP_DBF_TAG_LEN);
rec->id = ZFCP_DBF_SCSI_CMND;
rec->scsi_result = sc->result;
rec->scsi_retries = sc->retries;
rec->scsi_allowed = sc->allowed;
rec->scsi_id = sc->device->id;
rec->scsi_lun = (u32)sc->device->lun;
rec->scsi_lun_64_hi = (u32)(sc->device->lun >> 32);
rec->host_scribble = (unsigned long)sc->host_scribble;

memcpy(rec->scsi_opcode, sc->cmnd,
min((int)sc->cmd_len, ZFCP_DBF_SCSI_OPCODE));
if (sc) {
rec->scsi_result = sc->result;
rec->scsi_retries = sc->retries;
rec->scsi_allowed = sc->allowed;
rec->scsi_id = sc->device->id;
rec->scsi_lun = (u32)sc->device->lun;
rec->scsi_lun_64_hi = (u32)(sc->device->lun >> 32);
rec->host_scribble = (unsigned long)sc->host_scribble;

memcpy(rec->scsi_opcode, sc->cmnd,
min_t(int, sc->cmd_len, ZFCP_DBF_SCSI_OPCODE));
} else {
rec->scsi_result = ~0;
rec->scsi_retries = ~0;
rec->scsi_allowed = ~0;
rec->scsi_id = sdev->id;
rec->scsi_lun = (u32)sdev->lun;
rec->scsi_lun_64_hi = (u32)(sdev->lun >> 32);
rec->host_scribble = ~0;

memset(rec->scsi_opcode, 0xff, ZFCP_DBF_SCSI_OPCODE);
}

if (fsf) {
rec->fsf_req_id = fsf->req_id;
Expand Down Expand Up @@ -664,6 +680,46 @@ void zfcp_dbf_scsi(char *tag, int level, struct scsi_cmnd *sc,
spin_unlock_irqrestore(&dbf->scsi_lock, flags);
}

/**
* zfcp_dbf_scsi_eh() - Trace event for special cases of scsi_eh callbacks.
* @tag: Identifier for event.
* @adapter: Pointer to zfcp adapter as context for this event.
* @scsi_id: SCSI ID/target to indicate scope of task management function (TMF).
* @ret: Return value of calling function.
*
* This SCSI trace variant does not depend on any of:
* scsi_cmnd, zfcp_fsf_req, scsi_device.
*/
void zfcp_dbf_scsi_eh(char *tag, struct zfcp_adapter *adapter,
unsigned int scsi_id, int ret)
{
struct zfcp_dbf *dbf = adapter->dbf;
struct zfcp_dbf_scsi *rec = &dbf->scsi_buf;
unsigned long flags;
static int const level = 1;

if (unlikely(!debug_level_enabled(adapter->dbf->scsi, level)))
return;

spin_lock_irqsave(&dbf->scsi_lock, flags);
memset(rec, 0, sizeof(*rec));

memcpy(rec->tag, tag, ZFCP_DBF_TAG_LEN);
rec->id = ZFCP_DBF_SCSI_CMND;
rec->scsi_result = ret; /* re-use field, int is 4 bytes and fits */
rec->scsi_retries = ~0;
rec->scsi_allowed = ~0;
rec->fcp_rsp_info = ~0;
rec->scsi_id = scsi_id;
rec->scsi_lun = (u32)ZFCP_DBF_INVALID_LUN;
rec->scsi_lun_64_hi = (u32)(ZFCP_DBF_INVALID_LUN >> 32);
rec->host_scribble = ~0;
memset(rec->scsi_opcode, 0xff, ZFCP_DBF_SCSI_OPCODE);

debug_event(dbf->scsi, level, rec, sizeof(*rec));
spin_unlock_irqrestore(&dbf->scsi_lock, flags);
}

static debug_info_t *zfcp_dbf_reg(const char *name, int size, int rec_size)
{
struct debug_info *d;
Expand Down
Loading

0 comments on commit 5f85942

Please sign in to comment.