Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 14f1ffdd authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "mhi: core: process incoming data based on event ring type"

parents 0943aa14 135397f8
Loading
Loading
Loading
Loading
+3 −7
Original line number Diff line number Diff line
@@ -114,6 +114,7 @@ static int mhi_process_event_ring(
						 ev_index);
			spin_unlock_bh(&ring->ring_lock);
			__pm_relax(&mhi_dev_ctxt->w_lock);
			event_quota--;
			break;
		}
		case MHI_PKT_TYPE_STATE_CHANGE_EVENT:
@@ -207,7 +208,6 @@ static int mhi_process_event_ring(
						ev_ctxt->mhi_event_read_ptr);
		spin_unlock_irqrestore(&local_ev_ctxt->ring_lock, flags);
		ret_val = 0;
		--event_quota;
	}
	read_lock_bh(&mhi_dev_ctxt->pm_xfer_lock);
	mhi_dev_ctxt->deassert_wake(mhi_dev_ctxt);
@@ -222,12 +222,10 @@ void mhi_ev_task(unsigned long data)
	struct mhi_device_ctxt *mhi_dev_ctxt =
		mhi_ring->mhi_dev_ctxt;
	int ev_index = mhi_ring->index;
	struct mhi_event_ring_cfg *ring_props =
		&mhi_dev_ctxt->ev_ring_props[ev_index];

	mhi_log(mhi_dev_ctxt, MHI_MSG_VERBOSE, "Enter\n");
	/* Process event ring */
	mhi_process_event_ring(mhi_dev_ctxt, ev_index, ring_props->nr_desc);
	mhi_process_event_ring(mhi_dev_ctxt, ev_index, U32_MAX);

	enable_irq(MSI_TO_IRQ(mhi_dev_ctxt, ev_index));
	mhi_log(mhi_dev_ctxt, MHI_MSG_VERBOSE, "Exit\n");
@@ -240,12 +238,10 @@ void process_event_ring(struct work_struct *work)
	struct mhi_device_ctxt *mhi_dev_ctxt =
		mhi_ring->mhi_dev_ctxt;
	int ev_index = mhi_ring->index;
	struct mhi_event_ring_cfg *ring_props =
		&mhi_dev_ctxt->ev_ring_props[ev_index];

	mhi_log(mhi_dev_ctxt, MHI_MSG_VERBOSE, "Enter\n");
	/* Process event ring */
	mhi_process_event_ring(mhi_dev_ctxt, ev_index, ring_props->nr_desc);
	mhi_process_event_ring(mhi_dev_ctxt, ev_index, U32_MAX);

	enable_irq(MSI_TO_IRQ(mhi_dev_ctxt, ev_index));
	mhi_log(mhi_dev_ctxt, MHI_MSG_VERBOSE, "Exit\n");
+7 −3
Original line number Diff line number Diff line
@@ -1097,7 +1097,8 @@ static int parse_outbound(struct mhi_device_ctxt *mhi_dev_ctxt,
}

static int parse_inbound(struct mhi_device_ctxt *mhi_dev_ctxt,
		u32 chan, union mhi_xfer_pkt *local_ev_trb_loc, u16 xfer_len)
			 u32 chan, union mhi_xfer_pkt *local_ev_trb_loc,
			 u16 xfer_len, unsigned ev_ring)
{
	struct mhi_client_handle *client_handle;
	struct mhi_client_config *client_config;
@@ -1105,6 +1106,8 @@ static int parse_inbound(struct mhi_device_ctxt *mhi_dev_ctxt,
	struct mhi_result *result;
	struct mhi_cb_info cb_info;
	struct mhi_ring *bb_ctxt = &mhi_dev_ctxt->chan_bb_list[chan];
	bool ev_managed = GET_EV_PROPS(EV_MANAGED,
				mhi_dev_ctxt->ev_ring_props[ev_ring].flags);
	int r;
	uintptr_t bb_index, ctxt_index_rp, ctxt_index_wp;

@@ -1118,7 +1121,7 @@ static int parse_inbound(struct mhi_device_ctxt *mhi_dev_ctxt,
	result = &client_config->result;
	parse_inbound_bb(mhi_dev_ctxt, bb_ctxt, result, xfer_len);

	if (unlikely(IS_SOFTWARE_CHANNEL(chan))) {
	if (ev_managed) {
		MHI_TX_TRB_SET_LEN(TX_TRB_LEN, local_ev_trb_loc, xfer_len);
		r = ctxt_del_element(local_chan_ctxt, NULL);
		BUG_ON(r);
@@ -1284,7 +1287,8 @@ int parse_xfer_event(struct mhi_device_ctxt *mhi_dev_ctxt,
			}
			if (local_chan_ctxt->dir == MHI_IN) {
				parse_inbound(mhi_dev_ctxt, chan,
						local_ev_trb_loc, xfer_len);
					      local_ev_trb_loc, xfer_len,
					      event_id);
			} else {
				parse_outbound(mhi_dev_ctxt, chan,
						local_ev_trb_loc, xfer_len);