Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp1563812rdd; Thu, 11 Jan 2024 03:05:10 -0800 (PST) X-Google-Smtp-Source: AGHT+IERd2oJbR7qkFUfC4by/Iqzo7kis0WU8DCS54IRYk1EGZ8faHaM9zSrmCIIgVNzPaFag6Pu X-Received: by 2002:a17:906:e0c9:b0:a28:ab0d:4612 with SMTP id gl9-20020a170906e0c900b00a28ab0d4612mr350616ejb.78.1704971109909; Thu, 11 Jan 2024 03:05:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704971109; cv=none; d=google.com; s=arc-20160816; b=czFtOU7qKg0WBQAgUWGSQHTL+UF1L0Lkumvp2nKKFo/n018lnFJGZ2AqwJpsYv0lY6 9K/B9sOcuw42pePhNj4o/C0ZB+h5B3XvxKVrSurH7hLxwqI+Uh+1NCi1iTfHaxnX53nc swFZTBCjTqB52FBeVURZRw0awe1CEGCH5gOBIn3JNjoyeqhqpvV266vO0s6RrEX7y5vJ yoAnQR60l//D6/TV66he6074ZlZe+maR2RWIOmvX3DeA4hpfJ6beXudiOn4fAJGcxkcG iLLsSs3HmpoVBVcLCW81W5oXzkLSAJEdnj4QEwqlvrszZT1YKw6H49f0tZ90eC7Ng7kp nAGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=oZPGxlrX7BusY7TLHurUJ/YbEgD2UlLPEhETZEeCeag=; fh=KNxDcbhxerEdlWNyStM98QjhychgDlTzcmHtDTVAW0w=; b=UoK0/dPejSytJH/Uz3jVn6rCOeetZt1XrtOFxi23SM4MlLnRJKY2+Qh3++kG9kokmj IdsA02gbt9E9mKGbT4niLPp3+Ikf7y+2HdNWLVQKCq1+ml2/Y7p52LH2Zqq+UsAw+Apq UUzeZJ/EmeQToBNreUuT/yM9gHfe/cO7heD7X1HiqNUYA5fjoBIFcOFXYqbkmHdS8shq Z/sVSipq/vPE1+6mw/MC2OVmQZjfGSvbFu6etqHLOMZDcG3GXmDGptpCMPj9yXDoiGkU Ve9M7NFngd+HVa+0/pF0/SKOcE/VR62BDVNFC1gTSTmORfc4u/uUO7RozjtISqpkQ0bd G+iQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VTE8GgEA; spf=pass (google.com: domain of linux-kernel+bounces-23446-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-23446-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id x16-20020a170906299000b00a2bd2ebb084si407504eje.81.2024.01.11.03.05.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Jan 2024 03:05:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-23446-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=VTE8GgEA; spf=pass (google.com: domain of linux-kernel+bounces-23446-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-23446-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id AAABD1F23541 for ; Thu, 11 Jan 2024 11:05:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AA05D14F83; Thu, 11 Jan 2024 11:05:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="VTE8GgEA" Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9EB6414F79 for ; Thu, 11 Jan 2024 11:04:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-40d6b4e2945so60430125e9.0 for ; Thu, 11 Jan 2024 03:04:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704971098; x=1705575898; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=oZPGxlrX7BusY7TLHurUJ/YbEgD2UlLPEhETZEeCeag=; b=VTE8GgEAmwlqahjBoKTk6ll8/M0PDwjRmmDA8vYcnZYalElcxmAE8GjncnlaSgfCFf DEoaQHpSqe5VgtLV4o+ymFtr9nfPinQwZgb3U0U6shRhmZ7SRQQn5f7sfZqPzqxWnNJe oGSYWNzoAuKUi07AJFfMPfi+b91OtpgvmHNUujh0bZk7FAxAOzhAnSO/z+7HbGErnpN4 /1O2Lt6JMBUJk4vkwk6XpUa5+Gk9cG/0X9onno2BCu8w2qAwEMf5Uqe+CTyJ5Z6xiuNs 10+XzzUe4k56hkbcknQ0Zkzn6A+PZ09c29AlDkkfOZO/Lu7glmLaNOHnce+yevWDUb8O r8Jg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704971098; x=1705575898; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=oZPGxlrX7BusY7TLHurUJ/YbEgD2UlLPEhETZEeCeag=; b=U0rzIQUaGiUs+39IXp2MnYVANJmJZLvh3//LvIuGNh0jaruVseDyPPRmy65nVoYvDE BhrgGASpgTH8fdkpBxJdW9fOhz1BfFQHIpUn4vA4MaK2spruF+6LYoqtEZSt0NmtKVeY fX3mnjx4TQYWLxfpeDf23c/nX88BCAGuKbe8aoreZkViiQNMyT7doPJg7bSiYt55Dlll bTxq1xR1qt2XGbnY5t1Q8uxS5z+neW7AX16w9GSAhy+QUKwK5URLVRFXUVcmxigZO61G 6LGPbB2LAnzIiUeJ9ph2OsYSSdmuT1nOfA9ZE3XMigbKygcb62PD7eR6ueHLVtUeMdhK YioA== X-Gm-Message-State: AOJu0YyNMvA516lpxvmrEnJY0Q9m5/EAAIceMHp/wZBJMHRhij8Hl1P7 V31VF3o57j0zEKVkvdrZsySUm92oayIM6A== X-Received: by 2002:a05:600c:4e8c:b0:40d:39d0:9916 with SMTP id f12-20020a05600c4e8c00b0040d39d09916mr228182wmq.246.1704971097287; Thu, 11 Jan 2024 03:04:57 -0800 (PST) Received: from localhost ([102.140.209.237]) by smtp.gmail.com with ESMTPSA id o8-20020a05600c510800b0040e624995f1sm265160wms.8.2024.01.11.03.04.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Jan 2024 03:04:57 -0800 (PST) Date: Thu, 11 Jan 2024 14:04:53 +0300 From: Dan Carpenter To: Changhuang Liang Cc: Mauro Carvalho Chehab , Greg Kroah-Hartman , Matthias Brugger , Hans Verkuil , Ming Qian , Laurent Pinchart , Nicolas Dufresne , Benjamin Gaignard , Tomi Valkeinen , Mingjia Zhang , Jack Zhu , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-staging@lists.linux.dev Subject: Re: [PATCH v2 08/13] staging: media: starfive: Add for StarFive ISP 3A SC Message-ID: References: <20240111084120.16685-1-changhuang.liang@starfivetech.com> <20240111084120.16685-9-changhuang.liang@starfivetech.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240111084120.16685-9-changhuang.liang@starfivetech.com> On Thu, Jan 11, 2024 at 12:41:15AM -0800, Changhuang Liang wrote: > Register ISP 3A "capture_scd" video device to receive statistics > collection data. > > Signed-off-by: Changhuang Liang > --- > .../staging/media/starfive/camss/stf-buffer.h | 1 + > .../staging/media/starfive/camss/stf-camss.c | 8 + > .../media/starfive/camss/stf-capture.c | 21 ++- > .../media/starfive/camss/stf-isp-hw-ops.c | 66 ++++++++ > .../staging/media/starfive/camss/stf-isp.h | 23 +++ > .../staging/media/starfive/camss/stf-video.c | 143 +++++++++++++++++- > .../staging/media/starfive/camss/stf-video.h | 1 + > 7 files changed, 254 insertions(+), 9 deletions(-) > > diff --git a/drivers/staging/media/starfive/camss/stf-buffer.h b/drivers/staging/media/starfive/camss/stf-buffer.h > index 9d1670fb05ed..727d00617448 100644 > --- a/drivers/staging/media/starfive/camss/stf-buffer.h > +++ b/drivers/staging/media/starfive/camss/stf-buffer.h > @@ -23,6 +23,7 @@ enum stf_v_state { > struct stfcamss_buffer { > struct vb2_v4l2_buffer vb; > dma_addr_t addr[2]; > + void *vaddr; > struct list_head queue; > }; > > diff --git a/drivers/staging/media/starfive/camss/stf-camss.c b/drivers/staging/media/starfive/camss/stf-camss.c > index a587f860101a..3175d0d9a05c 100644 > --- a/drivers/staging/media/starfive/camss/stf-camss.c > +++ b/drivers/staging/media/starfive/camss/stf-camss.c > @@ -126,6 +126,7 @@ static int stfcamss_of_parse_ports(struct stfcamss *stfcamss) > static int stfcamss_register_devs(struct stfcamss *stfcamss) > { > struct stf_capture *cap_yuv = &stfcamss->captures[STF_CAPTURE_YUV]; > + struct stf_capture *cap_scd = &stfcamss->captures[STF_CAPTURE_SCD]; > struct stf_isp_dev *isp_dev = &stfcamss->isp_dev; > int ret; > > @@ -150,6 +151,13 @@ static int stfcamss_register_devs(struct stfcamss *stfcamss) > > cap_yuv->video.source_subdev = &isp_dev->subdev; > > + ret = media_create_pad_link(&isp_dev->subdev.entity, STF_ISP_PAD_SRC_SCD, > + &cap_scd->video.vdev.entity, 0, 0); > + if (ret) > + goto err_cap_unregister; > + Don't we need to do something like media_entity_remove_links(&cap_yuv->video.vdev.entity); as part of the cleanup? Also where do we clean up this new call to media_create_pad_link() in the unregister process? > + cap_scd->video.source_subdev = &isp_dev->subdev; > + > return ret; > > err_cap_unregister: regards, dan carpenter