Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp423001ybz; Wed, 29 Apr 2020 02:43:31 -0700 (PDT) X-Google-Smtp-Source: APiQypKMDUbzYV9XRGk5fNVXKp4VUJBVfT/JjI/Hq48nXZIQMn/4TiypaiTnEK+iLicDHut59qH7 X-Received: by 2002:a17:906:5e50:: with SMTP id b16mr1832130eju.331.1588153411587; Wed, 29 Apr 2020 02:43:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588153411; cv=none; d=google.com; s=arc-20160816; b=Mzx/nxsBw1k6xMES2e49M72QSE8dechRXOpuA4HSO3IvyFvdmxR6xUYP6HiimH8xc3 PPdPo2+QpJ24eG5wlCObbvQa1o8E0BEWLb1+CVZAPy74m3U4k1lKEHUDWimIQgk9PEIZ yL8sNYRfcRrG48dqfl8jeMgD01CEUMgaYxSOR34BvN5EfkHirxN95alSeN4gBs1hBjFm tJbnoM/ZbK10l3pHJ61+1qEuYHbXSvhxGAg/2HgklDX2zoN46TlSIV3MoQOiBkIq9f26 aMV0khg4tJQ/YD+kF2J+j4wQAuRztrEVTR+QZVvNdwGsXuEKWyx25Kv7nei1hZtr54rk rNbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=1+G6AXvD3wdX2SKemYdmZHTbWppKReMQPeVKJC4XSm0=; b=IaTa1kOE9JywblU2evijeHY61OyNtwg0lMiUBsLwLQBazD7N1A5c47TYfOnurhWuU8 7KvbYq3xyHFGXjjqpTqlNweIi1fZtIhPWn8pIG16YLS6HxjbIeB2B6m9vlo0eUL7diu4 XrrvYOqjhYyMi1rKeUJqCtDJbqr4RcRLb+Eu3Xs0BqwHAwS7qe+651cysaqiOvX0gN+G Kmf9Em/Ve8YrJX0NGsvuGntDId1WxKkyUassKRyEFIRnlyui6PsKvamer3OD8FiT+Ntn q4XV88SFByyGtF6CdzzcpZAu/497aoP+e4TiWo9e82Jk7gTTU+L/ZoSudkPDeir0HpJm D53g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Hm8896I7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gv6si3503763ejb.388.2020.04.29.02.43.07; Wed, 29 Apr 2020 02:43:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Hm8896I7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726539AbgD2Jlp (ORCPT + 99 others); Wed, 29 Apr 2020 05:41:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:58772 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726423AbgD2Jlp (ORCPT ); Wed, 29 Apr 2020 05:41:45 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 00DE62073E; Wed, 29 Apr 2020 09:41:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588153303; bh=AG5TFQjS0TvO7P2NrdT+6GM8hq5daMrhEGzYpdrsVw8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Hm8896I728fS54R8e60Rm+0EU2cD8L9ZwDgyfgFL+9eaCwKaqGavDdau5oK8KOPjV c2uOqi6/bwTgKj33Wnfuvgw1PubZmlJvzbH/jYgTIZtTbd49msJ5wyKLH1SQ/q1E+r GNcegYa6TkdGV7gtBbMvfahji+toB12Z74Agvm+o= Date: Wed, 29 Apr 2020 11:41:41 +0200 From: "gregkh@linuxfoundation.org" To: "Stahl, Manuel" Cc: "devel@driverdev.osuosl.org" , "linux-kernel@vger.kernel.org" , "sojkam1@fel.cvut.cz" Subject: Re: [PATCH v4] Add new uio device for PCI with dynamic memory allocation Message-ID: <20200429094141.GB2080576@kroah.com> References: <1507296707.2915.14.camel@iis-extern.fraunhofer.de> <20200416163830.30623-1-manuel.stahl@iis-extern.fraunhofer.de> <20200428135443.GA1437053@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 := [;] > > > + * := :[,] > > > + * := : > > > + * := 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