Skip to content

Commit 6a1636e

Browse files
committed
Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
Pull SCSI fixes from James Bottomley: "The only core fix is in doc; all the others are in drivers, with the biggest impacts in libsas being the rollback on error handling and in ufs coming from a couple of error handling fixes, one causing a crash if it's activated before scanning and the other fixing W-LUN resumption" * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: ufs: qcom: Fix confusing cleanup.h syntax scsi: libsas: Add rollback handling when an error occurs scsi: device_handler: Return error pointer in scsi_dh_attached_handler_name() scsi: ufs: core: Fix a deadlock in the frequency scaling code scsi: ufs: core: Fix an error handler crash scsi: Revert "scsi: libsas: Fix exp-attached device scan after probe failure scanned in again after probe failed" scsi: ufs: core: Fix RPMB link error by reversing Kconfig dependencies scsi: qla4xxx: Use time conversion macros scsi: qla2xxx: Enable/disable IRQD_NO_BALANCING during reset scsi: ipr: Enable/disable IRQD_NO_BALANCING during reset scsi: imm: Fix use-after-free bug caused by unfinished delayed work scsi: target: sbp: Remove KMSG_COMPONENT macro scsi: core: Correct documentation for scsi_device_quiesce() scsi: mpi3mr: Prevent duplicate SAS/SATA device entries in channel 1 scsi: target: Reset t_task_cdb pointer in error case scsi: ufs: core: Fix EH failure after W-LUN resume error
2 parents 0dfb36b + 9465744 commit 6a1636e

18 files changed

Lines changed: 165 additions & 56 deletions

File tree

