Re: [PATCH 3.13 35/99] tty: Set correct tty name in active sysfs attribute

2014-02-24 Thread Hannes Reinecke
On 02/23/2014 04:05 PM, David Herrmann wrote:
> Hi
> 
> On Sun, Feb 23, 2014 at 1:20 AM, Ray Strode  wrote:
>> Hi,
>>
>>
>> On Feb 22, 2014 9:27 AM, "David Herrmann"  wrote:
>>> How about this:
>>>
>>> +   driver = cs[i]->device(cs[i], );
>>> +/* special case for tty0 which must not be resolved */
>>> +   if (driver && (index > 0 || cs[i]->major != TTY_MAJOR)) {
>>> +   count += tty_line_name(driver, index, buf +
>>> count);
>>> +   count += sprintf(buf + count, "%c", i ? ' ':'\n');
>>> +   } else
>>> +   count += sprintf(buf + count, "%s%d%c",
>>> +name, index, i ? ' ':'\n');
>>
>> Assuming I'm reading the code correctly, I don't think that will work.
>> Index will be rewritten from 0 to fg_console (which I suppose is going to be
>> 1) after the device vfunc is called.
> 
> Oh, nice catch. We have to use cs[i]->index of course. I only
> hand-edited the patch, I didn't even compile-test. But I guess you get
> the idea of special-casing tty0.
> 
Okay, that's a good idea.

I'll be redoing the patch.

Cheers,

Hannes
-- 
Dr. Hannes Reinecke   zSeries & Storage
h...@suse.de  +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: J. Hawn, J. Guild, F. Imendörffer, HRB 16746 (AG Nürnberg)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 3.13 35/99] tty: Set correct tty name in active sysfs attribute

2014-02-24 Thread Hannes Reinecke
On 02/23/2014 04:05 PM, David Herrmann wrote:
 Hi
 
 On Sun, Feb 23, 2014 at 1:20 AM, Ray Strode halfl...@gmail.com wrote:
 Hi,


 On Feb 22, 2014 9:27 AM, David Herrmann dh.herrm...@gmail.com wrote:
 How about this:

 +   driver = cs[i]-device(cs[i], index);
 +/* special case for tty0 which must not be resolved */
 +   if (driver  (index  0 || cs[i]-major != TTY_MAJOR)) {
 +   count += tty_line_name(driver, index, buf +
 count);
 +   count += sprintf(buf + count, %c, i ? ' ':'\n');
 +   } else
 +   count += sprintf(buf + count, %s%d%c,
 +name, index, i ? ' ':'\n');

 Assuming I'm reading the code correctly, I don't think that will work.
 Index will be rewritten from 0 to fg_console (which I suppose is going to be
 1) after the device vfunc is called.
 
 Oh, nice catch. We have to use cs[i]-index of course. I only
 hand-edited the patch, I didn't even compile-test. But I guess you get
 the idea of special-casing tty0.
 
Okay, that's a good idea.

I'll be redoing the patch.

Cheers,

Hannes
-- 
Dr. Hannes Reinecke   zSeries  Storage
h...@suse.de  +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: J. Hawn, J. Guild, F. Imendörffer, HRB 16746 (AG Nürnberg)
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 3.13 35/99] tty: Set correct tty name in active sysfs attribute

2014-02-23 Thread David Herrmann
Hi

On Sun, Feb 23, 2014 at 1:20 AM, Ray Strode  wrote:
> Hi,
>
>
> On Feb 22, 2014 9:27 AM, "David Herrmann"  wrote:
>> How about this:
>>
>> +   driver = cs[i]->device(cs[i], );
>> +/* special case for tty0 which must not be resolved */
>> +   if (driver && (index > 0 || cs[i]->major != TTY_MAJOR)) {
>> +   count += tty_line_name(driver, index, buf +
>> count);
>> +   count += sprintf(buf + count, "%c", i ? ' ':'\n');
>> +   } else
>> +   count += sprintf(buf + count, "%s%d%c",
>> +name, index, i ? ' ':'\n');
>
> Assuming I'm reading the code correctly, I don't think that will work.
> Index will be rewritten from 0 to fg_console (which I suppose is going to be
> 1) after the device vfunc is called.

Oh, nice catch. We have to use cs[i]->index of course. I only
hand-edited the patch, I didn't even compile-test. But I guess you get
the idea of special-casing tty0.

Thanks
David
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 3.13 35/99] tty: Set correct tty name in active sysfs attribute

2014-02-23 Thread Ray Strode
Hi,

On Sat, Feb 22, 2014 at 10:16 AM, Hannes Reinecke  wrote:
> And of course, checking for "!tty0" is the proper check for serial console.
> Which, of course, means we have to stay with a broken kernel interface for
> ever and ever.
>
> Innovation, here we come.
So just so we're clear:

1) you have every right to try to make s390 work better
2) You have every right to make mistakes in that venture as well (we
all make mistakes after all)
3) You can even unapologetically break userspace and then be snarky about it
4) And, like the above message, you can also ridicule the code using
the kernel interface you broke

Of those things I'd certainly prefer if you stuck to the first two and
skipped the last two.

For bonus points, you could:

5) Reply to Kay, Greg, and David  when they ask questions about the
patch you wrote
6) Offer a follow up patch that acheives your initial objective
without the ensuing breakage
7) Offer any insight you might have on better ways for plymouth to
achieve what it wants to do going forward that would be less
objectionable

--Ray
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 3.13 35/99] tty: Set correct tty name in active sysfs attribute

2014-02-23 Thread Ray Strode
Hi,

On Sat, Feb 22, 2014 at 10:16 AM, Hannes Reinecke h...@suse.de wrote:
 And of course, checking for !tty0 is the proper check for serial console.
 Which, of course, means we have to stay with a broken kernel interface for
 ever and ever.

 Innovation, here we come.
So just so we're clear:

1) you have every right to try to make s390 work better
2) You have every right to make mistakes in that venture as well (we
all make mistakes after all)
3) You can even unapologetically break userspace and then be snarky about it
4) And, like the above message, you can also ridicule the code using
the kernel interface you broke

Of those things I'd certainly prefer if you stuck to the first two and
skipped the last two.

For bonus points, you could:

5) Reply to Kay, Greg, and David  when they ask questions about the
patch you wrote
6) Offer a follow up patch that acheives your initial objective
without the ensuing breakage
7) Offer any insight you might have on better ways for plymouth to
achieve what it wants to do going forward that would be less
objectionable

