linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* linux-next: manual merge of the driver-core tree with the s390 tree
@ 2011-12-28  6:26 Stephen Rothwell
  2012-01-04 23:07 ` Greg KH
  0 siblings, 1 reply; 4+ messages in thread
From: Stephen Rothwell @ 2011-12-28  6:26 UTC (permalink / raw)
  To: Greg KH
  Cc: linux-next, linux-kernel, Kay Sievers, Martin Schwidefsky,
	Heiko Carstens

[-- Attachment #1: Type: text/plain, Size: 6849 bytes --]

Hi Greg,

Today's linux-next merge of the driver-core tree got a conflict in
arch/s390/kernel/smp.c between commit 83a24e329084 ("[S390] topology: get
rid of ifdefs") from the s390 tree and commit 8a25a2fd126c ("cpu: convert
'cpu' and 'machinecheck' sysdev_class to a regular subsystem") from the
driver-core tree.

I fixed it up (see below) and can carry the fix as necessary.

I also applied the following merge fix patch (which may not be correct or
enough) for the bits moved into topology.c:

From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Wed, 28 Dec 2011 17:19:21 +1100
Subject: [PATCH] s390: fixup for sysdev removal

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 arch/s390/kernel/topology.c |   22 +++++++++++-----------
 1 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/arch/s390/kernel/topology.c b/arch/s390/kernel/topology.c
index 08a059d..b635a8b 100644
--- a/arch/s390/kernel/topology.c
+++ b/arch/s390/kernel/topology.c
@@ -366,8 +366,8 @@ void __init s390_init_cpu_topology(void)
 
 static int cpu_management;
 
-static ssize_t dispatching_show(struct sysdev_class *class,
-				struct sysdev_class_attribute *attr,
+static ssize_t dispatching_show(struct device *dev,
+				struct device_attribute *attr,
 				char *buf)
 {
 	ssize_t count;
@@ -378,8 +378,8 @@ static ssize_t dispatching_show(struct sysdev_class *class,
 	return count;
 }
 
-static ssize_t dispatching_store(struct sysdev_class *dev,
-				 struct sysdev_class_attribute *attr,
+static ssize_t dispatching_store(struct device *dev,
+				 struct device_attribute *attr,
 				 const char *buf,
 				 size_t count)
 {
@@ -405,11 +405,11 @@ out:
 	put_online_cpus();
 	return rc ? rc : count;
 }
-static SYSDEV_CLASS_ATTR(dispatching, 0644, dispatching_show,
+static DEIVCE_ATTR(dispatching, 0644, dispatching_show,
 			 dispatching_store);
 
-static ssize_t cpu_polarization_show(struct sys_device *dev,
-				     struct sysdev_attribute *attr, char *buf)
+static ssize_t cpu_polarization_show(struct device *dev,
+				     struct device_attribute *attr, char *buf)
 {
 	int cpu = dev->id;
 	ssize_t count;
@@ -435,10 +435,10 @@ static ssize_t cpu_polarization_show(struct sys_device *dev,
 	mutex_unlock(&smp_cpu_state_mutex);
 	return count;
 }
-static SYSDEV_ATTR(polarization, 0444, cpu_polarization_show, NULL);
+static DEVICE_ATTR(polarization, 0444, cpu_polarization_show, NULL);
 
 static struct attribute *topology_cpu_attrs[] = {
-	&attr_polarization.attr,
+	&dev_attr_polarization.attr,
 	NULL,
 };
 
@@ -448,7 +448,7 @@ static struct attribute_group topology_cpu_attr_group = {
 
 int topology_cpu_init(struct cpu *cpu)
 {
-	return sysfs_create_group(&cpu->sysdev.kobj, &topology_cpu_attr_group);
+	return sysfs_create_group(&cpu->dev.kobj, &topology_cpu_attr_group);
 }
 
 static int __init topology_init(void)
@@ -460,6 +460,6 @@ static int __init topology_init(void)
 	set_topology_timer();
 out:
 	update_cpu_core_map();
-	return sysdev_class_create_file(&cpu_sysdev_class, &attr_dispatching);
+	return device_create_file(cpu_subsys.dev_root, &dev_attr_dispatching);
 }
 device_initcall(topology_init);

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

diff --cc arch/s390/kernel/smp.c
index b1cd329,66cca03..0000000
--- a/arch/s390/kernel/smp.c
+++ b/arch/s390/kernel/smp.c
@@@ -923,21 -889,52 +923,21 @@@ out
  	put_online_cpus();
  	return rc ? rc : count;
  }
- static SYSDEV_ATTR(configure, 0644, cpu_configure_show, cpu_configure_store);
+ static DEVICE_ATTR(configure, 0644, cpu_configure_show, cpu_configure_store);
  #endif /* CONFIG_HOTPLUG_CPU */
  
- static ssize_t show_cpu_address(struct sys_device *dev,
- 				struct sysdev_attribute *attr, char *buf)
 -static ssize_t cpu_polarization_show(struct device *dev,
 -				     struct device_attribute *attr, char *buf)
 -{
 -	int cpu = dev->id;
 -	ssize_t count;
 -
 -	mutex_lock(&smp_cpu_state_mutex);
 -	switch (smp_cpu_polarization[cpu]) {
 -	case POLARIZATION_HRZ:
 -		count = sprintf(buf, "horizontal\n");
 -		break;
 -	case POLARIZATION_VL:
 -		count = sprintf(buf, "vertical:low\n");
 -		break;
 -	case POLARIZATION_VM:
 -		count = sprintf(buf, "vertical:medium\n");
 -		break;
 -	case POLARIZATION_VH:
 -		count = sprintf(buf, "vertical:high\n");
 -		break;
 -	default:
 -		count = sprintf(buf, "unknown\n");
 -		break;
 -	}
 -	mutex_unlock(&smp_cpu_state_mutex);
 -	return count;
 -}
 -static DEVICE_ATTR(polarization, 0444, cpu_polarization_show, NULL);
 -
+ static ssize_t show_cpu_address(struct device *dev,
+ 				struct device_attribute *attr, char *buf)
  {
  	return sprintf(buf, "%d\n", __cpu_logical_map[dev->id]);
  }
- static SYSDEV_ATTR(address, 0444, show_cpu_address, NULL);
+ static DEVICE_ATTR(address, 0444, show_cpu_address, NULL);
  
 -
  static struct attribute *cpu_common_attrs[] = {
  #ifdef CONFIG_HOTPLUG_CPU
- 	&attr_configure.attr,
+ 	&dev_attr_configure.attr,
  #endif
- 	&attr_address.attr,
+ 	&dev_attr_address.attr,
 -	&dev_attr_polarization.attr,
  	NULL,
  };
  
@@@ -1120,16 -1108,58 +1120,16 @@@ static ssize_t __ref rescan_store(struc
  	rc = smp_rescan_cpus();
  	return rc ? rc : count;
  }
- static SYSDEV_CLASS_ATTR(rescan, 0200, NULL, rescan_store);
+ static DEVICE_ATTR(rescan, 0200, NULL, rescan_store);
  #endif /* CONFIG_HOTPLUG_CPU */
  
 -static ssize_t dispatching_show(struct device *dev,
 -				struct device_attribute *attr,
 -				char *buf)
 -{
 -	ssize_t count;
 -
 -	mutex_lock(&smp_cpu_state_mutex);
 -	count = sprintf(buf, "%d\n", cpu_management);
 -	mutex_unlock(&smp_cpu_state_mutex);
 -	return count;
 -}
 -
 -static ssize_t dispatching_store(struct device *dev,
 -				 struct device_attribute *attr,
 -				 const char *buf,
 -				 size_t count)
 -{
 -	int val, rc;
 -	char delim;
 -
 -	if (sscanf(buf, "%d %c", &val, &delim) != 1)
 -		return -EINVAL;
 -	if (val != 0 && val != 1)
 -		return -EINVAL;
 -	rc = 0;
 -	get_online_cpus();
 -	mutex_lock(&smp_cpu_state_mutex);
 -	if (cpu_management == val)
 -		goto out;
 -	rc = topology_set_cpu_management(val);
 -	if (!rc)
 -		cpu_management = val;
 -out:
 -	mutex_unlock(&smp_cpu_state_mutex);
 -	put_online_cpus();
 -	return rc ? rc : count;
 -}
 -static DEVICE_ATTR(dispatching, 0644, dispatching_show,
 -			 dispatching_store);
 -
 -static int __init topology_init(void)
 +static int __init s390_smp_init(void)
  {
 -	int cpu;
 -	int rc;
 +	int cpu, rc;
  
  	register_cpu_notifier(&smp_cpu_nb);
 -
  #ifdef CONFIG_HOTPLUG_CPU
- 	rc = sysdev_class_create_file(&cpu_sysdev_class, &attr_rescan);
+ 	rc = device_create_file(cpu_subsys.dev_root, &dev_attr_rescan);
  	if (rc)
  		return rc;
  #endif

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: linux-next: manual merge of the driver-core tree with the s390 tree
  2011-12-28  6:26 linux-next: manual merge of the driver-core tree with the s390 tree Stephen Rothwell
@ 2012-01-04 23:07 ` Greg KH
  0 siblings, 0 replies; 4+ messages in thread
