linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: <yuji2.ishikawa@toshiba.co.jp>
To: <gregkh@linuxfoundation.org>
Cc: <robh+dt@kernel.org>, <hverkuil@xs4all.nl>,
	<nobuhiro1.iwamatsu@toshiba.co.jp>, <corbet@lwn.net>,
	<sumit.semwal@linaro.org>, <christian.koenig@amd.com>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>, <linux-media@vger.kernel.org>,
	<dri-devel@lists.freedesktop.org>,
	<linaro-mm-sig@lists.linaro.org>
Subject: RE: [PATCH v2 2/5] soc: visconti: Add Toshiba Visconti image processing accelerator common source
Date: Tue, 26 Jul 2022 07:02:12 +0000	[thread overview]
Message-ID: <TYAPR01MB6201082C58C5BFAF6902120C92949@TYAPR01MB6201.jpnprd01.prod.outlook.com> (raw)
In-Reply-To: <Yt6Qk6jdAjDVSBh/@kroah.com>

Hi Greg,

Thank you for your comments.

> -----Original Message-----
> From: Greg KH <gregkh@linuxfoundation.org>
> Sent: Monday, July 25, 2022 9:46 PM
> To: ishikawa yuji(石川 悠司 ○RDC□AITC○EA開)
> <yuji2.ishikawa@toshiba.co.jp>
> Cc: Rob Herring <robh+dt@kernel.org>; Hans Verkuil <hverkuil@xs4all.nl>;
> iwamatsu nobuhiro(岩松 信洋 □SWC◯ACT)
> <nobuhiro1.iwamatsu@toshiba.co.jp>; Jonathan Corbet <corbet@lwn.net>;
> Sumit Semwal <sumit.semwal@linaro.org>; Christian König
> <christian.koenig@amd.com>; linux-arm-kernel@lists.infradead.org;
> linux-kernel@vger.kernel.org; linux-media@vger.kernel.org;
> dri-devel@lists.freedesktop.org; linaro-mm-sig@lists.linaro.org
> Subject: Re: [PATCH v2 2/5] soc: visconti: Add Toshiba Visconti image
> processing accelerator common source
> 
> On Fri, Jul 22, 2022 at 05:28:55PM +0900, Yuji Ishikawa wrote:
> > This commit adds common definitions shared among image processing
> > accelerator drivers for Toshiba Visconti SoCs.
> 
> Please wrap your changelog text lines properly at 72 columns.
>
> And you need to provide a lot more information here as to what this is, it's not
> enough to be able to properly review this with just a single sentence.
>

I'll update changelog.

> >
> > Signed-off-by: Yuji Ishikawa <yuji2.ishikawa@toshiba.co.jp>
> > Reviewed-by: Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp>
> > ---
> > v1 -> v2:
> >   - applied checkpatch.pl --strict
> > ---
> >  drivers/soc/Kconfig               |  1 +
> >  drivers/soc/Makefile              |  1 +
> >  drivers/soc/visconti/Kconfig      |  1 +
> >  drivers/soc/visconti/Makefile     |  6 +++
> >  drivers/soc/visconti/ipa_common.c | 55 +++++++++++++++++++
> > drivers/soc/visconti/ipa_common.h | 18 +++++++
> >  drivers/soc/visconti/uapi/ipa.h   | 90
> +++++++++++++++++++++++++++++++
> >  7 files changed, 172 insertions(+)
> >  create mode 100644 drivers/soc/visconti/Kconfig  create mode 100644
> > drivers/soc/visconti/Makefile  create mode 100644
> > drivers/soc/visconti/ipa_common.c  create mode 100644
> > drivers/soc/visconti/ipa_common.h  create mode 100644
> > drivers/soc/visconti/uapi/ipa.h
> >
> > diff --git a/drivers/soc/Kconfig b/drivers/soc/Kconfig index
> > e8a30c4c5..c99139aa8 100644
> > --- a/drivers/soc/Kconfig
> > +++ b/drivers/soc/Kconfig
> > @@ -22,6 +22,7 @@ source "drivers/soc/tegra/Kconfig"
> >  source "drivers/soc/ti/Kconfig"
> >  source "drivers/soc/ux500/Kconfig"
> >  source "drivers/soc/versatile/Kconfig"
> > +source "drivers/soc/visconti/Kconfig"
> >  source "drivers/soc/xilinx/Kconfig"
> >
> >  endmenu
> > diff --git a/drivers/soc/Makefile b/drivers/soc/Makefile index
> > a05e9fbcd..455b993c2 100644
> > --- a/drivers/soc/Makefile
> > +++ b/drivers/soc/Makefile
> > @@ -28,4 +28,5 @@ obj-$(CONFIG_ARCH_TEGRA)	+= tegra/
> >  obj-y				+= ti/
> >  obj-$(CONFIG_ARCH_U8500)	+= ux500/
> >  obj-$(CONFIG_PLAT_VERSATILE)	+= versatile/
> > +obj-$(CONFIG_ARCH_VISCONTI)	+= visconti/
> >  obj-y				+= xilinx/
> > diff --git a/drivers/soc/visconti/Kconfig
> > b/drivers/soc/visconti/Kconfig new file mode 100644 index
> > 000000000..8b1378917
> > --- /dev/null
> > +++ b/drivers/soc/visconti/Kconfig
> > @@ -0,0 +1 @@
> > +
> > diff --git a/drivers/soc/visconti/Makefile
> > b/drivers/soc/visconti/Makefile new file mode 100644 index
> > 000000000..8d710da08
> > --- /dev/null
> > +++ b/drivers/soc/visconti/Makefile
> > @@ -0,0 +1,6 @@
> > +# SPDX-License-Identifier: GPL-2.0
> > +#
> > +# Makefile for the Visconti specific device drivers.
> > +#
> > +
> > +obj-y += ipa_common.o
> > diff --git a/drivers/soc/visconti/ipa_common.c
> > b/drivers/soc/visconti/ipa_common.c
> > new file mode 100644
> > index 000000000..6345f33c5
> > --- /dev/null
> > +++ b/drivers/soc/visconti/ipa_common.c
> > @@ -0,0 +1,55 @@
> > +// SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause
> 
> Why is this dual-licensed?  I have to ask, and also, have to see some sort of
> justification as to why this is needed.  Doing dual-licensed kernel code is
> tough and a pain and we need to know that you, and your lawyers, understand
> the issues involved here.
>

