Skip to content

Commit

Permalink
sparc64: Add vio_set_intr() to enable/disable Rx interrupts
Browse files Browse the repository at this point in the history
The vio_set_intr() API should be used by VIO consumers to enable/disable
Rx interrupts to facilitate deferred processing in softirq/bottom-half
context.

Signed-off-by: Sowmini Varadhan <sowmini.varadhan@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Sowmini Varadhan authored and David S. Miller committed Sep 30, 2014
1 parent d0aedcd commit ca605b7
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 2 additions & 0 deletions arch/sparc/include/asm/vio.h
Original file line number Diff line number Diff line change
@@ -298,6 +298,7 @@ struct vio_dev {

unsigned int tx_irq;
unsigned int rx_irq;
u64 rx_ino;

struct device dev;
};
@@ -453,5 +454,6 @@ int vio_driver_init(struct vio_driver_state *vio, struct vio_dev *vdev,
char *name);

void vio_port_up(struct vio_driver_state *vio);
int vio_set_intr(unsigned long dev_ino, int state);

#endif /* _SPARC64_VIO_H */
13 changes: 12 additions & 1 deletion arch/sparc/kernel/vio.c
Original file line number Diff line number Diff line change
@@ -180,15 +180,26 @@ static void vio_fill_channel_info(struct mdesc_handle *hp, u64 mp,
vdev->tx_irq = sun4v_build_virq(cdev_cfg_handle, *irq);

irq = mdesc_get_property(hp, target, "rx-ino", NULL);
if (irq)
if (irq) {
vdev->rx_irq = sun4v_build_virq(cdev_cfg_handle, *irq);
vdev->rx_ino = *irq;
}

chan_id = mdesc_get_property(hp, target, "id", NULL);
if (chan_id)
vdev->channel_id = *chan_id;
}
}

int vio_set_intr(unsigned long dev_ino, int state)
{
int err;

err = sun4v_vintr_set_valid(cdev_cfg_handle, dev_ino, state);
return err;
}
EXPORT_SYMBOL(vio_set_intr);

static struct vio_dev *vio_create_one(struct mdesc_handle *hp, u64 mp,
struct device *parent)
{

0 comments on commit ca605b7

Please sign in to comment.