--Ray
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 3.13 35/99] tty: Set correct tty name in active sysfs attribute

2014-02-23 Thread David Herrmann
Hi

On Sun, Feb 23, 2014 at 1:20 AM, Ray Strode halfl...@gmail.com wrote:
 Hi,


 On Feb 22, 2014 9:27 AM, David Herrmann dh.herrm...@gmail.com wrote:
 How about this:

 +   driver = cs[i]-device(cs[i], index);
 +/* special case for tty0 which must not be resolved */
 +   if (driver  (index  0 || cs[i]-major != TTY_MAJOR)) {
 +   count += tty_line_name(driver, index, buf +
 count);
 +   count += sprintf(buf + count, %c, i ? ' ':'\n');
 +   } else
 +   count += sprintf(buf + count, %s%d%c,
 +name, index, i ? ' ':'\n');

 Assuming I'm reading the code correctly, I don't think that will work.
 Index will be rewritten from 0 to fg_console (which I suppose is going to be
 1) after the device vfunc is called.

Oh, nice catch. We have to use cs[i]-index of course. I only
hand-edited the patch, I didn't even compile-test. But I guess you get
the idea of special-casing tty0.

Thanks
David
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 3.13 35/99] tty: Set correct tty name in active sysfs attribute

2014-02-22 Thread Ray Strode
Hi,

(resending because my phone tried to send the reply as html mail and
it got rejected)

On Sat, Feb 22, 2014 at 9:27 AM, David Herrmann  wrote:
> > How about this:
>
> +   driver = cs[i]->device(cs[i], );
> +/* special case for tty0 which must not be resolved */
> +   if (driver && (index > 0 || cs[i]->major != TTY_MAJOR)) {
> +   count += tty_line_name(driver, index, buf + count);
> +   count += sprintf(buf + count, "%c", i ? ' ':'\n');
> +   } else
> +   count += sprintf(buf + count, "%s%d%c",
> +name, index, i ? ' ':'\n');
Assuming I'm reading the code correctly, I don't think that will work.
 Index will be rewritten from 0 to fg_console (which I suppose is
going to be 1) after the device vfunc is called.

--Ray
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 3.13 35/99] tty: Set correct tty name in active sysfs attribute

2014-02-22 Thread David Herrmann
Hi

On Sat, Feb 22, 2014 at 4:16 PM, Hannes Reinecke  wrote:
> On 02/21/2014 11:18 PM, Ray Strode wrote:
>>
>> Hi,
>>
>> On Fri, Feb 21, 2014 at 3:21 PM, Greg Kroah-Hartman
>>  wrote:
>>>
>>> Ray, Josh, can I get some more information about this?  Is this broken
>>> in Linus's tree?  Or did I get the backport wrong here?
>>
>> I don't think it's a problem with the backport specifically. To be
>> honest, i'm not even 100% sure it is that patch. It was just the only
>> patch that touched that code recently so it seemed likely.  I didn't
>> do builds to check for sure.
>>
>>> What is the value of the file before and after this patch?
>>
>> "tty0" in the past and "tty1" now
>>
>>> And what is plymouth doing with this file value, it was incorrect
>>> before, what was it using the value for?
>>
>> See the other (3.11) thread for my initial message, but basically
>> plymouth had code something like this pseudocode:
>>
>> /* disable splash if there are serial consoles */
>> if (!contents_of_file_equals("/sys/class/tty/console/active", "tty0")) {
>>  disable_splash_and_force_verbose_messages();
>> }
>>
>> since the file started saying tty1 that code started disabling the
>> splash for everyone in rawhide.
>>
> 
>
> And of course, checking for "!tty0" is the proper check for serial console.
> Which, of course, means we have to stay with a broken kernel interface for
> ever and ever.
>
> Innovation, here we come.
>
> 
>

How about this:

+   driver = cs[i]->device(cs[i], );
+/* special case for tty0 which must not be resolved */
+   if (driver && (index > 0 || cs[i]->major != TTY_MAJOR)) {
+   count += tty_line_name(driver, index, buf + count);
+   count += sprintf(buf + count, "%c", i ? ' ':'\n');
+   } else
+   count += sprintf(buf + count, "%s%d%c",
+name, index, i ? ' ':'\n');

Regards
David
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 3.13 35/99] tty: Set correct tty name in active sysfs attribute

2014-02-22 Thread Peter Hurley

On 02/22/2014 08:25 AM, David Herrmann wrote:

Hi

On Fri, Feb 21, 2014 at 11:53 PM, Ray Strode  wrote:

Hi,

On Fri, Feb 21, 2014 at 11:01 AM, Kay Sievers  wrote:

Why did the tty0 change to tty1 now? That doesn't look like a "driver
name" vs. "device name" issue?


I don't know if it's intentional, but the patch does:
+   int index = cs[i]->index;
...
+   driver = cs[i]->device(cs[i], );

which will presumably change the index from 0 to 1 because of this code:

static struct tty_driver *vt_console_device(struct console *c, int *index)
{
*index = c->index ? c->index-1 : fg_console;
return console_driver;
}

At least that's what it looks like is causing the problem from
browsing through the source a bit.


Yepp, that's it. So if you configure the console to always be
redirected to the foreground terminal, you simply bind it to tty0 and
this file used to return tty0 then.
With this patch, we actually return the foreground terminal instead,
so tty0 is resolved to the real VT. This sounds like the correct
behavior (even though it currently breaks poll() on this file). But if
it breaks stuff, we should revert it and add a second file just like
Peter suggested.


Or add sysfs entries for each console that exposes the device, so
that the underlying device is trivially discoverable, which is the
original problem.

Regards,
Peter Hurley

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 3.13 35/99] tty: Set correct tty name in active sysfs attribute

2014-02-22 Thread David Herrmann
Hi

On Fri, Feb 21, 2014 at 11:53 PM, Ray Strode  wrote:
> Hi,
>
> On Fri, Feb 21, 2014 at 11:01 AM, Kay Sievers  wrote:
>> Why did the tty0 change to tty1 now? That doesn't look like a "driver
>> name" vs. "device name" issue?
>
> I don't know if it's intentional, but the patch does:
> +   int index = cs[i]->index;
> ...
> +   driver = cs[i]->device(cs[i], );
>
> which will presumably change the index from 0 to 1 because of this code:
>
> static struct tty_driver *vt_console_device(struct console *c, int *index)
> {
>*index = c->index ? c->index-1 : fg_console;
>return console_driver;
> }
>
> At least that's what it looks like is causing the problem from
> browsing through the source a bit.