drivers/md/dm-mpath.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -950,6 +950,19 @@ static struct pgpath *parse_path(struct dm_arg_set *as, struct path_selector *ps
950950

951951
q = bdev_get_queue(p->path.dev->bdev);
952952
attached_handler_name = scsi_dh_attached_handler_name(q, GFP_KERNEL);
953+
if (IS_ERR(attached_handler_name)) {
954+
if (PTR_ERR(attached_handler_name) == -ENODEV) {
955+
if (m->hw_handler_name) {
956+
DMERR("hardware handlers are only allowed for SCSI devices");
957+
kfree(m->hw_handler_name);
958+
m->hw_handler_name = NULL;
959+
}
960+
attached_handler_name = NULL;
961+
} else {
962+
r = PTR_ERR(attached_handler_name);
963+
goto bad;
964+
}
965+
}
953966
if (attached_handler_name || m->hw_handler_name) {
954967
INIT_DELAYED_WORK(&p->activate_path, activate_path_work);
955968
r = setup_scsi_dh(p->path.dev->bdev, m, &attached_handler_name, &ti->error);

drivers/misc/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ config PHANTOM
106106

107107
config RPMB
108108
tristate "RPMB partition interface"
109-
depends on MMC || SCSI_UFSHCD
110109
help
111110
Unified RPMB unit interface for RPMB capable devices such as eMMC and
112111
UFS. Provides interface for in-kernel security controllers to access

drivers/scsi/imm.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1260,6 +1260,7 @@ static void imm_detach(struct parport *pb)
12601260
imm_struct *dev;
12611261
list_for_each_entry(dev, &imm_hosts, list) {
12621262
if (dev->dev->port == pb) {
1263+
disable_delayed_work_sync(&dev->imm_tq);
12631264
list_del_init(&dev->list);
12641265
scsi_remove_host(dev->host);
12651266
scsi_host_put(dev->host);

drivers/scsi/ipr.c

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@
6161
#include <linux/hdreg.h>
6262
#include <linux/reboot.h>
6363
#include <linux/stringify.h>
64+
#include <linux/irq.h>
6465
#include <asm/io.h>
65-
#include <asm/irq.h>
6666
#include <asm/processor.h>
6767
#include <scsi/scsi.h>
6868
#include <scsi/scsi_host.h>
@@ -7843,6 +7843,30 @@ static int ipr_dump_mailbox_wait(struct ipr_cmnd *ipr_cmd)
78437843
return IPR_RC_JOB_RETURN;
78447844
}
78457845

7846+
/**
7847+
* ipr_set_affinity_nobalance
7848+
* @ioa_cfg: ipr_ioa_cfg struct for an ipr device
7849+
* @flag: bool
7850+
* true: ensable "IRQ_NO_BALANCING" bit for msix interrupt
7851+
* false: disable "IRQ_NO_BALANCING" bit for msix interrupt
7852+
* Description: This function will be called to disable/enable
7853+
* "IRQ_NO_BALANCING" to avoid irqbalance daemon
7854+
* kicking in during adapter reset.
7855+
**/
7856+
static void ipr_set_affinity_nobalance(struct ipr_ioa_cfg *ioa_cfg, bool flag)
7857+
{
7858+
int irq, i;
7859+
7860+
for (i = 0; i < ioa_cfg->nvectors; i++) {
7861+
irq = pci_irq_vector(ioa_cfg->pdev, i);
7862+
7863+
if (flag)
7864+
irq_set_status_flags(irq, IRQ_NO_BALANCING);
7865+
else
7866+
irq_clear_status_flags(irq, IRQ_NO_BALANCING);
7867+
}
7868+
}
7869+
78467870
/**
78477871
* ipr_reset_restore_cfg_space - Restore PCI config space.
78487872
* @ipr_cmd: ipr command struct
@@ -7866,6 +7890,7 @@ static int ipr_reset_restore_cfg_space(struct ipr_cmnd *ipr_cmd)
78667890
return IPR_RC_JOB_CONTINUE;
78677891
}
78687892

7893+
ipr_set_affinity_nobalance(ioa_cfg, false);
78697894
ipr_fail_all_ops(ioa_cfg);
78707895

78717896
if (ioa_cfg->sis64) {
@@ -7945,6 +7970,7 @@ static int ipr_reset_start_bist(struct ipr_cmnd *ipr_cmd)
79457970
rc = pci_write_config_byte(ioa_cfg->pdev, PCI_BIST, PCI_BIST_START);
79467971

79477972
if (rc == PCIBIOS_SUCCESSFUL) {
7973+
ipr_set_affinity_nobalance(ioa_cfg, true);
79487974
ipr_cmd->job_step = ipr_reset_bist_done;
79497975
ipr_reset_start_timer(ipr_cmd, IPR_WAIT_FOR_BIST_TIMEOUT);
79507976
rc = IPR_RC_JOB_RETURN;

drivers/scsi/libsas/sas_init.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ int sas_register_ha(struct sas_ha_struct *sas_ha)
141141
Undo_ports:
142142
sas_unregister_ports(sas_ha);
143143
Undo_phys:
144+
sas_unregister_phys(sas_ha);
144145

145146
return error;
146147
}

drivers/scsi/libsas/sas_internal.h

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ void sas_unregister_dev(struct asd_sas_port *port, struct domain_device *dev);
5454
void sas_scsi_recover_host(struct Scsi_Host *shost);
5555

5656
int sas_register_phys(struct sas_ha_struct *sas_ha);
57+
void sas_unregister_phys(struct sas_ha_struct *sas_ha);
5758

5859
struct asd_sas_event *sas_alloc_event(struct asd_sas_phy *phy, gfp_t gfp_flags);
5960
void sas_free_event(struct asd_sas_event *event);
@@ -145,20 +146,6 @@ static inline void sas_fail_probe(struct domain_device *dev, const char *func, i
145146
func, dev->parent ? "exp-attached" :
146147
"direct-attached",
147148
SAS_ADDR(dev->sas_addr), err);
148-
149-
/*
150-
* If the device probe failed, the expander phy attached address
151-
* needs to be reset so that the phy will not be treated as flutter
152-
* in the next revalidation
153-
*/
154-
if (dev->parent && !dev_is_expander(dev->dev_type)) {
155-
struct sas_phy *phy = dev->phy;
156-
struct domain_device *parent = dev->parent;
157-
struct ex_phy *ex_phy = &parent->ex_dev.ex_phy[phy->number];
158-
159-
memset(ex_phy->attached_sas_addr, 0, SAS_ADDR_SIZE);
160-
}
161-
162149
sas_unregister_dev(dev->port, dev);
163150
}
164151

drivers/scsi/libsas/sas_phy.c

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ static void sas_phye_shutdown(struct work_struct *work)
116116
int sas_register_phys(struct sas_ha_struct *sas_ha)
117117
{
118118
int i;
119+
int err;
119120

120121
/* Now register the phys. */
121122
for (i = 0; i < sas_ha->num_phys; i++) {
@@ -132,8 +133,10 @@ int sas_register_phys(struct sas_ha_struct *sas_ha)
132133
phy->frame_rcvd_size = 0;
133134

134135
phy->phy = sas_phy_alloc(&sas_ha->shost->shost_gendev, i);
135-
if (!phy->phy)
136-
return -ENOMEM;
136+
if (!phy->phy) {
137+
err = -ENOMEM;
138+
goto rollback;
139+
}
137140

138141
phy->phy->identify.initiator_port_protocols =
139142
phy->iproto;
@@ -146,10 +149,34 @@ int sas_register_phys(struct sas_ha_struct *sas_ha)
146149
phy->phy->maximum_linkrate = SAS_LINK_RATE_UNKNOWN;
147150
phy->phy->negotiated_linkrate = SAS_LINK_RATE_UNKNOWN;
148151

149-
sas_phy_add(phy->phy);
152+
err = sas_phy_add(phy->phy);
153+
if (err) {
154+
sas_phy_free(phy->phy);
155+
goto rollback;
156+
}
150157
}
151158

152159
return 0;
160+
rollback:
161+
for (i-- ; i >= 0 ; i--) {
162+
struct asd_sas_phy *phy = sas_ha->sas_phy[i];
163+
164+
sas_phy_delete(phy->phy);
165+
sas_phy_free(phy->phy);
166+
}
167+
return err;
168+
}
169+
170+
void sas_unregister_phys(struct sas_ha_struct *sas_ha)
171+
{
172+
int i;
173+
174+
for (i = 0 ; i < sas_ha->num_phys ; i++) {
175+
struct asd_sas_phy *phy = sas_ha->sas_phy[i];
176+
177+
sas_phy_delete(phy->phy);
178+
sas_phy_free(phy->phy);
179+
}
153180
}
154181

155182
const work_func_t sas_phy_event_fns[PHY_NUM_EVENTS] = {

drivers/scsi/mpi3mr/mpi3mr.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ extern struct list_head mrioc_list;
5656
extern int prot_mask;
5757
extern atomic64_t event_counter;
5858

59-
#define MPI3MR_DRIVER_VERSION "8.15.0.5.50"
60-
#define MPI3MR_DRIVER_RELDATE "12-August-2025"
59+
#define MPI3MR_DRIVER_VERSION "8.15.0.5.51"
60+
#define MPI3MR_DRIVER_RELDATE "18-November-2025"
6161

6262
#define MPI3MR_DRIVER_NAME "mpi3mr"
6363
#define MPI3MR_DRIVER_LICENSE "GPL"

drivers/scsi/mpi3mr/mpi3mr_os.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1184,6 +1184,8 @@ static void mpi3mr_update_tgtdev(struct mpi3mr_ioc *mrioc,
11841184
if (is_added == true)
11851185
tgtdev->io_throttle_enabled =
11861186
(flags & MPI3_DEVICE0_FLAGS_IO_THROTTLING_REQUIRED) ? 1 : 0;
1187+
if (!mrioc->sas_transport_enabled)
1188+
tgtdev->non_stl = 1;
11871189

11881190
switch (flags & MPI3_DEVICE0_FLAGS_MAX_WRITE_SAME_MASK) {
11891191
case MPI3_DEVICE0_FLAGS_MAX_WRITE_SAME_256_LB:
@@ -4844,7 +4846,7 @@ static int mpi3mr_target_alloc(struct scsi_target *starget)
48444846
spin_lock_irqsave(&mrioc->tgtdev_lock, flags);
48454847
if (starget->channel == mrioc->scsi_device_channel) {
48464848
tgt_dev = __mpi3mr_get_tgtdev_by_perst_id(mrioc, starget->id);
4847-
if (tgt_dev && !tgt_dev->is_hidden) {
4849+
if (tgt_dev && !tgt_dev->is_hidden && tgt_dev->non_stl) {
48484850
scsi_tgt_priv_data->starget = starget;
48494851
scsi_tgt_priv_data->dev_handle = tgt_dev->dev_handle;
48504852
scsi_tgt_priv_data->perst_id = tgt_dev->perst_id;

drivers/scsi/qla2xxx/qla_os.c

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include <linux/crash_dump.h>
1818
#include <linux/trace_events.h>
1919
#include <linux/trace.h>
20+
#include <linux/irq.h>
2021

2122
#include <scsi/scsi_tcq.h>
2223
#include <scsi/scsicam.h>
@@ -7776,6 +7777,31 @@ static void qla_pci_error_cleanup(scsi_qla_host_t *vha)
77767777
}
77777778

77787779

7780+
/**
7781+
* qla2xxx_set_affinity_nobalance
7782+
* @pdev: pci_dev struct for a qla2xxx device
7783+
* @flag: bool
7784+
* true: enable "IRQ_NO_BALANCING" bit for msix interrupt
7785+
* false: disable "IRQ_NO_BALANCING" bit for msix interrupt
7786+
* Description: This function will be called to disable/enable
7787+
* "IRQ_NO_BALANCING" to avoid irqbalance daemon
7788+
* kicking in during adapter reset.
7789+
**/
7790+
7791+
static void qla2xxx_set_affinity_nobalance(struct pci_dev *pdev, bool flag)
7792+
{
7793+
int irq, i;
7794+
7795+
for (i = 0; i < QLA_BASE_VECTORS; i++) {
7796+
irq = pci_irq_vector(pdev, i);
7797+
7798+
if (flag)
7799+
irq_set_status_flags(irq, IRQ_NO_BALANCING);
7800+
else
7801+
irq_clear_status_flags(irq, IRQ_NO_BALANCING);
7802+
}
7803+
}
7804+
77797805
static pci_ers_result_t
77807806
qla2xxx_pci_error_detected(struct pci_dev *pdev, pci_channel_state_t state)
77817807
{
@@ -7794,6 +7820,8 @@ qla2xxx_pci_error_detected(struct pci_dev *pdev, pci_channel_state_t state)
77947820
goto out;
77957821
}
77967822

7823+
qla2xxx_set_affinity_nobalance(pdev, false);
7824+
77977825
switch (state) {
77987826
case pci_channel_io_normal:
77997827
qla_pci_set_eeh_busy(vha);
@@ -7930,6 +7958,8 @@ qla2xxx_pci_slot_reset(struct pci_dev *pdev)
79307958
ql_dbg(ql_dbg_aer, base_vha, 0x900e,
79317959
"Slot Reset returning %x.\n", ret);
79327960

7961+
qla2xxx_set_affinity_nobalance(pdev, true);
7962+
79337963
return ret;
79347964
}
79357965

0 commit comments

Comments
 (0)