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

Commit 16638937 authored by Helmut Schaa's avatar Helmut Schaa Committed by John W. Linville
Browse files

rt2x00: Limit rt2x00pci rxdone processing to 16 entries at once



Instead of receiving an unlimited number of frames, stop after 16
entries and reschedule the rxdone tasklet. This allows other tasklets
to be run inbetween.

Signed-off-by: default avatarHelmut Schaa <helmut.schaa@googlemail.com>
Acked-by: default avatarGertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: default avatarIvo van Doorn <IvDoorn@gmail.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 32473284
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -1368,7 +1368,9 @@ static void rt2400pci_tbtt_tasklet(unsigned long data)
static void rt2400pci_rxdone_tasklet(unsigned long data)
{
	struct rt2x00_dev *rt2x00dev = (struct rt2x00_dev *)data;
	rt2x00pci_rxdone(rt2x00dev);
	if (rt2x00pci_rxdone(rt2x00dev))
		tasklet_schedule(&rt2x00dev->rxdone_tasklet);
	else
		rt2400pci_enable_interrupt(rt2x00dev, CSR8_RXDONE);
}

+4 −2
Original line number Diff line number Diff line
@@ -1500,7 +1500,9 @@ static void rt2500pci_tbtt_tasklet(unsigned long data)
static void rt2500pci_rxdone_tasklet(unsigned long data)
{
	struct rt2x00_dev *rt2x00dev = (struct rt2x00_dev *)data;
	rt2x00pci_rxdone(rt2x00dev);
	if (rt2x00pci_rxdone(rt2x00dev))
		tasklet_schedule(&rt2x00dev->rxdone_tasklet);
	else
		rt2500pci_enable_interrupt(rt2x00dev, CSR8_RXDONE);
}

+4 −2
Original line number Diff line number Diff line
@@ -806,7 +806,9 @@ static void rt2800pci_tbtt_tasklet(unsigned long data)
static void rt2800pci_rxdone_tasklet(unsigned long data)
{
	struct rt2x00_dev *rt2x00dev = (struct rt2x00_dev *)data;
	rt2x00pci_rxdone(rt2x00dev);
	if (rt2x00pci_rxdone(rt2x00dev))
		tasklet_schedule(&rt2x00dev->rxdone_tasklet);
	else
		rt2800pci_enable_interrupt(rt2x00dev, INT_MASK_CSR_RX_DONE);
}

+5 −2
Original line number Diff line number Diff line
@@ -60,14 +60,15 @@ int rt2x00pci_regbusy_read(struct rt2x00_dev *rt2x00dev,
}
EXPORT_SYMBOL_GPL(rt2x00pci_regbusy_read);

void rt2x00pci_rxdone(struct rt2x00_dev *rt2x00dev)
bool rt2x00pci_rxdone(struct rt2x00_dev *rt2x00dev)
{
	struct data_queue *queue = rt2x00dev->rx;
	struct queue_entry *entry;
	struct queue_entry_priv_pci *entry_priv;
	struct skb_frame_desc *skbdesc;
	int max_rx = 16;

	while (1) {
	while (--max_rx) {
		entry = rt2x00queue_get_entry(queue, Q_INDEX);
		entry_priv = entry->priv_data;

@@ -93,6 +94,8 @@ void rt2x00pci_rxdone(struct rt2x00_dev *rt2x00dev)
		 */
		rt2x00lib_rxdone(entry);
	}

	return !max_rx;
}
EXPORT_SYMBOL_GPL(rt2x00pci_rxdone);

+4 −1
Original line number Diff line number Diff line
@@ -101,8 +101,11 @@ struct queue_entry_priv_pci {
/**
 * rt2x00pci_rxdone - Handle RX done events
 * @rt2x00dev: Device pointer, see &struct rt2x00_dev.
 *
 * Returns true if there are still rx frames pending and false if all
 * pending rx frames were processed.
 */
void rt2x00pci_rxdone(struct rt2x00_dev *rt2x00dev);
bool rt2x00pci_rxdone(struct rt2x00_dev *rt2x00dev);

/*
 * Device initialization handlers.
Loading