Yepp, that's it. So if you configure the console to always be
redirected to the foreground terminal, you simply bind it to tty0 and
this file used to return tty0 then.
With this patch, we actually return the foreground terminal instead,
so tty0 is resolved to the real VT. This sounds like the correct
behavior (even though it currently breaks poll() on this file). But if
it breaks stuff, we should revert it and add a second file just like
Peter suggested.

Thanks
David
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 3.13 35/99] tty: Set correct tty name in active sysfs attribute

2014-02-22 Thread Hannes Reinecke

On 02/21/2014 11:18 PM, Ray Strode wrote:

Hi,

On Fri, Feb 21, 2014 at 3:21 PM, Greg Kroah-Hartman
 wrote:

Ray, Josh, can I get some more information about this?  Is this broken
in Linus's tree?  Or did I get the backport wrong here?

I don't think it's a problem with the backport specifically. To be
honest, i'm not even 100% sure it is that patch. It was just the only
patch that touched that code recently so it seemed likely.  I didn't
do builds to check for sure.


What is the value of the file before and after this patch?

"tty0" in the past and "tty1" now


And what is plymouth doing with this file value, it was incorrect
before, what was it using the value for?

See the other (3.11) thread for my initial message, but basically
plymouth had code something like this pseudocode:

/* disable splash if there are serial consoles */
if (!contents_of_file_equals("/sys/class/tty/console/active", "tty0")) {
 disable_splash_and_force_verbose_messages();
}

since the file started saying tty1 that code started disabling the
splash for everyone in rawhide.




And of course, checking for "!tty0" is the proper check for serial console.
Which, of course, means we have to stay with a broken kernel interface 
for ever and ever.


Innovation, here we come.



Cheers,

Hannes
--
Dr. Hannes Reinecke   zSeries & Storage
h...@suse.de  +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: J. Hawn, J. Guild, F. Imendörffer, HRB 16746 (AG Nürnberg)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 3.13 35/99] tty: Set correct tty name in active sysfs attribute

2014-02-22 Thread Hannes Reinecke

On 02/21/2014 11:18 PM, Ray Strode wrote:

Hi,

On Fri, Feb 21, 2014 at 3:21 PM, Greg Kroah-Hartman
gre...@linuxfoundation.org wrote:

Ray, Josh, can I get some more information about this?  Is this broken
in Linus's tree?  Or did I get the backport wrong here?

I don't think it's a problem with the backport specifically. To be
honest, i'm not even 100% sure it is that patch. It was just the only
patch that touched that code recently so it seemed likely.  I didn't
do builds to check for sure.


What is the value of the file before and after this patch?

tty0 in the past and tty1 now


And what is plymouth doing with this file value, it was incorrect
before, what was it using the value for?

See the other (3.11) thread for my initial message, but basically
plymouth had code something like this pseudocode:

/* disable splash if there are serial consoles */
if (!contents_of_file_equals(/sys/class/tty/console/active, tty0)) {
 disable_splash_and_force_verbose_messages();
}

since the file started saying tty1 that code started disabling the
splash for everyone in rawhide.


sigh

And of course, checking for !tty0 is the proper check for serial console.
Which, of course, means we have to stay with a broken kernel interface 
for ever and ever.


Innovation, here we come.

/sigh

Cheers,

Hannes
--
Dr. Hannes Reinecke   zSeries  Storage
h...@suse.de  +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: J. Hawn, J. Guild, F. Imendörffer, HRB 16746 (AG Nürnberg)
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 3.13 35/99] tty: Set correct tty name in active sysfs attribute

2014-02-22 Thread David Herrmann
Hi

On Fri, Feb 21, 2014 at 11:53 PM, Ray Strode halfl...@gmail.com wrote:
 Hi,

 On Fri, Feb 21, 2014 at 11:01 AM, Kay Sievers k...@vrfy.org wrote:
 Why did the tty0 change to tty1 now? That doesn't look like a driver
 name vs. device name issue?

 I don't know if it's intentional, but the patch does:
 +   int index = cs[i]-index;
 ...
 +   driver = cs[i]-device(cs[i], index);

 which will presumably change the index from 0 to 1 because of this code:

 static struct tty_driver *vt_console_device(struct console *c, int *index)
 {
*index = c-index ? c-index-1 : fg_console;
return console_driver;
 }

 At least that's what it looks like is causing the problem from
 browsing through the source a bit.

Yepp, that's it. So if you configure the console to always be
redirected to the foreground terminal, you simply bind it to tty0 and
this file used to return tty0 then.
With this patch, we actually return the foreground terminal instead,
so tty0 is resolved to the real VT. This sounds like the correct
behavior (even though it currently breaks poll() on this file). But if
it breaks stuff, we should revert it and add a second file just like
Peter suggested.

Thanks
David
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 3.13 35/99] tty: Set correct tty name in active sysfs attribute

2014-02-22 Thread Peter Hurley

On 02/22/2014 08:25 AM, David Herrmann wrote:

Hi

On Fri, Feb 21, 2014 at 11:53 PM, Ray Strode halfl...@gmail.com wrote:

Hi,

On Fri, Feb 21, 2014 at 11:01 AM, Kay Sievers k...@vrfy.org wrote:

Why did the tty0 change to tty1 now? That doesn't look like a driver
name vs. device name issue?


I don't know if it's intentional, but the patch does:
+   int index = cs[i]-index;
...
+   driver = cs[i]-device(cs[i], index);

which will presumably change the index from 0 to 1 because of this code:

static struct tty_driver *vt_console_device(struct console *c, int *index)
{
*index = c-index ? c-index-1 : fg_console;
return console_driver;
}

At least that's what it looks like is causing the problem from
browsing through the source a bit.


Yepp, that's it. So if you configure the console to always be
redirected to the foreground terminal, you simply bind it to tty0 and
this file used to return tty0 then.
With this patch, we actually return the foreground terminal instead,
so tty0 is resolved to the real VT. This sounds like the correct
behavior (even though it currently breaks poll() on this file). But if
it breaks stuff, we should revert it and add a second file just like
Peter suggested.


