mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>
To: "Stahl, Manuel" <manuel.stahl@iis-extern.fraunhofer.de>
Cc: "devel@driverdev.osuosl.org" <devel@driverdev.osuosl.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"sojkam1@fel.cvut.cz" <sojkam1@fel.cvut.cz>
Subject: Re: [PATCH v4] Add new uio device for PCI with dynamic memory allocation
Date: Wed, 29 Apr 2020 11:41:41 +0200	[thread overview]
Message-ID: <20200429094141.GB2080576@kroah.com> (raw)
In-Reply-To: <eb405ab3782844e379629a655a3dcaf38dd2552d.camel@iis-extern.fraunhofer.de>

On Wed, Apr 29, 2020 at 07:51:01AM +0000, Stahl, Manuel wrote:
> On Di, 2020-04-28 at 15:54 +0200, gregkh @ linuxfoundation . org wrote:
> > On Thu, Apr 16, 2020 at 06:38:30PM +0200, Manuel Stahl wrote:
> > > 
> > > + *
> > > + * Since the driver does not declare any device ids, you must allocate
> > > + * id and bind the device to the driver yourself.  For example:
> > > + *
> > > + * # echo "8086 10f5" > /sys/bus/pci/drivers/uio_pci_dmem_genirq/new_id
> > > + * # echo -n 0000:00:19.0 > /sys/bus/pci/drivers/e1000e/unbind
> > > + * # echo -n 0000:00:19.0 > /sys/bus/pci/drivers/uio_pci_dmem_genirq/bind
> > > + * # ls -l /sys/bus/pci/devices/0000:00:19.0/driver
> > > + * .../0000:00:19.0/driver -> ../../../bus/pci/drivers/uio_pci_dmem_genirq
> > > + *
> > > + * Or use a modprobe alias:
> > > + * # alias pci:v000010EEd00001000sv*sd*sc*i* uio_pci_dmem_genirq
> > > + *
> > > + * Driver won't bind to devices which do not support the Interrupt Disable Bit
> > > + * in the command register. All devices compliant to PCI 2.3 (circa 2002) and
> > > + * all compliant PCI Express devices should support this bit.
> > > + *
> > > + * The DMA mask bits and sizes of dynamic regions are derived from module
> > > + * parameters.
> > > + *
> > > + * The format for specifying dynamic region sizes in module parameters
> > > + * is as follows:
> > > + *
> > > + * uio_pci_dmem_genirq.dmem_sizes := <uio_dmem_sizes_def>[;<uio_dmem_sizes_def>]
> > > + * <uio_dmem_sizes_def>           := <pci_id>:<size>[,<size>]
> > > + * <pci_id>                       := <vendor>:<device>
> > > + * <size>                         := standard linux memsize
> > > + *
> > > + * Examples:
> > > + *
> > > + * 1) UIO dmem device with 3 dynamic regions:
> > > + * uio_pci_dmem_genirq.dmem_sizes=8086:10f5:4K,16K,4M
> > > + *
> > > + * 2) Two UIO dmem devices with different number of dynamic regions:
> > > + * uio_pci_dmem_genirq.dmem_sizes=8086:10f5:4K,16K,4M;1234:0001:8K
> > 
> > Module parameters are horrid, are you sure there is no other way?
> 
> You're right, seemed to be the simplest solution back when we started developing this driver. I will try to change it to sysfs, so that one can add regions while the module is already loaded.

/me hands you some \n characters...

Anyway, configfs is for configuring stuff, don't make a sysfs file that
you have to somehow "parse" please.

thanks,

greg k-h

  reply	other threads:[~2020-04-29  9:41 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-06 13:31 [PATCH 1/2 v3] " Stahl, Manuel
2017-10-06 13:33 ` [PATCH 2/2] uio: Prefer MSI(X) interrupts in PCI drivers Stahl, Manuel
2017-10-06 13:45   ` gregkh
2017-10-06 13:50     ` Stahl, Manuel
2017-10-06 14:57       ` Stephen Hemminger
2017-10-20 12:50         ` gregkh
2017-10-20 12:58           ` Stahl, Manuel
2020-03-04 15:19             ` Stahl, Manuel
2020-03-04 15:44               ` gregkh
2017-10-24 13:11           ` Stephen Hemminger
2020-04-16 16:38 ` [PATCH v4] Add new uio device for PCI with dynamic memory allocation Manuel Stahl
2020-04-28 13:54   ` gregkh @ linuxfoundation . org
2020-04-28 15:47     ` Stahl, Manuel
2020-04-28 15:58       ` gregkh
2020-04-29  7:51     ` Stahl, Manuel
2020-04-29  9:41       ` gregkh [this message]
2020-04-29 13:53         ` Stahl, Manuel
2023-05-18  4:48           ` Hongren Zheng

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=20200429094141.GB2080576@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=devel@driverdev.osuosl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=manuel.stahl@iis-extern.fraunhofer.de \
    --cc=sojkam1@fel.cvut.cz \
    /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

all inboxes | Powered by JetHome®