Skip to content

Commit 5f85942

Browse files
committed
Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/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() ...
2 parents 0c14e43 + 1b5c2cb commit 5f85942

File tree

152 files changed

+7234
-2017
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

152 files changed

+7234
-2017
lines changed

Documentation/driver-api/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ available subsections can be seen below.
3636
edac
3737
scsi
3838
libata
39+
target
3940
mtdnand
4041
miscellaneous
4142
w1

Documentation/driver-api/scsi.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,5 +334,5 @@ todo
334334
~~~~
335335

336336
Parallel (fast/wide/ultra) SCSI, USB, SATA, SAS, Fibre Channel,
337-
FireWire, ATAPI devices, Infiniband, I2O, iSCSI, Parallel ports,
337+
FireWire, ATAPI devices, Infiniband, I2O, Parallel ports,
338338
netlink...

Documentation/driver-api/target.rst

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
=================================
2+
target and iSCSI Interfaces Guide
3+
=================================
4+
5+
Introduction and Overview
6+
=========================
7+
8+
TBD
9+
10+
Target core device interfaces
11+
=============================
12+
13+
.. kernel-doc:: drivers/target/target_core_device.c
14+
:export:
15+
16+
Target core transport interfaces
17+
================================
18+
19+
.. kernel-doc:: drivers/target/target_core_transport.c
20+
:export:
21+
22+
Target-supported userspace I/O
23+
==============================
24+
25+
.. kernel-doc:: drivers/target/target_core_user.c
26+
:doc: Userspace I/O
27+
28+
.. kernel-doc:: include/uapi/linux/target_core_user.h
29+
:doc: Ring Design
30+
31+
iSCSI helper functions
32+
======================
33+
34+
.. kernel-doc:: drivers/scsi/libiscsi.c
35+
:export:
36+
37+
38+
iSCSI boot information
39+
======================
40+
41+
.. kernel-doc:: drivers/scsi/iscsi_boot_sysfs.c
42+
:export:
43+
44+
45+
iSCSI transport class
46+
=====================
47+
48+
The file drivers/scsi/scsi_transport_iscsi.c defines transport
49+
attributes for the iSCSI class, which sends SCSI packets over TCP/IP
50+
connections.
51+
52+
.. kernel-doc:: drivers/scsi/scsi_transport_iscsi.c
53+
:export:
54+
55+
56+
iSCSI TCP interfaces
57+
====================
58+
59+
.. kernel-doc:: drivers/scsi/iscsi_tcp.c
60+
:internal:
61+
62+
.. kernel-doc:: drivers/scsi/libiscsi_tcp.c
63+
:export:
64+

Documentation/ioctl/ioctl-number.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ Code Seq#(hex) Include File Comments
151151
'J' 00-1F drivers/scsi/gdth_ioctl.h
152152
'K' all linux/kd.h
153153
'L' 00-1F linux/loop.h conflict!
154-
'L' 10-1F drivers/scsi/mpt2sas/mpt2sas_ctl.h conflict!
154+
'L' 10-1F drivers/scsi/mpt3sas/mpt3sas_ctl.h conflict!
155155
'L' 20-2F linux/lightnvm.h
156156
'L' E0-FF linux/ppdd.h encrypted disk device driver
157157
<http://linux01.gwdg.de/~alatham/ppdd.html>

MAINTAINERS

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8446,7 +8446,6 @@ L: [email protected]
84468446
W: http://www.avagotech.com/support/
84478447
S: Supported
84488448
F: drivers/message/fusion/
8449-
F: drivers/scsi/mpt2sas/
84508449
F: drivers/scsi/mpt3sas/
84518450

84528451
LSILOGIC/SYMBIOS/NCR 53C8XX and 53C1010 PCI-SCSI drivers

drivers/ata/libata-scsi.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5054,6 +5054,18 @@ int ata_sas_port_init(struct ata_port *ap)
50545054
}
50555055
EXPORT_SYMBOL_GPL(ata_sas_port_init);
50565056

