diff options
author | Dimitri Sivanich <sivanich@sgi.com> | 2016-04-29 17:54:22 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2016-05-04 02:48:51 -0400 |
commit | 40bfb8eedf1e7fa0535c685ff1000c05bcf7a637 (patch) | |
tree | 09970d586c957464d9797157e4e01e736aa33ee0 | |
parent | c85375cd19966d5dd854cd8b8eada9be8f21fac1 (diff) |
x86/platform/UV: Remove Obsolete GRU MMR address translation
Use no-op messages in place of cross-partition interrupts when nacking a
put message in the GRU. This allows us to remove MMR's as a destination
from the GRU driver.
Tested-by: John Estabrook <estabrook@sgi.com>
Tested-by: Gary Kroening <gfk@sgi.com>
Tested-by: Nathan Zimmer <nzimmer@sgi.com>
Signed-off-by: Dimitri Sivanich <sivanich@sgi.com>
Signed-off-by: Mike Travis <travis@sgi.com>
Cc: Andrew Banman <abanman@sgi.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Len Brown <len.brown@intel.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Russ Anderson <rja@sgi.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/20160429215406.012228480@asylum.americas.sgi.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r-- | arch/x86/include/asm/uv/uv_hub.h | 10 | ||||
-rw-r--r-- | drivers/misc/sgi-gru/grukservices.c | 38 |
2 files changed, 22 insertions, 26 deletions
diff --git a/arch/x86/include/asm/uv/uv_hub.h b/arch/x86/include/asm/uv/uv_hub.h index ae979f7740f7..097b80c989c4 100644 --- a/arch/x86/include/asm/uv/uv_hub.h +++ b/arch/x86/include/asm/uv/uv_hub.h | |||
@@ -647,16 +647,6 @@ static inline unsigned long uv_read_global_mmr64(int pnode, unsigned long offset | |||
647 | return readq(uv_global_mmr64_address(pnode, offset)); | 647 | return readq(uv_global_mmr64_address(pnode, offset)); |
648 | } | 648 | } |
649 | 649 | ||
650 | /* | ||
651 | * Global MMR space addresses when referenced by the GRU. (GRU does | ||
652 | * NOT use socket addressing). | ||
653 | */ | ||
654 | static inline unsigned long uv_global_gru_mmr_address(int pnode, unsigned long offset) | ||
655 | { | ||
656 | return UV_GLOBAL_GRU_MMR_BASE | offset | | ||
657 | ((unsigned long)pnode << uv_hub_info->m_val); | ||
658 | } | ||
659 | |||
660 | static inline void uv_write_global_mmr8(int pnode, unsigned long offset, unsigned char val) | 650 | static inline void uv_write_global_mmr8(int pnode, unsigned long offset, unsigned char val) |
661 | { | 651 | { |
662 | writeb(val, uv_global_mmr64_address(pnode, offset)); | 652 | writeb(val, uv_global_mmr64_address(pnode, offset)); |
diff --git a/drivers/misc/sgi-gru/grukservices.c b/drivers/misc/sgi-gru/grukservices.c index 967b9dd24fe9..030769018461 100644 --- a/drivers/misc/sgi-gru/grukservices.c +++ b/drivers/misc/sgi-gru/grukservices.c | |||
@@ -718,8 +718,8 @@ cberr: | |||
718 | static int send_message_put_nacked(void *cb, struct gru_message_queue_desc *mqd, | 718 | static int send_message_put_nacked(void *cb, struct gru_message_queue_desc *mqd, |
719 | void *mesg, int lines) | 719 | void *mesg, int lines) |
720 | { | 720 | { |
721 | unsigned long m, *val = mesg, gpa, save; | 721 | unsigned long m; |
722 | int ret; | 722 | int ret, loops = 200; /* experimentally determined */ |
723 | 723 | ||
724 | m = mqd->mq_gpa + (gru_get_amo_value_head(cb) << 6); | 724 | m = mqd->mq_gpa + (gru_get_amo_value_head(cb) << 6); |
725 | if (lines == 2) { | 725 | if (lines == 2) { |
@@ -735,22 +735,28 @@ static int send_message_put_nacked(void *cb, struct gru_message_queue_desc *mqd, | |||
735 | return MQE_OK; | 735 | return MQE_OK; |
736 | 736 | ||
737 | /* | 737 | /* |
738 | * Send a cross-partition interrupt to the SSI that contains the target | 738 | * Send a noop message in order to deliver a cross-partition interrupt |
739 | * message queue. Normally, the interrupt is automatically delivered by | 739 | * to the SSI that contains the target message queue. Normally, the |
740 | * hardware but some error conditions require explicit delivery. | 740 | * interrupt is automatically delivered by hardware following mesq |
741 | * Use the GRU to deliver the interrupt. Otherwise partition failures | 741 | * operations, but some error conditions require explicit delivery. |
742 | * The noop message will trigger delivery. Otherwise partition failures | ||
742 | * could cause unrecovered errors. | 743 | * could cause unrecovered errors. |
743 | */ | 744 | */ |
744 | gpa = uv_global_gru_mmr_address(mqd->interrupt_pnode, UVH_IPI_INT); | 745 | do { |
745 | save = *val; | 746 | ret = send_noop_message(cb, mqd, mesg); |
746 | *val = uv_hub_ipi_value(mqd->interrupt_apicid, mqd->interrupt_vector, | 747 | } while ((ret == MQIE_AGAIN || ret == MQE_CONGESTION) && (loops-- > 0)); |
747 | dest_Fixed); | 748 | |
748 | gru_vstore_phys(cb, gpa, gru_get_tri(mesg), IAA_REGISTER, IMA); | 749 | if (ret == MQIE_AGAIN || ret == MQE_CONGESTION) { |
749 | ret = gru_wait(cb); | 750 | /* |
750 | *val = save; | 751 | * Don't indicate to the app to resend the message, as it's |
751 | if (ret != CBS_IDLE) | 752 | * already been successfully sent. We simply send an OK |
752 | return MQE_UNEXPECTED_CB_ERR; | 753 | * (rather than fail the send with MQE_UNEXPECTED_CB_ERR), |
753 | return MQE_OK; | 754 | * assuming that the other side is receiving enough |
755 | * interrupts to get this message processed anyway. | ||
756 | */ | ||
757 | ret = MQE_OK; | ||
758 | } | ||
759 | return ret; | ||
754 | } | 760 | } |
755 | 761 | ||
756 | /* | 762 | /* |