From 87fa5af80cdd5053b27a546725948c2b74ec82b2 Mon Sep 17 00:00:00 2001 From: Heiko Carstens Date: Thu, 26 Mar 2009 15:24:10 +0100 Subject: [S390] cio: ensure single load of irq handler pointer Add barrier to prevent compiler from reloading pointer to irq handler. Signed-off-by: Heiko Carstens Signed-off-by: Martin Schwidefsky --- drivers/s390/cio/airq.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers/s390/cio/airq.c') diff --git a/drivers/s390/cio/airq.c b/drivers/s390/cio/airq.c index fe6cea15bba..d3850dc30e4 100644 --- a/drivers/s390/cio/airq.c +++ b/drivers/s390/cio/airq.c @@ -133,6 +133,8 @@ void do_adapter_IO(u8 isc) while (word) { if (word & INDICATOR_MASK) { airq = airqs[isc][i]; + /* Make sure gcc reads from airqs only once. */ + barrier(); if (likely(airq)) airq->handler(&indicators[isc].byte[i], airq->drv_data); -- cgit v1.2.3 From a1f640734ab57d548a3fdadad6b869da534d4ecb Mon Sep 17 00:00:00 2001 From: Sebastian Ott Date: Thu, 26 Mar 2009 15:24:12 +0100 Subject: [S390] cio: airq - fix array boundary MAX_ISC is a valid isc number, so arrays with an index of isc need to have a length of MAX_ISC+1 Signed-off-by: Sebastian Ott Signed-off-by: Martin Schwidefsky --- drivers/s390/cio/airq.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/s390/cio/airq.c') diff --git a/drivers/s390/cio/airq.c b/drivers/s390/cio/airq.c index d3850dc30e4..65d2e769dfa 100644 --- a/drivers/s390/cio/airq.c +++ b/drivers/s390/cio/airq.c @@ -34,8 +34,8 @@ struct airq_t { void *drv_data; }; -static union indicator_t indicators[MAX_ISC]; -static struct airq_t *airqs[MAX_ISC][NR_AIRQS]; +static union indicator_t indicators[MAX_ISC+1]; +static struct airq_t *airqs[MAX_ISC+1][NR_AIRQS]; static int register_airq(struct airq_t *airq, u8 isc) { -- cgit v1.2.3