5057+
int ata_sas_tport_add(struct device *parent, struct ata_port *ap)
5058+
{
5059+
return ata_tport_add(parent, ap);
5060+
}
5061+
EXPORT_SYMBOL_GPL(ata_sas_tport_add);
5062+
5063+
void ata_sas_tport_delete(struct ata_port *ap)
5064+
{
5065+
ata_tport_delete(ap);
5066+
}
5067+
EXPORT_SYMBOL_GPL(ata_sas_tport_delete);
5068+
50575069
/**
50585070
* ata_sas_port_destroy - Destroy a SATA port allocated by ata_sas_port_alloc
50595071
* @ap: SATA port to destroy

drivers/hv/ring_buffer.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,8 @@ int hv_ringbuffer_init(struct hv_ring_buffer_info *ring_info,
227227
ring_info->ring_buffer->feature_bits.value = 1;
228228

229229
ring_info->ring_size = page_cnt << PAGE_SHIFT;
230+
ring_info->ring_size_div10_reciprocal =
231+
reciprocal_value(ring_info->ring_size / 10);
230232
ring_info->ring_datasize = ring_info->ring_size -
231233
sizeof(struct hv_ring_buffer);
232234

drivers/message/fusion/lsi/mpi_cnfg.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1802,13 +1802,13 @@ typedef struct _CONFIG_PAGE_FC_PORT_0
18021802
#define MPI_FCPORTPAGE0_SUPPORT_CLASS_2 (0x00000002)
18031803
#define MPI_FCPORTPAGE0_SUPPORT_CLASS_3 (0x00000004)
18041804

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

1811-
#define MPI_FCPORTPAGE0_CURRENT_SPEED_UKNOWN MPI_FCPORTPAGE0_SUPPORT_SPEED_UKNOWN
1811+
#define MPI_FCPORTPAGE0_CURRENT_SPEED_UNKNOWN MPI_FCPORTPAGE0_SUPPORT_SPEED_UNKNOWN
18121812
#define MPI_FCPORTPAGE0_CURRENT_SPEED_1GBIT MPI_FCPORTPAGE0_SUPPORT_1GBIT_SPEED
18131813
#define MPI_FCPORTPAGE0_CURRENT_SPEED_2GBIT MPI_FCPORTPAGE0_SUPPORT_2GBIT_SPEED
18141814
#define MPI_FCPORTPAGE0_CURRENT_SPEED_10GBIT MPI_FCPORTPAGE0_SUPPORT_10GBIT_SPEED

drivers/message/fusion/mptbase.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7600,7 +7600,7 @@ mpt_display_event_info(MPT_ADAPTER *ioc, EventNotificationReply_t *pEventReply)
76007600

76017601
snprintf(evStr, EVENT_DESCR_STR_SZ,
76027602
"SAS Initiator Device Table Overflow: max initiators=%02d "
7603-
"current initators=%02d",
7603+
"current initiators=%02d",
76047604
max_init, current_init);
76057605
break;
76067606
}

drivers/message/fusion/mptfc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,7 @@ mptfc_display_port_link_speed(MPT_ADAPTER *ioc, int portnum, FCPortPage0_t *pp0d
693693
state = pp0dest->PortState;
694694

695695
if (state != MPI_FCPORTPAGE0_PORTSTATE_OFFLINE &&
696-
new_speed != MPI_FCPORTPAGE0_CURRENT_SPEED_UKNOWN) {
696+
new_speed != MPI_FCPORTPAGE0_CURRENT_SPEED_UNKNOWN) {
697697

698698
old = old_speed == MPI_FCPORTPAGE0_CURRENT_SPEED_1GBIT ? "1 Gbps" :
699699
old_speed == MPI_FCPORTPAGE0_CURRENT_SPEED_2GBIT ? "2 Gbps" :

drivers/message/fusion/mptlan.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,7 @@ mpt_lan_send_reply(struct net_device *dev, LANSendReply_t *pSendRep)
670670
}
671671

672672
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
673-
static int
673+
static netdev_tx_t
674674
mpt_lan_sdu_send (struct sk_buff *skb, struct net_device *dev)
675675
{
676676
struct mpt_lan_priv *priv = netdev_priv(dev);

drivers/message/fusion/mptsas.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4320,7 +4320,7 @@ mptsas_hotplug_work(MPT_ADAPTER *ioc, struct fw_event_work *fw_event,
43204320
if (ioc->raid_data.pIocPg2->RaidVolume[i].VolumeID ==
43214321
hot_plug_info->id) {
43224322
printk(MYIOC_s_WARN_FMT "firmware bug: unable "
4323-
"to add hidden disk - target_id matchs "
4323+
"to add hidden disk - target_id matches "
43244324
"volume_id\n", ioc->name);
43254325
mptsas_free_fw_event(ioc, fw_event);
43264326
return;

drivers/net/hyperv/hyperv_net.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,6 @@ struct netvsc_device;
189189
struct net_device_context;
190190

191191
extern u32 netvsc_ring_bytes;
192-
extern struct reciprocal_value netvsc_ring_reciprocal;
193192

194193
struct netvsc_device *netvsc_device_add(struct hv_device *device,
195194
const struct netvsc_device_info *info);

drivers/net/hyperv/netvsc.c

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
#include <linux/vmalloc.h>
3232
#include <linux/rtnetlink.h>
3333
#include <linux/prefetch.h>
34-
#include <linux/reciprocal_div.h>
3534

3635
#include <asm/sync_bitops.h>
3736

@@ -635,17 +634,6 @@ void netvsc_device_remove(struct hv_device *device)
635634
#define RING_AVAIL_PERCENT_HIWATER 20
636635
#define RING_AVAIL_PERCENT_LOWATER 10
637636

638-
/*
639-
* Get the percentage of available bytes to write in the ring.
640-
* The return value is in range from 0 to 100.
641-
*/
642-
static u32 hv_ringbuf_avail_percent(const struct hv_ring_buffer_info *ring_info)
643-
{
644-
u32 avail_write = hv_get_bytes_to_write(ring_info);
645-
646-
return reciprocal_divide(avail_write * 100, netvsc_ring_reciprocal);
647-
}
648-
649637
static inline void netvsc_free_send_slot(struct netvsc_device *net_device,
650638
u32 index)
651639
{
@@ -694,8 +682,8 @@ static void netvsc_send_tx_complete(struct net_device *ndev,
694682
struct netdev_queue *txq = netdev_get_tx_queue(ndev, q_idx);
695683

696684
if (netif_tx_queue_stopped(txq) &&
697-
(hv_ringbuf_avail_percent(&channel->outbound) > RING_AVAIL_PERCENT_HIWATER ||
698-
queue_sends < 1)) {
685+
(hv_get_avail_to_write_percent(&channel->outbound) >
686+
RING_AVAIL_PERCENT_HIWATER || queue_sends < 1)) {
699687
netif_tx_wake_queue(txq);
700688
ndev_ctx->eth_stats.wake_queue++;
701689
}
@@ -802,7 +790,7 @@ static inline int netvsc_send_pkt(
802790
struct netdev_queue *txq = netdev_get_tx_queue(ndev, packet->q_idx);
803791
u64 req_id;
804792
int ret;
805-
u32 ring_avail = hv_ringbuf_avail_percent(&out_channel->outbound);
793+
u32 ring_avail = hv_get_avail_to_write_percent(&out_channel->outbound);
806794

807795
nvmsg.hdr.msg_type = NVSP_MSG1_TYPE_SEND_RNDIS_PKT;
808796
if (skb)

drivers/net/hyperv/netvsc_drv.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
#include <linux/slab.h>
3636
#include <linux/rtnetlink.h>
3737
#include <linux/netpoll.h>
38-
#include <linux/reciprocal_div.h>
3938

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

6462
static const u32 default_msg = NETIF_MSG_DRV | NETIF_MSG_PROBE |
6563
NETIF_MSG_LINK | NETIF_MSG_IFUP |
@@ -2130,7 +2128,6 @@ static int __init netvsc_drv_init(void)
21302128
ring_size);
21312129
}
21322130
netvsc_ring_bytes = ring_size * PAGE_SIZE;
2133-
netvsc_ring_reciprocal = reciprocal_value(netvsc_ring_bytes);
21342131

21352132
ret = vmbus_driver_register(&netvsc_drv);
21362133
if (ret)

drivers/s390/scsi/zfcp_dbf.c

Lines changed: 73 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,8 @@ void zfcp_dbf_rec_trig(char *tag, struct zfcp_adapter *adapter,
285285
struct list_head *entry;
286286
unsigned long flags;
287287

288+
lockdep_assert_held(&adapter->erp_lock);
289+
288290
if (unlikely(!debug_level_enabled(dbf->rec, level)))
289291
return;
290292

@@ -599,16 +601,18 @@ void zfcp_dbf_san_in_els(char *tag, struct zfcp_fsf_req *fsf)
599601
}
600602

601603
/**
602-
* zfcp_dbf_scsi - trace event for scsi commands
603-
* @tag: identifier for event
604-
* @sc: pointer to struct scsi_cmnd
605-
* @fsf: pointer to struct zfcp_fsf_req
604+
* zfcp_dbf_scsi_common() - Common trace event helper for scsi.
605+
* @tag: Identifier for event.
606+
* @level: trace level of event.
607+
* @sdev: Pointer to SCSI device as context for this event.
608+
* @sc: Pointer to SCSI command, or NULL with task management function (TMF).
609+
* @fsf: Pointer to FSF request, or NULL.
606610
*/
607-
void zfcp_dbf_scsi(char *tag, int level, struct scsi_cmnd *sc,
608-
struct zfcp_fsf_req *fsf)
611+
void zfcp_dbf_scsi_common(char *tag, int level, struct scsi_device *sdev,
612+
struct scsi_cmnd *sc, struct zfcp_fsf_req *fsf)
609613
{
610614
struct zfcp_adapter *adapter =
611-
(struct zfcp_adapter *) sc->device->host->hostdata[0];
615+
(struct zfcp_adapter *) sdev->host->hostdata[0];
612616
struct zfcp_dbf *dbf = adapter->dbf;
613617
struct zfcp_dbf_scsi *rec = &dbf->scsi_buf;
614618
struct fcp_resp_with_ext *fcp_rsp;
@@ -620,16 +624,28 @@ void zfcp_dbf_scsi(char *tag, int level, struct scsi_cmnd *sc,
620624

621625
memcpy(rec->tag, tag, ZFCP_DBF_TAG_LEN);
622626
rec->id = ZFCP_DBF_SCSI_CMND;
623-
rec->scsi_result = sc->result;
624-
rec->scsi_retries = sc->retries;
625-
rec->scsi_allowed = sc->allowed;
626-
rec->scsi_id = sc->device->id;
627-
rec->scsi_lun = (u32)sc->device->lun;
628-
rec->scsi_lun_64_hi = (u32)(sc->device->lun >> 32);
629-
rec->host_scribble = (unsigned long)sc->host_scribble;
630-
631-
memcpy(rec->scsi_opcode, sc->cmnd,
632-
min((int)sc->cmd_len, ZFCP_DBF_SCSI_OPCODE));
627+
if (sc) {
628+
rec->scsi_result = sc->result;
629+
rec->scsi_retries = sc->retries;
630+
rec->scsi_allowed = sc->allowed;
631+
rec->scsi_id = sc->device->id;
632+
rec->scsi_lun = (u32)sc->device->lun;
633+
rec->scsi_lun_64_hi = (u32)(sc->device->lun >> 32);
634+
rec->host_scribble = (unsigned long)sc->host_scribble;
635+
636+
memcpy(rec->scsi_opcode, sc->cmnd,
637+
min_t(int, sc->cmd_len, ZFCP_DBF_SCSI_OPCODE));
638+
} else {
639+
rec->scsi_result = ~0;
640+
rec->scsi_retries = ~0;
641+
rec->scsi_allowed = ~0;
642+
rec->scsi_id = sdev->id;
643+
rec->scsi_lun = (u32)sdev->lun;
644+
rec->scsi_lun_64_hi = (u32)(sdev->lun >> 32);
645+
rec->host_scribble = ~0;
646+
647+
memset(rec->scsi_opcode, 0xff, ZFCP_DBF_SCSI_OPCODE);
648+
}
633649

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

683+
/**
684+
* zfcp_dbf_scsi_eh() - Trace event for special cases of scsi_eh callbacks.
685+
* @tag: Identifier for event.
686+
* @adapter: Pointer to zfcp adapter as context for this event.
687+
* @scsi_id: SCSI ID/target to indicate scope of task management function (TMF).
688+
* @ret: Return value of calling function.
689+
*
690+
* This SCSI trace variant does not depend on any of:
691+
* scsi_cmnd, zfcp_fsf_req, scsi_device.
692+
*/
693+
void zfcp_dbf_scsi_eh(char *tag, struct zfcp_adapter *adapter,
694+
unsigned int scsi_id, int ret)
695+
{
696+
struct zfcp_dbf *dbf = adapter->dbf;
697+
struct zfcp_dbf_scsi *rec = &dbf->scsi_buf;
698+
unsigned long flags;
699+
static int const level = 1;
700+
701+
if (unlikely(!debug_level_enabled(adapter->dbf->scsi, level)))
702+
return;
703+
704+
spin_lock_irqsave(&dbf->scsi_lock, flags);
705+
memset(rec, 0, sizeof(*rec));
706+
707+
memcpy(rec->tag, tag, ZFCP_DBF_TAG_LEN);
708+
rec->id = ZFCP_DBF_SCSI_CMND;
709+
rec->scsi_result = ret; /* re-use field, int is 4 bytes and fits */
710+
rec->scsi_retries = ~0;
711+
rec->scsi_allowed = ~0;
712+
rec->fcp_rsp_info = ~0;
713+
rec->scsi_id = scsi_id;
714+
rec->scsi_lun = (u32)ZFCP_DBF_INVALID_LUN;
715+
rec->scsi_lun_64_hi = (u32)(ZFCP_DBF_INVALID_LUN >> 32);
716+
rec->host_scribble = ~0;
717+
memset(rec->scsi_opcode, 0xff, ZFCP_DBF_SCSI_OPCODE);
718+
719+
debug_event(dbf->scsi, level, rec, sizeof(*rec));
720+
spin_unlock_irqrestore(&dbf->scsi_lock, flags);
721+
}
722+
667723
static debug_info_t *zfcp_dbf_reg(const char *name, int size, int rec_size)
668724
{
669725
struct debug_info *d;

0 commit comments

Comments
 (0)