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: <CY5PR11MB63660C230457299E1201C38FED1A2@CY5PR11MB6366.namprd11.prod.outlook.com>
Date: Thu, 16 Jan 2025 06:54:39 +0000
From: "Usyskin, Alexander" <alexander.usyskin@...el.com>
To: Richard Weinberger <richard@....at>
CC: Miquel Raynal <miquel.raynal@...tlin.com>, Vignesh Raghavendra
	<vigneshr@...com>, "De Marchi, Lucas" <lucas.demarchi@...el.com>,
	Thomas Hellström <thomas.hellstrom@...ux.intel.com>,
	"Vivi, Rodrigo" <rodrigo.vivi@...el.com>, Maarten Lankhorst
	<maarten.lankhorst@...ux.intel.com>, Maxime Ripard <mripard@...nel.org>,
	Thomas Zimmermann <tzimmermann@...e.de>, David Airlie <airlied@...il.com>,
	Simona Vetter <simona@...ll.ch>, Jani Nikula <jani.nikula@...ux.intel.com>,
	Joonas Lahtinen <joonas.lahtinen@...ux.intel.com>, Tvrtko Ursulin
	<tursulin@...ulin.net>, "Poosa, Karthik" <karthik.poosa@...el.com>, "Abliyev,
 Reuven" <reuven.abliyev@...el.com>, "Weil, Oren jer"
	<oren.jer.weil@...el.com>, linux-mtd <linux-mtd@...ts.infradead.org>, "DRI
 mailing list" <dri-devel@...ts.freedesktop.org>, intel-gfx
	<intel-gfx@...ts.freedesktop.org>, linux-kernel
	<linux-kernel@...r.kernel.org>
Subject: RE: [PATCH v4 01/11] mtd: core: always create master device

> > Create master device without partition when
> > CONFIG_MTD_PARTITIONED_MASTER flag is unset.
> >
> > This streamlines device tree and allows to anchor
> > runtime power management on master device in all cases.
> 
> Please explain in more detail why this is needed.
> If this change makes the overall situation better and breaks
> no userspace, I'm happy. :-)
> 

The rest of the series is a driver that need runtime power management.
Absence of the master device breaks power management logic,
as kernel automatically propagates state from children to parent.
I initially hooked runtime_pm on chip auxiliary device, but this is a hack,
not a solution.

> From skimming over the patch I think the mtd_master device completely
> useless for userspace, right?
> 

As of today, yes.
In future we can add curated sysfs with common parameters for all partitions,
so user-space can query master device instead of one of the partitions.

> > int add_mtd_device(struct mtd_info *mtd)
> > {
> > 	struct device_node *np = mtd_get_of_node(mtd);
> > 	struct mtd_info *master = mtd_get_master(mtd);
> > 	struct mtd_notifier *not;
> > +	bool partitioned = true;
> > 	int i, error, ofidx;
> >
> > 	/*
> > @@ -655,6 +678,11 @@ int add_mtd_device(struct mtd_info *mtd)
> > 	if (WARN_ONCE(mtd->dev.type, "MTD already registered\n"))
> > 		return -EEXIST;
> >
> > +	if ((master == mtd) &&
> !IS_ENABLED(CONFIG_MTD_PARTITIONED_MASTER)) {
> > +		partitioned = false;
> > +		pr_debug("mtd: unpartitioned master %s\n", mtd->name);
> > +	}
> 
> So, when CONFIG_MTD_PARTITIONED_MASTER is not set and a driver like
> MTDRAM
> does mtd_device_register(mtd, NULL, 0) we end up here with partitioned =
> false,
> and allocate just a master device but no real mtd because with zero
> parts the mtd_device_parse_register() function will not call add_mtd_device().
> :-(

Yep, missed this.
I think that we can create master after partitions and condition it
on master not created in partition phase.

> 
> Thanks,
> //Richard


- - 
Thanks,
Sasha


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