23
23
24
24
static struct bau_operations ops __ro_after_init ;
25
25
26
- /* timeouts in nanoseconds (indexed by UVH_AGING_PRESCALE_SEL urgency7 30:28) */
27
- static const int timeout_base_ns [] = {
28
- 20 ,
29
- 160 ,
30
- 1280 ,
31
- 10240 ,
32
- 81920 ,
33
- 655360 ,
34
- 5242880 ,
35
- 167772160
36
- };
37
-
38
26
static int timeout_us ;
39
27
static bool nobau = true;
40
28
static int nobau_perm ;
@@ -510,70 +498,6 @@ static inline void end_uvhub_quiesce(struct bau_control *hmaster)
510
498
atom_asr (-1 , (struct atomic_short * )& hmaster -> uvhub_quiesce );
511
499
}
512
500
513
- static unsigned long uv1_read_status (unsigned long mmr_offset , int right_shift )
514
- {
515
- unsigned long descriptor_status ;
516
-
517
- descriptor_status = uv_read_local_mmr (mmr_offset );
518
- descriptor_status >>= right_shift ;
519
- descriptor_status &= UV_ACT_STATUS_MASK ;
520
- return descriptor_status ;
521
- }
522
-
523
- /*
524
- * Wait for completion of a broadcast software ack message
525
- * return COMPLETE, RETRY(PLUGGED or TIMEOUT) or GIVEUP
526
- */
527
- static int uv1_wait_completion (struct bau_desc * bau_desc ,
528
- struct bau_control * bcp , long try )
529
- {
530
- unsigned long descriptor_status ;
531
- cycles_t ttm ;
532
- u64 mmr_offset = bcp -> status_mmr ;
533
- int right_shift = bcp -> status_index ;
534
- struct ptc_stats * stat = bcp -> statp ;
535
-
536
- descriptor_status = uv1_read_status (mmr_offset , right_shift );
537
- /* spin on the status MMR, waiting for it to go idle */
538
- while ((descriptor_status != DS_IDLE )) {
539
- /*
540
- * Our software ack messages may be blocked because
541
- * there are no swack resources available. As long
542
- * as none of them has timed out hardware will NACK
543
- * our message and its state will stay IDLE.
544
- */
545
- if (descriptor_status == DS_SOURCE_TIMEOUT ) {
546
- stat -> s_stimeout ++ ;
547
- return FLUSH_GIVEUP ;
548
- } else if (descriptor_status == DS_DESTINATION_TIMEOUT ) {
549
- stat -> s_dtimeout ++ ;
550
- ttm = get_cycles ();
551
-
552
- /*
553
- * Our retries may be blocked by all destination
554
- * swack resources being consumed, and a timeout
555
- * pending. In that case hardware returns the
556
- * ERROR that looks like a destination timeout.
557
- */
558
- if (cycles_2_us (ttm - bcp -> send_message ) < timeout_us ) {
559
- bcp -> conseccompletes = 0 ;
560
- return FLUSH_RETRY_PLUGGED ;
561
- }
562
-
563
- bcp -> conseccompletes = 0 ;
564
- return FLUSH_RETRY_TIMEOUT ;
565
- } else {
566
- /*
567
- * descriptor_status is still BUSY
568
- */
569
- cpu_relax ();
570
- }
571
- descriptor_status = uv1_read_status (mmr_offset , right_shift );
572
- }
573
- bcp -> conseccompletes ++ ;
574
- return FLUSH_COMPLETE ;
575
- }
576
-
577
501
/*
578
502
* UV2 could have an extra bit of status in the ACTIVATION_STATUS_2 register.
579
503
* But not currently used.
@@ -852,24 +776,6 @@ static void record_send_stats(cycles_t time1, cycles_t time2,
852
776
}
853
777
}
854
778
855
- /*
856
- * Because of a uv1 hardware bug only a limited number of concurrent
857
- * requests can be made.
858
- */
859
- static void uv1_throttle (struct bau_control * hmaster , struct ptc_stats * stat )
860
- {
861
- spinlock_t * lock = & hmaster -> uvhub_lock ;
862
- atomic_t * v ;
863
-
864
- v = & hmaster -> active_descriptor_count ;
865
- if (!atomic_inc_unless_ge (lock , v , hmaster -> max_concurr )) {
866
- stat -> s_throttles ++ ;
867
- do {
868
- cpu_relax ();
869
- } while (!atomic_inc_unless_ge (lock , v , hmaster -> max_concurr ));
870
- }
871
- }
872
-
873
779
/*
874
780
* Handle the completion status of a message send.
875
781
*/
@@ -899,50 +805,30 @@ static int uv_flush_send_and_wait(struct cpumask *flush_mask,
899
805
{
900
806
int seq_number = 0 ;
901
807
int completion_stat = 0 ;
902
- int uv1 = 0 ;
903
808
long try = 0 ;
904
809
unsigned long index ;
905
810
cycles_t time1 ;
906
811
cycles_t time2 ;
907
812
struct ptc_stats * stat = bcp -> statp ;
908
813
struct bau_control * hmaster = bcp -> uvhub_master ;
909
- struct uv1_bau_msg_header * uv1_hdr = NULL ;
910
814
struct uv2_3_bau_msg_header * uv2_3_hdr = NULL ;
911
815
912
- if (bcp -> uvhub_version == UV_BAU_V1 ) {
913
- uv1 = 1 ;
914
- uv1_throttle (hmaster , stat );
915
- }
916
-
917
816
while (hmaster -> uvhub_quiesce )
918
817
cpu_relax ();
919
818
920
819
time1 = get_cycles ();
921
- if (uv1 )
922
- uv1_hdr = & bau_desc -> header .uv1_hdr ;
923
- else
924
- /* uv2 and uv3 */
925
- uv2_3_hdr = & bau_desc -> header .uv2_3_hdr ;
820
+ uv2_3_hdr = & bau_desc -> header .uv2_3_hdr ;
926
821
927
822
do {
928
823
if (try == 0 ) {
929
- if (uv1 )
930
- uv1_hdr -> msg_type = MSG_REGULAR ;
931
- else
932
- uv2_3_hdr -> msg_type = MSG_REGULAR ;
824
+ uv2_3_hdr -> msg_type = MSG_REGULAR ;
933
825
seq_number = bcp -> message_number ++ ;
934
826
} else {
935
- if (uv1 )
936
- uv1_hdr -> msg_type = MSG_RETRY ;
937
- else
938
- uv2_3_hdr -> msg_type = MSG_RETRY ;
827
+ uv2_3_hdr -> msg_type = MSG_RETRY ;
939
828
stat -> s_retry_messages ++ ;
940
829
}
941
830
942
- if (uv1 )
943
- uv1_hdr -> sequence = seq_number ;
944
- else
945
- uv2_3_hdr -> sequence = seq_number ;
831
+ uv2_3_hdr -> sequence = seq_number ;
946
832
index = (1UL << AS_PUSH_SHIFT ) | bcp -> uvhub_cpu ;
947
833
bcp -> send_message = get_cycles ();
948
834
@@ -1162,7 +1048,6 @@ const struct cpumask *uv_flush_tlb_others(const struct cpumask *cpumask,
1162
1048
address = TLB_FLUSH_ALL ;
1163
1049
1164
1050
switch (bcp -> uvhub_version ) {
1165
- case UV_BAU_V1 :
1166
1051
case UV_BAU_V2 :
1167
1052
case UV_BAU_V3 :
1168
1053
bau_desc -> payload .uv1_2_3 .address = address ;
@@ -1300,7 +1185,7 @@ DEFINE_IDTENTRY_SYSVEC(sysvec_uv_bau_message)
1300
1185
if (bcp -> uvhub_version == UV_BAU_V2 )
1301
1186
process_uv2_message (& msgdesc , bcp );
1302
1187
else
1303
- /* no error workaround for uv1 or uv3 */
1188
+ /* no error workaround for uv3 */
1304
1189
bau_process_message (& msgdesc , bcp , 1 );
1305
1190
1306
1191
msg ++ ;
@@ -1350,12 +1235,7 @@ static void __init enable_timeouts(void)
1350
1235
mmr_image &= ~((unsigned long )0xf << SOFTACK_PSHIFT );
1351
1236
mmr_image |= (SOFTACK_TIMEOUT_PERIOD << SOFTACK_PSHIFT );
1352
1237
write_mmr_misc_control (pnode , mmr_image );
1353
- /*
1354
- * UV1:
1355
- * Subsequent reversals of the timebase bit (3) cause an
1356
- * immediate timeout of one or all INTD resources as
1357
- * indicated in bits 2:0 (7 causes all of them to timeout).
1358
- */
1238
+
1359
1239
mmr_image |= (1L << SOFTACK_MSHIFT );
1360
1240
if (is_uv2_hub ()) {
1361
1241
/* do not touch the legacy mode bit */
@@ -1711,14 +1591,12 @@ static void activation_descriptor_init(int node, int pnode, int base_pnode)
1711
1591
{
1712
1592
int i ;
1713
1593
int cpu ;
1714
- int uv1 = 0 ;
1715
1594
unsigned long gpa ;
1716
1595
unsigned long m ;
1717
1596
unsigned long n ;
1718
1597
size_t dsize ;
1719
1598
struct bau_desc * bau_desc ;
1720
1599
struct bau_desc * bd2 ;
1721
- struct uv1_bau_msg_header * uv1_hdr ;
1722
1600
struct uv2_3_bau_msg_header * uv2_3_hdr ;
1723
1601
struct bau_control * bcp ;
1724
1602
@@ -1733,8 +1611,6 @@ static void activation_descriptor_init(int node, int pnode, int base_pnode)
1733
1611
gpa = uv_gpa (bau_desc );
1734
1612
n = uv_gpa_to_gnode (gpa );
1735
1613
m = ops .bau_gpa_to_offset (gpa );
1736
- if (is_uv1_hub ())
1737
- uv1 = 1 ;
1738
1614
1739
1615
/* the 14-bit pnode */
1740
1616
write_mmr_descriptor_base (pnode ,
@@ -1746,37 +1622,15 @@ static void activation_descriptor_init(int node, int pnode, int base_pnode)
1746
1622
*/
1747
1623
for (i = 0 , bd2 = bau_desc ; i < (ADP_SZ * ITEMS_PER_DESC ); i ++ , bd2 ++ ) {
1748
1624
memset (bd2 , 0 , sizeof (struct bau_desc ));
1749
- if (uv1 ) {
1750
- uv1_hdr = & bd2 -> header .uv1_hdr ;
1751
- uv1_hdr -> swack_flag = 1 ;
1752
- /*
1753
- * The base_dest_nasid set in the message header
1754
- * is the nasid of the first uvhub in the partition.
1755
- * The bit map will indicate destination pnode numbers
1756
- * relative to that base. They may not be consecutive
1757
- * if nasid striding is being used.
1758
- */
1759
- uv1_hdr -> base_dest_nasid =
1760
- UV_PNODE_TO_NASID (base_pnode );
1761
- uv1_hdr -> dest_subnodeid = UV_LB_SUBNODEID ;
1762
- uv1_hdr -> command = UV_NET_ENDPOINT_INTD ;
1763
- uv1_hdr -> int_both = 1 ;
1764
- /*
1765
- * all others need to be set to zero:
1766
- * fairness chaining multilevel count replied_to
1767
- */
1768
- } else {
1769
- /*
1770
- * BIOS uses legacy mode, but uv2 and uv3 hardware always
1771
- * uses native mode for selective broadcasts.
1772
- */
1773
- uv2_3_hdr = & bd2 -> header .uv2_3_hdr ;
1774
- uv2_3_hdr -> swack_flag = 1 ;
1775
- uv2_3_hdr -> base_dest_nasid =
1776
- UV_PNODE_TO_NASID (base_pnode );
1777
- uv2_3_hdr -> dest_subnodeid = UV_LB_SUBNODEID ;
1778
- uv2_3_hdr -> command = UV_NET_ENDPOINT_INTD ;
1779
- }
1625
+ /*
1626
+ * BIOS uses legacy mode, but uv2 and uv3 hardware always
1627
+ * uses native mode for selective broadcasts.
1628
+ */
1629
+ uv2_3_hdr = & bd2 -> header .uv2_3_hdr ;
1630
+ uv2_3_hdr -> swack_flag = 1 ;
1631
+ uv2_3_hdr -> base_dest_nasid = UV_PNODE_TO_NASID (base_pnode );
1632
+ uv2_3_hdr -> dest_subnodeid = UV_LB_SUBNODEID ;
1633
+ uv2_3_hdr -> command = UV_NET_ENDPOINT_INTD ;
1780
1634
}
1781
1635
for_each_present_cpu (cpu ) {
1782
1636
if (pnode != uv_blade_to_pnode (uv_cpu_to_blade_id (cpu )))
@@ -1861,7 +1715,7 @@ static void __init init_uvhub(int uvhub, int vector, int base_pnode)
1861
1715
* The below initialization can't be in firmware because the
1862
1716
* messaging IRQ will be determined by the OS.
1863
1717
*/
1864
- apicid = uvhub_to_first_apicid (uvhub ) | uv_apicid_hibits ;
1718
+ apicid = uvhub_to_first_apicid (uvhub );
1865
1719
write_mmr_data_config (pnode , ((apicid << 32 ) | vector ));
1866
1720
}
1867
1721
@@ -1874,33 +1728,20 @@ static int calculate_destination_timeout(void)
1874
1728
{
1875
1729
unsigned long mmr_image ;
1876
1730
int mult1 ;
1877
- int mult2 ;
1878
- int index ;
1879
1731
int base ;
1880
1732
int ret ;
1881
- unsigned long ts_ns ;
1882
-
1883
- if (is_uv1_hub ()) {
1884
- mult1 = SOFTACK_TIMEOUT_PERIOD & BAU_MISC_CONTROL_MULT_MASK ;
1885
- mmr_image = uv_read_local_mmr (UVH_AGING_PRESCALE_SEL );
1886
- index = (mmr_image >> BAU_URGENCY_7_SHIFT ) & BAU_URGENCY_7_MASK ;
1887
- mmr_image = uv_read_local_mmr (UVH_TRANSACTION_TIMEOUT );
1888
- mult2 = (mmr_image >> BAU_TRANS_SHIFT ) & BAU_TRANS_MASK ;
1889
- ts_ns = timeout_base_ns [index ];
1890
- ts_ns *= (mult1 * mult2 );
1891
- ret = ts_ns / 1000 ;
1892
- } else {
1893
- /* same destination timeout for uv2 and uv3 */
1894
- /* 4 bits 0/1 for 10/80us base, 3 bits of multiplier */
1895
- mmr_image = uv_read_local_mmr (UVH_LB_BAU_MISC_CONTROL );
1896
- mmr_image = (mmr_image & UV_SA_MASK ) >> UV_SA_SHFT ;
1897
- if (mmr_image & (1L << UV2_ACK_UNITS_SHFT ))
1898
- base = 80 ;
1899
- else
1900
- base = 10 ;
1901
- mult1 = mmr_image & UV2_ACK_MASK ;
1902
- ret = mult1 * base ;
1903
- }
1733
+
1734
+ /* same destination timeout for uv2 and uv3 */
1735
+ /* 4 bits 0/1 for 10/80us base, 3 bits of multiplier */
1736
+ mmr_image = uv_read_local_mmr (UVH_LB_BAU_MISC_CONTROL );
1737
+ mmr_image = (mmr_image & UV_SA_MASK ) >> UV_SA_SHFT ;
1738
+ if (mmr_image & (1L << UV2_ACK_UNITS_SHFT ))
1739
+ base = 80 ;
1740
+ else
1741
+ base = 10 ;
1742
+ mult1 = mmr_image & UV2_ACK_MASK ;
1743
+ ret = mult1 * base ;
1744
+
1904
1745
return ret ;
1905
1746
}
1906
1747
@@ -2039,9 +1880,7 @@ static int scan_sock(struct socket_desc *sdp, struct uvhub_desc *bdp,
2039
1880
bcp -> cpus_in_socket = sdp -> num_cpus ;
2040
1881
bcp -> socket_master = * smasterp ;
2041
1882
bcp -> uvhub = bdp -> uvhub ;
2042
- if (is_uv1_hub ())
2043
- bcp -> uvhub_version = UV_BAU_V1 ;
2044
- else if (is_uv2_hub ())
1883
+ if (is_uv2_hub ())
2045
1884
bcp -> uvhub_version = UV_BAU_V2 ;
2046
1885
else if (is_uv3_hub ())
2047
1886
bcp -> uvhub_version = UV_BAU_V3 ;
@@ -2123,7 +1962,7 @@ static int __init init_per_cpu(int nuvhubs, int base_part_pnode)
2123
1962
struct uvhub_desc * uvhub_descs ;
2124
1963
unsigned char * uvhub_mask = NULL ;
2125
1964
2126
- if (is_uv3_hub () || is_uv2_hub () || is_uv1_hub () )
1965
+ if (is_uv3_hub () || is_uv2_hub ())
2127
1966
timeout_us = calculate_destination_timeout ();
2128
1967
2129
1968
uvhub_descs = kcalloc (nuvhubs , sizeof (struct uvhub_desc ), GFP_KERNEL );
@@ -2151,17 +1990,6 @@ static int __init init_per_cpu(int nuvhubs, int base_part_pnode)
2151
1990
return 1 ;
2152
1991
}
2153
1992
2154
- static const struct bau_operations uv1_bau_ops __initconst = {
2155
- .bau_gpa_to_offset = uv_gpa_to_offset ,
2156
- .read_l_sw_ack = read_mmr_sw_ack ,
2157
- .read_g_sw_ack = read_gmmr_sw_ack ,
2158
- .write_l_sw_ack = write_mmr_sw_ack ,
2159
- .write_g_sw_ack = write_gmmr_sw_ack ,
2160
- .write_payload_first = write_mmr_payload_first ,
2161
- .write_payload_last = write_mmr_payload_last ,
2162
- .wait_completion = uv1_wait_completion ,
2163
- };
2164
-
2165
1993
static const struct bau_operations uv2_3_bau_ops __initconst = {
2166
1994
.bau_gpa_to_offset = uv_gpa_to_offset ,
2167
1995
.read_l_sw_ack = read_mmr_sw_ack ,
@@ -2206,8 +2034,6 @@ static int __init uv_bau_init(void)
2206
2034
ops = uv2_3_bau_ops ;
2207
2035
else if (is_uv2_hub ())
2208
2036
ops = uv2_3_bau_ops ;
2209
- else if (is_uv1_hub ())
2210
- ops = uv1_bau_ops ;
2211
2037
2212
2038
nuvhubs = uv_num_possible_blades ();
2213
2039
if (nuvhubs < 2 ) {
@@ -2228,7 +2054,7 @@ static int __init uv_bau_init(void)
2228
2054
}
2229
2055
2230
2056
/* software timeouts are not supported on UV4 */
2231
- if (is_uv3_hub () || is_uv2_hub () || is_uv1_hub () )
2057
+ if (is_uv3_hub () || is_uv2_hub ())
2232
2058
enable_timeouts ();
2233
2059
2234
2060
if (init_per_cpu (nuvhubs , uv_base_pnode )) {
@@ -2251,8 +2077,7 @@ static int __init uv_bau_init(void)
2251
2077
val = 1L << 63 ;
2252
2078
write_gmmr_activation (pnode , val );
2253
2079
mmr = 1 ; /* should be 1 to broadcast to both sockets */
2254
- if (!is_uv1_hub ())
2255
- write_mmr_data_broadcast (pnode , mmr );
2080
+ write_mmr_data_broadcast (pnode , mmr );
2256
2081
}
2257
2082
}
2258
2083
0 commit comments