Skip to content

Commit 40bfb8e

Browse files
Dimitri SivanichIngo Molnar
authored andcommitted
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 <[email protected]> Tested-by: Gary Kroening <[email protected]> Tested-by: Nathan Zimmer <[email protected]> Signed-off-by: Dimitri Sivanich <[email protected]> Signed-off-by: Mike Travis <[email protected]> Cc: Andrew Banman <[email protected]> Cc: Andrew Morton <[email protected]> Cc: Andy Lutomirski <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Brian Gerst <[email protected]> Cc: Denys Vlasenko <[email protected]> Cc: H. Peter Anvin <[email protected]> Cc: Len Brown <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Russ Anderson <[email protected]> Cc: Thomas Gleixner <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
1 parent c85375c commit 40bfb8e

File tree

2 files changed

+22
-26
lines changed

2 files changed

+22
-26
lines changed

arch/x86/include/asm/uv/uv_hub.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -647,16 +647,6 @@ static inline unsigned long uv_read_global_mmr64(int pnode, unsigned long offset
647647
return readq(uv_global_mmr64_address(pnode, offset));
648648
}
649649

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-
660650
static inline void uv_write_global_mmr8(int pnode, unsigned long offset, unsigned char val)
661651
{
662652
writeb(val, uv_global_mmr64_address(pnode, offset));

drivers/misc/sgi-gru/grukservices.c

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -718,8 +718,8 @@ static int send_message_queue_full(void *cb, struct gru_message_queue_desc *mqd,
718718
static int send_message_put_nacked(void *cb, struct gru_message_queue_desc *mqd,
719719
void *mesg, int lines)
720720
{
721-
unsigned long m, *val = mesg, gpa, save;
722-
int ret;
721+
unsigned long m;
722+
int ret, loops = 200; /* experimentally determined */
723723

724724
m = mqd->mq_gpa + (gru_get_amo_value_head(cb) << 6);
725725
if (lines == 2) {
@@ -735,22 +735,28 @@ static int send_message_put_nacked(void *cb, struct gru_message_queue_desc *mqd,
735735
return MQE_OK;
736736

737737
/*
738-
* Send a cross-partition interrupt to the SSI that contains the target
739-
* message queue. Normally, the interrupt is automatically delivered by
740-
* hardware but some error conditions require explicit delivery.
741-
* Use the GRU to deliver the interrupt. Otherwise partition failures
738+
* Send a noop message in order to deliver a cross-partition interrupt
739+
* to the SSI that contains the target message queue. Normally, the
740+
* interrupt is automatically delivered by hardware following mesq
741+
* operations, but some error conditions require explicit delivery.
742+
* The noop message will trigger delivery. Otherwise partition failures
742743
* could cause unrecovered errors.
743744
*/
744-
gpa = uv_global_gru_mmr_address(mqd->interrupt_pnode, UVH_IPI_INT);
745-
save = *val;
746-
*val = uv_hub_ipi_value(mqd->interrupt_apicid, mqd->interrupt_vector,
747-
dest_Fixed);
748-
gru_vstore_phys(cb, gpa, gru_get_tri(mesg), IAA_REGISTER, IMA);
749-
ret = gru_wait(cb);
750-
*val = save;
751-
if (ret != CBS_IDLE)
752-
return MQE_UNEXPECTED_CB_ERR;
753-
return MQE_OK;
745+
do {
746+
ret = send_noop_message(cb, mqd, mesg);
747+
} while ((ret == MQIE_AGAIN || ret == MQE_CONGESTION) && (loops-- > 0));
748+
749+
if (ret == MQIE_AGAIN || ret == MQE_CONGESTION) {
750+
/*
751+
* Don't indicate to the app to resend the message, as it's
752+
* already been successfully sent. We simply send an OK
753+
* (rather than fail the send with MQE_UNEXPECTED_CB_ERR),
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;
754760
}
755761

756762
/*

0 commit comments

Comments
 (0)