Or add sysfs entries for each console that exposes the device, so
that the underlying device is trivially discoverable, which is the
original problem.

Regards,
Peter Hurley

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 3.13 35/99] tty: Set correct tty name in active sysfs attribute

2014-02-22 Thread David Herrmann
Hi

On Sat, Feb 22, 2014 at 4:16 PM, Hannes Reinecke h...@suse.de wrote:
 On 02/21/2014 11:18 PM, Ray Strode wrote:

 Hi,

 On Fri, Feb 21, 2014 at 3:21 PM, Greg Kroah-Hartman
 gre...@linuxfoundation.org wrote:

 Ray, Josh, can I get some more information about this?  Is this broken
 in Linus's tree?  Or did I get the backport wrong here?

 I don't think it's a problem with the backport specifically. To be
 honest, i'm not even 100% sure it is that patch. It was just the only
 patch that touched that code recently so it seemed likely.  I didn't
 do builds to check for sure.

 What is the value of the file before and after this patch?

 tty0 in the past and tty1 now

 And what is plymouth doing with this file value, it was incorrect
 before, what was it using the value for?

 See the other (3.11) thread for my initial message, but basically
 plymouth had code something like this pseudocode:

 /* disable splash if there are serial consoles */
 if (!contents_of_file_equals(/sys/class/tty/console/active, tty0)) {
  disable_splash_and_force_verbose_messages();
 }

 since the file started saying tty1 that code started disabling the
 splash for everyone in rawhide.

 sigh

 And of course, checking for !tty0 is the proper check for serial console.
 Which, of course, means we have to stay with a broken kernel interface for
 ever and ever.

 Innovation, here we come.

 /sigh


How about this:

+   driver = cs[i]-device(cs[i], index);
+/* special case for tty0 which must not be resolved */
+   if (driver  (index  0 || cs[i]-major != TTY_MAJOR)) {
+   count += tty_line_name(driver, index, buf + count);
+   count += sprintf(buf + count, %c, i ? ' ':'\n');
+   } else
+   count += sprintf(buf + count, %s%d%c,
+name, index, i ? ' ':'\n');

Regards
David
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 3.13 35/99] tty: Set correct tty name in active sysfs attribute

2014-02-22 Thread Ray Strode
Hi,

(resending because my phone tried to send the reply as html mail and
it got rejected)

On Sat, Feb 22, 2014 at 9:27 AM, David Herrmann dh.herrm...@gmail.com wrote:
  How about this:

 +   driver = cs[i]-device(cs[i], index);
 +/* special case for tty0 which must not be resolved */
 +   if (driver  (index  0 || cs[i]-major != TTY_MAJOR)) {
 +   count += tty_line_name(driver, index, buf + count);
 +   count += sprintf(buf + count, %c, i ? ' ':'\n');
 +   } else
 +   count += sprintf(buf + count, %s%d%c,
 +name, index, i ? ' ':'\n');
Assuming I'm reading the code correctly, I don't think that will work.
 Index will be rewritten from 0 to fg_console (which I suppose is
going to be 1) after the device vfunc is called.

--Ray
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 3.13 35/99] tty: Set correct tty name in active sysfs attribute

2014-02-21 Thread Ray Strode
Hi,

On Fri, Feb 21, 2014 at 11:01 AM, Kay Sievers  wrote:
> Why did the tty0 change to tty1 now? That doesn't look like a "driver
> name" vs. "device name" issue?

I don't know if it's intentional, but the patch does:
+   int index = cs[i]->index;
...
+   driver = cs[i]->device(cs[i], );

which will presumably change the index from 0 to 1 because of this code:

static struct tty_driver *vt_console_device(struct console *c, int *index)
{
   *index = c->index ? c->index-1 : fg_console;
   return console_driver;
}

At least that's what it looks like is causing the problem from
browsing through the source a bit.

--Ray
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 3.13 35/99] tty: Set correct tty name in active sysfs attribute

2014-02-21 Thread Ray Strode
Hi,

On Fri, Feb 21, 2014 at 3:21 PM, Greg Kroah-Hartman
 wrote:
> Ray, Josh, can I get some more information about this?  Is this broken
> in Linus's tree?  Or did I get the backport wrong here?
I don't think it's a problem with the backport specifically. To be
honest, i'm not even 100% sure it is that patch. It was just the only
patch that touched that code recently so it seemed likely.  I didn't
do builds to check for sure.

> What is the value of the file before and after this patch?
"tty0" in the past and "tty1" now

> And what is plymouth doing with this file value, it was incorrect
> before, what was it using the value for?
See the other (3.11) thread for my initial message, but basically
plymouth had code something like this pseudocode:

/* disable splash if there are serial consoles */
if (!contents_of_file_equals("/sys/class/tty/console/active", "tty0")) {
disable_splash_and_force_verbose_messages();
}

since the file started saying tty1 that code started disabling the
splash for everyone in rawhide.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 3.13 35/99] tty: Set correct tty name in active sysfs attribute

2014-02-21 Thread Greg Kroah-Hartman
On Fri, Feb 21, 2014 at 09:48:46AM -0500, Josh Boyer wrote:
> On Thu, Feb 20, 2014 at 6:52 PM, Greg Kroah-Hartman
>  wrote:
> > 3.13-stable review patch.  If anyone has any objections, please let me know.
> >
> > --
> >
> > From: Hannes Reinecke 
> >
> > commit d8a5dc3033af2fd6d16030d2ee4fbd073460fe54 upstream.
> >
> > The 'active' sysfs attribute should refer to the currently active tty
> > devices the console is running on, not the currently active console.
> >
> > The console structure doesn't refer to any device in sysfs, only the tty
> > the console is running on has.  So we need to print out the tty names in
> > 'active', not the console names.
> >
> > This resolves an issue on s390 platforms in determining the correct
> > console device to use.
> 
> Just to be double sure this is seen, Ray points out that it breaks
> current plymouth because the heuristic changed.  Hold off on this one?

Ray, Josh, can I get some more information about this?  Is this broken
in Linus's tree?  Or did I get the backport wrong here?  What is the
value of the file before and after this patch?

And what is plymouth doing with this file value, it was incorrect
before, what was it using the value for?

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 3.13 35/99] tty: Set correct tty name in active sysfs attribute

