Received: by 2002:ac0:da4c:0:0:0:0:0 with SMTP id a12csp2689226imi; Mon, 25 Jul 2022 05:48:03 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sc6sjrkPn4q0Wrddwzbwqbt7ea2bHzN3DExz1bdTxYfFDOx+qrtKzqIPsU8NPKy8CXhKAy X-Received: by 2002:a05:6402:1c97:b0:43b:b984:f817 with SMTP id cy23-20020a0564021c9700b0043bb984f817mr13255305edb.196.1658753283442; Mon, 25 Jul 2022 05:48:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658753283; cv=none; d=google.com; s=arc-20160816; b=EdoP0kOgIrIbpf0pOKjfOfEuX0JvYjtxghH9BJBw3gZ5lWbY8DsKVSZlfll4ilb+bo zRQCHaR7wigwNC1qICQJfR4fq/SJHfZ1eZdlE+8qEeF3XMS5NagTftW+p3LM9AHGN8ce y2qaxN8FeGPHO8XAxbql3rXFENlD+8Wt2v+bZzsoDy3ELaoVsw/cWwuYMZL6fzjKChVS 8ZTrZ8dLh3IMvPOLCZnFC1A8YCApyBPJKVk8Q4uEoBYKkvWQFSOQqwmU+YKAPAVnxc7e TsEijcgmLitzbgBNP4XAT2j5MUntTGBV31E6l68gKsjydAD3z6DX5PyEl6/zJ4rTqrVG Xs6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=M7K7SYZv4AQUbmR5lcntY+CeY/MXxZXGsjWZDE4QrUk=; b=NIAlnobJ69vxlIxy8tJwHlVdWedUvt0/LnDMy3hJpthtpX2XKDDdy55rPG56oZT+Zm n07R+NmM0mRgTkMbaUI/cXgQ5Q4jyQjE9L8WIV3ac/n1sQxIXRdFL/1GGjd+Rcqg29j3 Aig4H768Xg3Gu2Dc5VIMifuFeyDidQvsbMEfkYJQnFDeWX3qqm2AWtvlvS+CLZbyuGh5 nRvIY+8MQQ6hr66/La/MCaJkAabUIG+46f4dXDR2otm5wlvdKyrNvmYZOZZXQCwT0HHy J+E1Fteq8enc7SDGDGRVux8gKIYVfGFbpRsPcbWLNfSiK5UwtN8gornLZhdx7p0FtJ82 DAqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=QLyMMpck; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w22-20020a05640234d600b0043be21a3510si5969405edc.312.2022.07.25.05.47.38; Mon, 25 Jul 2022 05:48:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=QLyMMpck; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235161AbiGYMqW (ORCPT + 99 others); Mon, 25 Jul 2022 08:46:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50784 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233546AbiGYMqU (ORCPT ); Mon, 25 Jul 2022 08:46:20 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D24B613F3A; Mon, 25 Jul 2022 05:46:18 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 6EF4EB80DEB; Mon, 25 Jul 2022 12:46:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 67C49C341C6; Mon, 25 Jul 2022 12:46:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1658753176; bh=2MPE6TEDK4JnTbJUnjvf9SyF00jGOhx4NmrdtmiQ+Nc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=QLyMMpckxebM7all/WIvnpW/lPJSouET0uAdYYLcoI0zs6kzYky6LNiSArprfaKya EUBDnLJWITtxEJnhxjfZQSjKWy2h6Rw0ac0fsYZXQUkDpDFAfgLvi/K7FfoZT86uj/ 6WONLaht6wzyG5AU2IBeDSKLJutgl5dqACpvCGIk= Date: Mon, 25 Jul 2022 14:46:11 +0200 From: Greg KH To: Yuji Ishikawa Cc: Rob Herring , Hans Verkuil , Nobuhiro Iwamatsu , Jonathan Corbet , Sumit Semwal , Christian =?iso-8859-1?Q?K=F6nig?= , 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 Message-ID: References: <20220722082858.17880-1-yuji2.ishikawa@toshiba.co.jp> <20220722082858.17880-3-yuji2.ishikawa@toshiba.co.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220722082858.17880-3-yuji2.ishikawa@toshiba.co.jp> X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. > > Signed-off-by: Yuji Ishikawa > Reviewed-by: Nobuhiro Iwamatsu > --- > 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. > +/* 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. thanks, greg k-h