lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <64f8bebd-35e1-c743-b212-e1a3292bade2@quicinc.com>
Date: Thu, 9 Jan 2025 23:18:29 +0530
From: Vikash Garodia <quic_vgarodia@...cinc.com>
To: Johan Hovold <johan@...nel.org>,
        Dikshita Agarwal
	<quic_dikshita@...cinc.com>
CC: Abhinav Kumar <quic_abhinavk@...cinc.com>,
        Mauro Carvalho Chehab
	<mchehab@...nel.org>,
        Rob Herring <robh@...nel.org>,
        Krzysztof Kozlowski
	<krzk+dt@...nel.org>,
        Conor Dooley <conor+dt@...nel.org>,
        Philipp Zabel
	<p.zabel@...gutronix.de>,
        Hans Verkuil <hverkuil@...all.nl>,
        Sebastian Fricke
	<sebastian.fricke@...labora.com>,
        Bryan O'Donoghue
	<bryan.odonoghue@...aro.org>,
        Dmitry Baryshkov <dmitry.baryshkov@...aro.org>,
        Neil Armstrong <neil.armstrong@...aro.org>,
        Nicolas Dufresne
	<nicolas@...fresne.ca>,
        Uwe Kleine-König
	<u.kleine-koenig@...libre.com>,
        Jianhua Lu <lujianhua000@...il.com>,
        "Stefan
 Schmidt" <stefan.schmidt@...aro.org>,
        <linux-media@...r.kernel.org>, <linux-arm-msm@...r.kernel.org>,
        <devicetree@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
        Bjorn Andersson <andersson@...nel.org>
Subject: Re: [PATCH v9 27/28] media: iris: enable video driver probe of SM8250
 SoC

Hi Johan,

On 1/9/2025 8:41 PM, Johan Hovold wrote:
> On Thu, Dec 12, 2024 at 05:21:49PM +0530, Dikshita Agarwal wrote:
>> Initialize the platform data and enable video driver probe of SM8250
>> SoC. Add a kernel param to select between venus and iris drivers for
>> platforms supported by both drivers, for ex: SM8250.
> 
> Why do you want to use a module parameter for this? What would be the
> default configuration? (Module parameters should generally be avoided.)
This was discussed during v4 [1] and implemented as per suggestion

[1]
https://lore.kernel.org/linux-media/eea14133-2152-37bb-e2ff-fcc7ed4c47f5@quicinc.com/

> 
> Why not simply switch to the new driver (and make sure that the new
> driver is selected if the old one was enabled in the kernel config)?
Its about the platform in migration i.e sm8250. Since new driver is not yet
feature parity with old driver, choice is provided to client if it wants to use
the new driver (default being old driver for sm8250)

Regards,
Vikash
>> Tested-by: Stefan Schmidt <stefan.schmidt@...aro.org> # x1e80100 (Dell
> 
> Looks like something is missing from Stefan's Tested-by tag throughout
> the series ("Dell XPS13"?)
> 
>> Reviewed-by: Stefan Schmidt <stefan.schmidt@...aro.org>
>> Signed-off-by: Dikshita Agarwal <quic_dikshita@...cinc.com>
>  
>> +static bool prefer_venus = true;
>> +MODULE_PARM_DESC(prefer_venus, "Select whether venus or iris driver should be preferred");
>> +module_param(prefer_venus, bool, 0444);
>> +
>> +/* list all platforms supported by only iris driver */
>> +static const char *const iris_only_platforms[] = {
>> +	"qcom,sm8550-iris",
>> +	NULL,
>> +};
> 
> Surely you don't want to have to add every new platform to two tables
> (i.e. the id table and again here).
> 
>> +
>> +/* list all platforms supported by both venus and iris drivers */
>> +static const char *const venus_to_iris_migration[] = {
>> +	"qcom,sm8250-venus",
>> +	NULL,
>> +};
>> +
>> +static bool video_drv_should_bind(struct device *dev, bool is_iris_driver)
>> +{
>> +	if (of_device_compatible_match(dev->of_node, iris_only_platforms))
>> +		return is_iris_driver;
>> +
>> +	/* If it is not in the migration list, use venus */
>> +	if (!of_device_compatible_match(dev->of_node, venus_to_iris_migration))
>> +		return !is_iris_driver;
>> +
>> +	return prefer_venus ? !is_iris_driver : is_iris_driver;
>> +}
>> +
>>  static int iris_probe(struct platform_device *pdev)
>>  {
>>  	struct device *dev = &pdev->dev;
>> @@ -196,6 +224,9 @@ static int iris_probe(struct platform_device *pdev)
>>  	u64 dma_mask;
>>  	int ret;
>>  
>> +	if (!video_drv_should_bind(&pdev->dev, true))
>> +		return -ENODEV;
> 
> AFAICT nothing is preventing venus from binding even when 'prefer_venus'
> is false.
> 
>> +
>>  	core = devm_kzalloc(&pdev->dev, sizeof(*core), GFP_KERNEL);
>>  	if (!core)
>>  		return -ENOMEM;
>> @@ -324,6 +355,10 @@ static const struct of_device_id iris_dt_match[] = {
>>  		.compatible = "qcom,sm8550-iris",
>>  		.data = &sm8550_data,
>>  	},
>> +	{
>> +		.compatible = "qcom,sm8250-venus",
>> +		.data = &sm8250_data,
>> +	},
>>  	{ },
>>  };
>>  MODULE_DEVICE_TABLE(of, iris_dt_match);
> 
> Johan

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