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] [day] [month] [year] [list]
Message-ID: <32c348a0a61d4c6585b1b58e923a7f79@huawei.com>
Date: Wed, 3 Apr 2024 14:03:58 +0000
From: Shiju Jose <shiju.jose@...wei.com>
To: Daniel Ferguson <danielf@...amperecomputing.com>,
	"linux-cxl@...r.kernel.org" <linux-cxl@...r.kernel.org>,
	"linux-acpi@...r.kernel.org" <linux-acpi@...r.kernel.org>,
	"linux-mm@...ck.org" <linux-mm@...ck.org>, "dan.j.williams@...el.com"
	<dan.j.williams@...el.com>, "dave@...olabs.net" <dave@...olabs.net>,
	"Jonathan Cameron" <jonathan.cameron@...wei.com>, "dave.jiang@...el.com"
	<dave.jiang@...el.com>, "alison.schofield@...el.com"
	<alison.schofield@...el.com>, "vishal.l.verma@...el.com"
	<vishal.l.verma@...el.com>, "ira.weiny@...el.com" <ira.weiny@...el.com>
CC: "linux-edac@...r.kernel.org" <linux-edac@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"david@...hat.com" <david@...hat.com>, "Vilas.Sridharan@....com"
	<Vilas.Sridharan@....com>, "leo.duran@....com" <leo.duran@....com>,
	"Yazen.Ghannam@....com" <Yazen.Ghannam@....com>, "rientjes@...gle.com"
	<rientjes@...gle.com>, "jiaqiyan@...gle.com" <jiaqiyan@...gle.com>,
	"tony.luck@...el.com" <tony.luck@...el.com>, "Jon.Grimm@....com"
	<Jon.Grimm@....com>, "dave.hansen@...ux.intel.com"
	<dave.hansen@...ux.intel.com>, "rafael@...nel.org" <rafael@...nel.org>,
	"lenb@...nel.org" <lenb@...nel.org>, "naoya.horiguchi@....com"
	<naoya.horiguchi@....com>, "james.morse@....com" <james.morse@....com>,
	"jthoughton@...gle.com" <jthoughton@...gle.com>, "somasundaram.a@....com"
	<somasundaram.a@....com>, "erdemaktas@...gle.com" <erdemaktas@...gle.com>,
	"pgonda@...gle.com" <pgonda@...gle.com>, "duenwen@...gle.com"
	<duenwen@...gle.com>, "mike.malvestuto@...el.com"
	<mike.malvestuto@...el.com>, "gthelen@...gle.com" <gthelen@...gle.com>,
	"wschwartz@...erecomputing.com" <wschwartz@...erecomputing.com>,
	"dferguson@...erecomputing.com" <dferguson@...erecomputing.com>, tanxiaofei
	<tanxiaofei@...wei.com>, "Zengtao (B)" <prime.zeng@...ilicon.com>,
	"kangkang.shen@...urewei.com" <kangkang.shen@...urewei.com>, wanghuiqiang
	<wanghuiqiang@...wei.com>, Linuxarm <linuxarm@...wei.com>,
	"wbs@...amperecomputing.com" <wbs@...amperecomputing.com>
Subject: RE: [RFC PATCH v7 12/12] memory: RAS2: Add memory RAS2 driver

Hi Daniel,

