From: Lubomir Rintel <lkundrak@v3.sk>
To: Jacopo Mondi <jacopo@jmondi.org>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>,
Jonathan Corbet <corbet@lwn.net>,
linux-media@vger.kernel.org, Rob Herring <robh+dt@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
James Cameron <quozl@laptop.org>, Pavel Machek <pavel@ucw.cz>,
Libin Yang <lbyang@marvell.com>,
Albert Wang <twang13@marvell.com>,
Sakari Ailus <sakari.ailus@iki.fi>
Subject: Re: [PATCH v5 02/10] [media] marvell-ccic: fix DMA s/g desc number calculation
Date: Wed, 19 Jun 2019 10:16:23 +0200 [thread overview]
Message-ID: <f70270d3d67b276bcde7caa6891d655c78ad128f.camel@v3.sk> (raw)
In-Reply-To: <20190614094128.miryq2wfzoewjoyn@uno.localdomain>
On Fri, 2019-06-14 at 11:41 +0200, Jacopo Mondi wrote:
> Hi Lubomir,
>
> On Sun, May 05, 2019 at 04:00:23PM +0200, Lubomir Rintel wrote:
> > The commit d790b7eda953 ("[media] vb2-dma-sg: move dma_(un)map_sg here")
> > left dma_desc_nent unset. It previously contained the number of DMA
> > descriptors as returned from dma_map_sg().
> >
> > We can now (since the commit referred to above) obtain the same value from
> > the sg_table and drop dma_desc_nent altogether.
> >
> > Tested on OLPC XO-1.75 machine. Doesn't affect the OLPC XO-1's Cafe
> > driver, since that one doesn't do DMA.
> >
> > Fixes: d790b7eda953df474f470169ebdf111c02fa7a2d
>
> Could you use the proper 'fixes' format here?
> Fixes: d790b7eda953 ("[media] vb2-dma-sg: move dma_(un)map_sg here")
>
> > Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
> > ---
> > drivers/media/platform/marvell-ccic/mcam-core.c | 5 +++--
> > 1 file changed, 3 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/media/platform/marvell-ccic/mcam-core.c b/drivers/media/platform/marvell-ccic/mcam-core.c
> > index f1b301810260a..d97f39bde9bd6 100644
> > --- a/drivers/media/platform/marvell-ccic/mcam-core.c
> > +++ b/drivers/media/platform/marvell-ccic/mcam-core.c
> > @@ -200,7 +200,6 @@ struct mcam_vb_buffer {
> > struct list_head queue;
> > struct mcam_dma_desc *dma_desc; /* Descriptor virtual address */
> > dma_addr_t dma_desc_pa; /* Descriptor physical address */
> > - int dma_desc_nent; /* Number of mapped descriptors */
> > };
> >
> > static inline struct mcam_vb_buffer *vb_to_mvb(struct vb2_v4l2_buffer *vb)
> > @@ -608,9 +607,11 @@ static void mcam_dma_contig_done(struct mcam_camera *cam, int frame)
> > static void mcam_sg_next_buffer(struct mcam_camera *cam)
> > {
> > struct mcam_vb_buffer *buf;
> > + struct sg_table *sg_table;
> >
> > buf = list_first_entry(&cam->buffers, struct mcam_vb_buffer, queue);
> > list_del_init(&buf->queue);
> > + sg_table = vb2_dma_sg_plane_desc(&buf->vb_buf.vb2_buf, 0);
> > /*
> > * Very Bad Not Good Things happen if you don't clear
> > * C1_DESC_ENA before making any descriptor changes.
> > @@ -618,7 +619,7 @@ static void mcam_sg_next_buffer(struct mcam_camera *cam)
> > mcam_reg_clear_bit(cam, REG_CTRL1, C1_DESC_ENA);
> > mcam_reg_write(cam, REG_DMA_DESC_Y, buf->dma_desc_pa);
> > mcam_reg_write(cam, REG_DESC_LEN_Y,
> > - buf->dma_desc_nent*sizeof(struct mcam_dma_desc));
> > + sg_table->nents*sizeof(struct mcam_dma_desc));
>
> Space betwen operators (it was there already, I know).
>
> Apart for that, patch seems fine to me:
> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
This has been already applied to media_tree.git, with the Fixes: tag
corrected by Mauro Chehab.
I suppose I can't make changes anymore and the space-between-operators
things is not worth fixing up in a separate commit?
> Thanks
> j
> > mcam_reg_write(cam, REG_DESC_LEN_U, 0);
> > mcam_reg_write(cam, REG_DESC_LEN_V, 0);
> > mcam_reg_set_bit(cam, REG_CTRL1, C1_DESC_ENA);
> >
Thank you
Lubo
next prev parent reply other threads:[~2019-06-19 8:16 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-05 14:00 [PATCH v5 00/10] media: make Marvell camera work on DT-based OLPC XO-1.75 Lubomir Rintel
2019-05-05 14:00 ` [PATCH v5 01/10] media: dt-bindings: marvell,mmp2-ccic: Add Marvell MMP2 camera Lubomir Rintel
2019-05-07 17:09 ` Rob Herring
2019-06-14 9:50 ` Jacopo Mondi
2019-05-05 14:00 ` [PATCH v5 02/10] [media] marvell-ccic: fix DMA s/g desc number calculation Lubomir Rintel
2019-06-14 9:41 ` Jacopo Mondi
2019-06-19 8:16 ` Lubomir Rintel [this message]
2019-05-05 14:00 ` [PATCH v5 03/10] [media] marvell-ccic: don't generate EOF on parallel bus Lubomir Rintel
2019-06-14 10:01 ` Jacopo Mondi
2019-05-05 14:00 ` [PATCH v5 04/10] Revert "[media] marvell-ccic: reset ccic phy when stop streaming for stability" Lubomir Rintel
2019-05-05 14:00 ` [PATCH v5 05/10] [media] marvell-ccic: drop unused stuff Lubomir Rintel
2019-05-05 14:00 ` [PATCH v5 06/10] [media] marvell-ccic/mmp: enable clock before accessing registers Lubomir Rintel
2019-05-05 14:00 ` [PATCH v5 07/10] [media] marvell-ccic: rename the clocks Lubomir Rintel
2019-05-05 14:00 ` [PATCH v5 08/10] [media] marvell-ccic/mmp: add devicetree support Lubomir Rintel
2019-05-05 14:00 ` [PATCH v5 09/10] [media] marvell-ccic: use async notifier to get the sensor Lubomir Rintel
2019-05-05 14:00 ` [PATCH v5 10/10] [media] marvell-ccic: provide a clock for " Lubomir Rintel
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=f70270d3d67b276bcde7caa6891d655c78ad128f.camel@v3.sk \
--to=lkundrak@v3.sk \
--cc=corbet@lwn.net \
--cc=devicetree@vger.kernel.org \
--cc=jacopo@jmondi.org \
--cc=lbyang@marvell.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mchehab@kernel.org \
--cc=pavel@ucw.cz \
--cc=quozl@laptop.org \
--cc=robh+dt@kernel.org \
--cc=sakari.ailus@iki.fi \
--cc=twang13@marvell.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).