please pull infiniband.git
Linus, please pull from
master.kernel.org:/pub/scm/linux/kernel/git/roland/infiniband.git for-linus
This tree is also available from kernel.org mirrors at:
git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband.git for-linus
This contains fixes for the new ipath driver. The changes are a little bit bigger than I would prefer at this stage in the release cycle, but since the ipath driver is new in 2.6.17, there's no risk of regressions against 2.6.16 ;)
Bryan O'Sullivan:
IB/ipath: fix spinlock recursion bug IB/ipath: don't modify QP if changes fail IB/ipath: fix reporting of driver version to userspace IB/ipath: replace uses of LIST_POISON IB/ipath: fix NULL dereference during cleanup IB/ipath: enable GPIO interrupt on HT-460 IB/ipath: enable PE800 receive interrupts on user ports IB/ipath: register as IB device owner IB/ipath: fix null deref during rdma ops IB/ipath: deref correct pointer when using kernel SMA
drivers/infiniband/hw/ipath/ipath_driver.c | 22 ++++----- drivers/infiniband/hw/ipath/ipath_eeprom.c | 7 +-- drivers/infiniband/hw/ipath/ipath_file_ops.c | 6 ++ drivers/infiniband/hw/ipath/ipath_ht400.c | 21 +++++++- drivers/infiniband/hw/ipath/ipath_init_chip.c | 1 drivers/infiniband/hw/ipath/ipath_kernel.h | 2 - drivers/infiniband/hw/ipath/ipath_keys.c | 6 -- drivers/infiniband/hw/ipath/ipath_layer.c | 12 +++-- drivers/infiniband/hw/ipath/ipath_pe800.c | 2 + drivers/infiniband/hw/ipath/ipath_qp.c | 64 +++++++++++++------------ drivers/infiniband/hw/ipath/ipath_rc.c | 15 +++--- drivers/infiniband/hw/ipath/ipath_ruc.c | 2 - drivers/infiniband/hw/ipath/ipath_verbs.c | 7 ++- 13 files changed, 92 insertions(+), 75 deletions(-)
drivers/infiniband/hw/ipath/ipath_driver.c +11 -11
@@ -1905,19 +1905,19 @@ static void __exit infinipath_cleanup(vo }else ipath_dbg ("irq is 0, not doing free_irq " "for unit %u\n" , dd->ipath_unit); - dd->pcidev =NULL ; - } -/* -* we check for NULL here, because it's outside the kregbase -* check, and we need to call it after the free_irq. Thus -* it's possible that the function pointers were never -* initialized. -*/ -if (dd->ipath_f_cleanup) -/* clean up chip-specific stuff */ - dd->ipath_f_cleanup (dd); +/* +* we check for NULL here, because it's outside +* the kregbase check, and we need to call it +* after the free_irq. Thus it's possible that +* the function pointers were never initialized. +*/ +if (dd->ipath_f_cleanup) +/* clean up chip-specific stuff */ + dd->ipath_f_cleanup (dd); + dd->pcidev =NULL ; + }spin_lock_irqsave (&ipath_devs_lock, flags); }
drivers/infiniband/hw/ipath/ipath_eeprom.c +3 -4
@@ -505,11 +505,10 @@ static u8 flash_csum(struct ipath_flash* ipath_get_guid - get the GUID from the i2c device * @dd: the infinipath device * -* When we add the multi-chip support, we will probably have to add -* the ability to use the number of guids field, and get the guid from -* the first chip's flash, to use for all of them. +* We have the capability to use the ipath_nguid field, and get +* the guid from the first chip's flash, to use for all of them. */ -void ipath_get_guid (struct ipath_devdata *dd) +void ipath_get_eeprom_info (struct ipath_devdata *dd) {void *buf;struct ipath_flash *ifp;
drivers/infiniband/hw/ipath/ipath_file_ops.c +5 -1
@@ -139,7 +139,7 @@ static int ipath_get_base_info(struct ip kinfo->spi_piosize = dd->ipath_ibmaxlen; kinfo->spi_mtu = dd->ipath_ibmaxlen;/* maxlen, not ibmtu */ kinfo->spi_port = pd->port_port; - kinfo->spi_sw_version =IPATH_USER_SWVERSION ; + kinfo->spi_sw_version =IPATH_KERN_SWVERSION ; kinfo->spi_hw_version = dd->ipath_revision;if (copy_to_user (ubase, kinfo,sizeof (*kinfo)))
@@ -1224,6 +1224,10 @@ static unsigned int ipath_poll(struct fiif (tail == head) {set_bit (IPATH_PORT_WAITING_RCV , &pd->port_flag); +if (dd->ipath_rhdrhead_intr_off)/* arm rcv interrupt */ + (void )ipath_write_ureg (dd, ur_rcvhdrhead, + dd->ipath_rhdrhead_intr_off + | head, pd->port_port);poll_wait (fp, &pd->port_wait, pt);if (test_bit (IPATH_PORT_WAITING_RCV , &pd->port_flag)) {
drivers/infiniband/hw/ipath/ipath_ht400.c +19 -2
@@ -607,7 +607,12 @@ static int ipath_ht_boardname(struct ipacase 4 :/* Ponderosa is one of the bringup boards */ n ="Ponderosa" ;break ; -case 5 :/* HT-460 original production board */ +case 5 : +/* +* HT-460 original production board; two production levels, with +* different serial number ranges. See ipath_ht_early_init() for +* case where we enable IPATH_GPIO_INTR for later serial # range. +*/ n ="InfiniPath_HT-460" ;break ;case 6 :
@@ -642,7 +647,7 @@ static int ipath_ht_boardname(struct ipaif (n)snprintf (name, namelen,"%s" , n); -if (dd->ipath_majrev !=3 || dd->ipath_minrev !=2 ) { +if (dd->ipath_majrev !=3 || (dd->ipath_minrev <2 || dd->ipath_minrev >3 )) {/* * This version of the driver only supports the HT-400 * Rev 3.2
@@ -1520,6 +1525,18 @@ static int ipath_ht_early_init(struct ip*/ ipath_write_kreg (dd, dd->ipath_kregs->kr_sendctrl,INFINIPATH_S_ABORT ); + +ipath_get_eeprom_info (dd); +if (dd->ipath_boardrev ==5 && dd->ipath_serial[0 ] =='1' && + dd->ipath_serial[1 ] =='2' && dd->ipath_serial[2 ] =='8' ) { +/* +* Later production HT-460 has same changes as HT-465, so +* can use GPIO interrupts. They have serial #'s starting +* with 128, rather than 112. +*/ + dd->ipath_flags |=IPATH_GPIO_INTR ; + dd->ipath_flags &= ~IPATH_POLL_RX_INTR ; + }return 0 ; }
drivers/infiniband/hw/ipath/ipath_init_chip.c +0 -1
@@ -879,7 +879,6 @@ int ipath_init_chip(struct ipath_devdata done:if (!ret) { -ipath_get_guid (dd); *dd->ipath_statusp |=IPATH_STATUS_CHIP_PRESENT ;if (!dd->ipath_f_intrsetup (dd)) {/* now we can enable all interrupts from the chip */
drivers/infiniband/hw/ipath/ipath_kernel.h +1 -1
@@ -650,7 +650,7 @@ u32 __iomem *ipath_getpiobuf(struct ipatvoid ipath_init_pe800_funcs (struct ipath_devdata *);/* init HT-400-specific func */ void ipath_init_ht400_funcs (struct ipath_devdata *); -void ipath_get_guid (struct ipath_devdata *); +void ipath_get_eeprom_info (struct ipath_devdata *);u64 ipath_snap_cntr (struct ipath_devdata *,ipath_creg );/*
drivers/infiniband/hw/ipath/ipath_keys.c +0 -6
@@ -136,9 +136,7 @@ int ipath_lkey_ok(struct ipath_lkey_tabl ret =1 ; goto bail; } -spin_lock (&rkt->lock); mr = rkt->table[(sge->lkey >> (32 - ib_ipath_lkey_table_size))]; -spin_unlock (&rkt->lock);if (unlikely (mr ==NULL || mr->lkey != sge->lkey)) { ret =0 ; goto bail;
@@ -184,8 +182,6 @@ bail:* @acc: access flags * * Return 1 if successful, otherwise 0. -* -* The QP r_rq.lock should be held. */ int ipath_rkey_ok (struct ipath_ibdev *dev,struct ipath_sge_state *ss,u32 len,u64 vaddr,u32 rkey,int acc)
@@ -196,9 +192,7 @@ int ipath_rkey_ok(struct ipath_ibdev *desize_t off;int ret; -spin_lock (&rkt->lock); mr = rkt->table[(rkey >> (32 - ib_ipath_lkey_table_size))]; -spin_unlock (&rkt->lock);if (unlikely (mr ==NULL || mr->lkey != rkey)) { ret =0 ; goto bail;
drivers/infiniband/hw/ipath/ipath_layer.c +7 -5
@@ -872,12 +872,13 @@ static void copy_io(u32 __iomem *piobuf,update_sge (ss, len); length -= len; } +/* Update address before sending packet. */ +update_sge (ss, length);/* must flush early everything before trigger word */ ipath_flush_wc ();__raw_writel (last, piobuf);/* be sure trigger word is written */ ipath_flush_wc (); -update_sge (ss, length); }/**
@@ -943,17 +944,18 @@ int ipath_verbs_send(struct ipath_devdatif (likely (ss->num_sge ==1 && len <= ss->sge.length && !((unsigned long )ss->sge.vaddr & (sizeof (u32) -1 )))) {u32 w; +u32 *addr = (u32 *) ss->sge.vaddr; +/* Update address before sending packet. */ +update_sge (ss, len);/* Need to round up for the last dword in the packet. */ w = (len +3 ) >>2 ; -__iowrite32_copy (piobuf, ss->sge.vaddr, w -1 ); +__iowrite32_copy (piobuf, addr, w -1 );/* must flush early everything before trigger word */ ipath_flush_wc (); -__raw_writel (((u32 *) ss->sge.vaddr)[w -1 ], - piobuf + w -1 ); +__raw_writel (addr[w -1 ], piobuf + w -1 );/* be sure trigger word is written */ ipath_flush_wc (); -update_sge (ss, len); ret =0 ; goto bail; }
drivers/infiniband/hw/ipath/ipath_pe800.c +2 -0
@@ -1180,6 +1180,8 @@ static int ipath_pe_early_init(struct ip*/ dd->ipath_rhdrhead_intr_off =1ULL <<32 ; +ipath_get_eeprom_info (dd); +return 0 ; }
drivers/infiniband/hw/ipath/ipath_qp.c +32 -32
127 lines not on this page · raw message
drivers/infiniband/hw/ipath/ipath_rc.c +7 -8
@@ -57,7 +57,7 @@ static void ipath_init_restart(struct ip qp->s_len = wqe->length - len; dev =to_idev (qp->ibqp.device);spin_lock (&dev->pending_lock); -if (qp->timerwait.next ==LIST_POISON1 ) +if (list_empty (&qp->timerwait))list_add_tail (&qp->timerwait, &dev->pending[dev->pending_index]);spin_unlock (&dev->pending_lock);
@@ -356,7 +356,7 @@ static inline int ipath_make_rc_req(struif ((int )(qp->s_psn - qp->s_next_psn) >0 ) qp->s_next_psn = qp->s_psn;spin_lock (&dev->pending_lock); -if (qp->timerwait.next ==LIST_POISON1 ) +if (list_empty (&qp->timerwait))list_add_tail (&qp->timerwait, &dev->pending[dev->pending_index]);spin_unlock (&dev->pending_lock);
@@ -726,8 +726,8 @@ void ipath_restart_rc(struct ipath_qp *q*/ dev =to_idev (qp->ibqp.device);spin_lock (&dev->pending_lock); -if (qp->timerwait.next !=LIST_POISON1 ) -list_del (&qp->timerwait); +if (!list_empty (&qp->timerwait)) +list_del_init (&qp->timerwait);spin_unlock (&dev->pending_lock);if (wqe->wr.opcode ==IB_WR_RDMA_READ )
@@ -886,8 +886,8 @@ static int do_rc_ack(struct ipath_qp *qp* just won't find anything to restart if we ACK everything. */ spin_lock (&dev->pending_lock); -if (qp->timerwait.next !=LIST_POISON1 ) -list_del (&qp->timerwait); +if (!list_empty (&qp->timerwait)) +list_del_init (&qp->timerwait);spin_unlock (&dev->pending_lock);/*
@@ -1194,8 +1194,7 @@ static inline void ipath_rc_rcv_resp(str IB_WR_RDMA_READ)) goto ack_done;spin_lock (&dev->pending_lock); -if (qp->s_rnr_timeout ==0 && - qp->timerwait.next !=LIST_POISON1 ) +if (qp->s_rnr_timeout ==0 && !list_empty (&qp->timerwait))list_move_tail (&qp->timerwait, &dev->pending[dev->pending_index]);spin_unlock (&dev->pending_lock);
drivers/infiniband/hw/ipath/ipath_ruc.c +1 -1
@@ -435,7 +435,7 @@ void ipath_no_bufs_available(struct ipatunsigned long flags;spin_lock_irqsave (&dev->pending_lock, flags); -if (qp->piowait.next ==LIST_POISON1 ) +if (list_empty (&qp->piowait))list_add_tail (&qp->piowait, &dev->piowait);spin_unlock_irqrestore (&dev->pending_lock, flags);/*
drivers/infiniband/hw/ipath/ipath_verbs.c +4 -3
@@ -464,7 +464,7 @@ static void ipath_ib_timer(void *arg) last = &dev->pending[dev->pending_index];while (!list_empty (last)) { qp = list_entry(last->next, struct ipath_qp, timerwait); -list_del (&qp->timerwait); +list_del_init (&qp->timerwait); qp->timer_next = resend; resend = qp;atomic_inc (&qp->refcount);
@@ -474,7 +474,7 @@ static void ipath_ib_timer(void *arg) qp = list_entry(last->next, struct ipath_qp, timerwait);if (--qp->s_rnr_timeout ==0 ) { do { - list_del(&qp->timerwait); + list_del_init(&qp->timerwait); tasklet_hi_schedule(&qp->s_task); if (list_empty(last)) break;
@@ -554,7 +554,7 @@ static int ipath_ib_piobufavail(void *arwhile (!list_empty (&dev->piowait)) { qp = list_entry(dev->piowait.next, struct ipath_qp, piowait); -list_del (&qp->piowait); +list_del_init (&qp->piowait);tasklet_hi_schedule (&qp->s_task); }spin_unlock_irqrestore (&dev->pending_lock, flags);
@@ -951,6 +951,7 @@ static void *ipath_register_ib_device(in idev->dd = dd;strlcpy (dev->name,"ipath%d" ,IB_DEVICE_NAME_MAX ); + dev->owner =THIS_MODULE ; dev->node_guid =ipath_layer_get_guid (dd); dev->uverbs_abi_ver =IPATH_UVERBS_ABI_VERSION ; dev->uverbs_cmd_mask =