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

Commit 677f8c0d authored by Stephen Rothwell's avatar Stephen Rothwell Committed by Paul Mackerras
Browse files

[PATCH] powerpc: remove bitfields from HvLpEvent

parent 6814350b
Loading
Loading
Loading
Loading
+2 −11
Original line number Diff line number Diff line
@@ -147,20 +147,11 @@ static void int_received(struct pci_event *event, struct pt_regs *regs)
static void pci_event_handler(struct HvLpEvent *event, struct pt_regs *regs)
{
	if (event && (event->xType == HvLpEvent_Type_PciIo)) {
		switch (event->xFlags.xFunction) {
		case HvLpEvent_Function_Int:
		if (hvlpevent_is_int(event))
			int_received((struct pci_event *)event, regs);
			break;
		case HvLpEvent_Function_Ack:
		else
			printk(KERN_ERR
				"pci_event_handler: unexpected ack received\n");
			break;
		default:
			printk(KERN_ERR
				"pci_event_handler: unexpected event function %d\n",
				(int)event->xFlags.xFunction);
			break;
		}
	} else if (event)
		printk(KERN_ERR
			"pci_event_handler: Unrecognized PCI event type 0x%x\n",
+6 −6
Original line number Diff line number Diff line
@@ -53,7 +53,7 @@ static struct HvLpEvent * get_next_hvlpevent(void)
	struct HvLpEvent * event;
	event = (struct HvLpEvent *)hvlpevent_queue.xSlicCurEventPtr;

	if (event->xFlags.xValid) {
	if (hvlpevent_is_valid(event)) {
		/* rmb() needed only for weakly consistent machines (regatta) */
		rmb();
		/* Set pointer to next potential event */
@@ -84,7 +84,7 @@ int hvlpevent_is_pending(void)

	next_event = (struct HvLpEvent *)hvlpevent_queue.xSlicCurEventPtr;

	return next_event->xFlags.xValid |
	return hvlpevent_is_valid(next_event) ||
		hvlpevent_queue.xPlicOverflowIntPending;
}

@@ -101,18 +101,18 @@ static void hvlpevent_clear_valid(struct HvLpEvent * event)
	switch (extra) {
	case 3:
		tmp = (struct HvLpEvent*)((char*)event + 3 * LpEventAlign);
		tmp->xFlags.xValid = 0;
		hvlpevent_invalidate(tmp);
	case 2:
		tmp = (struct HvLpEvent*)((char*)event + 2 * LpEventAlign);
		tmp->xFlags.xValid = 0;
		hvlpevent_invalidate(tmp);
	case 1:
		tmp = (struct HvLpEvent*)((char*)event + 1 * LpEventAlign);
		tmp->xFlags.xValid = 0;
		hvlpevent_invalidate(tmp);
	}

	mb();

	event->xFlags.xValid = 0;
	hvlpevent_invalidate(event);
}

void process_hvlpevents(struct pt_regs *regs)
+3 −13
Original line number Diff line number Diff line
@@ -251,10 +251,7 @@ static struct pending_event *new_pending_event(void)
	}
	memset(ev, 0, sizeof(struct pending_event));
	hev = &ev->event.hp_lp_event;
	hev->xFlags.xValid = 1;
	hev->xFlags.xAckType = HvLpEvent_AckType_ImmediateAck;
	hev->xFlags.xAckInd = HvLpEvent_AckInd_DoAck;
	hev->xFlags.xFunction = HvLpEvent_Function_Int;
	hev->flags = HV_LP_EVENT_VALID | HV_LP_EVENT_DO_ACK | HV_LP_EVENT_INT;
	hev->xType = HvLpEvent_Type_MachineFac;
	hev->xSourceLp = HvLpConfig_getLpIndex();
	hev->xTargetLp = primary_lp;
@@ -518,17 +515,10 @@ static void handle_ack(struct io_mf_lp_event *event)
static void hv_handler(struct HvLpEvent *event, struct pt_regs *regs)
{
	if ((event != NULL) && (event->xType == HvLpEvent_Type_MachineFac)) {
		switch(event->xFlags.xFunction) {
		case HvLpEvent_Function_Ack:
		if (hvlpevent_is_ack(event))
			handle_ack((struct io_mf_lp_event *)event);
			break;
		case HvLpEvent_Function_Int:
		else
			handle_int((struct io_mf_lp_event *)event);
			break;
		default:
			printk(KERN_ERR "mf.c: non ack/int event received\n");
			break;
		}
	} else
		printk(KERN_ERR "mf.c: alien event received\n");
}
+5 −7
Original line number Diff line number Diff line
@@ -270,7 +270,7 @@ static void handleMonitorEvent(struct HvLpEvent *event)
	 * First see if this is just a normal monitor message from the
	 * other partition
	 */
	if (event->xFlags.xFunction == HvLpEvent_Function_Int) {
	if (hvlpevent_is_int(event)) {
		remoteLp = event->xSourceLp;
		if (!viopathStatus[remoteLp].isActive)
			sendMonMsg(remoteLp);
@@ -331,13 +331,12 @@ static void handleConfig(struct HvLpEvent *event)
{
	if (!event)
		return;
	if (event->xFlags.xFunction == HvLpEvent_Function_Int) {
	if (hvlpevent_is_int(event)) {
		printk(VIOPATH_KERN_WARN
		       "unexpected config request from partition %d",
		       event->xSourceLp);

		if ((event->xFlags.xFunction == HvLpEvent_Function_Int) &&
		    (event->xFlags.xAckInd == HvLpEvent_AckInd_DoAck)) {
		if (hvlpevent_need_ack(event)) {
			event->xRc = HvLpEvent_Rc_InvalidSubtype;
			HvCallEvent_ackLpEvent(event);
		}
@@ -377,7 +376,7 @@ static void vio_handleEvent(struct HvLpEvent *event, struct pt_regs *regs)
	int subtype = (event->xSubtype & VIOMAJOR_SUBTYPE_MASK)
		>> VIOMAJOR_SUBTYPE_SHIFT;

	if (event->xFlags.xFunction == HvLpEvent_Function_Int) {
	if (hvlpevent_is_int(event)) {
		remoteLp = event->xSourceLp;
		/*
		 * The isActive is checked because if the hosting partition
@@ -436,8 +435,7 @@ static void vio_handleEvent(struct HvLpEvent *event, struct pt_regs *regs)
		       "unexpected virtual io event subtype %d from partition %d\n",
		       event->xSubtype, remoteLp);
		/* No handler.  Ack if necessary */
		if ((event->xFlags.xFunction == HvLpEvent_Function_Int) &&
		    (event->xFlags.xAckInd == HvLpEvent_AckInd_DoAck)) {
		if (hvlpevent_is_int(event) && hvlpevent_need_ack(event)) {
			event->xRc = HvLpEvent_Rc_InvalidSubtype;
			HvCallEvent_ackLpEvent(event);
		}
+15 −17
Original line number Diff line number Diff line
@@ -293,6 +293,7 @@ static int send_request(struct request *req)
	u16 viocmd;
	HvLpEvent_Rc hvrc;
	struct vioblocklpevent *bevent;
	struct HvLpEvent *hev;
	struct scatterlist sg[VIOMAXBLOCKDMA];
	int sgindex;
	int statindex;
@@ -347,22 +348,19 @@ static int send_request(struct request *req)
		 * token so we can match the response up later
		 */
		memset(bevent, 0, sizeof(struct vioblocklpevent));
		bevent->event.xFlags.xValid = 1;
		bevent->event.xFlags.xFunction = HvLpEvent_Function_Int;
		bevent->event.xFlags.xAckInd = HvLpEvent_AckInd_DoAck;
		bevent->event.xFlags.xAckType = HvLpEvent_AckType_ImmediateAck;
		bevent->event.xType = HvLpEvent_Type_VirtualIo;
		bevent->event.xSubtype = viocmd;
		bevent->event.xSourceLp = HvLpConfig_getLpIndex();
		bevent->event.xTargetLp = viopath_hostLp;
		bevent->event.xSizeMinus1 =
		hev = &bevent->event;
		hev->flags = HV_LP_EVENT_VALID | HV_LP_EVENT_DO_ACK |
			HV_LP_EVENT_INT;
		hev->xType = HvLpEvent_Type_VirtualIo;
		hev->xSubtype = viocmd;
		hev->xSourceLp = HvLpConfig_getLpIndex();
		hev->xTargetLp = viopath_hostLp;
		hev->xSizeMinus1 =
			offsetof(struct vioblocklpevent, u.rw_data.dma_info) +
			(sizeof(bevent->u.rw_data.dma_info[0]) * nsg) - 1;
		bevent->event.xSourceInstanceId =
			viopath_sourceinst(viopath_hostLp);
		bevent->event.xTargetInstanceId =
			viopath_targetinst(viopath_hostLp);
		bevent->event.xCorrelationToken = (u64)req;
		hev->xSourceInstanceId = viopath_sourceinst(viopath_hostLp);
		hev->xTargetInstanceId = viopath_targetinst(viopath_hostLp);
		hev->xCorrelationToken = (u64)req;
		bevent->version = VIOVERSION;
		bevent->disk = DEVICE_NO(d);
		bevent->u.rw_data.offset = start;
@@ -649,10 +647,10 @@ static void handle_block_event(struct HvLpEvent *event)
		/* Notification that a partition went away! */
		return;
	/* First, we should NEVER get an int here...only acks */
	if (event->xFlags.xFunction == HvLpEvent_Function_Int) {
	if (hvlpevent_is_int(event)) {
		printk(VIOD_KERN_WARNING
		       "Yikes! got an int in viodasd event handler!\n");
		if (event->xFlags.xAckInd == HvLpEvent_AckInd_DoAck) {
		if (hvlpevent_need_ack(event)) {
			event->xRc = HvLpEvent_Rc_InvalidSubtype;
			HvCallEvent_ackLpEvent(event);
		}
@@ -695,7 +693,7 @@ static void handle_block_event(struct HvLpEvent *event)

	default:
		printk(VIOD_KERN_WARNING "invalid subtype!");
		if (event->xFlags.xAckInd == HvLpEvent_AckInd_DoAck) {
		if (hvlpevent_need_ack(event)) {
			event->xRc = HvLpEvent_Rc_InvalidSubtype;
			HvCallEvent_ackLpEvent(event);
		}
Loading