All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ojaswin Mujoo <ojaswin98@gmail.com>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: Stefan Wahren <stefan.wahren@i2se.com>,
	nsaenz@kernel.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
Date: Wed, 21 Jul 2021 21:58:25 +0530	[thread overview]
Message-ID: <20210721162825.GA188355@ojas> (raw)
In-Reply-To: <YPfZW0k563kuuHnx@kroah.com>

On Wed, Jul 21, 2021 at 10:22:51AM +0200, Greg KH wrote:
> On Sun, Jul 11, 2021 at 04:58:21PM +0530, Ojaswin Mujoo wrote:
> > 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 <ojaswin98@gmail.com>
> > > > ---
> > > >  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 <linux/rcupdate.h>
> > > >  #include <linux/delay.h>
> > > >  #include <linux/slab.h>
> > > > +#include <linux/interrupt.h>
> > > > +#include <linux/io.h>
> > > > +#include <linux/uaccess.h>
> > > >  #include <soc/bcm2835/raspberrypi-firmware.h>
> > > >  
> > > >  #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.
> 
> Please fix up and resend the whole series properly so that I can apply
> them that way.
> 
> thanks,
> 
> greg k-h
Hello,

I have just sent a revised patchset with requested changes. [1]

[1] https://lore.kernel.org/patchwork/cover/1465322/

Thank you,
Ojaswin

WARNING: multiple messages have this Message-ID (diff)
From: Ojaswin Mujoo <ojaswin98@gmail.com>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: Stefan Wahren <stefan.wahren@i2se.com>,
	nsaenz@kernel.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
Date: Wed, 21 Jul 2021 21:58:25 +0530	[thread overview]
Message-ID: <20210721162825.GA188355@ojas> (raw)
In-Reply-To: <YPfZW0k563kuuHnx@kroah.com>

On Wed, Jul 21, 2021 at 10:22:51AM +0200, Greg KH wrote:
> On Sun, Jul 11, 2021 at 04:58:21PM +0530, Ojaswin Mujoo wrote:
> > 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 <ojaswin98@gmail.com>
> > > > ---
> > > >  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 <linux/rcupdate.h>
> > > >  #include <linux/delay.h>
> > > >  #include <linux/slab.h>
> > > > +#include <linux/interrupt.h>
> > > > +#include <linux/io.h>
> > > > +#include <linux/uaccess.h>
> > > >  #include <soc/bcm2835/raspberrypi-firmware.h>
> > > >  
> > > >  #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.
> 
> Please fix up and resend the whole series properly so that I can apply
> them that way.
> 
> thanks,
> 
> greg k-h
Hello,

I have just sent a revised patchset with requested changes. [1]

[1] https://lore.kernel.org/patchwork/cover/1465322/

Thank you,
Ojaswin

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2021-07-21 16:28 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-04 15:56 [PATCH v3 0/5] vchiq: Patch to separate platform and cdev code Ojaswin Mujoo
2021-07-04 15:56 ` Ojaswin Mujoo
2021-07-04 15:57 ` [PATCH v3 1/5] staging: vchiq: Refactor vchiq " Ojaswin Mujoo
2021-07-04 15:57   ` Ojaswin Mujoo
2021-07-11 10:33   ` Stefan Wahren
2021-07-11 10:33     ` Stefan Wahren
2021-07-04 15:57 ` [PATCH v3 2/5] staging: vchiq: Move certain declarations to vchiq_arm.h Ojaswin Mujoo
2021-07-04 15:57   ` Ojaswin Mujoo
2021-07-11 10:34   ` Stefan Wahren
2021-07-11 10:34     ` Stefan Wahren
2021-07-04 15:58 ` [PATCH v3 3/5] staging: vchiq: Move vchiq char driver to its own file Ojaswin Mujoo
2021-07-04 15:58   ` Ojaswin Mujoo
2021-07-05  8:21   ` kernel test robot
2021-07-05  9:56     ` Dan Carpenter
2021-07-05  9:56     ` Dan Carpenter
2021-07-05  9:56     ` Dan Carpenter
2021-07-05 10:58     ` Ojaswin Mujoo
2021-07-05 10:58       ` Ojaswin Mujoo
2021-07-05 10:58       ` Ojaswin Mujoo
2021-07-05 11:19       ` Dan Carpenter
2021-07-05 11:19         ` Dan Carpenter
2021-07-05 11:19         ` Dan Carpenter
2021-07-05 11:19         ` Dan Carpenter
2021-07-05 11:24         ` Ojaswin Mujoo
2021-07-05 11:24           ` Ojaswin Mujoo
2021-07-05 11:24           ` Ojaswin Mujoo
2021-07-11 10:35   ` Stefan Wahren
2021-07-11 10:35     ` Stefan Wahren
2021-07-04 15:59 ` [PATCH v3 4/5] staging: vchiq: Make creation of vchiq cdev optional Ojaswin Mujoo
2021-07-04 15:59   ` Ojaswin Mujoo
2021-07-11 10:39   ` Stefan Wahren
2021-07-11 10:39     ` Stefan Wahren
2021-07-04 15:59 ` [PATCH v3 5/5] staging: vchiq: Combine vchiq platform code into single file Ojaswin Mujoo
2021-07-04 15:59   ` Ojaswin Mujoo
2021-07-04 18:07   ` kernel test robot
2021-07-04 18:07     ` kernel test robot
2021-07-04 18:07     ` kernel test robot
2021-07-11 10:49   ` Stefan Wahren
2021-07-11 10:49     ` Stefan Wahren
2021-07-11 11:28     ` Ojaswin Mujoo
2021-07-11 11:28       ` Ojaswin Mujoo
2021-07-21  8:22       ` Greg KH
2021-07-21  8:22         ` Greg KH
2021-07-21 16:28         ` Ojaswin Mujoo [this message]
2021-07-21 16:28           ` Ojaswin Mujoo
2021-07-11 10:29 ` [PATCH v3 0/5] vchiq: Patch to separate platform and cdev code Stefan Wahren
2021-07-11 10:29   ` Stefan Wahren

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=20210721162825.GA188355@ojas \
    --to=ojaswin98@gmail.com \
    --cc=arnd@arndb.de \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=dan.carpenter@oracle.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=nsaenz@kernel.org \
    --cc=phil@raspberrypi.com \
    --cc=stefan.wahren@i2se.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.