2014-02-21 Thread Kay Sievers
On Fri, Feb 21, 2014 at 3:56 PM, Josh Boyer  wrote:
> On Fri, Feb 21, 2014 at 9:52 AM, Hannes Reinecke  wrote:
>> On 02/21/2014 03:48 PM, Josh Boyer wrote:
>>> On Thu, Feb 20, 2014 at 6:52 PM, Greg Kroah-Hartman
>>>  wrote:
 3.13-stable review patch.  If anyone has any objections, please let me 
 know.

 --

 From: Hannes Reinecke 

 commit d8a5dc3033af2fd6d16030d2ee4fbd073460fe54 upstream.

 The 'active' sysfs attribute should refer to the currently active tty
 devices the console is running on, not the currently active console.

 The console structure doesn't refer to any device in sysfs, only the tty
 the console is running on has.  So we need to print out the tty names in
 'active', not the console names.

 This resolves an issue on s390 platforms in determining the correct
 console device to use.
>>>
>>> Just to be double sure this is seen, Ray points out that it breaks
>>> current plymouth because the heuristic changed.  Hold off on this one?
>>>
>> Without this patch systemd won't present a login console for s390.
>> I'd prefer fixing plymouth.
>
> Sure.  Except fixing plymouth is easy to do, but not easy to actually
> get deployed on all of the old userspace.  So if someone runs a 3.14
> kernel on any distro that doesn't have a fixed plymouth, it's broken.
> By including this patch, you're basically trading one broken userspace
> component for another.
>
> Is there some other way this could be fixed in-kernel that would allow
> both to work?

Why did the tty0 change to tty1 now? That doesn't look like a "driver
name" vs. "device name" issue?

Kay
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 3.13 35/99] tty: Set correct tty name in active sysfs attribute

2014-02-21 Thread Greg Kroah-Hartman
On Fri, Feb 21, 2014 at 03:52:44PM +0100, Hannes Reinecke wrote:
> On 02/21/2014 03:48 PM, Josh Boyer wrote:
> > On Thu, Feb 20, 2014 at 6:52 PM, Greg Kroah-Hartman
> >  wrote:
> >> 3.13-stable review patch.  If anyone has any objections, please let me 
> >> know.
> >>
> >> --
> >>
> >> From: Hannes Reinecke 
> >>
> >> commit d8a5dc3033af2fd6d16030d2ee4fbd073460fe54 upstream.
> >>
> >> The 'active' sysfs attribute should refer to the currently active tty
> >> devices the console is running on, not the currently active console.
> >>
> >> The console structure doesn't refer to any device in sysfs, only the tty
> >> the console is running on has.  So we need to print out the tty names in
> >> 'active', not the console names.
> >>
> >> This resolves an issue on s390 platforms in determining the correct
> >> console device to use.
> > 
> > Just to be double sure this is seen, Ray points out that it breaks
> > current plymouth because the heuristic changed.  Hold off on this one?
> > 
> Without this patch systemd won't present a login console for s390.
> I'd prefer fixing plymouth.

We can't break working userspace programs, sorry.  I'll go revert this
patch from the stable kernel's, and from Linus's tree as well, as we
can't break things when 3.14 comes out either.

I'll be glad to take a patch that does not break existing systems...

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 3.13 35/99] tty: Set correct tty name in active sysfs attribute

2014-02-21 Thread Peter Hurley

On 02/21/2014 09:52 AM, Hannes Reinecke wrote:

On 02/21/2014 03:48 PM, Josh Boyer wrote:

On Thu, Feb 20, 2014 at 6:52 PM, Greg Kroah-Hartman
 wrote:

3.13-stable review patch.  If anyone has any objections, please let me know.

--

From: Hannes Reinecke 

commit d8a5dc3033af2fd6d16030d2ee4fbd073460fe54 upstream.

The 'active' sysfs attribute should refer to the currently active tty
devices the console is running on, not the currently active console.

The console structure doesn't refer to any device in sysfs, only the tty
the console is running on has.  So we need to print out the tty names in
'active', not the console names.

This resolves an issue on s390 platforms in determining the correct
console device to use.


Just to be double sure this is seen, Ray points out that it breaks
current plymouth because the heuristic changed.  Hold off on this one?


Without this patch systemd won't present a login console for s390.
I'd prefer fixing plymouth.


Not an option.

As I said before, the old interface should be left alone and
forked to present a new interface that systemd can use to
get what it expects.

Regards,
Peter Hurley

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 3.13 35/99] tty: Set correct tty name in active sysfs attribute

2014-02-21 Thread Josh Boyer
On Fri, Feb 21, 2014 at 9:52 AM, Hannes Reinecke  wrote:
> On 02/21/2014 03:48 PM, Josh Boyer wrote:
>> On Thu, Feb 20, 2014 at 6:52 PM, Greg Kroah-Hartman
>>  wrote:
>>> 3.13-stable review patch.  If anyone has any objections, please let me know.
>>>
>>> --
>>>
>>> From: Hannes Reinecke 
>>>
>>> commit d8a5dc3033af2fd6d16030d2ee4fbd073460fe54 upstream.
>>>
>>> The 'active' sysfs attribute should refer to the currently active tty
>>> devices the console is running on, not the currently active console.
>>>
>>> The console structure doesn't refer to any device in sysfs, only the tty
>>> the console is running on has.  So we need to print out the tty names in
>>> 'active', not the console names.
>>>
>>> This resolves an issue on s390 platforms in determining the correct
>>> console device to use.
>>
>> Just to be double sure this is seen, Ray points out that it breaks
>> current plymouth because the heuristic changed.  Hold off on this one?
>>
> Without this patch systemd won't present a login console for s390.
> I'd prefer fixing plymouth.

Sure.  Except fixing plymouth is easy to do, but not easy to actually
get deployed on all of the old userspace.  So if someone runs a 3.14
kernel on any distro that doesn't have a fixed plymouth, it's broken.
By including this patch, you're basically trading one broken userspace
component for another.

Is there some other way this could be fixed in-kernel that would allow
both to work?

josh
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 3.13 35/99] tty: Set correct tty name in active sysfs attribute

