Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 266855
b: refs/heads/master
c: 5ea2ef5
h: refs/heads/master
i:
  266853: 72a038c
  266851: 0cbe114
  266847: cb91438
v: v3
  • Loading branch information
Daniel Martensson authored and David S. Miller committed Oct 19, 2011
1 parent 4d1f5e2 commit d2ddf4b
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5bbed92d3d8dab1f28945eec9fb15b6f50bf8669
refs/heads/master: 5ea2ef5f8b006ff9e970327e7fea78f1f5841c44
42 changes: 40 additions & 2 deletions trunk/drivers/net/caif/caif_hsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -674,6 +674,7 @@ static void cfhsi_wake_up(struct work_struct *work)
/* It happenes when wakeup is requested by
* both ends at the same time. */
clear_bit(CFHSI_WAKE_UP, &cfhsi->bits);
clear_bit(CFHSI_WAKE_UP_ACK, &cfhsi->bits);
return;
}

Expand All @@ -690,19 +691,47 @@ static void cfhsi_wake_up(struct work_struct *work)
&cfhsi->bits), ret);
if (unlikely(ret < 0)) {
/* Interrupted by signal. */
dev_info(&cfhsi->ndev->dev, "%s: Signalled: %ld.\n",
dev_err(&cfhsi->ndev->dev, "%s: Signalled: %ld.\n",
__func__, ret);

clear_bit(CFHSI_WAKE_UP, &cfhsi->bits);
cfhsi->dev->cfhsi_wake_down(cfhsi->dev);
return;
} else if (!ret) {
bool ca_wake = false;
size_t fifo_occupancy = 0;

/* Wakeup timeout */
dev_err(&cfhsi->ndev->dev, "%s: Timeout.\n",
__func__);

/* Check FIFO to check if modem has sent something. */
WARN_ON(cfhsi->dev->cfhsi_fifo_occupancy(cfhsi->dev,
&fifo_occupancy));

dev_err(&cfhsi->ndev->dev, "%s: Bytes in FIFO: %u.\n",
__func__, (unsigned) fifo_occupancy);

/* Check if we misssed the interrupt. */
WARN_ON(cfhsi->dev->cfhsi_get_peer_wake(cfhsi->dev,
&ca_wake));

if (ca_wake) {
dev_err(&cfhsi->ndev->dev, "%s: CA Wake missed !.\n",
__func__);

/* Clear the CFHSI_WAKE_UP_ACK bit to prevent race. */
clear_bit(CFHSI_WAKE_UP_ACK, &cfhsi->bits);

/* Continue execution. */
goto wake_ack;
}

clear_bit(CFHSI_WAKE_UP, &cfhsi->bits);
cfhsi->dev->cfhsi_wake_down(cfhsi->dev);
return;
}
wake_ack:
dev_dbg(&cfhsi->ndev->dev, "%s: Woken.\n",
__func__);

Expand Down Expand Up @@ -779,12 +808,21 @@ static void cfhsi_wake_down(struct work_struct *work)
&cfhsi->bits), ret);
if (ret < 0) {
/* Interrupted by signal. */
dev_info(&cfhsi->ndev->dev, "%s: Signalled: %ld.\n",
dev_err(&cfhsi->ndev->dev, "%s: Signalled: %ld.\n",
__func__, ret);
return;
} else if (!ret) {
bool ca_wake = true;

/* Timeout */
dev_err(&cfhsi->ndev->dev, "%s: Timeout.\n", __func__);

/* Check if we misssed the interrupt. */
WARN_ON(cfhsi->dev->cfhsi_get_peer_wake(cfhsi->dev,
&ca_wake));
if (!ca_wake)
dev_err(&cfhsi->ndev->dev, "%s: CA Wake missed !.\n",
__func__);
}

/* Check FIFO occupancy. */
Expand Down
1 change: 1 addition & 0 deletions trunk/include/net/caif/caif_hsi.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ struct cfhsi_dev {
int (*cfhsi_rx) (u8 *ptr, int len, struct cfhsi_dev *dev);
int (*cfhsi_wake_up) (struct cfhsi_dev *dev);
int (*cfhsi_wake_down) (struct cfhsi_dev *dev);
int (*cfhsi_get_peer_wake) (struct cfhsi_dev *dev, bool *status);
int (*cfhsi_fifo_occupancy)(struct cfhsi_dev *dev, size_t *occupancy);
int (*cfhsi_rx_cancel)(struct cfhsi_dev *dev);
struct cfhsi_drv *drv;
Expand Down

0 comments on commit d2ddf4b

Please sign in to comment.