linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] tty: Partially revert the removal of the Cyclades public API
@ 2022-01-23 13:32 Maciej W. Rozycki
  2022-01-24  9:22 ` Christoph Hellwig
  0 siblings, 1 reply; 3+ messages in thread
From: Maciej W. Rozycki @ 2022-01-23 13:32 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Jiri Slaby; +Cc: linux-serial, linux-kernel, stable

Fix a user API regression introduced with commit f76edd8f7ce0 ("tty: 
cyclades, remove this orphan"), which removed a part of the API and 
caused compilation errors for user programs using said part, such as 
GCC 9 in its libsanitizer component[1]:

.../libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc:160:10: fatal error: linux/cyclades.h: No such file or directory
  160 | #include <linux/cyclades.h>
      |          ^~~~~~~~~~~~~~~~~~
compilation terminated.
make[4]: *** [Makefile:664: sanitizer_platform_limits_posix.lo] Error 1

As the absolute minimum required bring `struct cyclades_monitor' and 
ioctl numbers back then so as to make the library build again.

References:

[1] GCC PR sanitizer/100379, "cyclades.h is removed from linux kernel 
    header files", <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100379>

Signed-off-by: Maciej W. Rozycki <macro@embecosm.com>
Fixes: f76edd8f7ce0 ("tty: cyclades, remove this orphan")
Cc: stable@vger.kernel.org # v5.13+
---
Hi Greg,

 Only these ioctl numbers are referred by libsanitizer (quoted with source
line numbers as printed by GCC):

  836 |   unsigned IOCTL_CYGETDEFTHRESH = CYGETDEFTHRESH;
  837 |   unsigned IOCTL_CYGETDEFTIMEOUT = CYGETDEFTIMEOUT;
  838 |   unsigned IOCTL_CYGETMON = CYGETMON;
  839 |   unsigned IOCTL_CYGETTHRESH = CYGETTHRESH;
  840 |   unsigned IOCTL_CYGETTIMEOUT = CYGETTIMEOUT;
  841 |   unsigned IOCTL_CYSETDEFTHRESH = CYSETDEFTHRESH;
  842 |   unsigned IOCTL_CYSETDEFTIMEOUT = CYSETDEFTIMEOUT;
  843 |   unsigned IOCTL_CYSETTHRESH = CYSETTHRESH;
  844 |   unsigned IOCTL_CYSETTIMEOUT = CYSETTIMEOUT;

-- however I don't think it makes sense to bring them back selectively.  

 Please apply.

  Maciej

Changes from v1:

- Adjust heading from "tty: Revert the removal of the Cyclades public API".

- Only revert `struct cyclades_monitor' and ioctl numbers.

- Properly format the change given that it's not a plain revert anymore.
---
 include/uapi/linux/cyclades.h |   32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

linux-uapi-cyclades.diff
Index: linux/include/uapi/linux/cyclades.h
===================================================================
--- /dev/null
+++ linux/include/uapi/linux/cyclades.h
@@ -0,0 +1,32 @@
+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
+
+#ifndef _UAPI_LINUX_CYCLADES_H
+#define _UAPI_LINUX_CYCLADES_H
+
+struct cyclades_monitor {
+	unsigned long int_count;
+	unsigned long char_count;
+	unsigned long char_max;
+	unsigned long char_last;
+};
+
+#define CYGETMON		0x435901
+#define CYGETTHRESH		0x435902
+#define CYSETTHRESH		0x435903
+#define CYGETDEFTHRESH		0x435904
+#define CYSETDEFTHRESH		0x435905
+#define CYGETTIMEOUT		0x435906
+#define CYSETTIMEOUT		0x435907
+#define CYGETDEFTIMEOUT		0x435908
+#define CYSETDEFTIMEOUT		0x435909
+#define CYSETRFLOW		0x43590a
+#define CYGETRFLOW		0x43590b
+#define CYSETRTSDTR_INV		0x43590c
+#define CYGETRTSDTR_INV		0x43590d
+#define CYZSETPOLLCYCLE		0x43590e
+#define CYZGETPOLLCYCLE		0x43590f
+#define CYGETCD1400VER		0x435910
+#define CYSETWAIT		0x435912
+#define CYGETWAIT		0x435913
+
+#endif /* _UAPI_LINUX_CYCLADES_H */

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

* Re: [PATCH v2] tty: Partially revert the removal of the Cyclades public API
  2022-01-23 13:32 [PATCH v2] tty: Partially revert the removal of the Cyclades public API Maciej W. Rozycki
@ 2022-01-24  9:22 ` Christoph Hellwig
  2022-01-26  9:22   ` Maciej W. Rozycki
  0 siblings, 1 reply; 3+ messages in thread
From: Christoph Hellwig @ 2022-01-24  9:22 UTC (permalink / raw)
  To: Maciej W. Rozycki
  Cc: Greg Kroah-Hartman, Jiri Slaby, linux-serial, linux-kernel, stable

On Sun, Jan 23, 2022 at 01:32:45PM +0000, Maciej W. Rozycki wrote:
> Fix a user API regression introduced with commit f76edd8f7ce0 ("tty: 
> cyclades, remove this orphan"), which removed a part of the API and 
> caused compilation errors for user programs using said part, such as 
> GCC 9 in its libsanitizer component[1]:

This looks sensible, but a #warning might be useful to get people to
stop including this random header.

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

* Re: [PATCH v2] tty: Partially revert the removal of the Cyclades public API
  2022-01-24  9:22 ` Christoph Hellwig
@ 2022-01-26  9:22   ` Maciej W. Rozycki
  0 siblings, 0 replies; 3+ messages in thread
From: Maciej W. Rozycki @ 2022-01-26  9:22 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Greg Kroah-Hartman, Jiri Slaby, linux-serial, linux-kernel, stable

On Mon, 24 Jan 2022, Christoph Hellwig wrote:

> > Fix a user API regression introduced with commit f76edd8f7ce0 ("tty: 
> > cyclades, remove this orphan"), which removed a part of the API and 
> > caused compilation errors for user programs using said part, such as 
> > GCC 9 in its libsanitizer component[1]:
> 
> This looks sensible, but a #warning might be useful to get people to
> stop including this random header.

 We have no precedent, but your suggestion seems reasonable to me, thanks.

  Maciej

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

end of thread, other threads:[~2022-01-26  9:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-23 13:32 [PATCH v2] tty: Partially revert the removal of the Cyclades public API Maciej W. Rozycki
2022-01-24  9:22 ` Christoph Hellwig
2022-01-26  9:22   ` Maciej W. Rozycki

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).