All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Slansky <slansky@gmail.com>
To: linux-serial@vger.kernel.org
Subject: Serial raw mode. Bug in serial driver in Linux kernel? Is documentation correct?
Date: Wed, 12 Aug 2020 18:51:39 +0200	[thread overview]
Message-ID: <CA+ww9hwAzFHCYhkQUev2_VBN=8gMsxBcnExG53_gCkC6++-ScA@mail.gmail.com> (raw)

Hi Linux-Serial,

I was fixing "pirate-loader" for BusPirate device, firmware loader utility.
The design followed documentation for serial communication for "row"
serial mode but it was not working. I modified flags and utility works
now but my modification doesn't match documentation. That is strange
from my point of view. Have I discovered a bug in the kernel? Could
you check??

Details are here, second comment, the long one:
https://github.com/BusPirate/Bus_Pirate/issues/140

This is the core of my fix, I changed CSIZE flag:

        cfmakeraw(&g_new_tio);

-       g_new_tio.c_cflag |=  (CS8 | CLOCAL | CREAD);
-       g_new_tio.c_cflag &= ~(PARENB | CSTOPB | CSIZE);
-       g_new_tio.c_oflag = 0;
-       g_new_tio.c_lflag = 0;
+       g_new_tio.c_cflag |=  (CS8 | CSIZE | CLOCAL | CREAD);
+       g_new_tio.c_cflag &= ~(PARENB | CSTOPB);
+       //g_new_tio.c_oflag = 0;
+       //g_new_tio.c_lflag = 0;

When I write about wrong documentation, that information is on many
places including "man cfmakeraw":

           termios_p->c_iflag &= ~(IGNBRK | BRKINT | PARMRK | ISTRIP |
INLCR | IGNCR | ICRNL | IXON);
           termios_p->c_oflag &= ~OPOST;
           termios_p->c_lflag &= ~(ECHO | ECHONL | ICANON | ISIG | IEXTEN);
           termios_p->c_cflag &= ~(CSIZE | PARENB);
           termios_p->c_cflag |= CS8;

With regards,
Petr

BTW, I tried to send this email to Greg KH first but he asked me to
send my email to this group because his INBOX is full of unread
messages (912 messages in /home/greg/mail/INBOX/). That is not so bad,
I have more than 5000 unread messages in my INBOX... ;-)

             reply	other threads:[~2020-08-12 16:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-12 16:51 Petr Slansky [this message]
2020-08-12 19:09 ` Serial raw mode. Bug in serial driver in Linux kernel? Is documentation correct? Sergey Organov
2020-08-12 19:14 ` Sergey Organov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CA+ww9hwAzFHCYhkQUev2_VBN=8gMsxBcnExG53_gCkC6++-ScA@mail.gmail.com' \
    --to=slansky@gmail.com \
    --cc=linux-serial@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.