From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751304AbdJDJjY (ORCPT ); Wed, 4 Oct 2017 05:39:24 -0400 Received: from mx-relay10-hz1.antispameurope.com ([94.100.132.210]:60974 "EHLO mx-relay10-hz1.antispameurope.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751114AbdJDJjW (ORCPT ); Wed, 4 Oct 2017 05:39:22 -0400 From: "Stahl, Manuel" To: "dan.carpenter@oracle.com" CC: "hjk@linutronix.de" , "linux-kernel@vger.kernel.org" , "devel@driverdev.osuosl.org" , "gregkh@linuxfoundation.org" , "sojkam1@fel.cvut.cz" Subject: Re: [PATCH] Add new uio device for PCI with dynamic memory allocation Thread-Topic: [PATCH] Add new uio device for PCI with dynamic memory allocation Thread-Index: AQHTO49rX0nLYatQxkGmNPc1+ba1AqLRwNcAgAFqOYCAAAmsAIAAG+cA Date: Wed, 4 Oct 2017 09:39:18 +0000 Message-ID: <1507109956.2603.5.camel@iis-extern.fraunhofer.de> References: <1506956528.3410.3.camel@iis-extern.fraunhofer.de> <20171003094820.hxsrougf444d7vmm@mwanda> <1507101887.2603.1.camel@iis-extern.fraunhofer.de> <20171004075923.nl454dbxmvqivqy7@mwanda> In-Reply-To: <20171004075923.nl454dbxmvqivqy7@mwanda> Accept-Language: de-DE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [153.96.171.210] Content-Type: text/plain; charset="utf-8" Content-ID: <51B5CD280EAE03479D3A4A71FB9BE3CF@iis.fhg.de> MIME-Version: 1.0 X-cloud-security-sender: manuel.stahl@iis-extern.fraunhofer.de X-cloud-security-recipient: linux-kernel@vger.kernel.org X-cloud-security-crypt: load encryption module X-cloud-security-Virusscan: CLEAN X-cloud-security-disclaimer: This E-Mail was scanned by E-Mailservice on mx-relay10-hz1.antispameurope.com with 38B2A622F87 X-cloud-security-connect: mailgw1.iis.fraunhofer.de[153.96.172.4], TLS=1, IP=153.96.172.4 X-cloud-security: scantime:.1238 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by nfs id v949dSwv008998 On Mi, 2017-10-04 at 10:59 +0300, Dan Carpenter wrote: > On Wed, Oct 04, 2017 at 07:24:49AM +0000, Stahl, Manuel wrote: > > Hi Dan. Thanks for your comments. I can fix all of those. > > Probably there is also some upgrade needed for the MSI stuff. > > pci_disable_msi() is not there anymore, so I have to use > > pci_alloc_irq_vectors(). Doing tests with my PCIe HW I had some > > problems with masking the legacy IRQs. Probably uio_pci_generic > > suffers from the same problems. > > > > Can someone tell me how to properly handle legacy and MSI > > interrupts in irqhandler()? Or should I implement a irqcontrol() > > function? > > > > These questions about above my pay grade. I've never used the code, I > just do mechanical reviews. I'm not certain who to ask either... > Alright. I checked again your comments. Some are copy&paste from the other drivers, but I can improve this. Some cannot be changed: 1) continue instead of break: Actually size=0 makes no sense for the maps, so open() and release() take this as abort condition (see also uio_dmem_genirq.c). The parser continues in that case, but we could break there as well. 2) char * const buf = kstrdup(uio_dmem_sizes, GFP_KERNEL); Since buf is a const pointer, it has to be set during declaration. Also I'd like to keep it const. I will post another patch set without MSI (just the same functionality as in uio_pci_generic) and then try to add MSI(X) support to both. Regards, Manuel