2014-02-21 Thread Hannes Reinecke
On 02/21/2014 03:48 PM, Josh Boyer wrote:
> On Thu, Feb 20, 2014 at 6:52 PM, Greg Kroah-Hartman
>  wrote:
>> 3.13-stable review patch.  If anyone has any objections, please let me know.
>>
>> --
>>
>> From: Hannes Reinecke 
>>
>> commit d8a5dc3033af2fd6d16030d2ee4fbd073460fe54 upstream.
>>
>> The 'active' sysfs attribute should refer to the currently active tty
>> devices the console is running on, not the currently active console.
>>
>> The console structure doesn't refer to any device in sysfs, only the tty
>> the console is running on has.  So we need to print out the tty names in
>> 'active', not the console names.
>>
>> This resolves an issue on s390 platforms in determining the correct
>> console device to use.
> 
> Just to be double sure this is seen, Ray points out that it breaks
> current plymouth because the heuristic changed.  Hold off on this one?
> 
Without this patch systemd won't present a login console for s390.
I'd prefer fixing plymouth.

Cheers,

Hannes
-- 
Dr. Hannes Reinecke   zSeries & Storage
h...@suse.de  +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: J. Hawn, J. Guild, F. Imendörffer, HRB 16746 (AG Nürnberg)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 3.13 35/99] tty: Set correct tty name in active sysfs attribute

2014-02-21 Thread Josh Boyer
On Thu, Feb 20, 2014 at 6:52 PM, Greg Kroah-Hartman
 wrote:
> 3.13-stable review patch.  If anyone has any objections, please let me know.
>
> --
>
> From: Hannes Reinecke 
>
> commit d8a5dc3033af2fd6d16030d2ee4fbd073460fe54 upstream.
>
> The 'active' sysfs attribute should refer to the currently active tty
> devices the console is running on, not the currently active console.
>
> The console structure doesn't refer to any device in sysfs, only the tty
> the console is running on has.  So we need to print out the tty names in
> 'active', not the console names.
>
> This resolves an issue on s390 platforms in determining the correct
> console device to use.

Just to be double sure this is seen, Ray points out that it breaks
current plymouth because the heuristic changed.  Hold off on this one?

josh

>
> Cc: Lennart Poettering 
> Cc: Kay Sievers 
> Cc: Jiri Slaby 
> Cc: David Herrmann 
> Signed-off-by: Werner Fink 
> Signed-off-by: Hannes Reinecke 
> Signed-off-by: Greg Kroah-Hartman 
>
> ---
>  Documentation/ABI/testing/sysfs-tty |3 ++-
>  drivers/tty/tty_io.c|   25 ++---
>  2 files changed, 20 insertions(+), 8 deletions(-)
>
> --- a/Documentation/ABI/testing/sysfs-tty
> +++ b/Documentation/ABI/testing/sysfs-tty
> @@ -3,7 +3,8 @@ Date:   Nov 2010
>  Contact:   Kay Sievers 
>  Description:
>  Shows the list of currently configured
> -console devices, like 'tty1 ttyS0'.
> +tty devices used for the console,
> +like 'tty1 ttyS0'.
>  The last entry in the file is the active
>  device connected to /dev/console.
>  The file supports poll() to detect virtual
> --- a/drivers/tty/tty_io.c
> +++ b/drivers/tty/tty_io.c
> @@ -1267,16 +1267,17 @@ static void pty_line_name(struct tty_dri
>   * @p: output buffer of at least 7 bytes
>   *
>   * Generate a name from a driver reference and write it to the output
> - * buffer.
> + * buffer. Return the number of bytes written.
>   *
>   * Locking: None
>   */
> -static void tty_line_name(struct tty_driver *driver, int index, char *p)
> +static ssize_t tty_line_name(struct tty_driver *driver, int index, char *p)
>  {
> if (driver->flags & TTY_DRIVER_UNNUMBERED_NODE)
> -   strcpy(p, driver->name);
> +   return sprintf(p, "%s", driver->name);
> else
> -   sprintf(p, "%s%d", driver->name, index + driver->name_base);
> +   return sprintf(p, "%s%d", driver->name,
> +  index + driver->name_base);
>  }
>
>  /**
> @@ -3545,9 +3546,19 @@ static ssize_t show_cons_active(struct d
> if (i >= ARRAY_SIZE(cs))
> break;
> }
> -   while (i--)
> -   count += sprintf(buf + count, "%s%d%c",
> -cs[i]->name, cs[i]->index, i ? ' ':'\n');
> +   while (i--) {
> +   struct tty_driver *driver;
> +   const char *name = cs[i]->name;
> +   int index = cs[i]->index;
> +
> +   driver = cs[i]->device(cs[i], );
> +   if (driver) {
> +   count += tty_line_name(driver, index, buf + count);
> +   count += sprintf(buf + count, "%c", i ? ' ':'\n');
> +   } else
> +   count += sprintf(buf + count, "%s%d%c",
> +name, index, i ? ' ':'\n');
> +   }
> console_unlock();
>
> return count;
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 3.13 35/99] tty: Set correct tty name in active sysfs attribute

2014-02-21 Thread Greg Kroah-Hartman
On Fri, Feb 21, 2014 at 09:48:46AM -0500, Josh Boyer wrote:
 On Thu, Feb 20, 2014 at 6:52 PM, Greg Kroah-Hartman
 gre...@linuxfoundation.org wrote:
  3.13-stable review patch.  If anyone has any objections, please let me know.
 
  --
 
  From: Hannes Reinecke h...@suse.de
 
  commit d8a5dc3033af2fd6d16030d2ee4fbd073460fe54 upstream.
 
  The 'active' sysfs attribute should refer to the currently active tty
  devices the console is running on, not the currently active console.
 
  The console structure doesn't refer to any device in sysfs, only the tty
  the console is running on has.  So we need to print out the tty names in
  'active', not the console names.
 
  This resolves an issue on s390 platforms in determining the correct
  console device to use.
 
 Just to be double sure this is seen, Ray points out that it breaks
 current plymouth because the heuristic changed.  Hold off on this one?

Ray, Josh, can I get some more information about this?  Is this broken
in Linus's tree?  Or did I get the backport wrong here?  What is the
value of the file before and after this patch?

And what is plymouth doing with this file value, it was incorrect
before, what was it using the value for?

thanks,

greg k-h
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 3.13 35/99] tty: Set correct tty name in active sysfs attribute

2014-02-21 Thread Ray Strode
Hi,

On Fri, Feb 21, 2014 at 3:21 PM, Greg Kroah-Hartman
gre...@linuxfoundation.org wrote:
 Ray, Josh, can I get some more information about this?  Is this broken
 in Linus's tree?  Or did I get the backport wrong here?
I don't think it's a problem with the backport specifically. To be
honest, i'm not even 100% sure it is that patch. It was just the only
patch that touched that code recently so it seemed likely.  I didn't
do builds to check for sure.

 What is the value of the file before and after this patch?
tty0 in the past and tty1 now

 And what is plymouth doing with this file value, it was incorrect
 before, what was it using the value for?
See the other (3.11) thread for my initial message, but basically
plymouth had code something like this pseudocode:

/* disable splash if there are serial consoles */
if (!contents_of_file_equals(/sys/class/tty/console/active, tty0)) {
disable_splash_and_force_verbose_messages();
}

since the file started saying tty1 that code started disabling the
splash for everyone in rawhide.
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 3.13 35/99] tty: Set correct tty name in active sysfs attribute

