From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: Tomas Hlavacek <tmshlvck@gmail.com>
Cc: gregkh@linuxfoundation.org, alan@linux.intel.com,
linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org,
marek.vasut@gmail.com
Subject: Re: [PATCH 1/1] [RFC] uartclk from serial_core exposed to sysfs
Date: Thu, 16 Aug 2012 11:31:52 +0100 [thread overview]
Message-ID: <20120816113152.73838695@pyramind.ukuu.org.uk> (raw)
In-Reply-To: <1344929718-22736-1-git-send-email-tmshlvck@gmail.com>
> + /*
> + * Check value: baud_base has to be more than 9600
> + * and uartclock = baud_base * 16 .
> + */
> + if (val >= 153600)
> + state->uart_port->uartclk = val;
> +
> + mutex_unlock(&state->port.mutex);
> +
> + return count;
This breaks if for example the port is in use. Fixing that looks pretty
horrible as you need a valid tty pointer to stop and restart the pot.
It's also not calling the verfy method of the port as is expected.
At minimum I think you need to be able to do the same work
uart_get_info/uart_set_info perform and with the same checks on ->verify
etc.
I'm not 100% sure the drvdata on the tty_dev is clear to use. It does
seem to be in all the drivers I looked at. I'd rather however it pointed
to the tty_port that each tty device has (or very soon will be required
to have). You can still find the uart_foo structs from that but it means
we can do the dev_set_drvdata() in a consistent manner for all tty
devices in the kernel. That in turn means we can make some of the sysfs
valid the same way.
I want to have think about the setting side of it. Can you submit a
revised version that just allows the user to read the value this way but
does the drvdata setting etc and sysfs node create/delete.
I'll merge that and we can throw it over the parapet and see if anything
explodes.
To make the setting part work properly I think I need to sort out
uart_get_info/set_info so the core part of it can be called with kernel
space structures and the caller handling locks.
Alan
next prev parent reply other threads:[~2012-08-16 10:27 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CAEB7QLAJXkK6NDPVDi36n_U_X_DGh5niHJhH6FpqBUZFmXQ2Xg@mail.gmail.com>
2012-08-14 7:35 ` Tomas Hlavacek
2012-08-14 12:50 ` Marek Vasut
2012-08-15 17:09 ` Tomas Hlavacek
2012-08-15 17:12 ` [PATCHv2 " Tomas Hlavacek
2012-08-16 10:31 ` Alan Cox [this message]
2012-08-17 14:43 ` [PATCHv3 " Tomas Hlavacek
2012-08-17 15:06 ` Greg KH
2012-08-17 16:30 ` Tomas Hlavacek
2012-08-17 16:54 ` Greg KH
2012-08-17 18:44 ` Marek Vasut
2012-08-17 19:01 ` Greg KH
2012-08-17 20:25 ` Tomas Hlavacek
2012-08-19 18:34 ` [PATCHv4 " Tomas Hlavacek
2012-08-21 13:24 ` Tomas Hlavacek
2012-08-21 13:44 ` Alan Cox
2012-09-05 20:36 ` Greg KH
2012-09-05 23:16 ` [PATCHv5 1/1] uartclk value " Tomas Hlavacek
2012-09-05 23:42 ` Greg KH
2012-09-06 1:01 ` Tomas Hlavacek
2012-09-06 1:17 ` [PATCH v6] " Tomas Hlavacek
2012-09-06 16:23 ` [PATCH v6] tty: " Greg KH
2012-09-06 17:54 ` [PATCH v6] " Jiri Slaby
2012-09-06 18:39 ` Tomas Hlavacek
2012-09-06 18:54 ` Jiri Slaby
2012-09-06 19:41 ` Tomas Hlavacek
2012-09-06 19:47 ` Jiri Slaby
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=20120816113152.73838695@pyramind.ukuu.org.uk \
--to=alan@lxorguk.ukuu.org.uk \
--cc=alan@linux.intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=marek.vasut@gmail.com \
--cc=tmshlvck@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
Powered by JetHome