Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cf105601 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband:
  IB/ipath: tidy up white space in a few files
  IB/ipath: fix label name in interrupt handler
  IB/ipath: improve sparse annotation
  IB/ipath: simplify IB timer usage
  IB/ipath: simplify RC send posting
  IB/ipath: prevent hardware from being accessed during reset
  IB/ipath: fix verbs registration
  IB/ipath: change handling of PIO buffers
  IB/ipath: iterate over correct number of ports during reset
  IB/ipath: set up 32-bit DMA mask if 64-bit setup fails
  IB/ipath: fix race with exposing reset file
  IB/mthca: Fix offset in query_gid method
parents 6ba815de f6f0413e
Loading
Loading
Loading
Loading
+8 −7
Original line number Diff line number Diff line
@@ -60,11 +60,11 @@
#define __IPATH_KERNEL_SEND 0x2000	/* use kernel mode send */
#define __IPATH_EPKTDBG     0x4000	/* print ethernet packet data */
#define __IPATH_SMADBG      0x8000	/* sma packet debug */
#define __IPATH_IPATHDBG    0x10000	/* Ethernet (IPATH) general debug on */
#define __IPATH_IPATHWARN   0x20000	/* Ethernet (IPATH) warnings on */
#define __IPATH_IPATHERR    0x40000	/* Ethernet (IPATH) errors on */
#define __IPATH_IPATHPD     0x80000	/* Ethernet (IPATH) packet dump on */
#define __IPATH_IPATHTABLE  0x100000	/* Ethernet (IPATH) table dump on */
#define __IPATH_IPATHDBG    0x10000	/* Ethernet (IPATH) gen debug */
#define __IPATH_IPATHWARN   0x20000	/* Ethernet (IPATH) warnings */
#define __IPATH_IPATHERR    0x40000	/* Ethernet (IPATH) errors */
#define __IPATH_IPATHPD     0x80000	/* Ethernet (IPATH) packet dump */
#define __IPATH_IPATHTABLE  0x100000	/* Ethernet (IPATH) table dump */

#else				/* _IPATH_DEBUGGING */

@@ -79,11 +79,12 @@
#define __IPATH_TRSAMPLE  0x0	/* generate trace buffer sample entries */
#define __IPATH_VERBDBG   0x0	/* very verbose debug */
#define __IPATH_PKTDBG    0x0	/* print packet data */
#define __IPATH_PROCDBG   0x0	/* print process startup (init)/exit messages */
#define __IPATH_PROCDBG   0x0	/* process startup (init)/exit messages */
/* print mmap/nopage stuff, not using VDBG any more */
#define __IPATH_MMDBG     0x0
#define __IPATH_EPKTDBG   0x0	/* print ethernet packet data */
#define __IPATH_SMADBG    0x0   /* print process startup (init)/exit messages */#define __IPATH_IPATHDBG  0x0	/* Ethernet (IPATH) table dump on */
#define __IPATH_SMADBG    0x0   /* process startup (init)/exit messages */
#define __IPATH_IPATHDBG  0x0	/* Ethernet (IPATH) table dump on */
#define __IPATH_IPATHWARN 0x0	/* Ethernet (IPATH) warnings on   */
#define __IPATH_IPATHERR  0x0	/* Ethernet (IPATH) errors on   */
#define __IPATH_IPATHPD   0x0	/* Ethernet (IPATH) packet dump on   */
+2 −1
Original line number Diff line number Diff line
@@ -277,13 +277,14 @@ static int ipath_diag_open(struct inode *in, struct file *fp)

bail:
	spin_unlock_irqrestore(&ipath_devs_lock, flags);
	mutex_unlock(&ipath_mutex);

	/* Only expose a way to reset the device if we
	   make it into diag mode. */
	if (ret == 0)
		ipath_expose_reset(&dd->pcidev->dev);

	mutex_unlock(&ipath_mutex);

	return ret;
}

+14 −4
Original line number Diff line number Diff line
@@ -417,11 +417,21 @@ static int __devinit ipath_init_one(struct pci_dev *pdev,
	}

	ret = pci_set_dma_mask(pdev, DMA_64BIT_MASK);
	if (ret) {
		/*
		 * if the 64 bit setup fails, try 32 bit.  Some systems
		 * do not setup 64 bit maps on systems with 2GB or less
		 * memory installed.
		 */
		ret = pci_set_dma_mask(pdev, DMA_32BIT_MASK);
		if (ret) {
			dev_info(&pdev->dev, "pci_set_dma_mask unit %u "
				 "fails: %d\n", dd->ipath_unit, ret);
			goto bail_regions;
		}
		else
			ipath_dbg("No 64bit DMA mask, used 32 bit mask\n");
	}

	pci_set_master(pdev);