>-----Original Message-----
>From: Daniel Ferguson <danielf@...amperecomputing.com>
>Sent: 28 March 2024 23:42
>To: Shiju Jose <shiju.jose@...wei.com>; linux-cxl@...r.kernel.org; linux-
>acpi@...r.kernel.org; linux-mm@...ck.org; dan.j.williams@...el.com;
>dave@...olabs.net; Jonathan Cameron <jonathan.cameron@...wei.com>;
>dave.jiang@...el.com; alison.schofield@...el.com; vishal.l.verma@...el.com;
>ira.weiny@...el.com
>Cc: linux-edac@...r.kernel.org; linux-kernel@...r.kernel.org;
>david@...hat.com; Vilas.Sridharan@....com; leo.duran@....com;
>Yazen.Ghannam@....com; rientjes@...gle.com; jiaqiyan@...gle.com;
>tony.luck@...el.com; Jon.Grimm@....com; dave.hansen@...ux.intel.com;
>rafael@...nel.org; lenb@...nel.org; naoya.horiguchi@....com;
>james.morse@....com; jthoughton@...gle.com; somasundaram.a@....com;
>erdemaktas@...gle.com; pgonda@...gle.com; duenwen@...gle.com;
>mike.malvestuto@...el.com; gthelen@...gle.com;
>wschwartz@...erecomputing.com; dferguson@...erecomputing.com;
>tanxiaofei <tanxiaofei@...wei.com>; Zengtao (B) <prime.zeng@...ilicon.com>;
>kangkang.shen@...urewei.com; wanghuiqiang <wanghuiqiang@...wei.com>;
>Linuxarm <linuxarm@...wei.com>; wbs@...amperecomputing.com
>Subject: Re: [RFC PATCH v7 12/12] memory: RAS2: Add memory RAS2 driver
>
>> +/*
...
>> +
>> +static int ras2_probe(struct platform_device *pdev) {
>> +	int ret, id;
>> +	struct mbox_client *cl;
>> +	struct device *hw_scrub_dev;
>> +	struct ras2_context *ras2_ctx;
>> +	char scrub_name[RAS2_MAX_NAME_LENGTH];
>> +
>> +	ras2_ctx = devm_kzalloc(&pdev->dev, sizeof(*ras2_ctx), GFP_KERNEL);
>> +	if (!ras2_ctx)
>> +		return -ENOMEM;
>> +
>> +	ras2_ctx->dev = &pdev->dev;
>> +	ras2_ctx->ops = &ras2_hw_ops;
>> +	spin_lock_init(&ras2_ctx->spinlock);
>> +	platform_set_drvdata(pdev, ras2_ctx);
>> +
>> +	cl = &ras2_ctx->mbox_client;
>> +	/* Request mailbox channel */
>> +	cl->dev = &pdev->dev;
>> +	cl->tx_done = ras2_tx_done;
>> +	cl->knows_txdone = true;
>> +	ras2_ctx->pcc_subspace_idx = *((int *)pdev->dev.platform_data);
>> +	dev_dbg(&pdev->dev, "pcc-subspace-id=%d\n", ras2_ctx-
>>pcc_subspace_idx);
>> +	ret = ras2_register_pcc_channel(ras2_ctx);
>
>In our enabling activities, we have found a challenge here.
>Our hardware has a single PCC channel corresponding to a single platform-wide
>scrub interface. This driver, following the ACPI spec, will create a new scrub
>node for each NUMA node. However, for us, this means that each scrub device
>will try to map the same PCC channel, and this causes an error.

Is failing to probe cleanly is enough for your platform?  i.e. put any error messages as dev_dbg()
or whichever one causes this problem.
>> +	if (ret < 0)
>> +		return ret;
>> +
>> +	ret = devm_add_action_or_reset(&pdev->dev, devm_ras2_release,
>ras2_ctx);
>> +	if (ret < 0)
>> +		return ret;
>> +
>> +	if (ras2_is_patrol_scrub_support(ras2_ctx)) {
>> +		id = ida_alloc(&ras2_ida, GFP_KERNEL);
>> +		if (id < 0)
>> +			return id;
>> +		ras2_ctx->id = id;
>> +		snprintf(scrub_name, sizeof(scrub_name), "%s%d",
>RAS2_SCRUB, id);
>> +		dev_set_name(&pdev->dev, RAS2_ID_FORMAT, id);
>> +		hw_scrub_dev = devm_scrub_device_register(&pdev->dev,
>scrub_name,
>> +							  ras2_ctx,
>&ras2_scrub_ops,
>> +							  0, NULL);
>> +		if (PTR_ERR_OR_ZERO(hw_scrub_dev))
>> +			return PTR_ERR_OR_ZERO(hw_scrub_dev);
>> +	}
>> +	ras2_ctx->scrub_dev = hw_scrub_dev;
>> +
>> +	return 0;
>> +}
>
Thanks,
Shiju

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