40 #include <linux/pci.h>
49 static u8 qib_6120_phys_portstate(
u64);
50 static u32 qib_6120_iblink_state(
u64);
59 #define KREG_IDX(regname) (QIB_6120_##regname##_OFFS / sizeof(u64))
62 #define kr_extctrl KREG_IDX(EXTCtrl)
63 #define kr_extstatus KREG_IDX(EXTStatus)
64 #define kr_gpio_clear KREG_IDX(GPIOClear)
65 #define kr_gpio_mask KREG_IDX(GPIOMask)
66 #define kr_gpio_out KREG_IDX(GPIOOut)
67 #define kr_gpio_status KREG_IDX(GPIOStatus)
68 #define kr_rcvctrl KREG_IDX(RcvCtrl)
69 #define kr_sendctrl KREG_IDX(SendCtrl)
70 #define kr_partitionkey KREG_IDX(RcvPartitionKey)
71 #define kr_hwdiagctrl KREG_IDX(HwDiagCtrl)
72 #define kr_ibcstatus KREG_IDX(IBCStatus)
73 #define kr_ibcctrl KREG_IDX(IBCCtrl)
74 #define kr_sendbuffererror KREG_IDX(SendBufErr0)
75 #define kr_rcvbthqp KREG_IDX(RcvBTHQP)
76 #define kr_counterregbase KREG_IDX(CntrRegBase)
77 #define kr_palign KREG_IDX(PageAlign)
78 #define kr_rcvegrbase KREG_IDX(RcvEgrBase)
79 #define kr_rcvegrcnt KREG_IDX(RcvEgrCnt)
80 #define kr_rcvhdrcnt KREG_IDX(RcvHdrCnt)
81 #define kr_rcvhdrentsize KREG_IDX(RcvHdrEntSize)
82 #define kr_rcvhdrsize KREG_IDX(RcvHdrSize)
83 #define kr_rcvtidbase KREG_IDX(RcvTIDBase)
84 #define kr_rcvtidcnt KREG_IDX(RcvTIDCnt)
85 #define kr_scratch KREG_IDX(Scratch)
86 #define kr_sendctrl KREG_IDX(SendCtrl)
87 #define kr_sendpioavailaddr KREG_IDX(SendPIOAvailAddr)
88 #define kr_sendpiobufbase KREG_IDX(SendPIOBufBase)
89 #define kr_sendpiobufcnt KREG_IDX(SendPIOBufCnt)
90 #define kr_sendpiosize KREG_IDX(SendPIOSize)
91 #define kr_sendregbase KREG_IDX(SendRegBase)
92 #define kr_userregbase KREG_IDX(UserRegBase)
93 #define kr_control KREG_IDX(Control)
94 #define kr_intclear KREG_IDX(IntClear)
95 #define kr_intmask KREG_IDX(IntMask)
96 #define kr_intstatus KREG_IDX(IntStatus)
97 #define kr_errclear KREG_IDX(ErrClear)
98 #define kr_errmask KREG_IDX(ErrMask)
99 #define kr_errstatus KREG_IDX(ErrStatus)
100 #define kr_hwerrclear KREG_IDX(HwErrClear)
101 #define kr_hwerrmask KREG_IDX(HwErrMask)
102 #define kr_hwerrstatus KREG_IDX(HwErrStatus)
103 #define kr_revision KREG_IDX(Revision)
104 #define kr_portcnt KREG_IDX(PortCnt)
105 #define kr_serdes_cfg0 KREG_IDX(SerdesCfg0)
106 #define kr_serdes_cfg1 (kr_serdes_cfg0 + 1)
107 #define kr_serdes_stat KREG_IDX(SerdesStat)
108 #define kr_xgxs_cfg KREG_IDX(XGXSCfg)
111 #define kr_rcvhdraddr KREG_IDX(RcvHdrAddr0)
112 #define kr_rcvhdrtailaddr KREG_IDX(RcvHdrTailAddr0)
114 #define CREG_IDX(regname) ((QIB_6120_##regname##_OFFS - \
115 QIB_6120_LBIntCnt_OFFS) / sizeof(u64))
117 #define cr_badformat CREG_IDX(RxBadFormatCnt)
118 #define cr_erricrc CREG_IDX(RxICRCErrCnt)
119 #define cr_errlink CREG_IDX(RxLinkProblemCnt)
120 #define cr_errlpcrc CREG_IDX(RxLPCRCErrCnt)
121 #define cr_errpkey CREG_IDX(RxPKeyMismatchCnt)
122 #define cr_rcvflowctrl_err CREG_IDX(RxFlowCtrlErrCnt)
123 #define cr_err_rlen CREG_IDX(RxLenErrCnt)
124 #define cr_errslen CREG_IDX(TxLenErrCnt)
125 #define cr_errtidfull CREG_IDX(RxTIDFullErrCnt)
126 #define cr_errtidvalid CREG_IDX(RxTIDValidErrCnt)
127 #define cr_errvcrc CREG_IDX(RxVCRCErrCnt)
128 #define cr_ibstatuschange CREG_IDX(IBStatusChangeCnt)
129 #define cr_lbint CREG_IDX(LBIntCnt)
130 #define cr_invalidrlen CREG_IDX(RxMaxMinLenErrCnt)
131 #define cr_invalidslen CREG_IDX(TxMaxMinLenErrCnt)
132 #define cr_lbflowstall CREG_IDX(LBFlowStallCnt)
133 #define cr_pktrcv CREG_IDX(RxDataPktCnt)
134 #define cr_pktrcvflowctrl CREG_IDX(RxFlowPktCnt)
135 #define cr_pktsend CREG_IDX(TxDataPktCnt)
136 #define cr_pktsendflow CREG_IDX(TxFlowPktCnt)
137 #define cr_portovfl CREG_IDX(RxP0HdrEgrOvflCnt)
138 #define cr_rcvebp CREG_IDX(RxEBPCnt)
139 #define cr_rcvovfl CREG_IDX(RxBufOvflCnt)
140 #define cr_senddropped CREG_IDX(TxDroppedPktCnt)
141 #define cr_sendstall CREG_IDX(TxFlowStallCnt)
142 #define cr_sendunderrun CREG_IDX(TxUnderrunCnt)
143 #define cr_wordrcv CREG_IDX(RxDwordCnt)
144 #define cr_wordsend CREG_IDX(TxDwordCnt)
145 #define cr_txunsupvl CREG_IDX(TxUnsupVLErrCnt)
146 #define cr_rxdroppkt CREG_IDX(RxDroppedPktCnt)
147 #define cr_iblinkerrrecov CREG_IDX(IBLinkErrRecoveryCnt)
148 #define cr_iblinkdown CREG_IDX(IBLinkDownedCnt)
149 #define cr_ibsymbolerr CREG_IDX(IBSymbolErrCnt)
151 #define SYM_RMASK(regname, fldname) ((u64) \
152 QIB_6120_##regname##_##fldname##_RMASK)
153 #define SYM_MASK(regname, fldname) ((u64) \
154 QIB_6120_##regname##_##fldname##_RMASK << \
155 QIB_6120_##regname##_##fldname##_LSB)
156 #define SYM_LSB(regname, fldname) (QIB_6120_##regname##_##fldname##_LSB)
158 #define SYM_FIELD(value, regname, fldname) ((u64) \
159 (((value) >> SYM_LSB(regname, fldname)) & \
160 SYM_RMASK(regname, fldname)))
161 #define ERR_MASK(fldname) SYM_MASK(ErrMask, fldname##Mask)
162 #define HWE_MASK(fldname) SYM_MASK(HwErrMask, fldname##Mask)
165 #define IB_6120_LT_STATE_DISABLED 0x00
166 #define IB_6120_LT_STATE_LINKUP 0x01
167 #define IB_6120_LT_STATE_POLLACTIVE 0x02
168 #define IB_6120_LT_STATE_POLLQUIET 0x03
169 #define IB_6120_LT_STATE_SLEEPDELAY 0x04
170 #define IB_6120_LT_STATE_SLEEPQUIET 0x05
171 #define IB_6120_LT_STATE_CFGDEBOUNCE 0x08
172 #define IB_6120_LT_STATE_CFGRCVFCFG 0x09
173 #define IB_6120_LT_STATE_CFGWAITRMT 0x0a
174 #define IB_6120_LT_STATE_CFGIDLE 0x0b
175 #define IB_6120_LT_STATE_RECOVERRETRAIN 0x0c
176 #define IB_6120_LT_STATE_RECOVERWAITRMT 0x0e
177 #define IB_6120_LT_STATE_RECOVERIDLE 0x0f
180 #define IB_6120_L_STATE_DOWN 0x0
181 #define IB_6120_L_STATE_INIT 0x1
182 #define IB_6120_L_STATE_ARM 0x2
183 #define IB_6120_L_STATE_ACTIVE 0x3
184 #define IB_6120_L_STATE_ACT_DEFER 0x4
186 static const u8 qib_6120_physportstate[0x20] = {
274 #define QLOGIC_IB_IBCC_LINKINITCMD_DISABLE 1
276 #define QLOGIC_IB_IBCC_LINKINITCMD_POLL 2
278 #define QLOGIC_IB_IBCC_LINKINITCMD_SLEEP 3
279 #define QLOGIC_IB_IBCC_LINKINITCMD_SHIFT 16
281 #define QLOGIC_IB_IBCC_LINKCMD_DOWN 1
282 #define QLOGIC_IB_IBCC_LINKCMD_ARMED 2
283 #define QLOGIC_IB_IBCC_LINKCMD_ACTIVE 3
284 #define QLOGIC_IB_IBCC_LINKCMD_SHIFT 18
331 static inline void qib_write_ureg(
const struct qib_devdata *
dd,
346 writeq(value, &ubase[regno]);
366 static inline void qib_write_kreg(
const struct qib_devdata *dd,
367 const u16 regno,
u64 value)
380 static inline void qib_write_kreg_ctxt(
const struct qib_devdata *dd,
381 const u16 regno,
unsigned ctxt,
384 qib_write_kreg(dd, regno + ctxt, value);
387 static inline void write_6120_creg(
const struct qib_devdata *dd,
409 #define QLOGIC_IB_C_RESET 1U
412 #define QLOGIC_IB_I_RCVURG_MASK ((1U << 5) - 1)
413 #define QLOGIC_IB_I_RCVURG_SHIFT 0
414 #define QLOGIC_IB_I_RCVAVAIL_MASK ((1U << 5) - 1)
415 #define QLOGIC_IB_I_RCVAVAIL_SHIFT 12
417 #define QLOGIC_IB_C_FREEZEMODE 0x00000002
418 #define QLOGIC_IB_C_LINKENABLE 0x00000004
419 #define QLOGIC_IB_I_ERROR 0x0000000080000000ULL
420 #define QLOGIC_IB_I_SPIOSENT 0x0000000040000000ULL
421 #define QLOGIC_IB_I_SPIOBUFAVAIL 0x0000000020000000ULL
422 #define QLOGIC_IB_I_GPIO 0x0000000010000000ULL
423 #define QLOGIC_IB_I_BITSEXTANT \
424 ((QLOGIC_IB_I_RCVURG_MASK << QLOGIC_IB_I_RCVURG_SHIFT) | \
425 (QLOGIC_IB_I_RCVAVAIL_MASK << \
426 QLOGIC_IB_I_RCVAVAIL_SHIFT) | \
427 QLOGIC_IB_I_ERROR | QLOGIC_IB_I_SPIOSENT | \
428 QLOGIC_IB_I_SPIOBUFAVAIL | QLOGIC_IB_I_GPIO)
431 #define QLOGIC_IB_HWE_PCIEMEMPARITYERR_MASK 0x000000000000003fULL
432 #define QLOGIC_IB_HWE_PCIEMEMPARITYERR_SHIFT 0
433 #define QLOGIC_IB_HWE_PCIEPOISONEDTLP 0x0000000010000000ULL
434 #define QLOGIC_IB_HWE_PCIECPLTIMEOUT 0x0000000020000000ULL
435 #define QLOGIC_IB_HWE_PCIEBUSPARITYXTLH 0x0000000040000000ULL
436 #define QLOGIC_IB_HWE_PCIEBUSPARITYXADM 0x0000000080000000ULL
437 #define QLOGIC_IB_HWE_PCIEBUSPARITYRADM 0x0000000100000000ULL
438 #define QLOGIC_IB_HWE_COREPLL_FBSLIP 0x0080000000000000ULL
439 #define QLOGIC_IB_HWE_COREPLL_RFSLIP 0x0100000000000000ULL
440 #define QLOGIC_IB_HWE_PCIE1PLLFAILED 0x0400000000000000ULL
441 #define QLOGIC_IB_HWE_PCIE0PLLFAILED 0x0800000000000000ULL
442 #define QLOGIC_IB_HWE_SERDESPLLFAILED 0x1000000000000000ULL
446 #define QLOGIC_IB_EXTS_FREQSEL 0x2
447 #define QLOGIC_IB_EXTS_SERDESSEL 0x4
448 #define QLOGIC_IB_EXTS_MEMBIST_ENDTEST 0x0000000000004000
449 #define QLOGIC_IB_EXTS_MEMBIST_FOUND 0x0000000000008000
452 #define QLOGIC_IB_XGXS_RESET 0x5ULL
454 #define _QIB_GPIO_SDA_NUM 1
455 #define _QIB_GPIO_SCL_NUM 0
458 #define GPIO_RXUVL_BIT 3
459 #define GPIO_OVRUN_BIT 4
460 #define GPIO_LLI_BIT 5
461 #define GPIO_ERRINTR_MASK 0x38
464 #define QLOGIC_IB_RT_BUFSIZE_MASK 0xe0000000ULL
465 #define QLOGIC_IB_RT_BUFSIZE_SHIFTVAL(tid) \
466 ((((tid) & QLOGIC_IB_RT_BUFSIZE_MASK) >> 29) + 11 - 1)
467 #define QLOGIC_IB_RT_BUFSIZE(tid) (1 << QLOGIC_IB_RT_BUFSIZE_SHIFTVAL(tid))
468 #define QLOGIC_IB_RT_IS_VALID(tid) \
469 (((tid) & QLOGIC_IB_RT_BUFSIZE_MASK) && \
470 ((((tid) & QLOGIC_IB_RT_BUFSIZE_MASK) != QLOGIC_IB_RT_BUFSIZE_MASK)))
471 #define QLOGIC_IB_RT_ADDR_MASK 0x1FFFFFFFULL
472 #define QLOGIC_IB_RT_ADDR_SHIFT 10
474 #define QLOGIC_IB_R_INTRAVAIL_SHIFT 16
475 #define QLOGIC_IB_R_TAILUPD_SHIFT 31
476 #define IBA6120_R_PKEY_DIS_SHIFT 30
478 #define PBC_6120_VL15_SEND_CTRL (1ULL << 31)
480 #define IBCBUSFRSPCPARITYERR HWE_MASK(IBCBusFromSPCParityErr)
481 #define IBCBUSTOSPCPARITYERR HWE_MASK(IBCBusToSPCParityErr)
483 #define SYM_MASK_BIT(regname, fldname, bit) ((u64) \
484 ((1ULL << (SYM_LSB(regname, fldname) + (bit)))))
486 #define TXEMEMPARITYERR_PIOBUF \
487 SYM_MASK_BIT(HwErrMask, TXEMemParityErrMask, 0)
488 #define TXEMEMPARITYERR_PIOPBC \
489 SYM_MASK_BIT(HwErrMask, TXEMemParityErrMask, 1)
490 #define TXEMEMPARITYERR_PIOLAUNCHFIFO \
491 SYM_MASK_BIT(HwErrMask, TXEMemParityErrMask, 2)
493 #define RXEMEMPARITYERR_RCVBUF \
494 SYM_MASK_BIT(HwErrMask, RXEMemParityErrMask, 0)
495 #define RXEMEMPARITYERR_LOOKUPQ \
496 SYM_MASK_BIT(HwErrMask, RXEMemParityErrMask, 1)
497 #define RXEMEMPARITYERR_EXPTID \
498 SYM_MASK_BIT(HwErrMask, RXEMemParityErrMask, 2)
499 #define RXEMEMPARITYERR_EAGERTID \
500 SYM_MASK_BIT(HwErrMask, RXEMemParityErrMask, 3)
501 #define RXEMEMPARITYERR_FLAGBUF \
502 SYM_MASK_BIT(HwErrMask, RXEMemParityErrMask, 4)
503 #define RXEMEMPARITYERR_DATAINFO \
504 SYM_MASK_BIT(HwErrMask, RXEMemParityErrMask, 5)
505 #define RXEMEMPARITYERR_HDRINFO \
506 SYM_MASK_BIT(HwErrMask, RXEMemParityErrMask, 6)
515 "TXE PIOBUF Memory Parity"),
517 "TXE PIOPBC Memory Parity"),
519 "TXE PIOLAUNCHFIFO Memory Parity"),
522 "RXE RCVBUF Memory Parity"),
524 "RXE LOOKUPQ Memory Parity"),
526 "RXE EAGERTID Memory Parity"),
528 "RXE EXPTID Memory Parity"),
530 "RXE FLAGBUF Memory Parity"),
532 "RXE DATAINFO Memory Parity"),
534 "RXE HDRINFO Memory Parity"),
538 "PCIe Poisoned TLP"),
540 "PCIe completion timeout"),
553 "PCIe XTLH core parity"),
555 "PCIe ADM TX core parity"),
557 "PCIe ADM RX core parity"),
562 #define TXE_PIO_PARITY (TXEMEMPARITYERR_PIOBUF | TXEMEMPARITYERR_PIOPBC)
563 #define _QIB_PLL_FAIL (QLOGIC_IB_HWE_COREPLL_FBSLIP | \
564 QLOGIC_IB_HWE_COREPLL_RFSLIP)
567 #define IB_HWE_BITSEXTANT \
568 (HWE_MASK(RXEMemParityErr) | \
569 HWE_MASK(TXEMemParityErr) | \
570 (QLOGIC_IB_HWE_PCIEMEMPARITYERR_MASK << \
571 QLOGIC_IB_HWE_PCIEMEMPARITYERR_SHIFT) | \
572 QLOGIC_IB_HWE_PCIE1PLLFAILED | \
573 QLOGIC_IB_HWE_PCIE0PLLFAILED | \
574 QLOGIC_IB_HWE_PCIEPOISONEDTLP | \
575 QLOGIC_IB_HWE_PCIECPLTIMEOUT | \
576 QLOGIC_IB_HWE_PCIEBUSPARITYXTLH | \
577 QLOGIC_IB_HWE_PCIEBUSPARITYXADM | \
578 QLOGIC_IB_HWE_PCIEBUSPARITYRADM | \
579 HWE_MASK(PowerOnBISTFailed) | \
580 QLOGIC_IB_HWE_COREPLL_FBSLIP | \
581 QLOGIC_IB_HWE_COREPLL_RFSLIP | \
582 QLOGIC_IB_HWE_SERDESPLLFAILED | \
583 HWE_MASK(IBCBusToSPCParityErr) | \
584 HWE_MASK(IBCBusFromSPCParityErr))
586 #define IB_E_BITSEXTANT \
587 (ERR_MASK(RcvFormatErr) | ERR_MASK(RcvVCRCErr) | \
588 ERR_MASK(RcvICRCErr) | ERR_MASK(RcvMinPktLenErr) | \
589 ERR_MASK(RcvMaxPktLenErr) | ERR_MASK(RcvLongPktLenErr) | \
590 ERR_MASK(RcvShortPktLenErr) | ERR_MASK(RcvUnexpectedCharErr) | \
591 ERR_MASK(RcvUnsupportedVLErr) | ERR_MASK(RcvEBPErr) | \
592 ERR_MASK(RcvIBFlowErr) | ERR_MASK(RcvBadVersionErr) | \
593 ERR_MASK(RcvEgrFullErr) | ERR_MASK(RcvHdrFullErr) | \
594 ERR_MASK(RcvBadTidErr) | ERR_MASK(RcvHdrLenErr) | \
595 ERR_MASK(RcvHdrErr) | ERR_MASK(RcvIBLostLinkErr) | \
596 ERR_MASK(SendMinPktLenErr) | ERR_MASK(SendMaxPktLenErr) | \
597 ERR_MASK(SendUnderRunErr) | ERR_MASK(SendPktLenErr) | \
598 ERR_MASK(SendDroppedSmpPktErr) | \
599 ERR_MASK(SendDroppedDataPktErr) | \
600 ERR_MASK(SendPioArmLaunchErr) | \
601 ERR_MASK(SendUnexpectedPktNumErr) | \
602 ERR_MASK(SendUnsupportedVLErr) | ERR_MASK(IBStatusChanged) | \
603 ERR_MASK(InvalidAddrErr) | ERR_MASK(ResetNegated) | \
604 ERR_MASK(HardwareErr))
606 #define QLOGIC_IB_E_PKTERRS ( \
607 ERR_MASK(SendPktLenErr) | \
608 ERR_MASK(SendDroppedDataPktErr) | \
609 ERR_MASK(RcvVCRCErr) | \
610 ERR_MASK(RcvICRCErr) | \
611 ERR_MASK(RcvShortPktLenErr) | \
615 #define E_SUM_PKTERRS \
616 (ERR_MASK(RcvHdrLenErr) | ERR_MASK(RcvBadTidErr) | \
617 ERR_MASK(RcvBadVersionErr) | ERR_MASK(RcvHdrErr) | \
618 ERR_MASK(RcvLongPktLenErr) | ERR_MASK(RcvShortPktLenErr) | \
619 ERR_MASK(RcvMaxPktLenErr) | ERR_MASK(RcvMinPktLenErr) | \
620 ERR_MASK(RcvFormatErr) | ERR_MASK(RcvUnsupportedVLErr) | \
621 ERR_MASK(RcvUnexpectedCharErr) | ERR_MASK(RcvEBPErr))
625 (ERR_MASK(SendPioArmLaunchErr) | \
626 ERR_MASK(SendUnexpectedPktNumErr) | \
627 ERR_MASK(SendDroppedDataPktErr) | \
628 ERR_MASK(SendDroppedSmpPktErr) | \
629 ERR_MASK(SendMaxPktLenErr) | ERR_MASK(SendUnsupportedVLErr) | \
630 ERR_MASK(SendMinPktLenErr) | ERR_MASK(SendPktLenErr) | \
631 ERR_MASK(InvalidAddrErr))
639 #define E_SPKT_ERRS_IGNORE \
640 (ERR_MASK(SendDroppedDataPktErr) | \
641 ERR_MASK(SendDroppedSmpPktErr) | \
642 ERR_MASK(SendMaxPktLenErr) | ERR_MASK(SendMinPktLenErr) | \
643 ERR_MASK(SendPktLenErr))
651 #define E_SUM_LINK_PKTERRS \
652 (ERR_MASK(SendDroppedDataPktErr) | \
653 ERR_MASK(SendDroppedSmpPktErr) | \
654 ERR_MASK(SendMinPktLenErr) | ERR_MASK(SendPktLenErr) | \
655 ERR_MASK(RcvShortPktLenErr) | ERR_MASK(RcvMinPktLenErr) | \
656 ERR_MASK(RcvUnexpectedCharErr))
668 static void qib_6120_txe_recover(
struct qib_devdata *dd)
672 "Recovering from TXE PIO parity error\n");
703 static void qib_6120_clear_freeze(
struct qib_devdata *dd)
709 qib_6120_set_intr_state(dd, 0);
729 qib_6120_set_intr_state(dd, 1);
743 static void qib_handle_6120_hwerrors(
struct qib_devdata *dd,
char *
msg,
755 if (hwerrs == ~0ULL) {
757 "Read of hardware error status failed (all bits set); ignoring\n");
768 hwerrs & ~
HWE_MASK(PowerOnBISTFailed));
770 hwerrs &= dd->
cspec->hwerrmask;
783 "Hardware error: hwerr=0x%llx (cleared)\n",
784 (
unsigned long long) hwerrs);
788 "hwerror interrupt with unknown errors %llx set\n",
802 qib_6120_txe_recover(dd);
803 hwerrs &= ~TXE_PIO_PARITY;
807 static u32 freeze_cnt;
810 qib_6120_clear_freeze(dd);
817 if (hwerrs &
HWE_MASK(PowerOnBISTFailed)) {
820 "[Memory BIST test failed, InfiniPath hardware unusable]",
828 ARRAY_SIZE(qib_6120_hwerror_msgs), msg, msgl);
830 bitsmsg = dd->
cspec->bitsmsgbuf;
833 bits = (
u32) ((hwerrs >>
837 "[PCIe Mem Parity Errs %x] ", bits);
844 "[PLL failed (%llx), InfiniPath hardware unusable]",
845 (
unsigned long long) hwerrs & _QIB_PLL_FAIL);
857 dd->
cspec->hwerrmask &= ~QLOGIC_IB_HWE_SERDESPLLFAILED;
874 "Fatal Hardware Error, no longer usable, SN %.16s\n",
893 static int qib_decode_6120_err(
struct qib_devdata *dd,
char *
buf,
size_t blen,
900 if (!(err & ~QLOGIC_IB_E_PKTERRS))
909 strlcat(buf,
"rhdrlen ", blen);
911 strlcat(buf,
"rbadtid ", blen);
912 if (err &
ERR_MASK(RcvBadVersionErr))
913 strlcat(buf,
"rbadversion ", blen);
916 if (err &
ERR_MASK(RcvLongPktLenErr))
917 strlcat(buf,
"rlongpktlen ", blen);
918 if (err &
ERR_MASK(RcvMaxPktLenErr))
919 strlcat(buf,
"rmaxpktlen ", blen);
920 if (err &
ERR_MASK(RcvMinPktLenErr))
921 strlcat(buf,
"rminpktlen ", blen);
922 if (err &
ERR_MASK(SendMinPktLenErr))
923 strlcat(buf,
"sminpktlen ", blen);
925 strlcat(buf,
"rformaterr ", blen);
926 if (err &
ERR_MASK(RcvUnsupportedVLErr))
927 strlcat(buf,
"runsupvl ", blen);
928 if (err &
ERR_MASK(RcvUnexpectedCharErr))
929 strlcat(buf,
"runexpchar ", blen);
931 strlcat(buf,
"ribflow ", blen);
932 if (err &
ERR_MASK(SendUnderRunErr))
933 strlcat(buf,
"sunderrun ", blen);
934 if (err &
ERR_MASK(SendPioArmLaunchErr))
935 strlcat(buf,
"spioarmlaunch ", blen);
936 if (err &
ERR_MASK(SendUnexpectedPktNumErr))
937 strlcat(buf,
"sunexperrpktnum ", blen);
938 if (err &
ERR_MASK(SendDroppedSmpPktErr))
939 strlcat(buf,
"sdroppedsmppkt ", blen);
940 if (err &
ERR_MASK(SendMaxPktLenErr))
941 strlcat(buf,
"smaxpktlen ", blen);
942 if (err &
ERR_MASK(SendUnsupportedVLErr))
943 strlcat(buf,
"sunsupVL ", blen);
945 strlcat(buf,
"invalidaddr ", blen);
947 strlcat(buf,
"rcvegrfull ", blen);
949 strlcat(buf,
"rcvhdrfull ", blen);
950 if (err &
ERR_MASK(IBStatusChanged))
951 strlcat(buf,
"ibcstatuschg ", blen);
952 if (err &
ERR_MASK(RcvIBLostLinkErr))
953 strlcat(buf,
"riblostlink ", blen);
955 strlcat(buf,
"hardware ", blen);
966 static void qib_disarm_6120_senderrbufs(
struct qib_pportdata *ppd)
968 unsigned long sbuf[2];
978 if (sbuf[0] || sbuf[1])
983 static int chk_6120_linkrecovery(
struct qib_devdata *dd,
u64 ibcs)
986 u32 ibstate = qib_6120_iblink_state(ibcs);
989 if (linkrecov != dd->
cspec->lastlinkrecov) {
991 dd->
cspec->lastlinkrecov = 0;
996 dd->
cspec->lastlinkrecov =
1004 u64 ignore_this_time = 0;
1011 errs &= dd->
cspec->errormask;
1012 msg = dd->
cspec->emsgbuf;
1016 qib_handle_6120_hwerrors(dd, msg,
sizeof dd->
cspec->emsgbuf);
1024 "error interrupt with unknown errors %llx set\n",
1028 qib_disarm_6120_senderrbufs(ppd);
1040 }
else if ((errs & E_SUM_LINK_PKTERRS) &&
1054 errs &= ~ignore_this_time;
1064 qib_decode_6120_err(dd, msg,
sizeof dd->
cspec->emsgbuf, errs & ~mask);
1068 if (errs & E_SUM_ERRS)
1073 if (errs &
ERR_MASK(IBStatusChanged)) {
1075 u32 ibstate = qib_6120_iblink_state(ibcs);
1079 handle = chk_6120_linkrecovery(dd, ibcs);
1087 if (handle && qib_6120_phys_portstate(ibcs) ==
1094 if (errs &
ERR_MASK(ResetNegated)) {
1096 "Got reset, requires re-init (unload and reload driver)\n");
1118 if (errs &
ERR_MASK(RcvEgrFullErr))
1137 static void qib_6120_init_hwerrors(
struct qib_devdata *dd)
1183 static void qib_set_6120_armlaunch(
struct qib_devdata *dd,
u32 enable)
1204 unsigned long flags;
1237 static int qib_6120_bringup_serdes(
struct qib_pportdata *ppd)
1240 u64 val, config1, prev_val, hwstat, ibc;
1246 dd->
cspec->ibdeltainprog = 1;
1251 ibc = 0x5ULL <<
SYM_LSB(IBCCtrl, FlowCtrlWaterMark);
1257 ibc |= 0x3ULL <<
SYM_LSB(IBCCtrl, FlowCtrlPeriod);
1259 dd->
cspec->lli_thresh = 0xf;
1260 ibc |= (
u64) dd->
cspec->lli_thresh <<
SYM_LSB(IBCCtrl, PhyerrThreshold);
1262 ibc |= 4ULL <<
SYM_LSB(IBCCtrl, CreditScale);
1264 ibc |= 0xfULL <<
SYM_LSB(IBCCtrl, OverrunThreshold);
1270 dd->
cspec->ibcctrl = ibc;
1286 val |=
SYM_MASK(SerdesCfg0, ResetPLL) |
1301 val &= ~(
SYM_MASK(SerdesCfg0, RxDetEnX) |
1307 val |= (
SYM_MASK(SerdesCfg0, ResetA) |
1318 val &= ~((
SYM_MASK(SerdesCfg0, ResetA) |
1331 val &= ~QLOGIC_IB_XGXS_RESET;
1334 val &= ~
SYM_MASK(XGXSCfg, polarity_inv);
1337 if (val != prev_val)
1343 config1 &= ~0x0ffffffff00ULL;
1345 config1 |= 0x00000000000ULL;
1347 config1 |= 0x0cccc000000ULL;
1366 dd->
control &= ~QLOGIC_IB_C_FREEZEMODE;
1377 static void qib_6120_quiet_serdes(
struct qib_pportdata *ppd)
1387 dd->
control | QLOGIC_IB_C_FREEZEMODE);
1389 if (dd->
cspec->ibsymdelta || dd->
cspec->iblnkerrdelta ||
1390 dd->
cspec->ibdeltainprog) {
1396 diagc |
SYM_MASK(HwDiagCtrl, CounterWrEnable));
1398 if (dd->
cspec->ibsymdelta || dd->
cspec->ibdeltainprog) {
1400 if (dd->
cspec->ibdeltainprog)
1401 val -= val - dd->
cspec->ibsymsnap;
1402 val -= dd->
cspec->ibsymdelta;
1405 if (dd->
cspec->iblnkerrdelta || dd->
cspec->ibdeltainprog) {
1407 if (dd->
cspec->ibdeltainprog)
1408 val -= val - dd->
cspec->iblnkerrsnap;
1409 val -= dd->
cspec->iblnkerrdelta;
1418 val |=
SYM_MASK(SerdesCfg0, TxIdeEnX);
1447 u64 extctl,
val, lst, ltst;
1448 unsigned long flags;
1466 ltst = qib_6120_phys_portstate(val);
1467 lst = qib_6120_iblink_state(val);
1474 extctl = dd->
cspec->extctrl & ~(
SYM_MASK(EXTCtrl, LEDPriPortGreenOn) |
1475 SYM_MASK(EXTCtrl, LEDPriPortYellowOn));
1478 extctl |=
SYM_MASK(EXTCtrl, LEDPriPortYellowOn);
1480 extctl |=
SYM_MASK(EXTCtrl, LEDPriPortGreenOn);
1481 dd->
cspec->extctrl = extctl;
1483 spin_unlock_irqrestore(&dd->
cspec->gpio_lock, flags);
1486 static void qib_6120_free_irq(
struct qib_devdata *dd)
1488 if (dd->
cspec->irq) {
1501 static void qib_6120_setup_cleanup(
struct qib_devdata *dd)
1503 qib_6120_free_irq(dd);
1506 if (dd->
cspec->dummy_hdrq) {
1511 dd->
cspec->dummy_hdrq,
1512 dd->
cspec->dummy_hdrq_phys);
1517 static void qib_wantpiobuf_6120_intr(
struct qib_devdata *dd,
u32 needint)
1519 unsigned long flags;
1538 qib_dev_err(dd,
"interrupt with unknown interrupts %Lx set\n",
1548 "error interrupt (%Lx), but no error bits set!\n",
1550 handle_6120_errors(dd, estat);
1572 dd->
cspec->rxfc_unsupvl_errs++;
1574 dd->
cspec->overrun_thresh_errs++;
1576 dd->
cspec->lli_errs++;
1577 gpiostatus &= ~GPIO_ERRINTR_MASK;
1593 if (mask & gpiostatus) {
1594 to_clear |= (gpiostatus &
mask);
1595 dd->
cspec->gpio_mask &= ~(gpiostatus &
mask);
1597 dd->
cspec->gpio_mask);
1609 u32 istat, ctxtrbits,
rmask, crcs = 0;
1641 QLOGIC_IB_I_GPIO | QLOGIC_IB_I_ERROR)))
1642 unlikely_6120_intr(dd, istat);
1664 if (ctxtrbits & rmask) {
1665 ctxtrbits &= ~rmask;
1667 &dd->
cspec->lli_counter,
1676 if (cntr > dd->
cspec->lli_thresh) {
1677 dd->
cspec->lli_counter = 0;
1678 dd->
cspec->lli_errs++;
1680 dd->
cspec->lli_counter += cntr;
1706 static void qib_setup_6120_interrupt(
struct qib_devdata *dd)
1715 ChipRevMinor) > 1) {
1721 if (!dd->
cspec->irq)
1723 "irq is 0, BIOS error? Interrupts won't work\n");
1730 "Couldn't setup interrupt (irq=%d): %d\n",
1731 dd->
cspec->irq, ret);
1751 n =
"InfiniPath_QLE7140";
1754 qib_dev_err(dd,
"Unknown 6120 board with ID %u\n", boardid);
1755 n =
"Unknown_InfiniPath_6120";
1761 qib_dev_err(dd,
"Failed allocation for board name: %s\n", n);
1767 "Unsupported InfiniPath hardware revision %u.%u!\n",
1771 "ChipABI %u.%u, %s, InfiniPath%u %u.%u, SW Compat %u\n",
1784 static int qib_6120_setup_reset(
struct qib_devdata *dd)
1790 u8 int_line, clinesz;
1798 qib_6120_set_intr_state(dd, 0);
1800 dd->
cspec->ibdeltainprog = 0;
1801 dd->
cspec->ibsymdelta = 0;
1802 dd->
cspec->iblnkerrdelta = 0;
1815 for (i = 1; i <= 5; i++) {
1821 msleep(1000 + (1 + i) * 2000);
1842 "Reset failed to setup PCIe or interrupts; continuing anyway\n");
1844 qib_6120_init_hwerrors(dd);
1848 qib_6120_init_hwerrors(dd);
1869 unsigned long flags;
1877 if (pa & ((1
U << 11) - 1)) {
1878 qib_dev_err(dd,
"Physaddr %lx not 2KB aligned!\n",
1885 "Physical page address 0x%lx larger than supported\n",
1912 ? &dd->
cspec->kernel_tid_lock : &dd->
cspec->user_tid_lock;
1918 spin_unlock_irqrestore(tidlockp, flags);
1934 u32 type,
unsigned long pa)
1943 if (pa & ((1
U << 11) - 1)) {
1944 qib_dev_err(dd,
"Physaddr %lx not 2KB aligned!\n",
1951 "Physical page address 0x%lx larger than supported\n",
1977 static void qib_6120_clear_tids(
struct qib_devdata *dd,
1981 unsigned long tidinv;
1994 ctxt * dd->
rcvtidcnt *
sizeof(*tidbase));
2018 static void qib_6120_tidtemplate(
struct qib_devdata *dd)
2031 if (egrsize == 2048)
2033 else if (egrsize == 4096)
2051 static int qib_6120_get_base_info(
struct qib_ctxtdata *rcd,
2067 &rhf_addr[
sizeof(
u64) /
sizeof(
u32)];
2070 static void qib_6120_config_ctxts(
struct qib_devdata *dd)
2099 tail = qib_get_rcvhdrtail(rcd);
2102 return head ==
tail;
2110 static void alloc_dummy_hdrq(
struct qib_devdata *dd)
2113 dd->
rcd[0]->rcvhdrq_size,
2114 &dd->
cspec->dummy_hdrq_phys,
2116 if (!dd->
cspec->dummy_hdrq) {
2119 dd->
cspec->dummy_hdrq_phys = 0
UL;
2130 static void rcvctrl_6120_mod(
struct qib_pportdata *ppd,
unsigned int op,
2135 unsigned long flags;
2148 mask = (1ULL << dd->
ctxtcnt) - 1;
2150 mask = (1ULL << ctxt);
2158 dd->
rcd[ctxt]->rcvhdrqtailaddr_phys);
2160 dd->
rcd[ctxt]->rcvhdrq_phys);
2162 if (ctxt == 0 && !dd->
cspec->dummy_hdrq)
2163 alloc_dummy_hdrq(dd);
2178 if (op & QIB_RCVCTRL_CTXT_ENB) {
2189 dd->
rcd[ctxt]->head =
val;
2195 if (op & QIB_RCVCTRL_CTXT_DIS) {
2207 dd->
cspec->dummy_hdrq_phys);
2209 dd->
cspec->dummy_hdrq_phys);
2213 for (i = 0; i < dd->
cfgctxts; i++) {
2215 i, dd->
cspec->dummy_hdrq_phys);
2217 i, dd->
cspec->dummy_hdrq_phys);
2221 spin_unlock_irqrestore(&dd->
cspec->rcvmod_lock, flags);
2235 u64 tmp_dd_sendctrl;
2236 unsigned long flags;
2263 SYM_MASK(SendCtrl, PIOBufAvailUpd));
2264 for (i = 0; i < last; i++) {
2276 tmp_dd_sendctrl |=
SYM_MASK(SendCtrl, Disarm) |
2278 SYM_LSB(SendCtrl, DisarmPIOBuf));
2280 tmp_dd_sendctrl &= ~
SYM_MASK(SendCtrl, PIOBufAvailUpd);
2285 if (op & QIB_SENDCTRL_AVAIL_BLIP) {
2292 if (op & QIB_SENDCTRL_FLUSH) {
2319 static const u16 xlator[] = {
2358 "Unimplemented portcounter %u\n", reg);
2365 ret = dd->
cspec->lli_errs;
2367 ret = dd->
cspec->overrun_thresh_errs;
2375 ret = dd->
cspec->pma_sample_status;
2385 ret = read_6120_creg(dd, creg);
2387 ret = read_6120_creg32(dd, creg);
2389 if (dd->
cspec->ibdeltainprog)
2390 ret -= ret - dd->
cspec->ibsymsnap;
2391 ret -= dd->
cspec->ibsymdelta;
2393 if (dd->
cspec->ibdeltainprog)
2394 ret -= ret - dd->
cspec->iblnkerrsnap;
2395 ret -= dd->
cspec->iblnkerrdelta;
2398 ret += dd->
cspec->rxfc_unsupvl_errs;
2417 static const char cntr6120names[] =
2428 static const size_t cntr6120indices[] = {
2445 static const char portcntr6120names[] =
2477 #define _PORT_VIRT_FLAG 0x8000
2478 static const size_t portcntr6120indices[] = {
2511 static void init_6120_cntrnames(
struct qib_devdata *dd)
2516 for (i = 0, s = (
char *)cntr6120names; s && j <= dd->
cfgctxts;
2519 if (!j && !
strncmp(
"Ctxt0EgrOvfl", s + 1, 12))
2528 dd->
cspec->cntrnamelen =
sizeof(cntr6120names) - 1;
2530 dd->
cspec->cntrnamelen = 1 + s - cntr6120names;
2533 if (!dd->
cspec->cntrs)
2534 qib_dev_err(dd,
"Failed allocation for counters\n");
2536 for (i = 0, s = (
char *)portcntr6120names;
s; i++)
2538 dd->
cspec->nportcntrs = i - 1;
2539 dd->
cspec->portcntrnamelen =
sizeof(portcntr6120names) - 1;
2542 if (!dd->
cspec->portcntrs)
2543 qib_dev_err(dd,
"Failed allocation for portcounters\n");
2552 ret = dd->
cspec->cntrnamelen;
2556 *namep = (
char *)cntr6120names;
2561 ret = dd->
cspec->ncntrs *
sizeof(
u64);
2562 if (!cntr || pos >= ret) {
2572 for (i = 0; i < dd->
cspec->ncntrs; i++)
2573 *cntr++ = read_6120_creg32(dd, cntr6120indices[i]);
2580 char **namep,
u64 **cntrp)
2585 ret = dd->
cspec->portcntrnamelen;
2589 *namep = (
char *)portcntr6120names;
2595 ret = dd->
cspec->nportcntrs *
sizeof(
u64);
2596 if (!cntr || pos >= ret) {
2602 for (i = 0; i < dd->
cspec->nportcntrs; i++) {
2604 *cntr++ = qib_portcntr_6120(ppd,
2605 portcntr6120indices[i] &
2608 *cntr++ = read_6120_creg32(dd,
2609 portcntr6120indices[i]);
2616 static void qib_chk_6120_errormask(
struct qib_devdata *dd)
2620 unsigned long errormask;
2621 unsigned long hwerrs;
2628 if (errormask == dd->
cspec->errormask)
2636 dd->
cspec->errormask);
2638 if ((hwerrs & dd->
cspec->hwerrmask) ||
2639 (ctrl & QLOGIC_IB_C_FREEZEMODE)) {
2645 "errormask fixed(%u) %lx->%lx, ctrl %x hwerr %lx\n",
2646 fixed, errormask, (
unsigned long)dd->
cspec->errormask,
2659 static void qib_get_6120_faststats(
unsigned long opaque)
2663 unsigned long flags;
2679 traffic_wds = qib_portcntr_6120(ppd,
cr_wordsend) +
2688 qib_chk_6120_errormask(dd);
2694 static int qib_6120_nointr_fallback(
struct qib_devdata *dd)
2712 prev_val &= ~QLOGIC_IB_XGXS_RESET;
2721 static int qib_6120_get_ib_cfg(
struct qib_pportdata *ppd,
int which)
2766 ret = (ppd->
dd->cspec->ibcctrl &
2767 SYM_MASK(IBCCtrl, LinkDownDefaultState)) ?
2789 static int qib_6120_set_ib_cfg(
struct qib_pportdata *ppd,
int which,
u32 val)
2809 dd->
cspec->ibcctrl &=
2810 ~
SYM_MASK(IBCCtrl, OverrunThreshold);
2812 SYM_LSB(IBCCtrl, OverrunThreshold);
2822 dd->
cspec->ibcctrl &=
2823 ~
SYM_MASK(IBCCtrl, PhyerrThreshold);
2825 SYM_LSB(IBCCtrl, PhyerrThreshold);
2841 dd->
cspec->ibcctrl &=
2842 ~
SYM_MASK(IBCCtrl, LinkDownDefaultState);
2844 dd->
cspec->ibcctrl |=
2845 SYM_MASK(IBCCtrl, LinkDownDefaultState);
2867 switch (val & 0xffff0000) {
2870 if (!dd->
cspec->ibdeltainprog) {
2871 dd->
cspec->ibdeltainprog = 1;
2872 dd->
cspec->ibsymsnap =
2874 dd->
cspec->iblnkerrsnap =
2889 qib_dev_err(dd,
"bad linkcmd req 0x%x\n", val >> 16);
2892 switch (val & 0xffff) {
2915 qib_set_ib_6120_lstate(ppd, lcmd, licmd);
2932 if (!
strncmp(what,
"ibc", 3)) {
2933 ppd->
dd->cspec->ibcctrl |=
SYM_MASK(IBCCtrl, Loopback);
2934 qib_devinfo(ppd->
dd->pcidev,
"Enabling IB%u:%u IBC loopback\n",
2935 ppd->
dd->unit, ppd->
port);
2936 }
else if (!
strncmp(what,
"off", 3)) {
2937 ppd->
dd->cspec->ibcctrl &= ~
SYM_MASK(IBCCtrl, Loopback);
2939 "Disabling IB%u:%u IBC loopback (normal)\n",
2940 ppd->
dd->unit, ppd->
port);
2950 static void pma_6120_timer(
unsigned long data)
2955 unsigned long flags;
2976 spin_unlock_irqrestore(&ibp->
lock, flags);
2987 if (start && intv) {
3005 static u32 qib_6120_iblink_state(
u64 ibcs)
3030 static u8 qib_6120_phys_portstate(
u64 ibcs)
3032 u8 state = (
u8)
SYM_FIELD(ibcs, IBCStatus, LinkTrainingState);
3033 return qib_6120_physportstate[
state];
3036 static int qib_6120_ib_updown(
struct qib_pportdata *ppd,
int ibup,
u64 ibcs)
3038 unsigned long flags;
3045 if (ppd->
dd->cspec->ibdeltainprog) {
3046 ppd->
dd->cspec->ibdeltainprog = 0;
3047 ppd->
dd->cspec->ibsymdelta +=
3049 ppd->
dd->cspec->ibsymsnap;
3050 ppd->
dd->cspec->iblnkerrdelta +=
3052 ppd->
dd->cspec->iblnkerrsnap;
3056 ppd->
dd->cspec->lli_counter = 0;
3057 if (!ppd->
dd->cspec->ibdeltainprog) {
3058 ppd->
dd->cspec->ibdeltainprog = 1;
3059 ppd->
dd->cspec->ibsymsnap =
3061 ppd->
dd->cspec->iblnkerrsnap =
3067 qib_6120_setup_setextled(ppd, ibup);
3080 u64 read_val, new_out;
3081 unsigned long flags;
3090 new_out = (dd->
cspec->gpio_out & ~mask) | out;
3094 dd->
cspec->gpio_out = new_out;
3095 spin_unlock_irqrestore(&dd->
cspec->gpio_lock, flags);
3106 return SYM_FIELD(read_val, EXTStatus, GPIOIn);
3114 static void get_6120_chip_params(
struct qib_devdata *dd)
3170 static void set_6120_baseaddrs(
struct qib_devdata *dd)
3186 static int qib_late_6120_initreg(
struct qib_devdata *dd)
3198 "Catastrophic software error, SendPIOAvailAddr written as %lx, read back as %llx\n",
3200 (
unsigned long long) val);
3206 static int init_6120_variables(
struct qib_devdata *dd)
3227 if ((dd->
revision & 0xffffffffU) == 0xffffffffU) {
3229 "Revision register read failure, giving up initialization\n");
3240 get_6120_chip_params(dd);
3289 qib_6120_tidtemplate(dd);
3300 dd->
stats_timer.function = qib_get_6120_faststats;
3304 dd->
cspec->pma_timer.function = pma_6120_timer;
3305 dd->
cspec->pma_timer.data = (
unsigned long) ppd;
3310 qib_6120_config_ctxts(dd);
3318 set_6120_baseaddrs(dd);
3327 init_6120_cntrnames(dd);
3360 u32 lbuf = ppd->
dd->piobcnt2k + ppd->
dd->piobcnt4k - 1;
3366 sendctrl_6120_mod(ppd->
dd->pport, QIB_SENDCTRL_AVAIL_BLIP);
3372 sendctrl_6120_mod(ppd, QIB_SENDCTRL_DISARM_ALL | QIB_SENDCTRL_FLUSH |
3373 QIB_SENDCTRL_AVAIL_BLIP);
3374 ppd->
dd->upd_pio_shadow = 1;
3390 buf = get_6120_link_buf(ppd, pbufnum);
3423 static void qib_6120_sdma_sendctrl(
struct qib_pportdata *ppd,
unsigned op)
3427 static void qib_sdma_set_6120_desc_cnt(
struct qib_pportdata *ppd,
unsigned cnt)
3441 static void qib_6120_initvl15_bufs(
struct qib_devdata *dd)
3445 static void qib_6120_init_ctxt(
struct qib_ctxtdata *rcd)
3451 static void qib_6120_txchk_change(
struct qib_devdata *dd,
u32 start,
3461 static int qib_6120_tempsense_rd(
struct qib_devdata *dd,
int regnum)
3467 static int qib_6120_eeprom_wen(
struct qib_devdata *dd,
int wen)
3512 qib_6120_put_tid_2 :
3518 dd->
f_reset = qib_6120_setup_reset;
3553 ret = init_6120_variables(dd);
3562 "Failed to setup PCIe or interrupts; continuing anyway\n");
3569 QLOGIC_IB_HWE_SERDESPLLFAILED)
3571 QLOGIC_IB_HWE_SERDESPLLFAILED);
3574 qib_setup_6120_interrupt(dd);
3576 qib_6120_init_hwerrors(dd);