Skip to content

Commit

Permalink
ps3: fix rare issue that reenabling rx DMA fails
Browse files Browse the repository at this point in the history
Fixed rare issue that 'lv1_net_start_rx_dma failed, status=-9" was shown
in dmesg.  This meant restarting rx DMA had been rejected by the hypervisor.
This issue would caused if the guest os requested starting DMA when
the hypervisor thought the DMA was in progress.
The state machine for DMA status of the hypervisor would be updated
by processing interrupt in the hypervisor.
Thus we should wait for the interrupt delivery before restarting
DMA.

Signed-off-by: Masakazu Mokuno <mokuno@sm.sony.co.jp>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
  • Loading branch information
Masakazu Mokuno authored and Jeff Garzik committed Jul 24, 2007
1 parent 39a3d2d commit 583aae1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
9 changes: 7 additions & 2 deletions drivers/net/ps3_gelic_net.c
Original file line number Diff line number Diff line change
Expand Up @@ -943,8 +943,8 @@ static int gelic_net_decode_one_descr(struct gelic_net_card *card)
descr->prev->next_descr_addr = descr->bus_addr;

if (dmac_chain_ended) {
gelic_net_enable_rxdmac(card);
dev_dbg(ctodev(card), "reenable rx dma\n");
card->rx_dma_restart_required = 1;
dev_dbg(ctodev(card), "reenable rx dma scheduled\n");
}

return 1;
Expand Down Expand Up @@ -1020,6 +1020,11 @@ static irqreturn_t gelic_net_interrupt(int irq, void *ptr)
if (!status)
return IRQ_NONE;

if (card->rx_dma_restart_required) {
card->rx_dma_restart_required = 0;
gelic_net_enable_rxdmac(card);
}

if (status & GELIC_NET_RXINT) {
gelic_net_rx_irq_off(card);
netif_rx_schedule(netdev);
Expand Down
1 change: 1 addition & 0 deletions drivers/net/ps3_gelic_net.h
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ struct gelic_net_card {

struct gelic_net_descr_chain tx_chain;
struct gelic_net_descr_chain rx_chain;
int rx_dma_restart_required;
/* gurad dmac descriptor chain*/
spinlock_t chain_lock;

Expand Down

0 comments on commit 583aae1

Please sign in to comment.