2014-02-21 Thread Ray Strode
Hi,

On Fri, Feb 21, 2014 at 11:01 AM, Kay Sievers k...@vrfy.org wrote:
 Why did the tty0 change to tty1 now? That doesn't look like a driver
 name vs. device name issue?

I don't know if it's intentional, but the patch does:
+   int index = cs[i]-index;
...
+   driver = cs[i]-device(cs[i], index);

which will presumably change the index from 0 to 1 because of this code:

static struct tty_driver *vt_console_device(struct console *c, int *index)
{
   *index = c-index ? c-index-1 : fg_console;
   return console_driver;
}

At least that's what it looks like is causing the problem from
browsing through the source a bit.

--Ray
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 3.13 35/99] tty: Set correct tty name in active sysfs attribute

2014-02-21 Thread Josh Boyer
On Thu, Feb 20, 2014 at 6:52 PM, Greg Kroah-Hartman
gre...@linuxfoundation.org wrote:
 3.13-stable review patch.  If anyone has any objections, please let me know.

 --

 From: Hannes Reinecke h...@suse.de

 commit d8a5dc3033af2fd6d16030d2ee4fbd073460fe54 upstream.

 The 'active' sysfs attribute should refer to the currently active tty
 devices the console is running on, not the currently active console.

 The console structure doesn't refer to any device in sysfs, only the tty
 the console is running on has.  So we need to print out the tty names in
 'active', not the console names.

 This resolves an issue on s390 platforms in determining the correct
 console device to use.

Just to be double sure this is seen, Ray points out that it breaks
current plymouth because the heuristic changed.  Hold off on this one?