@@ -1949,7 +1959,7 @@ int ipath_reset_device(int unit)
	}

	if (dd->ipath_pd)
		for (i = 1; i < dd->ipath_portcnt; i++) {
		for (i = 1; i < dd->ipath_cfgports; i++) {
			if (dd->ipath_pd[i] && dd->ipath_pd[i]->port_cnt) {
				ipath_dbg("unit %u port %d is in use "
					  "(PID %u cmd %s), can't reset\n",
+22 −14
Original line number Diff line number Diff line
@@ -53,13 +53,19 @@ MODULE_PARM_DESC(cfgports, "Set max number of ports to use");

/*
 * Number of buffers reserved for driver (layered drivers and SMA
 * send).  Reserved at end of buffer list.
 * send).  Reserved at end of buffer list.   Initialized based on
 * number of PIO buffers if not set via module interface.
 * The problem with this is that it's global, but we'll use different
 * numbers for different chip types.  So the default value is not
 * very useful.  I've redefined it for the 1.3 release so that it's
 * zero unless set by the user to something else, in which case we
 * try to respect it.
 */
static ushort ipath_kpiobufs = 32;
static ushort ipath_kpiobufs;

static int ipath_set_kpiobufs(const char *val, struct kernel_param *kp);

module_param_call(kpiobufs, ipath_set_kpiobufs, param_get_uint,
module_param_call(kpiobufs, ipath_set_kpiobufs, param_get_ushort,
		  &ipath_kpiobufs, S_IWUSR | S_IRUGO);
MODULE_PARM_DESC(kpiobufs, "Set number of PIO buffers for driver");

@@ -531,8 +537,11 @@ static int init_housekeeping(struct ipath_devdata *dd,
	 * Don't clear ipath_flags as 8bit mode was set before
	 * entering this func. However, we do set the linkstate to
	 * unknown, so we can watch for a transition.
	 * PRESENT is set because we want register reads to work,
	 * and the kernel infrastructure saw it in config space;
	 * We clear it if we have failures.
	 */
	dd->ipath_flags |= IPATH_LINKUNK;
	dd->ipath_flags |= IPATH_LINKUNK | IPATH_PRESENT;
	dd->ipath_flags &= ~(IPATH_LINKACTIVE | IPATH_LINKARMED |
			     IPATH_LINKDOWN | IPATH_LINKINIT);

@@ -560,6 +569,7 @@ static int init_housekeeping(struct ipath_devdata *dd,
	    || (dd->ipath_uregbase & 0xffffffff) == 0xffffffff) {
		ipath_dev_err(dd, "Register read failures from chip, "
			      "giving up initialization\n");
		dd->ipath_flags &= ~IPATH_PRESENT;
		ret = -ENODEV;
		goto done;
	}
@@ -682,16 +692,14 @@ int ipath_init_chip(struct ipath_devdata *dd, int reinit)
	 */
	dd->ipath_pioavregs = ALIGN(val, sizeof(u64) * BITS_PER_BYTE / 2)
		/ (sizeof(u64) * BITS_PER_BYTE / 2);
	if (!ipath_kpiobufs)	/* have to have at least 1, for SMA */
		kpiobufs = ipath_kpiobufs = 1;
	else if ((dd->ipath_piobcnt2k + dd->ipath_piobcnt4k) <
		 (dd->ipath_cfgports * IPATH_MIN_USER_PORT_BUFCNT)) {
		dev_info(&dd->pcidev->dev, "Too few PIO buffers (%u) "
			 "for %u ports to have %u each!\n",
			 dd->ipath_piobcnt2k + dd->ipath_piobcnt4k,
			 dd->ipath_cfgports, IPATH_MIN_USER_PORT_BUFCNT);
		kpiobufs = 1;	/* reserve just the minimum for SMA/ether */
	} else
	if (ipath_kpiobufs == 0) {
		/* not set by user, or set explictly to default  */
		if ((dd->ipath_piobcnt2k + dd->ipath_piobcnt4k) > 128)
			kpiobufs = 32;
		else
			kpiobufs = 16;
	}
	else
		kpiobufs = ipath_kpiobufs;

	if (kpiobufs >
+17 −4
Original line number Diff line number Diff line
@@ -665,14 +665,14 @@ static void handle_layer_pioavail(struct ipath_devdata *dd)

	ret = __ipath_layer_intr(dd, IPATH_LAYER_INT_SEND_CONTINUE);
	if (ret > 0)
		goto clear;
		goto set;

	ret = __ipath_verbs_piobufavail(dd);
	if (ret > 0)
		goto clear;
		goto set;

	return;
clear:
set:
	set_bit(IPATH_S_PIOINTBUFAVAIL, &dd->ipath_sendctrl);
	ipath_write_kreg(dd, dd->ipath_kregs->kr_sendctrl,
			 dd->ipath_sendctrl);
@@ -719,11 +719,24 @@ static void handle_rcv(struct ipath_devdata *dd, u32 istat)
irqreturn_t ipath_intr(int irq, void *data, struct pt_regs *regs)
{
	struct ipath_devdata *dd = data;
	u32 istat = ipath_read_kreg32(dd, dd->ipath_kregs->kr_intstatus);
	u32 istat;
	ipath_err_t estat = 0;
	static unsigned unexpected = 0;
	irqreturn_t ret;

	if(!(dd->ipath_flags & IPATH_PRESENT)) {
		/* this is mostly so we don't try to touch the chip while
		 * it is being reset */
		/*
		 * This return value is perhaps odd, but we do not want the
		 * interrupt core code to remove our interrupt handler
		 * because we don't appear to be handling an interrupt
		 * during a chip reset.
		 */
		return IRQ_HANDLED;
	}

	istat = ipath_read_kreg32(dd, dd->ipath_kregs->kr_intstatus);
	if (unlikely(!istat)) {
		ipath_stats.sps_nullintr++;
		ret = IRQ_NONE; /* not our interrupt, or already handled */
Loading