I'll talk with development members.

> 
> > +/* Toshiba Visconti Image Processing Accelerator Support
> > + *
> > + * (C) Copyright 2022 TOSHIBA CORPORATION
> > + * (C) Copyright 2022 Toshiba Electronic Devices & Storage
> > +Corporation  */
> > +
> > +#include "ipa_common.h"
> > +
> > +int ipa_attach_dmabuf(struct device *dev, int fd, struct
> dma_buf_attachment **a,
> > +		      struct sg_table **s, dma_addr_t *addr, enum
> > +dma_data_direction dma_dir) {
> > +	struct dma_buf_attachment *attachment;
> > +	struct dma_buf *dmabuf;
> > +	struct sg_table *sgt;
> > +	int ret;
> > +
> > +	dmabuf = dma_buf_get(fd);
> > +	if (IS_ERR(dmabuf)) {
> > +		dev_err(dev, "Invalid dmabuf FD\n");
> > +		return PTR_ERR(dmabuf);
> > +	}
> > +	attachment = dma_buf_attach(dmabuf, dev);
> > +
> > +	if (IS_ERR(attachment)) {
> > +		dev_err(dev, "Failed to attach dmabuf\n");
> > +		ret = PTR_ERR(attachment);
> > +		goto err_put;
> > +	}
> > +	sgt = dma_buf_map_attachment(attachment, dma_dir);
> > +	if (IS_ERR(sgt)) {
> > +		dev_err(dev, "Failed to get dmabufs sg_table\n");
> > +		ret = PTR_ERR(sgt);
> > +		goto err_detach;
> > +	}
> > +	if (sgt->nents != 1) {
> > +		dev_err(dev, "Sparse DMA region is unsupported\n");
> > +		ret = -EINVAL;
> > +		goto err_unmap;
> > +	}
> > +
> > +	*addr = sg_dma_address(sgt->sgl);
> > +	*a = attachment;
> > +	*s = sgt;
> > +
> > +	return 0;
> > +
> > +err_unmap:
> > +	dma_buf_unmap_attachment(attachment, sgt, dma_dir);
> > +err_detach:
> > +	dma_buf_detach(dmabuf, attachment);
> > +err_put:
> > +	dma_buf_put(dmabuf);
> > +	return ret;
> > +}
> 
> Why do you have a whole file for one function?  That feels unneeded.
> 

The function ipa_attach_dmabuf() is shared among several accelerator drivers.
Visconti has other 8 kinds of accelerators; Affine, Pyramid, DSPIF, ...
I should have mentioned detail of how ipa_common.c is used. Sorry.

> thanks,
> 
> greg k-h

Regards,
  Yuji

  reply	other threads:[~2022-07-26  7:07 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-22  8:28 [PATCH v2 0/5] Add Toshiba Visconti DNN image processing accelerator driver Yuji Ishikawa
2022-07-22  8:28 ` [PATCH v2 1/5] dt-bindings: soc: visconti: Add Toshiba Visconti DNN image processing accelerator bindings Yuji Ishikawa
2022-07-22  8:28 ` [PATCH v2 2/5] soc: visconti: Add Toshiba Visconti image processing accelerator common source Yuji Ishikawa
2022-07-25 12:46   ` Greg KH
2022-07-26  7:02     ` yuji2.ishikawa [this message]
2022-07-22  8:28 ` [PATCH v2 3/5] soc: visconti: Add Toshiba Visconti DNN image processing accelerator Yuji Ishikawa
2022-07-25 12:48   ` Greg KH
2022-07-26  6:10     ` yuji2.ishikawa
2022-07-25 12:50   ` Greg KH
2022-07-26  6:10     ` yuji2.ishikawa
2022-07-26 15:15       ` Greg KH
2022-07-22  8:28 ` [PATCH v2 4/5] MAINTAINERS: Add entries for " Yuji Ishikawa
2022-07-25 12:47   ` Greg KH
2022-07-26  6:10     ` yuji2.ishikawa
2022-07-28  8:46       ` Greg KH
2022-07-22  8:28 ` [PATCH v2 5/5] Documentation: driver-api: visconti: add a description of DNN driver Yuji Ishikawa
2022-07-22 13:32   ` Jonathan Corbet
2022-07-26  6:10     ` yuji2.ishikawa
2022-07-25 12:46 ` [PATCH v2 0/5] Add Toshiba Visconti DNN image processing accelerator driver Greg KH
2022-07-26  6:09   ` yuji2.ishikawa
2022-07-28  8:47     ` Greg KH

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=TYAPR01MB6201082C58C5BFAF6902120C92949@TYAPR01MB6201.jpnprd01.prod.outlook.com \
    --to=yuji2.ishikawa@toshiba.co.jp \
    --cc=christian.koenig@amd.com \
    --cc=corbet@lwn.net \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=hverkuil@xs4all.nl \
    --cc=linaro-mm-sig@lists.linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=nobuhiro1.iwamatsu@toshiba.co.jp \
    --cc=robh+dt@kernel.org \
    --cc=sumit.semwal@linaro.org \
    /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).