Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 272099
b: refs/heads/master
c: 5f4026f
h: refs/heads/master
i:
  272097: 6f3fd2a
  272095: 077e9f2
v: v3
  • Loading branch information
Jan Glauber authored and Martin Schwidefsky committed Oct 30, 2011
1 parent 30a9ee7 commit 3e768c6
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 34 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: 2a3a2d66aa4e5abaf8f9222d21735321f02a00dc
refs/heads/master: 5f4026f8b2e4c5e26713d6c707592a33326a88c4
29 changes: 2 additions & 27 deletions trunk/drivers/s390/cio/qdio.h
Original file line number Diff line number Diff line change
Expand Up @@ -418,32 +418,6 @@ static inline int multicast_outbound(struct qdio_q *q)
#define queue_irqs_disabled(q) \
(test_bit(QDIO_QUEUE_IRQS_DISABLED, &q->u.in.queue_irq_state) != 0)

#define TIQDIO_SHARED_IND 63

/* device state change indicators */
struct indicator_t {
u32 ind; /* u32 because of compare-and-swap performance */
atomic_t count; /* use count, 0 or 1 for non-shared indicators */
};

extern struct indicator_t *q_indicators;

static inline int has_multiple_inq_on_dsci(struct qdio_irq *irq)
{
return irq->nr_input_qs > 1;
}

static inline int references_shared_dsci(struct qdio_irq *irq)
{
return irq->dsci == &q_indicators[TIQDIO_SHARED_IND].ind;
}

static inline int shared_ind(struct qdio_q *q)
{
struct qdio_irq *i = q->irq_ptr;
return references_shared_dsci(i) || has_multiple_inq_on_dsci(i);
}

extern u64 last_ai_time;

/* prototypes for thin interrupt */
Expand All @@ -457,7 +431,8 @@ int tiqdio_allocate_memory(void);
void tiqdio_free_memory(void);
int tiqdio_register_thinints(void);
void tiqdio_unregister_thinints(void);

void clear_nonshared_ind(struct qdio_irq *);
int test_nonshared_ind(struct qdio_irq *);

/* prototypes for setup */
void qdio_inbound_processing(unsigned long data);
Expand Down
6 changes: 2 additions & 4 deletions trunk/drivers/s390/cio/qdio_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1719,17 +1719,15 @@ int qdio_start_irq(struct ccw_device *cdev, int nr)

WARN_ON(queue_irqs_enabled(q));

if (!shared_ind(q))
xchg(q->irq_ptr->dsci, 0);

clear_nonshared_ind(irq_ptr);
qdio_stop_polling(q);
clear_bit(QDIO_QUEUE_IRQS_DISABLED, &q->u.in.queue_irq_state);

/*
* We need to check again to not lose initiative after
* resetting the ACK state.
*/
if (!shared_ind(q) && *q->irq_ptr->dsci)
if (test_nonshared_ind(irq_ptr))
goto rescan;
if (!qdio_inbound_q_done(q))
goto rescan;
Expand Down
48 changes: 46 additions & 2 deletions trunk/drivers/s390/cio/qdio_thinint.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@
*/
#define TIQDIO_NR_NONSHARED_IND 63
#define TIQDIO_NR_INDICATORS (TIQDIO_NR_NONSHARED_IND + 1)
#define TIQDIO_SHARED_IND 63

/* device state change indicators */
struct indicator_t {
u32 ind; /* u32 because of compare-and-swap performance */
atomic_t count; /* use count, 0 or 1 for non-shared indicators */
};

/* list of thin interrupt input queues */
static LIST_HEAD(tiq_list);
Expand All @@ -34,7 +41,7 @@ static DEFINE_MUTEX(tiq_list_lock);
/* adapter local summary indicator */
static u8 *tiqdio_alsi;

struct indicator_t *q_indicators;
static struct indicator_t *q_indicators;

u64 last_ai_time;

Expand Down Expand Up @@ -90,6 +97,43 @@ void tiqdio_remove_input_queues(struct qdio_irq *irq_ptr)
synchronize_rcu();
}

static inline int has_multiple_inq_on_dsci(struct qdio_irq *irq_ptr)
{
return irq_ptr->nr_input_qs > 1;
}

static inline int references_shared_dsci(struct qdio_irq *irq_ptr)
{
return irq_ptr->dsci == &q_indicators[TIQDIO_SHARED_IND].ind;
}

static inline int shared_ind(struct qdio_irq *irq_ptr)
{
return references_shared_dsci(irq_ptr) ||
has_multiple_inq_on_dsci(irq_ptr);
}

void clear_nonshared_ind(struct qdio_irq *irq_ptr)
{
if (!is_thinint_irq(irq_ptr))
return;
if (shared_ind(irq_ptr))
return;
xchg(irq_ptr->dsci, 0);
}

int test_nonshared_ind(struct qdio_irq *irq_ptr)
{
if (!is_thinint_irq(irq_ptr))
return 0;
if (shared_ind(irq_ptr))
return 0;
if (*irq_ptr->dsci)
return 1;
else
return 0;
}

static inline u32 clear_shared_ind(void)
{
if (!atomic_read(&q_indicators[TIQDIO_SHARED_IND].count))
Expand Down Expand Up @@ -119,7 +163,7 @@ static inline void tiqdio_call_inq_handlers(struct qdio_irq *irq)
q->u.in.queue_start_poll(q->irq_ptr->cdev, q->nr,
q->irq_ptr->int_parm);
} else {
if (!shared_ind(q))
if (!shared_ind(q->irq_ptr))
xchg(q->irq_ptr->dsci, 0);

/*
Expand Down

0 comments on commit 3e768c6

Please sign in to comment.