diff options
author | Bryan O'Sullivan <bos@pathscale.com> | 2006-04-24 17:23:03 -0400 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2006-05-01 15:14:16 -0400 |
commit | c71c30dcba142f16bc5f651812b1bc0b9f70f02d (patch) | |
tree | a6cb67f3b2c59d5eeb3638c859d983d9006c5a2d /drivers/infiniband/hw/ipath/ipath_kernel.h | |
parent | fccea663643cedfa310c5254da30e1e35e09199b (diff) |
IB/ipath: prevent hardware from being accessed during reset
The reset code now turns off the PRESENT flag during a reset, so that
other code won't attempt to access a device that's in mid-reset.
Signed-off-by: Bryan O'Sullivan <bos@pathscale.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband/hw/ipath/ipath_kernel.h')
-rw-r--r-- | drivers/infiniband/hw/ipath/ipath_kernel.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/infiniband/hw/ipath/ipath_kernel.h b/drivers/infiniband/hw/ipath/ipath_kernel.h index 0ce5f19c9d62..e6507f8115bc 100644 --- a/drivers/infiniband/hw/ipath/ipath_kernel.h +++ b/drivers/infiniband/hw/ipath/ipath_kernel.h | |||
@@ -731,7 +731,7 @@ u64 ipath_read_kreg64_port(const struct ipath_devdata *, ipath_kreg, | |||
731 | static inline u32 ipath_read_ureg32(const struct ipath_devdata *dd, | 731 | static inline u32 ipath_read_ureg32(const struct ipath_devdata *dd, |
732 | ipath_ureg regno, int port) | 732 | ipath_ureg regno, int port) |
733 | { | 733 | { |
734 | if (!dd->ipath_kregbase) | 734 | if (!dd->ipath_kregbase || !(dd->ipath_flags & IPATH_PRESENT)) |
735 | return 0; | 735 | return 0; |
736 | 736 | ||
737 | return readl(regno + (u64 __iomem *) | 737 | return readl(regno + (u64 __iomem *) |
@@ -762,7 +762,7 @@ static inline void ipath_write_ureg(const struct ipath_devdata *dd, | |||
762 | static inline u32 ipath_read_kreg32(const struct ipath_devdata *dd, | 762 | static inline u32 ipath_read_kreg32(const struct ipath_devdata *dd, |
763 | ipath_kreg regno) | 763 | ipath_kreg regno) |
764 | { | 764 | { |
765 | if (!dd->ipath_kregbase) | 765 | if (!dd->ipath_kregbase || !(dd->ipath_flags & IPATH_PRESENT)) |
766 | return -1; | 766 | return -1; |
767 | return readl((u32 __iomem *) & dd->ipath_kregbase[regno]); | 767 | return readl((u32 __iomem *) & dd->ipath_kregbase[regno]); |
768 | } | 768 | } |
@@ -770,7 +770,7 @@ static inline u32 ipath_read_kreg32(const struct ipath_devdata *dd, | |||
770 | static inline u64 ipath_read_kreg64(const struct ipath_devdata *dd, | 770 | static inline u64 ipath_read_kreg64(const struct ipath_devdata *dd, |
771 | ipath_kreg regno) | 771 | ipath_kreg regno) |
772 | { | 772 | { |
773 | if (!dd->ipath_kregbase) | 773 | if (!dd->ipath_kregbase || !(dd->ipath_flags & IPATH_PRESENT)) |
774 | return -1; | 774 | return -1; |
775 | 775 | ||
776 | return readq(&dd->ipath_kregbase[regno]); | 776 | return readq(&dd->ipath_kregbase[regno]); |
@@ -786,7 +786,7 @@ static inline void ipath_write_kreg(const struct ipath_devdata *dd, | |||
786 | static inline u64 ipath_read_creg(const struct ipath_devdata *dd, | 786 | static inline u64 ipath_read_creg(const struct ipath_devdata *dd, |
787 | ipath_sreg regno) | 787 | ipath_sreg regno) |
788 | { | 788 | { |
789 | if (!dd->ipath_kregbase) | 789 | if (!dd->ipath_kregbase || !(dd->ipath_flags & IPATH_PRESENT)) |
790 | return 0; | 790 | return 0; |
791 | 791 | ||
792 | return readq(regno + (u64 __iomem *) | 792 | return readq(regno + (u64 __iomem *) |
@@ -797,7 +797,7 @@ static inline u64 ipath_read_creg(const struct ipath_devdata *dd, | |||
797 | static inline u32 ipath_read_creg32(const struct ipath_devdata *dd, | 797 | static inline u32 ipath_read_creg32(const struct ipath_devdata *dd, |
798 | ipath_sreg regno) | 798 | ipath_sreg regno) |
799 | { | 799 | { |
800 | if (!dd->ipath_kregbase) | 800 | if (!dd->ipath_kregbase || !(dd->ipath_flags & IPATH_PRESENT)) |
801 | return 0; | 801 | return 0; |
802 | return readl(regno + (u64 __iomem *) | 802 | return readl(regno + (u64 __iomem *) |
803 | (dd->ipath_cregbase + | 803 | (dd->ipath_cregbase + |