[ewg] New version of ipath-24-warn-if-no-lid.patch

Hal Rosenstock halr at voltaire.com
Wed Mar 7 03:50:42 PST 2007


On Wed, 2007-03-07 at 00:53, Bryan O'Sullivan wrote:
> Hi, Vlad -
> 
> Please replace the current copy of this patch with the attached.
> 
> Thanks,
> 
> 	<b
> 
> ______________________________________________________________________
> 
> From: Robert Walsh <robert.walsh at qlogic.com>
> 
> IB/ipath - print warning if LID not acquired and link ACTIVE within one minute
> 
> Signed-off-by: Bryan O'Sullivan <bryan.osullivan at qlogic.com>
> 
> diff -r aacb05b4697d drivers/infiniband/hw/ipath/ipath_driver.c
> --- a/drivers/infiniband/hw/ipath/ipath_driver.c	Mon Feb 26 14:56:41 2007 -0800
> +++ b/drivers/infiniband/hw/ipath/ipath_driver.c	Mon Feb 26 15:05:14 2007 -0800
> @@ -104,6 +104,13 @@ static int __devinit ipath_init_one(stru
>  #define PCI_DEVICE_ID_INFINIPATH_HT 0xd
>  #define PCI_DEVICE_ID_INFINIPATH_PE800 0x10
>  
> +/*
> + * Number of seconds before we complain about not getting a LID
> + * assignment.
> + */
> +
> +#define LID_TIMEOUT 60
> +
>  static const struct pci_device_id ipath_pci_tbl[] = {
>  	{ PCI_DEVICE(PCI_VENDOR_ID_PATHSCALE, PCI_DEVICE_ID_INFINIPATH_HT) },
>  	{ PCI_DEVICE(PCI_VENDOR_ID_PATHSCALE, PCI_DEVICE_ID_INFINIPATH_PE800) },
> @@ -119,6 +126,33 @@ static struct pci_driver ipath_driver = 
>  	.id_table = ipath_pci_tbl,
>  };
>  
> +
> +static void check_link_status(struct work_struct *work)
> +{
> +	struct ipath_devdata *dd = container_of(work, struct ipath_devdata,
> +						link_work);
> +
> +	/*
> +	 * If we're in the NOCABLE state, try again in another minute.
> +	 */
> +
> +	if (*dd->ipath_statusp & IPATH_STATUS_IB_NOCABLE) {
> +		schedule_delayed_work(&dd->link_work, HZ * LID_TIMEOUT);
> +		return;
> +	}
> +
> +	/*
> +	 * If we don't have a LID, let the user know and don't bother
> +	 * checking again.
> +	 */
> +
> +	if (dd->ipath_lid == 0)

Might an uninitialized unicast LID also be the promiscuous LID ?

-- Hal

> +		dev_info(&dd->pcidev->dev,
> +			 "We don't have a LID yet (no subnet manager?)\n");
> +	else if (!(*dd->ipath_statusp & IPATH_STATUS_IB_READY))
> +		dev_info(&dd->pcidev->dev,
> +			 "LID assigned, but IB link is not ACTIVE\n");
> +}
>  
>  #if defined (pgprot_writecombine) && defined(_PAGE_MA_WC)
>  int remap_area_pages(unsigned long address, unsigned long phys_addr,
> @@ -191,6 +225,8 @@ static struct ipath_devdata *ipath_alloc
>  
>  	dd->pcidev = pdev;
>  	pci_set_drvdata(pdev, dd);
> +
> +	INIT_DELAYED_WORK(&dd->link_work, check_link_status);
>  
>  	list_add(&dd->ipath_list, &ipath_dev_list);
>  
> @@ -516,6 +552,9 @@ static int __devinit ipath_init_one(stru
>  	ipath_diag_add(dd);
>  	ipath_register_ib_device(dd);
>  
> +	/* Check that we have a LID in LID_TIMEOUT seconds. */
> +	schedule_delayed_work(&dd->link_work, HZ * LID_TIMEOUT);
> +
>  	goto bail;
>  
>  bail_irqsetup:
> @@ -638,6 +677,9 @@ static void __devexit ipath_remove_one(s
>  
>  	ipath_cdbg(VERBOSE, "removing, pdev=%p, dd=%p\n", pdev, dd);
>  
> + 	cancel_delayed_work(&dd->link_work);
> +	flush_scheduled_work();
> + 
>  	if (dd->verbs_dev)
>  		ipath_unregister_ib_device(dd->verbs_dev);
>  
> @@ -1817,6 +1859,8 @@ int ipath_set_lid(struct ipath_devdata *
>  	dd->ipath_lid = arg;
>  	dd->ipath_lmc = lmc;
>  
> +	dev_info(&dd->pcidev->dev, "We got a lid: 0x%x\n", arg);
> +
>  	return 0;
>  }
>  
> diff -r aacb05b4697d drivers/infiniband/hw/ipath/ipath_kernel.h
> --- a/drivers/infiniband/hw/ipath/ipath_kernel.h	Mon Feb 26 14:56:41 2007 -0800
> +++ b/drivers/infiniband/hw/ipath/ipath_kernel.h	Mon Feb 26 15:05:14 2007 -0800
> @@ -550,6 +550,9 @@ struct ipath_devdata {
>  	u32 ipath_overrun_thresh_errs;
>  	u32 ipath_lli_errs;
>  
> +	/* Link status check work */
> +	struct delayed_work link_work;
> +
>  	/*
>  	 * Not all devices managed by a driver instance are the same
>  	 * type, so these fields must be per-device.
> 
> ______________________________________________________________________
> 
> _______________________________________________
> ewg mailing list
> ewg at lists.openfabrics.org
> http://lists.openfabrics.org/cgi-bin/mailman/listinfo/ewg




More information about the ewg mailing list