linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Oded Gabbay <oded.gabbay@gmail.com>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: "Linux-Kernel@Vger. Kernel. Org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 8/8] habanalabs: enable 64-bit DMA mask in POWER9
Date: Tue, 11 Jun 2019 11:47:47 +0300	[thread overview]
Message-ID: <CAFCwf123XC_SM3-P-Va4YO707ghSuqahtbFqpkWs+cTmkPvnEg@mail.gmail.com> (raw)
In-Reply-To: <CAFCwf12GRn6ePeH1cLuC_-C9pyQJJSZ9RaGdMUz6MkGrtR=Lvg@mail.gmail.com>

On Tue, Jun 11, 2019 at 11:08 AM Oded Gabbay <oded.gabbay@gmail.com> wrote:
>
> On Tue, Jun 11, 2019 at 10:59 AM Greg KH <gregkh@linuxfoundation.org> wrote:
> >
> > On Tue, Jun 11, 2019 at 08:50:45AM +0300, Oded Gabbay wrote:
> > > --- a/drivers/misc/habanalabs/habanalabs_drv.c
> > > +++ b/drivers/misc/habanalabs/habanalabs_drv.c
> > > @@ -28,6 +28,7 @@ static DEFINE_MUTEX(hl_devs_idr_lock);
> > >
> > >  static int timeout_locked = 5;
> > >  static int reset_on_lockup = 1;
> > > +static int power9_64bit_dma_enable;
> > >
> > >  module_param(timeout_locked, int, 0444);
> > >  MODULE_PARM_DESC(timeout_locked,
> > > @@ -37,6 +38,10 @@ module_param(reset_on_lockup, int, 0444);
> > >  MODULE_PARM_DESC(reset_on_lockup,
> > >       "Do device reset on lockup (0 = no, 1 = yes, default yes)");
> > >
> > > +module_param(power9_64bit_dma_enable, int, 0444);
> > > +MODULE_PARM_DESC(power9_64bit_dma_enable,
> > > +     "Enable 64-bit DMA mask. Should be set only in POWER9 machine (0 = no, 1 = yes, default no)");
> > > +
> > >  #define PCI_VENDOR_ID_HABANALABS     0x1da3
> > >
> > >  #define PCI_IDS_GOYA                 0x0001
> >
> >
> > This is not the 1990's, please do not use module parameters.  Yeah, you
> > have a bunch of them already, but do not add additional ones that can be
> > easily determined at runtime, like this one.
> >
> > thanks,
> >
> > greg k-h
>
> Hi Greg,
> I would love to do this in runtime and that was my intent all along
> until I hit a wall on *how* to find out it in runtime if I'm running
> on POWER9 with PHB4 or not.
> I did a search in the kernel code, consulted with a couple of people
> but I didn't get any way of doing this in runtime.
> If you have some way, please share it with me because I hit a wall
> with this issue.
>
> The fact of the matter is, I have two different configurations of *my*
> device's PCIe controller. One is only suitable to POWER9 with PHB4 and
> the other one suits all the rest architectures/systems (that we have
> tested so far). So I have to know which system I'm running on and as I
> said, I didn't find a kernel API which can help me do that.
>
> Thanks,
> Oded

btw, even the powernv code determines the PHB model by reading the
device-tree file. They don't even read it from the controller.

Having said that, it occurred to me that I may be able to determine
this by the PCI ID of the parent bus of my device. It has a unique PCI
ID so hopefully that will be enough.
I will check and update here.

Thanks,
Oded

  reply	other threads:[~2019-06-11  8:48 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-11  5:50 [PATCH 0/8] Fixing DMA mask issues in habanalabs driver Oded Gabbay
2019-06-11  5:50 ` [PATCH 1/8] habanalabs: initialize device CPU queues after MMU init Oded Gabbay
2019-06-11  5:50 ` [PATCH 2/8] habanalabs: de-couple MMU and VM module initialization Oded Gabbay
2019-06-11  5:50 ` [PATCH 3/8] habanalabs: initialize MMU context for driver Oded Gabbay
2019-06-11  5:50 ` [PATCH 4/8] habanalabs: add MMU mappings for Goya CPU Oded Gabbay
2019-06-11  5:50 ` [PATCH 5/8] habanalabs: set Goya CPU to use ASIC MMU Oded Gabbay
2019-06-11  5:50 ` [PATCH 6/8] habanalabs: remove DMA mask hack for Goya Oded Gabbay
2019-06-11  5:50 ` [PATCH 7/8] habanalabs: add WARN in case of bad MMU mapping Oded Gabbay
2019-06-11  5:50 ` [PATCH 8/8] habanalabs: enable 64-bit DMA mask in POWER9 Oded Gabbay
2019-06-11  7:59   ` Greg KH
2019-06-11  8:08     ` Oded Gabbay
2019-06-11  8:47       ` Oded Gabbay [this message]
2019-06-11 15:12   ` Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAFCwf123XC_SM3-P-Va4YO707ghSuqahtbFqpkWs+cTmkPvnEg@mail.gmail.com \
    --to=oded.gabbay@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).