Skip to content
12 changes: 8 additions & 4 deletions crypto/pcrypt.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,10 @@ static int pcrypt_aead_encrypt(struct aead_request *req)
err = padata_do_parallel(ictx->psenc, padata, &ctx->cb_cpu);
if (!err)
return -EINPROGRESS;
if (err == -EBUSY)
return -EAGAIN;
if (err == -EBUSY) {
/* try non-parallel mode */
return crypto_aead_encrypt(creq);
}

return err;
}
Expand Down Expand Up @@ -166,8 +168,10 @@ static int pcrypt_aead_decrypt(struct aead_request *req)
err = padata_do_parallel(ictx->psdec, padata, &ctx->cb_cpu);
if (!err)
return -EINPROGRESS;
if (err == -EBUSY)
return -EAGAIN;
if (err == -EBUSY) {
/* try non-parallel mode */
return crypto_aead_decrypt(creq);
}

return err;
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/xe/xe_migrate.c
Original file line number Diff line number Diff line change
Expand Up @@ -1177,7 +1177,7 @@ struct dma_fence *xe_migrate_clear(struct xe_migrate *m,
err_sync:
/* Sync partial copies if any. FIXME: job_mutex? */
if (fence) {
dma_fence_wait(m->fence, false);
dma_fence_wait(fence, false);
dma_fence_put(fence);
}

Expand Down
2 changes: 1 addition & 1 deletion drivers/irqchip/irq-gic-v2m.c
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ static int __init gicv2m_of_init(struct fwnode_handle *parent_handle,
#ifdef CONFIG_ACPI
static int acpi_num_msi;

static __init struct fwnode_handle *gicv2m_get_fwnode(struct device *dev)
static struct fwnode_handle *gicv2m_get_fwnode(struct device *dev)
{
struct v2m_data *data;

Expand Down
2 changes: 1 addition & 1 deletion drivers/ntb/hw/mscc/ntb_hw_switchtec.c
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ static int switchtec_ntb_mw_set_trans(struct ntb_dev *ntb, int pidx, int widx,
if (size != 0 && xlate_pos < 12)
return -EINVAL;

if (!IS_ALIGNED(addr, BIT_ULL(xlate_pos))) {
if (xlate_pos >= 0 && !IS_ALIGNED(addr, BIT_ULL(xlate_pos))) {
/*
* In certain circumstances we can get a buffer that is
* not aligned to its size. (Most of the time
Expand Down
2 changes: 2 additions & 0 deletions drivers/scsi/mpi3mr/mpi3mr.h
Original file line number Diff line number Diff line change
Expand Up @@ -1097,6 +1097,7 @@ struct scmd_priv {
* @ts_update_interval: Timestamp update interval
* @reset_in_progress: Reset in progress flag
* @unrecoverable: Controller unrecoverable flag
* @io_admin_reset_sync: Manage state of I/O ops during an admin reset process
* @prev_reset_result: Result of previous reset
* @reset_mutex: Controller reset mutex
* @reset_waitq: Controller reset wait queue
Expand Down Expand Up @@ -1285,6 +1286,7 @@ struct mpi3mr_ioc {
u16 ts_update_interval;
u8 reset_in_progress;
u8 unrecoverable;
u8 io_admin_reset_sync;
int prev_reset_result;
struct mutex reset_mutex;
wait_queue_head_t reset_waitq;
Expand Down
67 changes: 64 additions & 3 deletions drivers/scsi/mpi3mr/mpi3mr_fw.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ static void mpi3mr_process_factsdata(struct mpi3mr_ioc *mrioc,
struct mpi3_ioc_facts_data *facts_data);
static void mpi3mr_pel_wait_complete(struct mpi3mr_ioc *mrioc,
struct mpi3mr_drv_cmd *drv_cmd);

static int mpi3mr_check_op_admin_proc(struct mpi3mr_ioc *mrioc);
static int poll_queues;
module_param(poll_queues, int, 0444);
MODULE_PARM_DESC(poll_queues, "Number of queues for io_uring poll mode. (Range 1 - 126)");
Expand Down Expand Up @@ -459,7 +459,7 @@ int mpi3mr_process_admin_reply_q(struct mpi3mr_ioc *mrioc)
}

do {
if (mrioc->unrecoverable)
if (mrioc->unrecoverable || mrioc->io_admin_reset_sync)
break;

mrioc->admin_req_ci = le16_to_cpu(reply_desc->request_queue_ci);
Expand Down Expand Up @@ -554,7 +554,7 @@ int mpi3mr_process_op_reply_q(struct mpi3mr_ioc *mrioc,
}

do {
if (mrioc->unrecoverable)
if (mrioc->unrecoverable || mrioc->io_admin_reset_sync)
break;

req_q_idx = le16_to_cpu(reply_desc->request_queue_id) - 1;
Expand Down Expand Up @@ -4394,6 +4394,7 @@ int mpi3mr_reinit_ioc(struct mpi3mr_ioc *mrioc, u8 is_resume)
goto out_failed_noretry;
}

mrioc->io_admin_reset_sync = 0;
if (is_resume || mrioc->block_on_pci_err) {
dprint_reset(mrioc, "setting up single ISR\n");
retval = mpi3mr_setup_isr(mrioc, 1);
Expand Down Expand Up @@ -5252,6 +5253,55 @@ void mpi3mr_pel_get_seqnum_complete(struct mpi3mr_ioc *mrioc,
drv_cmd->retry_count = 0;
}

/**
* mpi3mr_check_op_admin_proc -
* @mrioc: Adapter instance reference
*
* Check if any of the operation reply queues
* or the admin reply queue are currently in use.
* If any queue is in use, this function waits for
* a maximum of 10 seconds for them to become available.
*
* Return: 0 on success, non-zero on failure.
*/
static int mpi3mr_check_op_admin_proc(struct mpi3mr_ioc *mrioc)
{

u16 timeout = 10 * 10;
u16 elapsed_time = 0;
bool op_admin_in_use = false;

do {
op_admin_in_use = false;

/* Check admin_reply queue first to exit early */
if (atomic_read(&mrioc->admin_reply_q_in_use) == 1)
op_admin_in_use = true;
else {
/* Check op_reply queues */
int i;

for (i = 0; i < mrioc->num_queues; i++) {
if (atomic_read(&mrioc->op_reply_qinfo[i].in_use) == 1) {
op_admin_in_use = true;
break;
}
}
}

if (!op_admin_in_use)
break;

msleep(100);

} while (++elapsed_time < timeout);

if (op_admin_in_use)
return 1;

return 0;
}

/**
* mpi3mr_soft_reset_handler - Reset the controller
* @mrioc: Adapter instance reference
Expand Down Expand Up @@ -5332,6 +5382,7 @@ int mpi3mr_soft_reset_handler(struct mpi3mr_ioc *mrioc,
mpi3mr_wait_for_host_io(mrioc, MPI3MR_RESET_HOST_IOWAIT_TIMEOUT);

mpi3mr_ioc_disable_intr(mrioc);
mrioc->io_admin_reset_sync = 1;

if (snapdump) {
mpi3mr_set_diagsave(mrioc);
Expand Down Expand Up @@ -5359,6 +5410,16 @@ int mpi3mr_soft_reset_handler(struct mpi3mr_ioc *mrioc,
ioc_err(mrioc, "Failed to issue soft reset to the ioc\n");
goto out;
}

retval = mpi3mr_check_op_admin_proc(mrioc);
if (retval) {
ioc_err(mrioc, "Soft reset failed due to an Admin or I/O queue polling\n"
"thread still processing replies even after a 10 second\n"
"timeout. Marking the controller as unrecoverable!\n");

goto out;
}

if (mrioc->num_io_throttle_group !=
mrioc->facts.max_io_throttle_group) {
ioc_err(mrioc,
Expand Down
20 changes: 14 additions & 6 deletions drivers/usb/host/xhci-ring.c
Original file line number Diff line number Diff line change
Expand Up @@ -2622,6 +2622,7 @@ static int handle_tx_event(struct xhci_hcd *xhci,
int status = -EINPROGRESS;
struct xhci_ep_ctx *ep_ctx;
u32 trb_comp_code;
bool ring_xrun_event = false;

slot_id = TRB_TO_SLOT_ID(le32_to_cpu(event->flags));
ep_index = TRB_TO_EP_ID(le32_to_cpu(event->flags)) - 1;
Expand Down Expand Up @@ -2728,14 +2729,12 @@ static int handle_tx_event(struct xhci_hcd *xhci,
* Underrun Event for OUT Isoch endpoint.
*/
xhci_dbg(xhci, "Underrun event on slot %u ep %u\n", slot_id, ep_index);
if (ep->skip)
break;
return 0;
ring_xrun_event = true;
break;
case COMP_RING_OVERRUN:
xhci_dbg(xhci, "Overrun event on slot %u ep %u\n", slot_id, ep_index);
if (ep->skip)
break;
return 0;
ring_xrun_event = true;
break;
case COMP_MISSED_SERVICE_ERROR:
/*
* When encounter missed service error, one or more isoc tds
Expand Down Expand Up @@ -2807,6 +2806,7 @@ static int handle_tx_event(struct xhci_hcd *xhci,
*/
if (trb_comp_code != COMP_STOPPED &&
trb_comp_code != COMP_STOPPED_LENGTH_INVALID &&
!ring_xrun_event &&
!ep_ring->last_td_was_short) {
xhci_warn(xhci, "Event TRB for slot %u ep %u with no TDs queued\n",
slot_id, ep_index);
Expand Down Expand Up @@ -2837,6 +2837,10 @@ static int handle_tx_event(struct xhci_hcd *xhci,
goto check_endpoint_halted;
}

/* TD was queued after xrun, maybe xrun was on a link, don't panic yet */
if (ring_xrun_event)
return 0;

/*
* Skip the Force Stopped Event. The 'ep_trb' of FSE is not in the current
* TD pointed by 'ep_ring->dequeue' because that the hardware dequeue
Expand Down Expand Up @@ -2883,6 +2887,10 @@ static int handle_tx_event(struct xhci_hcd *xhci,
*/
} while (ep->skip);

/* Get out if a TD was queued at enqueue after the xrun occurred */
if (ring_xrun_event)
return 0;

if (trb_comp_code == COMP_SHORT_PACKET)
ep_ring->last_td_was_short = true;
else
Expand Down
7 changes: 5 additions & 2 deletions fs/nfsd/nfs4callback.c
Original file line number Diff line number Diff line change
Expand Up @@ -1480,8 +1480,11 @@ nfsd4_run_cb_work(struct work_struct *work)
nfsd4_process_cb_update(cb);

clnt = clp->cl_cb_client;
if (!clnt) {
/* Callback channel broken, or client killed; give up: */
if (!clnt || clp->cl_state == NFSD4_COURTESY) {
/*
* Callback channel broken, client killed or
* nfs4_client in courtesy state; give up.
*/
nfsd41_destroy_cb(cb);
return;
}
Expand Down
3 changes: 2 additions & 1 deletion net/openvswitch/flow_netlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -2860,7 +2860,8 @@ static int validate_set(const struct nlattr *a,
size_t key_len;

/* There can be only one key in a action */
if (nla_total_size(nla_len(ovs_key)) != nla_len(a))
if (!nla_ok(ovs_key, nla_len(a)) ||
nla_total_size(nla_len(ovs_key)) != nla_len(a))
return -EINVAL;

key_len = nla_len(ovs_key);
Expand Down
Loading