Skip to content

Commit

Permalink
[PATCH] ehea: bugfix for register access functions
Browse files Browse the repository at this point in the history
Hi Jeff,

sorry to bother you again. We figured out that the readq function we
included in the eHEA patch we sent yesterday to access eHEA registers
is defined as little endian on POWER. This collides with our adapter.
We talked to some PPC people who told us there is a discussion going
on about new access functions. We were told to use __raw_readq /
__raw_writeq for now.

This patch fixes this bug found by our internal tests today.
Please apply this small patch on the latest patch we sent you yesterday.
If it is easier for you I can also give you the entire eHEA patch again.

sorry and thanks a lot,
Jan-Bernd

Signed-off-by: Jan-Bernd Themann <themann@de.ibm.com>

 drivers/net/ehea/ehea.h    |    2 +-
 drivers/net/ehea/ehea_hw.h |   11 ++++++++---
 2 files changed, 9 insertions(+), 4 deletions(-)
Signed-off-by: Jeff Garzik <jeff@garzik.org>
  • Loading branch information
Jan-Bernd Themann authored and Jeff Garzik committed Sep 19, 2006
1 parent 72e8d6b commit 53ccce2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion drivers/net/ehea/ehea.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
#include <asm/io.h>

#define DRV_NAME "ehea"
#define DRV_VERSION "EHEA_0027"
#define DRV_VERSION "EHEA_0028"

#define EHEA_MSG_DEFAULT (NETIF_MSG_LINK | NETIF_MSG_TIMER \
| NETIF_MSG_RX_ERR | NETIF_MSG_TX_ERR)
Expand Down
11 changes: 8 additions & 3 deletions drivers/net/ehea/ehea_hw.h
Original file line number Diff line number Diff line change
Expand Up @@ -189,20 +189,25 @@ struct ehea_eqtemm {
u64 eqx_it;
};

/*
* These access functions will be changed when the dissuccsion about
* the new access methods for POWER has settled.
*/

static inline u64 epa_load(struct h_epa epa, u32 offset)
{
return readq((void __iomem *)(epa.addr + offset));
return __raw_readq((void __iomem *)(epa.addr + offset));
}

static inline void epa_store(struct h_epa epa, u32 offset, u64 value)
{
writeq(value, (void __iomem *)(epa.addr + offset));
__raw_writeq(value, (void __iomem *)(epa.addr + offset));
epa_load(epa, offset); /* synchronize explicitly to eHEA */
}

static inline void epa_store_acc(struct h_epa epa, u32 offset, u64 value)
{
writeq(value, (void __iomem *)(epa.addr + offset));
__raw_writeq(value, (void __iomem *)(epa.addr + offset));
}

#define epa_store_eq(epa, offset, value)\
Expand Down

0 comments on commit 53ccce2

Please sign in to comment.