From: Greg KH @ 2012-01-04 23:07 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: linux-next, linux-kernel, Kay Sievers, Martin Schwidefsky,
	Heiko Carstens

On Wed, Dec 28, 2011 at 05:26:11PM +1100, Stephen Rothwell wrote:
> Hi Greg,
> 
> Today's linux-next merge of the driver-core tree got a conflict in
> arch/s390/kernel/smp.c between commit 83a24e329084 ("[S390] topology: get
> rid of ifdefs") from the s390 tree and commit 8a25a2fd126c ("cpu: convert
> 'cpu' and 'machinecheck' sysdev_class to a regular subsystem") from the
> driver-core tree.
> 
> I fixed it up (see below) and can carry the fix as necessary.
> 
> I also applied the following merge fix patch (which may not be correct or
> enough) for the bits moved into topology.c:

Looks good, thanks for doing this.

greg k-h

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: linux-next: manual merge of the driver-core tree with the s390 tree
  2023-03-21  1:34 Stephen Rothwell
@ 2023-03-21  7:39 ` Greg KH
  0 siblings, 0 replies; 4+ messages in thread
From: Greg KH @ 2023-03-21  7:39 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Heiko Carstens, Vasily Gorbik, Christian Borntraeger,
	Linux Kernel Mailing List, Linux Next Mailing List,
	Luis Chamberlain

On Tue, Mar 21, 2023 at 12:34:28PM +1100, Stephen Rothwell wrote:
> Hi all,
> 
> Today's linux-next merge of the driver-core tree got a conflict in:
> 
>   arch/s390/kernel/topology.c
> 
> between commit:
> 
>   0599331c3da6 ("s390: simplify one-level sysctl registration for topology_ctl_table")
> 
> from the s390 tree and commit:
> 
>   9493ed19fbc3 ("s390/topology: move to use bus_get_dev_root()")
> 
> from the driver-core tree.
> 
> I fixed it up (see below) and can carry the fix as necessary. This
> is now fixed as far as linux-next is concerned, but any non trivial
> conflicts should be mentioned to your upstream maintainer when your tree
> is submitted for merging.  You may also want to consider cooperating
> with the maintainer of the conflicting tree to minimise any particularly
> complex conflicts.
> 
> -- 
> Cheers,
> Stephen Rothwell
> 
> diff --cc arch/s390/kernel/topology.c
> index e5d6a1c25d13,72af753d1bba..000000000000
> --- a/arch/s390/kernel/topology.c
> +++ b/arch/s390/kernel/topology.c
> @@@ -637,14 -637,33 +637,23 @@@ static struct ctl_table topology_ctl_ta
>   	{ },
>   };
>   
>  -static struct ctl_table topology_dir_table[] = {
>  -	{
>  -		.procname	= "s390",
>  -		.maxlen		= 0,
>  -		.mode		= 0555,
>  -		.child		= topology_ctl_table,
>  -	},
>  -	{ },
>  -};
>  -
>   static int __init topology_init(void)
>   {
> + 	struct device *dev_root;
> + 	int rc = 0;
> + 
>   	timer_setup(&topology_timer, topology_timer_fn, TIMER_DEFERRABLE);
>   	if (MACHINE_HAS_TOPOLOGY)
>   		set_topology_timer();
>   	else
>   		topology_update_polarization_simple();
>  -	register_sysctl_table(topology_dir_table);
>  +	register_sysctl("s390", topology_ctl_table);
> - 	return device_create_file(cpu_subsys.dev_root, &dev_attr_dispatching);
> + 
> + 	dev_root = bus_get_dev_root(&cpu_subsys);
> + 	if (dev_root) {
> + 		rc = device_create_file(dev_root, &dev_attr_dispatching);
> + 		put_device(dev_root);
> + 	}
> + 	return rc;
>   }
>   device_initcall(topology_init);

Looks correct to me, thanks!

greg k-h




^ permalink raw reply	[flat|nested] 4+ messages in thread

* linux-next: manual merge of the driver-core tree with the s390 tree
@ 2023-03-21  1:34 Stephen Rothwell
  2023-03-21  7:39 ` Greg KH
  0 siblings, 1 reply; 4+ messages in thread
From: Stephen Rothwell @ 2023-03-21  1:34 UTC (permalink / raw)
  To: Greg KH, Heiko Carstens, Vasily Gorbik, Christian Borntraeger
  Cc: Greg Kroah-Hartman, Linux Kernel Mailing List,
	Linux Next Mailing List, Luis Chamberlain

[-- Attachment #1: Type: text/plain, Size: 1866 bytes --]

Hi all,

Today's linux-next merge of the driver-core tree got a conflict in:

  arch/s390/kernel/topology.c

between commit:

  0599331c3da6 ("s390: simplify one-level sysctl registration for topology_ctl_table")

from the s390 tree and commit:

  9493ed19fbc3 ("s390/topology: move to use bus_get_dev_root()")

from the driver-core tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc arch/s390/kernel/topology.c
index e5d6a1c25d13,72af753d1bba..000000000000
--- a/arch/s390/kernel/topology.c
+++ b/arch/s390/kernel/topology.c
@@@ -637,14 -637,33 +637,23 @@@ static struct ctl_table topology_ctl_ta
  	{ },
  };
  
 -static struct ctl_table topology_dir_table[] = {
 -	{
 -		.procname	= "s390",
 -		.maxlen		= 0,
 -		.mode		= 0555,
 -		.child		= topology_ctl_table,
 -	},
 -	{ },
 -};
 -
  static int __init topology_init(void)
  {
+ 	struct device *dev_root;
+ 	int rc = 0;
+ 
  	timer_setup(&topology_timer, topology_timer_fn, TIMER_DEFERRABLE);
  	if (MACHINE_HAS_TOPOLOGY)
  		set_topology_timer();
  	else
  		topology_update_polarization_simple();
 -	register_sysctl_table(topology_dir_table);
 +	register_sysctl("s390", topology_ctl_table);
- 	return device_create_file(cpu_subsys.dev_root, &dev_attr_dispatching);
+ 
+ 	dev_root = bus_get_dev_root(&cpu_subsys);
+ 	if (dev_root) {
+ 		rc = device_create_file(dev_root, &dev_attr_dispatching);
+ 		put_device(dev_root);
+ 	}
+ 	return rc;
  }
  device_initcall(topology_init);

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-03-21  7:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-28  6:26 linux-next: manual merge of the driver-core tree with the s390 tree Stephen Rothwell
2012-01-04 23:07 ` Greg KH
2023-03-21  1:34 Stephen Rothwell
2023-03-21  7:39 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).