josh


 Cc: Lennart Poettering lenn...@poettering.net
 Cc: Kay Sievers k...@vrfy.org
 Cc: Jiri Slaby jsl...@suse.cz
 Cc: David Herrmann dh.herrm...@gmail.com
 Signed-off-by: Werner Fink wer...@suse.de
 Signed-off-by: Hannes Reinecke h...@suse.de
 Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org

 ---
  Documentation/ABI/testing/sysfs-tty |3 ++-
  drivers/tty/tty_io.c|   25 ++---
  2 files changed, 20 insertions(+), 8 deletions(-)

 --- a/Documentation/ABI/testing/sysfs-tty
 +++ b/Documentation/ABI/testing/sysfs-tty
 @@ -3,7 +3,8 @@ Date:   Nov 2010
  Contact:   Kay Sievers kay.siev...@vrfy.org
  Description:
  Shows the list of currently configured
 -console devices, like 'tty1 ttyS0'.
 +tty devices used for the console,
 +like 'tty1 ttyS0'.
  The last entry in the file is the active
  device connected to /dev/console.
  The file supports poll() to detect virtual
 --- a/drivers/tty/tty_io.c
 +++ b/drivers/tty/tty_io.c
 @@ -1267,16 +1267,17 @@ static void pty_line_name(struct tty_dri
   * @p: output buffer of at least 7 bytes
   *
   * Generate a name from a driver reference and write it to the output
 - * buffer.
 + * buffer. Return the number of bytes written.
   *
   * Locking: None
   */
 -static void tty_line_name(struct tty_driver *driver, int index, char *p)
 +static ssize_t tty_line_name(struct tty_driver *driver, int index, char *p)
  {
 if (driver-flags  TTY_DRIVER_UNNUMBERED_NODE)
 -   strcpy(p, driver-name);
 +   return sprintf(p, %s, driver-name);
 else
 -   sprintf(p, %s%d, driver-name, index + driver-name_base);
 +   return sprintf(p, %s%d, driver-name,
 +  index + driver-name_base);
  }

  /**
 @@ -3545,9 +3546,19 @@ static ssize_t show_cons_active(struct d
 if (i = ARRAY_SIZE(cs))
 break;
 }
 -   while (i--)
 -   count += sprintf(buf + count, %s%d%c,
 -cs[i]-name, cs[i]-index, i ? ' ':'\n');
 +   while (i--) {
 +   struct tty_driver *driver;
 +   const char *name = cs[i]-name;
 +   int index = cs[i]-index;
 +
 +   driver = cs[i]-device(cs[i], index);
 +   if (driver) {
 +   count += tty_line_name(driver, index, buf + count);
 +   count += sprintf(buf + count, %c, i ? ' ':'\n');
 +   } else
 +   count += sprintf(buf + count, %s%d%c,
 +name, index, i ? ' ':'\n');
 +   }
 console_unlock();

 return count;


 --
 To unsubscribe from this list: send the line unsubscribe linux-kernel in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
 Please read the FAQ at  http://www.tux.org/lkml/
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 3.13 35/99] tty: Set correct tty name in active sysfs attribute

2014-02-21 Thread Hannes Reinecke
On 02/21/2014 03:48 PM, Josh Boyer wrote:
 On Thu, Feb 20, 2014 at 6:52 PM, Greg Kroah-Hartman
 gre...@linuxfoundation.org wrote:
 3.13-stable review patch.  If anyone has any objections, please let me know.

 --

 From: Hannes Reinecke h...@suse.de

 commit d8a5dc3033af2fd6d16030d2ee4fbd073460fe54 upstream.

 The 'active' sysfs attribute should refer to the currently active tty
 devices the console is running on, not the currently active console.

 The console structure doesn't refer to any device in sysfs, only the tty
 the console is running on has.  So we need to print out the tty names in
 'active', not the console names.

 This resolves an issue on s390 platforms in determining the correct
 console device to use.
 
 Just to be double sure this is seen, Ray points out that it breaks
 current plymouth because the heuristic changed.  Hold off on this one?
 
Without this patch systemd won't present a login console for s390.
I'd prefer fixing plymouth.

Cheers,

Hannes
-- 
Dr. Hannes Reinecke   zSeries  Storage
h...@suse.de  +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: J. Hawn, J. Guild, F. Imendörffer, HRB 16746 (AG Nürnberg)
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 3.13 35/99] tty: Set correct tty name in active sysfs attribute

2014-02-21 Thread Josh Boyer
On Fri, Feb 21, 2014 at 9:52 AM, Hannes Reinecke h...@suse.de wrote:
 On 02/21/2014 03:48 PM, Josh Boyer wrote:
 On Thu, Feb 20, 2014 at 6:52 PM, Greg Kroah-Hartman
 gre...@linuxfoundation.org wrote:
 3.13-stable review patch.  If anyone has any objections, please let me know.

 --

 From: Hannes Reinecke h...@suse.de

 commit d8a5dc3033af2fd6d16030d2ee4fbd073460fe54 upstream.

 The 'active' sysfs attribute should refer to the currently active tty
 devices the console is running on, not the currently active console.

 The console structure doesn't refer to any device in sysfs, only the tty
 the console is running on has.  So we need to print out the tty names in
 'active', not the console names.

 This resolves an issue on s390 platforms in determining the correct
 console device to use.

 Just to be double sure this is seen, Ray points out that it breaks
 current plymouth because the heuristic changed.  Hold off on this one?

 Without this patch systemd won't present a login console for s390.
 I'd prefer fixing plymouth.

Sure.  Except fixing plymouth is easy to do, but not easy to actually
get deployed on all of the old userspace.  So if someone runs a 3.14
kernel on any distro that doesn't have a fixed plymouth, it's broken.
By including this patch, you're basically trading one broken userspace
component for another.

Is there some other way this could be fixed in-kernel that would allow
both to work?

josh
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 3.13 35/99] tty: Set correct tty name in active sysfs attribute

2014-02-21 Thread Peter Hurley

On 02/21/2014 09:52 AM, Hannes Reinecke wrote:

On 02/21/2014 03:48 PM, Josh Boyer wrote:

On Thu, Feb 20, 2014 at 6:52 PM, Greg Kroah-Hartman
gre...@linuxfoundation.org wrote:

3.13-stable review patch.  If anyone has any objections, please let me know.

--

From: Hannes Reinecke h...@suse.de

commit d8a5dc3033af2fd6d16030d2ee4fbd073460fe54 upstream.

The 'active' sysfs attribute should refer to the currently active tty
devices the console is running on, not the currently active console.

The console structure doesn't refer to any device in sysfs, only the tty
the console is running on has.  So we need to print out the tty names in
'active', not the console names.

This resolves an issue on s390 platforms in determining the correct
console device to use.


Just to be double sure this is seen, Ray points out that it breaks
current plymouth because the heuristic changed.  Hold off on this one?


Without this patch systemd won't present a login console for s390.
I'd prefer fixing plymouth.


Not an option.

As I said before, the old interface should be left alone and
forked to present a new interface that systemd can use to
get what it expects.

Regards,
Peter Hurley

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 3.13 35/99] tty: Set correct tty name in active sysfs attribute

2014-02-21 Thread Greg Kroah-Hartman
On Fri, Feb 21, 2014 at 03:52:44PM +0100, Hannes Reinecke wrote:
 On 02/21/2014 03:48 PM, Josh Boyer wrote:
  On Thu, Feb 20, 2014 at 6:52 PM, Greg Kroah-Hartman
  gre...@linuxfoundation.org wrote:
  3.13-stable review patch.  If anyone has any objections, please let me 
  know.
 
  --
 
  From: Hannes Reinecke h...@suse.de
 
  commit d8a5dc3033af2fd6d16030d2ee4fbd073460fe54 upstream.
 
  The 'active' sysfs attribute should refer to the currently active tty
  devices the console is running on, not the currently active console.
 
  The console structure doesn't refer to any device in sysfs, only the tty
  the console is running on has.  So we need to print out the tty names in
  'active', not the console names.
 
  This resolves an issue on s390 platforms in determining the correct
  console device to use.
  
  Just to be double sure this is seen, Ray points out that it breaks
  current plymouth because the heuristic changed.  Hold off on this one?
  
 Without this patch systemd won't present a login console for s390.
 I'd prefer fixing plymouth.

We can't break working userspace programs, sorry.  I'll go revert this
patch from the stable kernel's, and from Linus's tree as well, as we
can't break things when 3.14 comes out either.

I'll be glad to take a patch that does not break existing systems...

thanks,

greg k-h
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 3.13 35/99] tty: Set correct tty name in active sysfs attribute

2014-02-21 Thread Kay Sievers
On Fri, Feb 21, 2014 at 3:56 PM, Josh Boyer jwbo...@fedoraproject.org wrote:
 On Fri, Feb 21, 2014 at 9:52 AM, Hannes Reinecke h...@suse.de wrote:
 On 02/21/2014 03:48 PM, Josh Boyer wrote:
 On Thu, Feb 20, 2014 at 6:52 PM, Greg Kroah-Hartman
 gre...@linuxfoundation.org wrote:
 3.13-stable review patch.  If anyone has any objections, please let me 
 know.

 --

 From: Hannes Reinecke h...@suse.de

 commit d8a5dc3033af2fd6d16030d2ee4fbd073460fe54 upstream.

 The 'active' sysfs attribute should refer to the currently active tty
 devices the console is running on, not the currently active console.

 The console structure doesn't refer to any device in sysfs, only the tty
 the console is running on has.  So we need to print out the tty names in
 'active', not the console names.

 This resolves an issue on s390 platforms in determining the correct
 console device to use.

 Just to be double sure this is seen, Ray points out that it breaks
 current plymouth because the heuristic changed.  Hold off on this one?

 Without this patch systemd won't present a login console for s390.
 I'd prefer fixing plymouth.

 Sure.  Except fixing plymouth is easy to do, but not easy to actually
 get deployed on all of the old userspace.  So if someone runs a 3.14
 kernel on any distro that doesn't have a fixed plymouth, it's broken.
 By including this patch, you're basically trading one broken userspace
 component for another.

 Is there some other way this could be fixed in-kernel that would allow
 both to work?

Why did the tty0 change to tty1 now? That doesn't look like a driver
name vs. device name issue?

Kay
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/