From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.7 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 34653C07E96 for ; Sun, 11 Jul 2021 11:30:08 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id F15FB61220 for ; Sun, 11 Jul 2021 11:30:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F15FB61220 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=qUCfrw+hNlLokv5Xz3lsouZWT6LNhfV1PY6pNFW2dZ4=; b=doYMQyrH9o2Wdi Ei9HeFlgdjeBzp3VtPRhAmtxQrnFJLjRZ5Kf3fyu3mOHwbDhLSsZZHgvgjhke/UvRttOD72adqxVK +E7xXVGDSeDao1T9lng81Kp9yRlvXTRwPrAEb1lUwl3NKzOY+cGQqpPk/ajcXzke9fMhPqsO2z1pX 1W//b3RI1RIXn8UdZcsfwRpEgua+VBYJoGW4kQVoRF3zf1o4UDEpRDddLhaPTYm3234MTlOHJx3q+ pUqPNT7Wq3HNUqnGn6bg8nH/zgahWyXLOFUPFPBd7gNmX9mfCbPmQuqbgBK3zOngkoJbpyKVjxzFf 0DtJbNLv9qvgHseCbpuw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m2XdU-004zWp-Uc; Sun, 11 Jul 2021 11:28:37 +0000 Received: from mail-pj1-x1033.google.com ([2607:f8b0:4864:20::1033]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1m2XdR-004zVr-7u for linux-arm-kernel@lists.infradead.org; Sun, 11 Jul 2021 11:28:34 +0000 Received: by mail-pj1-x1033.google.com with SMTP id d9-20020a17090ae289b0290172f971883bso10374405pjz.1 for ; Sun, 11 Jul 2021 04:28:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=XJqaYNuAhx03VwNz0nBHeMeBm3MIj1+un/V3SAMY9Y4=; b=YbQPULznAFWlcyQEfotPQ6Vd2/Z/zQFWcnjtaVIe0y6OjzI5vyyTvYyFuJd/swEV/r G76DopUvMWN4bEGq1s8wxQZpUxEEz9/wtn3Xay2e6MwZ/9hCrQ8dRmmBBksXgSGeTNjb wjgHuLgEsIjcWD4J0p1fR+B6IlMNAs/u2I8gEnIMtdej2jUjGP/D3Fmtg8xIgX0weu3V 5iy7lFlor5kq1zRFNgoS+G/vrM4jb+o7ORle7y9+PU8EGpd6wR9UCCc+5LPCx4rqW8Jj t3yrtfBxCKkSaXRFOTyaQOLGVidtuvl1k41T0MXWkvLUXNDiorwfC9WNvw4zrSFBjNND qtLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=XJqaYNuAhx03VwNz0nBHeMeBm3MIj1+un/V3SAMY9Y4=; b=pnolmqweVBuRGR6fOKEvfLWJtazPn9SBxKKU8Ar4GAraos61hcl4UsxpmJhkNSDshh n7qeQHDuCp0Eao3af2qBQ9gKIPyH37tAc6RD0ITN87Eko0lG10S3RxomZi+VDlZ3qh/d eywu9E0urPgcyXKRuWuR/zbgYK/F0cSfZNjeGcXP+M5x+qvHpQmeKGNVaTEvYTXGXX6X Y6FmCa2qKTn+gc9k0/1rrVlMym5NXOn+28mxKjuDmSP7XScq3sigm3YfC4Y1/yuzzFvG QAunoSqixDP9HGtdjcwZVfs7gtUl1Jh8EKOOSBlUUYZ2qEnCAsfZwOF/n6urVEqSYPU6 XUww== X-Gm-Message-State: AOAM5302BiVarx6BSCAGmzqvCI44Lpldq7ght85bp21mvDq7JtwXZbsL hvm597Qk+AzijKdjUz9TKuY= X-Google-Smtp-Source: ABdhPJxo3youatxyZWxLBBreYWrXeVGWLK7TP89pTPaDjT7duO2vlYst58Piv+hlJjZfYK4JBXz5Jg== X-Received: by 2002:a17:90b:314d:: with SMTP id ip13mr22207735pjb.131.1626002911875; Sun, 11 Jul 2021 04:28:31 -0700 (PDT) Received: from ojas ([122.177.24.64]) by smtp.gmail.com with ESMTPSA id l6sm12222720pff.74.2021.07.11.04.28.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 11 Jul 2021 04:28:31 -0700 (PDT) Date: Sun, 11 Jul 2021 16:58:21 +0530 From: Ojaswin Mujoo To: Stefan Wahren Cc: nsaenz@kernel.org, gregkh@linuxfoundation.org, arnd@arndb.de, dan.carpenter@oracle.com, phil@raspberrypi.com, bcm-kernel-feedback-list@broadcom.com, linux-arm-kernel@lists.infradead.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 5/5] staging: vchiq: Combine vchiq platform code into single file Message-ID: <20210711112821.GA5049@ojas> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210711_042833_342373_23D311A0 X-CRM114-Status: GOOD ( 29.04 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Sun, Jul 11, 2021 at 12:49:35PM +0200, Stefan Wahren wrote: > Am 04.07.21 um 17:59 schrieb Ojaswin Mujoo: > > Combine the vchiq platform initialization code into a single file by > > merging vchiq_2835_arm.c into vchiq_arm.c > > > > Signed-off-by: Ojaswin Mujoo > > --- > > drivers/staging/vc04_services/Makefile | 1 - > > .../interface/vchiq_arm/vchiq_2835_arm.c | 564 ------------------ > > .../interface/vchiq_arm/vchiq_arm.c | 549 +++++++++++++++++ > > 3 files changed, 549 insertions(+), 565 deletions(-) > > delete mode 100644 drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c > > > > diff --git a/drivers/staging/vc04_services/Makefile b/drivers/staging/vc04_services/Makefile > > index 0a04338fc962..1fd191e2e2a5 100644 > > --- a/drivers/staging/vc04_services/Makefile > > +++ b/drivers/staging/vc04_services/Makefile > > @@ -4,7 +4,6 @@ obj-$(CONFIG_BCM2835_VCHIQ) += vchiq.o > > vchiq-objs := \ > > interface/vchiq_arm/vchiq_core.o \ > > interface/vchiq_arm/vchiq_arm.o \ > > - interface/vchiq_arm/vchiq_2835_arm.o \ > > interface/vchiq_arm/vchiq_debugfs.o \ > > interface/vchiq_arm/vchiq_connected.o \ > > > ... > > diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c > > index 0f2de571eba7..9057d01ffd48 100644 > > --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c > > +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c > > @@ -25,15 +25,32 @@ > > #include > > #include > > #include > > +#include > > +#include > > +#include > > #include > > > > #include "vchiq_core.h" > > #include "vchiq_ioctl.h" > > #include "vchiq_arm.h" > > #include "vchiq_debugfs.h" > > +#include "vchiq_connected.h" > > +#include "vchiq_pagelist.h" > > > > #define DEVICE_NAME "vchiq" > > > > +#define TOTAL_SLOTS (VCHIQ_SLOT_ZERO_SLOTS + 2 * 32) > > + > > +#define MAX_FRAGMENTS (VCHIQ_NUM_CURRENT_BULKS * 2) > > + > > +#define VCHIQ_PLATFORM_FRAGMENTS_OFFSET_IDX 0 > > +#define VCHIQ_PLATFORM_FRAGMENTS_COUNT_IDX 1 > > + > > +#define BELL0 0x00 > > +#define BELL2 0x08 > > + > > +#define ARM_DS_ACTIVE BIT(2) > > + > > /* Override the default prefix, which would be vchiq_arm (from the filename) */ > > #undef MODULE_PARAM_PREFIX > > #define MODULE_PARAM_PREFIX DEVICE_NAME "." > > @@ -59,10 +76,542 @@ static struct vchiq_drvdata bcm2836_drvdata = { > > .cache_line_size = 64, > > }; > > > > +struct vchiq_2835_state { > > + int inited; > > + struct vchiq_arm_state arm_state; > > +}; > > + > > +struct vchiq_pagelist_info { > > + struct pagelist *pagelist; > > + size_t pagelist_buffer_size; > > + dma_addr_t dma_addr; > > + enum dma_data_direction dma_dir; > > + unsigned int num_pages; > > + unsigned int pages_need_release; > > + struct page **pages; > > + struct scatterlist *scatterlist; > > + unsigned int scatterlist_mapped; > > +}; > > + > > +static void __iomem *g_regs; > > +/* This value is the size of the L2 cache lines as understood by the > > + * VPU firmware, which determines the required alignment of the > > + * offsets/sizes in pagelists. > > + * > > + * Modern VPU firmware looks for a DT "cache-line-size" property in > > + * the VCHIQ node and will overwrite it with the actual L2 cache size, > > + * which the kernel must then respect. That property was rejected > > + * upstream, so we have to use the VPU firmware's compatibility value > > + * of 32. > > + */ > > +static unsigned int g_cache_line_size = 32; > > +static unsigned int g_fragments_size; > > +static char *g_fragments_base; > > +static char *g_free_fragments; > > +static struct semaphore g_free_fragments_sema; > > +static struct device *g_dev; > > + > > +static DEFINE_SEMAPHORE(g_free_fragments_mutex); > > + > > +static irqreturn_t > > +vchiq_doorbell_irq(int irq, void *dev_id); > > + > > +static struct vchiq_pagelist_info * > > +create_pagelist(char *buf, char __user *ubuf, size_t count, unsigned short type); > > + > > +static void > > +free_pagelist(struct vchiq_pagelist_info *pagelistinfo, > > + int actual); > > please no forward declarations of these 3 functions. Put them into the > right order instead ... > > Since this patch is independent from the other ones from the series, > maybe Greg can merg the rest of the series. > > > Hello Stefan, Thanks for the review. As for the forward declerations, sure I can fix these 3 functions and send an independent patch for this. Regards, Ojaswin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel