Re: [PATCH 1/6] RDMA: Fully setup the device name in ib_register_device

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Sep 25, 2018 at 11:28:24AM +0000, Ruhl, Michael J wrote:

> >> >Signed-off-by: Jason Gunthorpe <jgg@xxxxxxxxxxxx>
> >> > drivers/infiniband/hw/hfi1/init.c             |  1 -
> >> > drivers/infiniband/hw/hfi1/verbs.c            |  4 ++-
> >> > drivers/infiniband/hw/qib/qib_init.c          |  1 -
> >> > drivers/infiniband/hw/qib/qib_verbs.c         |  4 ++-
> >> >diff --git a/drivers/infiniband/hw/hfi1/init.c
> >> >b/drivers/infiniband/hw/hfi1/init.c
> >> >index 1e770a1337793e..e87ff7a544eb1a 100644
> >> >+++ b/drivers/infiniband/hw/hfi1/init.c
> >> >@@ -1313,7 +1313,6 @@ static struct hfi1_devdata
> >*hfi1_alloc_devdata(struct
> >> >pci_dev *pdev,
> >> > 			"Could not allocate unit ID: error %d\n", -ret);
> >> > 		goto bail;
> >> > 	}
> >> >-	rvt_set_ibdev_name(&dd->verbs_dev.rdi, "%s_%d", class_name(),
> >> >dd->unit);
> >>
> >> If you remove this call, the HFI (and probably the QIB) dd_dev_xxx() macros will
> >> not work correctly until we call ib_register().  Since we do a lot of work before
> >> that, this will lose our ability to print out the device name.
> >
> >What prints exactly?
> >
> >From what I can see the hfi driver uses macros like this:
> >
> >#define dd_dev_warn(dd, fmt, ...) \
> >        dev_warn(&(dd)->pcidev->dev, "%s: " fmt, \
> 
> You missed the important part of this macro: 
> 
> #define dd_dev_warn(dd, fmt, ...) \
> 	dev_warn(&(dd)->pcidev->dev, "%s: " fmt, \
> 		 rvt_get_ibdev_name(&(dd)->verbs_dev.rdi), ##__VA_ARGS__)
> 
> The unit name is retrieved with the rvt_get_ibdev_name() function.

So lets just keep setting dev_name early in hfi1 then.

This is really ugly BTW, drivers shouldn't be making so much stuff up
on their own..

Jason



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux