From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: "Michalik, Michal" <michal.michalik@intel.com>
Cc: Jakub Kicinski <kuba@kernel.org>,
"Nguyen, Anthony L" <anthony.l.nguyen@intel.com>,
"davem@davemloft.net" <davem@davemloft.net>,
"pabeni@redhat.com" <pabeni@redhat.com>,
"edumazet@google.com" <edumazet@google.com>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"richardcochran@gmail.com" <richardcochran@gmail.com>,
"G, GurucharanX" <gurucharanx.g@intel.com>,
Jiri Slaby <jirislaby@kernel.org>,
Johan Hovold <johan@kernel.org>
Subject: Re: [PATCH net 3/3] ice: Add set_termios tty operations handle to GNSS
Date: Wed, 7 Sep 2022 07:45:39 +0200 [thread overview]
Message-ID: <YxgwA9bTvdheeZUf@kroah.com> (raw)
In-Reply-To: <BN6PR11MB4177F526AA1726DC0EF95E62E37E9@BN6PR11MB4177.namprd11.prod.outlook.com>
On Tue, Sep 06, 2022 at 08:55:59PM +0000, Michalik, Michal wrote:
> Greg,
>
> Thanks - answer inline.
As is required, no need to put this on your emails, as top-posting is
not allowed :)
> > -----Original Message-----
> > From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > Sent: Tuesday, September 6, 2022 8:16 AM
> > To: Michalik, Michal <michal.michalik@intel.com>
> > Cc: Jakub Kicinski <kuba@kernel.org>; Nguyen, Anthony L <anthony.l.nguyen@intel.com>; davem@davemloft.net; pabeni@redhat.com; edumazet@google.com; netdev@vger.kernel.org; richardcochran@gmail.com; G, GurucharanX <gurucharanx.g@intel.com>; Jiri Slaby <jirislaby@kernel.org>; Johan Hovold <johan@kernel.org>
> > Subject: Re: [PATCH net 3/3] ice: Add set_termios tty operations handle to GNSS
Please fix your email client to not do this.
> > > Adding this empty function solved the problem.
> >
> > That seems very wrong, please work to fix this by NOT having an empty
> > function like this as it should not be required.
> >
>
> I don't get one thing, though. You are saying, it "seem" wrong and that
> "should not" be required but I observe different behavior. I have prepared
> a very simple code to reproduce the issue:
> #include <termios.h>
> #include <unistd.h>
> #include <stdio.h>
> #include <fcntl.h>
> #include <errno.h>
>
> int main()
> {
> struct termios tty;
> int fd;
>
> fd = open("/dev/ttyGNSS_0300", O_RDWR | O_NOCTTY | O_SYNC);
>
> if (fd < 0) {
> printf("Error - TTY not open.\n");
> return -1;
> }
>
> if (tcgetattr (fd, &tty) != 0) {
> printf("Error on get - errno=%i\n", errno);
> return -1;
> }
> tty.c_cflag |= CS8; // try to set 8 data bits
> if (tcsetattr(fd, TCSANOW, &tty) != 0) {
> printf("Error on set - errno=%i\n", errno);
> return -1;
> }
>
> close(fd);
> printf("Done.\n");
> }
>
> In this case, when I don't satisfy this API, I get an errno 22.
You get the error on the first get or the set?
> If add this
> empty function and therefore implement the full API it works as expected (no
> error). In our case no action is needed, therefore we have an empty function.
> At the moment, I'm not sure how I should fix it other way - since no action
> on HW is neccessary.
This should not be needed as I thought the default would be "just ignore
this", but maybe not. Can you look into this problem please and figure
out why this is required and fix that up?
> Of course in the meantime we are working on investigating if we can easily
> align to existing GNSS interface accroding to community suggestions. Still,
> we believe that this fix is solving the problem at the moment.
Let's fix the root problem here, not paper over it.
thanks,
greg k-h
next prev parent reply other threads:[~2022-09-07 5:46 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-29 22:00 [PATCH net 0/3][pull request] Intel Wired LAN Driver Updates 2022-08-29 (ice) Tony Nguyen
2022-08-29 22:00 ` [PATCH net 1/3] ice: Fix DMA mappings leak Tony Nguyen
2022-08-29 22:00 ` [PATCH net 2/3] ice: use bitmap_free instead of devm_kfree Tony Nguyen
2022-08-29 22:00 ` [PATCH net 3/3] ice: Add set_termios tty operations handle to GNSS Tony Nguyen
2022-08-31 21:54 ` Jakub Kicinski
2022-08-31 23:36 ` Tony Nguyen
2022-09-01 5:46 ` Greg Kroah-Hartman
2022-09-01 20:18 ` Jakub Kicinski
2022-09-02 16:55 ` Tony Nguyen
2022-09-05 19:32 ` Michalik, Michal
2022-09-06 6:15 ` Greg Kroah-Hartman
2022-09-06 20:55 ` Michalik, Michal
2022-09-07 5:45 ` Greg Kroah-Hartman [this message]
2022-09-08 13:44 ` Michalik, Michal
2022-09-01 6:44 ` Johan Hovold
2022-09-02 7:42 ` Jiri Slaby
2022-09-02 10:47 ` Jiri Slaby
2022-09-05 19:47 ` Michalik, Michal
2022-09-05 19:41 ` Michalik, Michal
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=YxgwA9bTvdheeZUf@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=anthony.l.nguyen@intel.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=gurucharanx.g@intel.com \
--cc=jirislaby@kernel.org \
--cc=johan@kernel.org \
--cc=kuba@kernel.org \
--cc=michal.michalik@intel.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=richardcochran@gmail.com \
/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 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).