From: "gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>
To: mrhowel@g.clemson.edu
Cc: Matthew Howell <matthew.howell@sealevel.com>,
"linux-serial@vger.kernel.org" <linux-serial@vger.kernel.org>,
Ryan Wenglarz <ryan.wenglarz@sealevel.com>
Subject: Re: Possible issue with RS485 IOCTLs on 16C950 UARTs?
Date: Thu, 21 Oct 2021 16:30:54 +0200 [thread overview]
Message-ID: <YXF5nig6PzRWsLjS@kroah.com> (raw)
In-Reply-To: <alpine.DEB.2.22.394.2110211004030.10664@SLTS-20200428.int.sealevel.com>
On Thu, Oct 21, 2021 at 10:10:30AM -0400, mrhowel@g.clemson.edu wrote:
>
> That noticed is enforced by our exchange server. I have removed it by
> using an external email address instead.
>
> Original message is copied below.
>
> Hi,
>
> I'm not sure if this is the right place for this, but hopefully someone
> can help me figure out what else I can do to troubleshoot this problem, or
> point me to the right place to ask questions about this.
>
> A recent investigation led us to discover issues related to the RS485
> IOCTLs on our serial cards utilizing the 16C950 UART. More specifically,
> the TIOCSRS485 IOCTL to set the serial_rs485 flags as documented at
> https://www.kernel.org/doc/html/latest/driver-api/serial/serial-rs485.html
> .
>
> When attempting to set the SER_RS485_ENABLED flag using TIOCSRS485 as per
> below I receive an error code 25, "Inappropriate IOCTL for device"
>
> /* -----RS485----- */
> struct serial_rs485 rs485conf = {0};
> rs485conf.flags |= SER_RS485_ENABLED;
> rc = ioctl(fd, TIOCSRS485, &rs485conf);
> if (rc < 0) {
> printf("error=%d %s\n", errno, strerror(errno));
> return rc;
> }
>
> >From what I've read this typically indicates an unsupported serial device,
> but the documentation mentions the 16C950 UART as a specific example, so I
> would think the kernel is intended to support this functionality on the
> 16C950.
>
> I have tried this across several kernel versions: 3.10 (Centos 7) , 4.18
> (Centos 8), and 5.11 (Ubuntu 21.04) with no change in the behavior.
> The issue was originally discovered on a PLX OXPCIe952 UART, but has been
> replicated on 'standard' OX16C950 UARTs as well. setserial -ag correctly
> identifies all cards as 16950's (Specifically "16950/954").
>
> Has anyone else had or seen this IOCTL issue on the 16C950? Are there any
> 'known good' 16C950 based cards people can confirm that this works with?
I do not think that that type of hardware actually supports RS485, as the
kernel is reporting that the driver says it is not allowed.
Perhaps you need to find some hardware that does support it? It is not
very common at all.
good luck!
greg k-h
next prev parent reply other threads:[~2021-10-21 14:30 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-20 20:44 Possible issue with RS485 IOCTLs on 16C950 UARTs? Matthew Howell
2021-10-21 7:56 ` gregkh
2021-10-21 14:10 ` mrhowel
2021-10-21 14:30 ` gregkh [this message]
2021-10-21 17:37 ` mrhowel
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=YXF5nig6PzRWsLjS@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=linux-serial@vger.kernel.org \
--cc=matthew.howell@sealevel.com \
--cc=mrhowel@g.clemson.edu \
--cc=ryan.wenglarz@sealevel.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