From patchwork Tue Nov 20 14:53:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Saenz Julienne X-Patchwork-Id: 10690725 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1B58D13AD for ; Tue, 20 Nov 2018 16:22:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0697F2A980 for ; Tue, 20 Nov 2018 16:22:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EE0432A993; Tue, 20 Nov 2018 16:22:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9016D2A980 for ; Tue, 20 Nov 2018 16:22:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=+YSTRzKtxLoEzpav02GobzQCzNrmRooIAqk/Kf5Q/K4=; b=TbMWltgjcF/u1W cHR5918s0WmFc8dbDg4oRIEoL3+oi68aHbW+g+jX13MWy5fKOiZhIdWdftmdynVgixDYVSW92rCpS 2lFtcDgdTRKyT9tjTfVYWjPUkPBWiQUR2qfXuDqiIICuLGlxebjjnAgYwy2J6wnzNpWnZeyExYjxL dle+dWC7pFQTaSzycgOI9Rwe5wrJSZA59qXPmYfjK3aUGLKO7LV6cPxzIXlyfWemrNtmdU3Q1n4xE uQ+jQrtvEQ/9C9g2G9z4peCjFyeGHBLpTS54MYeqWToEjEZNA0dFUpz2cPXNQfrnIIyBu810iz3/N WosSrsWrsA9HiqY29mXQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gP8nE-00007l-24; Tue, 20 Nov 2018 16:22:28 +0000 Received: from casper.infradead.org ([85.118.1.10]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gP8jw-0001u1-Lg; Tue, 20 Nov 2018 16:19:04 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=PS/PxEYJRJXURg5T50v47cLsPvNeLgf6REc93JaolTo=; b=fyhaFnJUbvlWxun4Wxo6dNvmBo 742jHC5JNq4GG677kCIvqT8UFtdVCUc3jeRpb2EU57H4aubtPsGusS9F1DYyC47THt3HDBLGn1r8D t2GIK1kEZ1SYqNqRVbX/N6xkta/ZxKeHrAaqqCG4VfScH3auxmm/JwT+QKM3FumML444l+R+kv1jp jCBDFKWGYhJxiSrKvMlzqrgJvB2o0jb8jkkGZqYd68Mqi0LruAZkcdkvG8ocMdPs+p3SoD3m8rQ9N B1TXjXjfHmgO6Q/4iS6JOv1tigzy8EUusVDDbFNC+m/hwn1rV3P8JyrbPeY6FjsNWF2/H3h+c1oVf cka8ai9g==; Received: from mx2.suse.de ([195.135.220.15] helo=mx1.suse.de) by casper.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gP7QI-0005tI-AT; Tue, 20 Nov 2018 14:54:44 +0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id A4C94B0CE; Tue, 20 Nov 2018 14:54:14 +0000 (UTC) From: Nicolas Saenz Julienne To: stefan.wahren@i2se.com, eric@anholt.net, dave.stevenson@raspberrypi.org Subject: [PATCH 16/16] staging: vchiq: add more tasks to the TODO list Date: Tue, 20 Nov 2018 15:53:51 +0100 Message-Id: <20181120145351.30390-17-nsaenzjulienne@suse.de> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181120145351.30390-1-nsaenzjulienne@suse.de> References: <20181120145351.30390-1-nsaenzjulienne@suse.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181120_145442_379558_546A9403 X-CRM114-Status: GOOD ( 17.23 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devel@driverdev.osuosl.org, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, Nicolas Saenz Julienne , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The TODO list was missing some tasks needed before upstreaming the device. Signed-off-by: Nicolas Saenz Julienne --- .../staging/vc04_services/interface/vchi/TODO | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/drivers/staging/vc04_services/interface/vchi/TODO b/drivers/staging/vc04_services/interface/vchi/TODO index 0b3ec75ff627..fc2752bc95b2 100644 --- a/drivers/staging/vc04_services/interface/vchi/TODO +++ b/drivers/staging/vc04_services/interface/vchi/TODO @@ -49,3 +49,45 @@ such as dev_info, dev_dbg, and friends. A short top-down description of this driver's architecture (function of kthreads, userspace, limitations) could be very helpful for reviewers. + +7) Review and comment memory barriers + +There is a heavy use of memory barriers in this driver, it would be very +beneficial to go over all of them and, if correct, comment on their merits. +Extra points to whomever confidently reviews the remote_event_*() family of +functions. + +8) Get rid of custom function return values + +Most functions use a custom set of return values, we should force proper Linux +error numbers. Special care is needed for VCHIQ_RETRY. + +9) Reformat core code with more sane indentations + +The code follows the 80 characters limitation yet tends to go 3 or 4 levels of +indentation deep making it very unpleasant to read. This is specially relevant +in the character driver ioctl code and in the core thread functions. + +10) Reorganize file structure: Move char driver to it's own file and join both +platform files + +The cdev is defined alongside with the platform code in vchiq_arm.c. It would +be nice to completely decouple it from the actual core code. For instance to be +able to use bcm2835-audio without having /dev/vchiq created. One could argue +it's better for security reasons or general cleanliness. It could even be +interesting to create two different kernel modules, something the likes of +vchiq-core.ko and vchiq-dev.ko. This would also ease the upstreaming process. + +The code in vchiq_bcm2835_arm.c should fit in the generic platform file. + +12) Get rid of all the struct typedefs + +Most structs are typedefd, it's not encouraged in the kernel. + +13) Get rid of all non essential global structures and create a proper per +device structure + +The first thing one generally sees in a probe function is a memory allocation +for all the device specific data. This structure is then passed all over the +driver. This is good practice since it makes the driver work regardless of the +number of devices probed.