* Re: Is 115200 still the maximum baudrate?
From: Theodore Ts'o @ 2017-11-02 17:13 UTC (permalink / raw)
To: Paul Menzel; +Cc: linux-serial, linux-kernel
In-Reply-To: <d712888f-3b91-76c5-b949-407b0c072bcf@molgen.mpg.de>
On Thu, Nov 02, 2017 at 04:42:56PM +0100, Paul Menzel wrote:
>
> The Linux serial console documentation [1] says that 115200 is the maximum
> supported baudrate.
>
> > The maximum baudrate is 115200.
>
> Is that still accurate? If yes, where should I look to support higher
> values?
See the setserial man page and the spd_* options:
spd_hi
Use 57.6kb when the application requests 38.4kb. This parameter
may be specified by a non-privileged user.
spd_vhi
Use 115kb when the application requests 38.4kb. This parameter may
be specified by a non-privileged user.
spd_shi
Use 230kb when the application requests 38.4kb. This parameter may
be specified by a non-privileged user.
spd_warp
Use 460kb when the application requests 38.4kb. This parameter may
be specified by a non-privileged user.
- Ted
^ permalink raw reply
* Re: How to enable output to serial console at run-time?
From: Greg KH @ 2017-11-02 16:53 UTC (permalink / raw)
To: Paul Menzel; +Cc: linux-serial, linux-kernel
In-Reply-To: <3c348fe1-1474-6c19-691d-8130d4bd0d32@molgen.mpg.de>
On Thu, Nov 02, 2017 at 04:39:36PM +0100, Paul Menzel wrote:
> Dear Linux folks,
>
>
> If I want to output the Linux kernel messages to the serial console, but the
> `console=ttyS…` line is missing on the Linux command line, is there a way to
> activate that during run-time by, for example, using the sysfs interface?
Why not change the command line to enable it properly?
thanks,
greg k-h
^ permalink raw reply
* Is 115200 still the maximum baudrate?
From: Paul Menzel @ 2017-11-02 15:42 UTC (permalink / raw)
To: linux-serial; +Cc: linux-kernel
Dear Linux folks,
The Linux serial console documentation [1] says that 115200 is the
maximum supported baudrate.
> The maximum baudrate is 115200.
Is that still accurate? If yes, where should I look to support higher
values?
Kind regards,
Paul
[1] https://www.kernel.org/doc/html/v4.13/admin-guide/serial-console.html
^ permalink raw reply
* How to enable output to serial console at run-time?
From: Paul Menzel @ 2017-11-02 15:39 UTC (permalink / raw)
To: linux-serial; +Cc: linux-kernel
Dear Linux folks,
If I want to output the Linux kernel messages to the serial console, but
the `console=ttyS…` line is missing on the Linux command line, is there
a way to activate that during run-time by, for example, using the sysfs
interface?
Kind regards,
Paul
^ permalink raw reply
* Re: [PATCH] tty: max3100: remove unused variable rts and remove unused assignment
From: walter harms @ 2017-11-02 14:36 UTC (permalink / raw)
To: Colin Ian King
Cc: Greg Kroah-Hartman, Jiri Slaby, linux-serial, kernel-janitors,
linux-kernel
In-Reply-To: <4ab49f27-4122-15bd-bc36-2e28f96255b7@canonical.com>
Am 02.11.2017 15:22, schrieb Colin Ian King:
> On 02/11/17 14:21, Colin Ian King wrote:
>> On 02/11/17 14:14, walter harms wrote:
>>>
>>>
>>> Am 02.11.2017 15:01, schrieb Colin King:
>>>> From: Colin Ian King <colin.king@canonical.com>
>>>>
>>>> Variable rts is being assigned but it is never read, hence it can be
>>>> removed. The assignment to param_new to zero is redundant as it is
>>>> being updates a few statements later, so remove this redundant
>>>> assignment. Cleans up two clang warnings:
>>>>
>>>> drivers/tty/serial/max3100.c:277:3: warning: Value stored to 'rts'
>>>> is never read
>>>> drivers/tty/serial/max3100.c:439:2: warning: Value stored to 'param_new'
>>>> is never read
>>>>
>>>> Signed-off-by: Colin Ian King <colin.king@canonical.com>
>>>> ---
>>>> drivers/tty/serial/max3100.c | 4 +---
>>>> 1 file changed, 1 insertion(+), 3 deletions(-)
>>>>
>>>> diff --git a/drivers/tty/serial/max3100.c b/drivers/tty/serial/max3100.c
>>>> index b6b3453e8c1f..f691f3cdb5b1 100644
>>>> --- a/drivers/tty/serial/max3100.c
>>>> +++ b/drivers/tty/serial/max3100.c
>>>> @@ -263,7 +263,7 @@ static void max3100_work(struct work_struct *w)
>>>> struct max3100_port *s = container_of(w, struct max3100_port, work);
>>>> int rxchars;
>>>> u16 tx, rx;
>>>> - int conf, cconf, rts, crts;
>>>> + int conf, cconf, crts;
>>>> struct circ_buf *xmit = &s->port.state->xmit;
>>>>
>>>> dev_dbg(&s->spi->dev, "%s\n", __func__);
>>>> @@ -274,7 +274,6 @@ static void max3100_work(struct work_struct *w)
>>>> conf = s->conf;
>>>> cconf = s->conf_commit;
>>>> s->conf_commit = 0;
>>>> - rts = s->rts;
>>>> crts = s->rts_commit;
>>>> s->rts_commit = 0;
>>>> spin_unlock(&s->conf_lock);
>>>> @@ -436,7 +435,6 @@ max3100_set_termios(struct uart_port *port, struct ktermios *termios,
>>>> dev_dbg(&s->spi->dev, "%s\n", __func__);
>>>>
>>>> cflag = termios->c_cflag;
>>>> - param_new = 0;
>>>> param_mask = 0;
>>>>
>>>> baud = tty_termios_baud_rate(termios);
>>>
>>> are you sure ?
>>
>> Yep. So are my compilers
>>
>>>
>>> based on this code:
>>> https://lxr.missinglinkelectronics.com/linux/drivers/tty/serial/max3100.c
>>
>> 438 cflag = termios->c_cflag;
>> 439 param_new = 0;
>> 440 param_mask = 0;
>> 441
>> 442 baud = tty_termios_baud_rate(termios);
>> 443 param_new = s->conf & MAX3100_BAUD;
>>
>> param_new is being updated again on line 440, so line 439 is redundant.
> I mean "again on line 443"
>
yep, i missed 443, sorry for the noise.
re,
wh
>>
>>>
>>> the default case will not set param_new
>>>
>>> re,
>>> wh
>>>
>>> --
>>> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
>>> the body of a message to majordomo@vger.kernel.org
>>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>>>
>>
>
> --
> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply
* Re: [PATCH] tty: max3100: remove unused variable rts and remove unused assignment
From: Colin Ian King @ 2017-11-02 14:22 UTC (permalink / raw)
To: wharms
Cc: Greg Kroah-Hartman, Jiri Slaby, linux-serial, kernel-janitors,
linux-kernel
In-Reply-To: <026e02c7-745e-af05-8d20-4588420888b3@canonical.com>
On 02/11/17 14:21, Colin Ian King wrote:
> On 02/11/17 14:14, walter harms wrote:
>>
>>
>> Am 02.11.2017 15:01, schrieb Colin King:
>>> From: Colin Ian King <colin.king@canonical.com>
>>>
>>> Variable rts is being assigned but it is never read, hence it can be
>>> removed. The assignment to param_new to zero is redundant as it is
>>> being updates a few statements later, so remove this redundant
>>> assignment. Cleans up two clang warnings:
>>>
>>> drivers/tty/serial/max3100.c:277:3: warning: Value stored to 'rts'
>>> is never read
>>> drivers/tty/serial/max3100.c:439:2: warning: Value stored to 'param_new'
>>> is never read
>>>
>>> Signed-off-by: Colin Ian King <colin.king@canonical.com>
>>> ---
>>> drivers/tty/serial/max3100.c | 4 +---
>>> 1 file changed, 1 insertion(+), 3 deletions(-)
>>>
>>> diff --git a/drivers/tty/serial/max3100.c b/drivers/tty/serial/max3100.c
>>> index b6b3453e8c1f..f691f3cdb5b1 100644
>>> --- a/drivers/tty/serial/max3100.c
>>> +++ b/drivers/tty/serial/max3100.c
>>> @@ -263,7 +263,7 @@ static void max3100_work(struct work_struct *w)
>>> struct max3100_port *s = container_of(w, struct max3100_port, work);
>>> int rxchars;
>>> u16 tx, rx;
>>> - int conf, cconf, rts, crts;
>>> + int conf, cconf, crts;
>>> struct circ_buf *xmit = &s->port.state->xmit;
>>>
>>> dev_dbg(&s->spi->dev, "%s\n", __func__);
>>> @@ -274,7 +274,6 @@ static void max3100_work(struct work_struct *w)
>>> conf = s->conf;
>>> cconf = s->conf_commit;
>>> s->conf_commit = 0;
>>> - rts = s->rts;
>>> crts = s->rts_commit;
>>> s->rts_commit = 0;
>>> spin_unlock(&s->conf_lock);
>>> @@ -436,7 +435,6 @@ max3100_set_termios(struct uart_port *port, struct ktermios *termios,
>>> dev_dbg(&s->spi->dev, "%s\n", __func__);
>>>
>>> cflag = termios->c_cflag;
>>> - param_new = 0;
>>> param_mask = 0;
>>>
>>> baud = tty_termios_baud_rate(termios);
>>
>> are you sure ?
>
> Yep. So are my compilers
>
>>
>> based on this code:
>> https://lxr.missinglinkelectronics.com/linux/drivers/tty/serial/max3100.c
>
> 438 cflag = termios->c_cflag;
> 439 param_new = 0;
> 440 param_mask = 0;
> 441
> 442 baud = tty_termios_baud_rate(termios);
> 443 param_new = s->conf & MAX3100_BAUD;
>
> param_new is being updated again on line 440, so line 439 is redundant.
I mean "again on line 443"
>
>>
>> the default case will not set param_new
>>
>> re,
>> wh
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>>
>
^ permalink raw reply
* Re: [PATCH] tty: max3100: remove unused variable rts and remove unused assignment
From: Colin Ian King @ 2017-11-02 14:21 UTC (permalink / raw)
To: wharms
Cc: Greg Kroah-Hartman, Jiri Slaby, linux-serial, kernel-janitors,
linux-kernel
In-Reply-To: <59FB2849.6020108@bfs.de>
On 02/11/17 14:14, walter harms wrote:
>
>
> Am 02.11.2017 15:01, schrieb Colin King:
>> From: Colin Ian King <colin.king@canonical.com>
>>
>> Variable rts is being assigned but it is never read, hence it can be
>> removed. The assignment to param_new to zero is redundant as it is
>> being updates a few statements later, so remove this redundant
>> assignment. Cleans up two clang warnings:
>>
>> drivers/tty/serial/max3100.c:277:3: warning: Value stored to 'rts'
>> is never read
>> drivers/tty/serial/max3100.c:439:2: warning: Value stored to 'param_new'
>> is never read
>>
>> Signed-off-by: Colin Ian King <colin.king@canonical.com>
>> ---
>> drivers/tty/serial/max3100.c | 4 +---
>> 1 file changed, 1 insertion(+), 3 deletions(-)
>>
>> diff --git a/drivers/tty/serial/max3100.c b/drivers/tty/serial/max3100.c
>> index b6b3453e8c1f..f691f3cdb5b1 100644
>> --- a/drivers/tty/serial/max3100.c
>> +++ b/drivers/tty/serial/max3100.c
>> @@ -263,7 +263,7 @@ static void max3100_work(struct work_struct *w)
>> struct max3100_port *s = container_of(w, struct max3100_port, work);
>> int rxchars;
>> u16 tx, rx;
>> - int conf, cconf, rts, crts;
>> + int conf, cconf, crts;
>> struct circ_buf *xmit = &s->port.state->xmit;
>>
>> dev_dbg(&s->spi->dev, "%s\n", __func__);
>> @@ -274,7 +274,6 @@ static void max3100_work(struct work_struct *w)
>> conf = s->conf;
>> cconf = s->conf_commit;
>> s->conf_commit = 0;
>> - rts = s->rts;
>> crts = s->rts_commit;
>> s->rts_commit = 0;
>> spin_unlock(&s->conf_lock);
>> @@ -436,7 +435,6 @@ max3100_set_termios(struct uart_port *port, struct ktermios *termios,
>> dev_dbg(&s->spi->dev, "%s\n", __func__);
>>
>> cflag = termios->c_cflag;
>> - param_new = 0;
>> param_mask = 0;
>>
>> baud = tty_termios_baud_rate(termios);
>
> are you sure ?
Yep. So are my compilers
>
> based on this code:
> https://lxr.missinglinkelectronics.com/linux/drivers/tty/serial/max3100.c
438 cflag = termios->c_cflag;
439 param_new = 0;
440 param_mask = 0;
441
442 baud = tty_termios_baud_rate(termios);
443 param_new = s->conf & MAX3100_BAUD;
param_new is being updated again on line 440, so line 439 is redundant.
>
> the default case will not set param_new
>
> re,
> wh
>
> --
> To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply
* Re: [PATCH] tty: max3100: remove unused variable rts and remove unused assignment
From: walter harms @ 2017-11-02 14:14 UTC (permalink / raw)
To: Colin King
Cc: Greg Kroah-Hartman, Jiri Slaby, linux-serial, kernel-janitors,
linux-kernel
In-Reply-To: <20171102140144.21514-1-colin.king@canonical.com>
Am 02.11.2017 15:01, schrieb Colin King:
> From: Colin Ian King <colin.king@canonical.com>
>
> Variable rts is being assigned but it is never read, hence it can be
> removed. The assignment to param_new to zero is redundant as it is
> being updates a few statements later, so remove this redundant
> assignment. Cleans up two clang warnings:
>
> drivers/tty/serial/max3100.c:277:3: warning: Value stored to 'rts'
> is never read
> drivers/tty/serial/max3100.c:439:2: warning: Value stored to 'param_new'
> is never read
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
> drivers/tty/serial/max3100.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/tty/serial/max3100.c b/drivers/tty/serial/max3100.c
> index b6b3453e8c1f..f691f3cdb5b1 100644
> --- a/drivers/tty/serial/max3100.c
> +++ b/drivers/tty/serial/max3100.c
> @@ -263,7 +263,7 @@ static void max3100_work(struct work_struct *w)
> struct max3100_port *s = container_of(w, struct max3100_port, work);
> int rxchars;
> u16 tx, rx;
> - int conf, cconf, rts, crts;
> + int conf, cconf, crts;
> struct circ_buf *xmit = &s->port.state->xmit;
>
> dev_dbg(&s->spi->dev, "%s\n", __func__);
> @@ -274,7 +274,6 @@ static void max3100_work(struct work_struct *w)
> conf = s->conf;
> cconf = s->conf_commit;
> s->conf_commit = 0;
> - rts = s->rts;
> crts = s->rts_commit;
> s->rts_commit = 0;
> spin_unlock(&s->conf_lock);
> @@ -436,7 +435,6 @@ max3100_set_termios(struct uart_port *port, struct ktermios *termios,
> dev_dbg(&s->spi->dev, "%s\n", __func__);
>
> cflag = termios->c_cflag;
> - param_new = 0;
> param_mask = 0;
>
> baud = tty_termios_baud_rate(termios);
are you sure ?
based on this code:
https://lxr.missinglinkelectronics.com/linux/drivers/tty/serial/max3100.c
the default case will not set param_new
re,
wh
^ permalink raw reply
* [PATCH] tty: max3100: remove unused variable rts and remove unused assignment
From: Colin King @ 2017-11-02 14:01 UTC (permalink / raw)
To: Greg Kroah-Hartman, Jiri Slaby, linux-serial
Cc: kernel-janitors, linux-kernel
From: Colin Ian King <colin.king@canonical.com>
Variable rts is being assigned but it is never read, hence it can be
removed. The assignment to param_new to zero is redundant as it is
being updates a few statements later, so remove this redundant
assignment. Cleans up two clang warnings:
drivers/tty/serial/max3100.c:277:3: warning: Value stored to 'rts'
is never read
drivers/tty/serial/max3100.c:439:2: warning: Value stored to 'param_new'
is never read
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
drivers/tty/serial/max3100.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/tty/serial/max3100.c b/drivers/tty/serial/max3100.c
index b6b3453e8c1f..f691f3cdb5b1 100644
--- a/drivers/tty/serial/max3100.c
+++ b/drivers/tty/serial/max3100.c
@@ -263,7 +263,7 @@ static void max3100_work(struct work_struct *w)
struct max3100_port *s = container_of(w, struct max3100_port, work);
int rxchars;
u16 tx, rx;
- int conf, cconf, rts, crts;
+ int conf, cconf, crts;
struct circ_buf *xmit = &s->port.state->xmit;
dev_dbg(&s->spi->dev, "%s\n", __func__);
@@ -274,7 +274,6 @@ static void max3100_work(struct work_struct *w)
conf = s->conf;
cconf = s->conf_commit;
s->conf_commit = 0;
- rts = s->rts;
crts = s->rts_commit;
s->rts_commit = 0;
spin_unlock(&s->conf_lock);
@@ -436,7 +435,6 @@ max3100_set_termios(struct uart_port *port, struct ktermios *termios,
dev_dbg(&s->spi->dev, "%s\n", __func__);
cflag = termios->c_cflag;
- param_new = 0;
param_mask = 0;
baud = tty_termios_baud_rate(termios);
--
2.14.1
^ permalink raw reply related
* Re: [patch v10 1/4] drivers: jtag: Add JTAG core driver (fwd)
From: Julia Lawall @ 2017-11-02 13:06 UTC (permalink / raw)
Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
devicetree-u79uwXL29TY76Z2rM5mHXA, openbmc-uLR06cmDAlY/bJ5BZ2RsiQ,
joel-U3u1mxZcP9KHXe+LvDLADg, jiri-rHqAuBHg3fBzbRFIqnYvSA,
tklauser-93Khv+1bN0NyDzI6CaY1VQ,
linux-serial-u79uwXL29TY76Z2rM5mHXA, mec-WqBc5aa1uDFeoWH0uzbU5w,
vadimp-VPRAkNaXOzVWk0Htik3J/w,
system-sw-low-level-VPRAkNaXOzVWk0Htik3J/w,
robh+dt-DgEjT+Ai2ygdnm+yROfE0A,
openocd-devel-owner-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
linux-api-u79uwXL29TY76Z2rM5mHXA, davem-fT/PcQaiUtIeIZ0/mPfg9Q,
mchehab-DgEjT+Ai2ygdnm+yROfE0A, Oleksandr Shamray, Jiri Pirko,
gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r, arnd-r2nGTMty4D4,
kbuild-all-JC7UmRfGjtg
It looks like the return on line 137 belongs after line 138.
julia
---------- Forwarded message ----------
Date: Thu, 2 Nov 2017 21:02:22 +0800
From: kbuild test robot <fengguang.wu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
To: kbuild-JC7UmRfGjtg@public.gmane.org
Cc: Julia Lawall <julia.lawall-L2FTfq7BK8M@public.gmane.org>
Subject: Re: [patch v10 1/4] drivers: jtag: Add JTAG core driver
In-Reply-To: <1509365528-28803-2-git-send-email-oleksandrs-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
References: <1509365528-28803-2-git-send-email-oleksandrs-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Hi Oleksandr,
I love your patch! Perhaps something to improve:
[auto build test WARNING on linus/master]
[also build test WARNING on v4.14-rc7]
[cannot apply to next-20171102]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Oleksandr-Shamray/JTAG-driver-introduction/20171102-045624
:::::: branch date: 16 hours ago
:::::: commit date: 16 hours ago
>> drivers/jtag/jtag.c:142:16-25: ERROR: reference preceded by free on line 138
# https://github.com/0day-ci/linux/commit/1a7d120a0e3ba075879bc00ab136c4608f16a2a7
git remote add linux-review https://github.com/0day-ci/linux
git remote update linux-review
git checkout 1a7d120a0e3ba075879bc00ab136c4608f16a2a7
vim +142 drivers/jtag/jtag.c
1a7d120a Oleksandr Shamray 2017-10-30 46
1a7d120a Oleksandr Shamray 2017-10-30 47 static long jtag_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
1a7d120a Oleksandr Shamray 2017-10-30 48 {
1a7d120a Oleksandr Shamray 2017-10-30 49 struct jtag *jtag = file->private_data;
1a7d120a Oleksandr Shamray 2017-10-30 50 struct jtag_run_test_idle idle;
1a7d120a Oleksandr Shamray 2017-10-30 51 struct jtag_xfer xfer;
1a7d120a Oleksandr Shamray 2017-10-30 52 u8 *xfer_data;
1a7d120a Oleksandr Shamray 2017-10-30 53 u32 data_size;
1a7d120a Oleksandr Shamray 2017-10-30 54 u32 value;
1a7d120a Oleksandr Shamray 2017-10-30 55 int err;
1a7d120a Oleksandr Shamray 2017-10-30 56
1a7d120a Oleksandr Shamray 2017-10-30 57 if (!arg)
1a7d120a Oleksandr Shamray 2017-10-30 58 return -EINVAL;
1a7d120a Oleksandr Shamray 2017-10-30 59
1a7d120a Oleksandr Shamray 2017-10-30 60 switch (cmd) {
1a7d120a Oleksandr Shamray 2017-10-30 61 case JTAG_GIOCFREQ:
1a7d120a Oleksandr Shamray 2017-10-30 62
1a7d120a Oleksandr Shamray 2017-10-30 63 if (jtag->ops->freq_get)
1a7d120a Oleksandr Shamray 2017-10-30 64 err = jtag->ops->freq_get(jtag, &value);
1a7d120a Oleksandr Shamray 2017-10-30 65 else
1a7d120a Oleksandr Shamray 2017-10-30 66 err = -EOPNOTSUPP;
1a7d120a Oleksandr Shamray 2017-10-30 67 if (err)
1a7d120a Oleksandr Shamray 2017-10-30 68 break;
1a7d120a Oleksandr Shamray 2017-10-30 69
1a7d120a Oleksandr Shamray 2017-10-30 70 if (put_user(value, (__u32 *)arg))
1a7d120a Oleksandr Shamray 2017-10-30 71 err = -EFAULT;
1a7d120a Oleksandr Shamray 2017-10-30 72 break;
1a7d120a Oleksandr Shamray 2017-10-30 73
1a7d120a Oleksandr Shamray 2017-10-30 74 case JTAG_SIOCFREQ:
1a7d120a Oleksandr Shamray 2017-10-30 75 if (get_user(value, (__u32 *)arg))
1a7d120a Oleksandr Shamray 2017-10-30 76 return -EFAULT;
1a7d120a Oleksandr Shamray 2017-10-30 77 if (value == 0)
1a7d120a Oleksandr Shamray 2017-10-30 78 return -EINVAL;
1a7d120a Oleksandr Shamray 2017-10-30 79
1a7d120a Oleksandr Shamray 2017-10-30 80 if (jtag->ops->freq_set)
1a7d120a Oleksandr Shamray 2017-10-30 81 err = jtag->ops->freq_set(jtag, value);
1a7d120a Oleksandr Shamray 2017-10-30 82 else
1a7d120a Oleksandr Shamray 2017-10-30 83 err = -EOPNOTSUPP;
1a7d120a Oleksandr Shamray 2017-10-30 84 break;
1a7d120a Oleksandr Shamray 2017-10-30 85
1a7d120a Oleksandr Shamray 2017-10-30 86 case JTAG_IOCRUNTEST:
1a7d120a Oleksandr Shamray 2017-10-30 87 if (copy_from_user(&idle, (void *)arg,
1a7d120a Oleksandr Shamray 2017-10-30 88 sizeof(struct jtag_run_test_idle)))
1a7d120a Oleksandr Shamray 2017-10-30 89 return -EFAULT;
1a7d120a Oleksandr Shamray 2017-10-30 90
1a7d120a Oleksandr Shamray 2017-10-30 91 if (idle.mode > JTAG_XFER_SW_MODE)
1a7d120a Oleksandr Shamray 2017-10-30 92 return -EINVAL;
1a7d120a Oleksandr Shamray 2017-10-30 93
1a7d120a Oleksandr Shamray 2017-10-30 94 if (idle.endstate > JTAG_STATE_PAUSEDR)
1a7d120a Oleksandr Shamray 2017-10-30 95 return -EINVAL;
1a7d120a Oleksandr Shamray 2017-10-30 96
1a7d120a Oleksandr Shamray 2017-10-30 97 if (jtag->ops->idle)
1a7d120a Oleksandr Shamray 2017-10-30 98 err = jtag->ops->idle(jtag, &idle);
1a7d120a Oleksandr Shamray 2017-10-30 99 else
1a7d120a Oleksandr Shamray 2017-10-30 100 err = -EOPNOTSUPP;
1a7d120a Oleksandr Shamray 2017-10-30 101 break;
1a7d120a Oleksandr Shamray 2017-10-30 102
1a7d120a Oleksandr Shamray 2017-10-30 103 case JTAG_IOCXFER:
1a7d120a Oleksandr Shamray 2017-10-30 104 if (copy_from_user(&xfer, (void *)arg,
1a7d120a Oleksandr Shamray 2017-10-30 105 sizeof(struct jtag_xfer)))
1a7d120a Oleksandr Shamray 2017-10-30 106 return -EFAULT;
1a7d120a Oleksandr Shamray 2017-10-30 107
1a7d120a Oleksandr Shamray 2017-10-30 108 if (xfer.length >= JTAG_MAX_XFER_DATA_LEN)
1a7d120a Oleksandr Shamray 2017-10-30 109 return -EINVAL;
1a7d120a Oleksandr Shamray 2017-10-30 110
1a7d120a Oleksandr Shamray 2017-10-30 111 if (xfer.mode > JTAG_XFER_SW_MODE)
1a7d120a Oleksandr Shamray 2017-10-30 112 return -EINVAL;
1a7d120a Oleksandr Shamray 2017-10-30 113
1a7d120a Oleksandr Shamray 2017-10-30 114 if (xfer.type > JTAG_SDR_XFER)
1a7d120a Oleksandr Shamray 2017-10-30 115 return -EINVAL;
1a7d120a Oleksandr Shamray 2017-10-30 116
1a7d120a Oleksandr Shamray 2017-10-30 117 if (xfer.direction > JTAG_WRITE_XFER)
1a7d120a Oleksandr Shamray 2017-10-30 118 return -EINVAL;
1a7d120a Oleksandr Shamray 2017-10-30 119
1a7d120a Oleksandr Shamray 2017-10-30 120 if (xfer.endstate > JTAG_STATE_PAUSEDR)
1a7d120a Oleksandr Shamray 2017-10-30 121 return -EINVAL;
1a7d120a Oleksandr Shamray 2017-10-30 122
1a7d120a Oleksandr Shamray 2017-10-30 123 data_size = DIV_ROUND_UP(xfer.length, BITS_PER_BYTE);
1a7d120a Oleksandr Shamray 2017-10-30 124 xfer_data = memdup_user(u64_to_user_ptr(xfer.tdio), data_size);
1a7d120a Oleksandr Shamray 2017-10-30 125
1a7d120a Oleksandr Shamray 2017-10-30 126 if (!xfer_data)
1a7d120a Oleksandr Shamray 2017-10-30 127 return -EFAULT;
1a7d120a Oleksandr Shamray 2017-10-30 128
1a7d120a Oleksandr Shamray 2017-10-30 129 if (jtag->ops->xfer) {
1a7d120a Oleksandr Shamray 2017-10-30 130 err = jtag->ops->xfer(jtag, &xfer, xfer_data);
1a7d120a Oleksandr Shamray 2017-10-30 131 } else {
1a7d120a Oleksandr Shamray 2017-10-30 132 kfree(xfer_data);
1a7d120a Oleksandr Shamray 2017-10-30 133 return -EOPNOTSUPP;
1a7d120a Oleksandr Shamray 2017-10-30 134 }
1a7d120a Oleksandr Shamray 2017-10-30 135
1a7d120a Oleksandr Shamray 2017-10-30 136 if (err) {
1a7d120a Oleksandr Shamray 2017-10-30 137 return -EFAULT;
1a7d120a Oleksandr Shamray 2017-10-30 @138 kfree(xfer_data);
1a7d120a Oleksandr Shamray 2017-10-30 139 }
1a7d120a Oleksandr Shamray 2017-10-30 140
1a7d120a Oleksandr Shamray 2017-10-30 141 err = copy_to_user(u64_to_user_ptr(xfer.tdio),
1a7d120a Oleksandr Shamray 2017-10-30 @142 (void *)(xfer_data), data_size);
1a7d120a Oleksandr Shamray 2017-10-30 143
1a7d120a Oleksandr Shamray 2017-10-30 144 if (err) {
1a7d120a Oleksandr Shamray 2017-10-30 145 kfree(xfer_data);
1a7d120a Oleksandr Shamray 2017-10-30 146 return -EFAULT;
1a7d120a Oleksandr Shamray 2017-10-30 147 }
1a7d120a Oleksandr Shamray 2017-10-30 148
1a7d120a Oleksandr Shamray 2017-10-30 149 kfree(xfer_data);
1a7d120a Oleksandr Shamray 2017-10-30 150 if (copy_to_user((void *)arg, &xfer, sizeof(struct jtag_xfer)))
1a7d120a Oleksandr Shamray 2017-10-30 151 return -EFAULT;
1a7d120a Oleksandr Shamray 2017-10-30 152 break;
1a7d120a Oleksandr Shamray 2017-10-30 153
1a7d120a Oleksandr Shamray 2017-10-30 154 case JTAG_GIOCSTATUS:
1a7d120a Oleksandr Shamray 2017-10-30 155 if (jtag->ops->status_get)
1a7d120a Oleksandr Shamray 2017-10-30 156 err = jtag->ops->status_get(jtag, &value);
1a7d120a Oleksandr Shamray 2017-10-30 157 else
1a7d120a Oleksandr Shamray 2017-10-30 158 err = -EOPNOTSUPP;
1a7d120a Oleksandr Shamray 2017-10-30 159 if (err)
1a7d120a Oleksandr Shamray 2017-10-30 160 break;
1a7d120a Oleksandr Shamray 2017-10-30 161
1a7d120a Oleksandr Shamray 2017-10-30 162 err = put_user(value, (__u32 *)arg);
1a7d120a Oleksandr Shamray 2017-10-30 163 if (err)
1a7d120a Oleksandr Shamray 2017-10-30 164 err = -EFAULT;
1a7d120a Oleksandr Shamray 2017-10-30 165 break;
1a7d120a Oleksandr Shamray 2017-10-30 166
1a7d120a Oleksandr Shamray 2017-10-30 167 default:
1a7d120a Oleksandr Shamray 2017-10-30 168 return -EINVAL;
1a7d120a Oleksandr Shamray 2017-10-30 169 }
1a7d120a Oleksandr Shamray 2017-10-30 170 return err;
1a7d120a Oleksandr Shamray 2017-10-30 171 }
1a7d120a Oleksandr Shamray 2017-10-30 172
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
^ permalink raw reply
* Re: [RFC PATCH] serial: 8250, redirect IRQ processing to kthread
From: Denys Zagorui @ 2017-11-02 12:11 UTC (permalink / raw)
To: gregkh, jslaby; +Cc: linux-serial, linux-kernel
In-Reply-To: <20171031141746.18720-1-dzagorui@cisco.com>
Hi,
There is known issue that annoyed people at least
a decade during using virtual machines by printing
many of this:
"too much work for irq.."
There were some workarounds:
- serial: 8250, increase PASS_LIMIT
e7328ae1848966181a7ac47e8ae6cddbd2cf55f3
- serial: 8250, disable "too much work" messages
f4f653e9875e573860e783fecbebde284a8626f5
Last one was reverted later
12de375ec493ab1767d4a07dde823e63ae5edc21
So maybe we should redirect IRQ processing to
kthread and make this process more friendly for
other by rescheduling sometimes.
Best Regards,
Denys
On 10/31/2017 04:17 PM, Denys Zagorui wrote:
> Some serial 8250 devices may work with very high speed.
> While was using QEMU KVM was observed speed
> 1..100 Mbit/sec, it fully depends at host machine.
> It may affects on responsiveness of system due a cpu
> would be spinning in 8250 driver at burst. So added
> opportunity to put this processing in kthread.
>
> Signed-off-by: Denys Zagorui <dzagorui@cisco.com>
> ---
> drivers/tty/serial/8250/8250_core.c | 29 +++++++++++++++++++++++++++++
> drivers/tty/serial/8250/8250_port.c | 10 ++++++++++
> drivers/tty/serial/8250/Kconfig | 10 ++++++++++
> 3 files changed, 49 insertions(+)
>
> diff --git a/drivers/tty/serial/8250/8250_core.c b/drivers/tty/serial/8250/8250_core.c
> index 1aab3010fbfa..7b498d2e882b 100644
> --- a/drivers/tty/serial/8250/8250_core.c
> +++ b/drivers/tty/serial/8250/8250_core.c
> @@ -58,7 +58,11 @@ static struct uart_driver serial8250_reg;
>
> static unsigned int skip_txen_test; /* force skip of txen test at init time */
>
> +#ifdef CONFIG_SERIAL_8250_THREADED_IRQ
> +#define PASS_LIMIT 32
> +#else
> #define PASS_LIMIT 512
> +#endif
>
> #include <asm/serial.h>
> /*
> @@ -135,10 +139,16 @@ static irqreturn_t serial8250_interrupt(int irq, void *dev_id)
> l = l->next;
>
> if (l == i->head && pass_counter++ > PASS_LIMIT) {
> +#ifdef CONFIG_SERIAL_8250_THREADED_IRQ
> + cond_resched();
> + pass_counter = 0;
> +#else
> /* If we hit this, we're dead. */
> printk_ratelimited(KERN_ERR
> "serial8250: too much work for irq%d\n", irq);
> break;
> +
> +#endif
> }
> } while (l != end);
>
> @@ -146,9 +156,23 @@ static irqreturn_t serial8250_interrupt(int irq, void *dev_id)
>
> pr_debug("%s(%d): end\n", __func__, irq);
>
> +#ifdef CONFIG_SERIAL_8250_THREADED_IRQ
> + enable_irq(i->irq);
> +#endif
> return IRQ_RETVAL(handled);
> }
>
> +#ifdef CONFIG_SERIAL_8250_THREADED_IRQ
> +static irqreturn_t serial8250_hard_irq(int irq, void *dev_id)
> +{
> + struct irq_info *i = dev_id;
> +
> + disable_irq_nosync(i->irq);
> +
> + return IRQ_WAKE_THREAD;
> +}
> +#endif
> +
> /*
> * To support ISA shared interrupts, we need to have one interrupt
> * handler that ensures that the IRQ line has been deasserted
> @@ -217,8 +241,13 @@ static int serial_link_irq_chain(struct uart_8250_port *up)
> i->head = &up->list;
> spin_unlock_irq(&i->lock);
> irq_flags |= up->port.irqflags;
> +#ifdef CONFIG_SERIAL_8250_THREADED_IRQ
> + ret = request_threaded_irq(up->port.irq, serial8250_hard_irq,
> + serial8250_interrupt, irq_flags, up->port.name, i);
> +#else
> ret = request_irq(up->port.irq, serial8250_interrupt,
> irq_flags, up->port.name, i);
> +#endif
> if (ret < 0)
> serial_do_unlink(i, up);
> }
> diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c
> index a5fe0e66c607..16e647473c4d 100644
> --- a/drivers/tty/serial/8250/8250_port.c
> +++ b/drivers/tty/serial/8250/8250_port.c
> @@ -1827,13 +1827,19 @@ static bool handle_rx_dma(struct uart_8250_port *up, unsigned int iir)
> int serial8250_handle_irq(struct uart_port *port, unsigned int iir)
> {
> unsigned char status;
> +#ifndef CONFIG_SERIAL_8250_THREADED_IRQ
> unsigned long flags;
> +#endif
> struct uart_8250_port *up = up_to_u8250p(port);
>
> if (iir & UART_IIR_NO_INT)
> return 0;
>
> +#ifdef CONFIG_SERIAL_8250_THREADED_IRQ
> + spin_lock(&port->lock);
> +#else
> spin_lock_irqsave(&port->lock, flags);
> +#endif
>
> status = serial_port_in(port, UART_LSR);
>
> @@ -1845,7 +1851,11 @@ int serial8250_handle_irq(struct uart_port *port, unsigned int iir)
> if ((!up->dma || up->dma->tx_err) && (status & UART_LSR_THRE))
> serial8250_tx_chars(up);
>
> +#ifdef CONFIG_SERIAL_8250_THREADED_IRQ
> + spin_unlock(&port->lock);
> +#else
> spin_unlock_irqrestore(&port->lock, flags);
> +#endif
> return 1;
> }
> EXPORT_SYMBOL_GPL(serial8250_handle_irq);
> diff --git a/drivers/tty/serial/8250/Kconfig b/drivers/tty/serial/8250/Kconfig
> index a1161ec0256f..58a0f324cbea 100644
> --- a/drivers/tty/serial/8250/Kconfig
> +++ b/drivers/tty/serial/8250/Kconfig
> @@ -202,6 +202,16 @@ config SERIAL_8250_MANY_PORTS
> say N here to save some memory. You can also say Y if you have an
> "intelligent" multiport card such as Cyclades, Digiboards, etc.
>
> +config SERIAL_8250_THREADED_IRQ
> + bool "Make serial 8250 interrupt processing threaded"
> + depends on SERIAL_8250
> + help
> + Some virtual devices can work at very high speed (like QEMU KVM
> + serial 8250). So when burst happens this processing will capture
> + cpu.
> + Say Y if you want to make processing more friendly for others
> + processes.
> +
> #
> # Multi-port serial cards
> #
^ permalink raw reply
* [PATCH] serial: mvebu-uart: drop incorrect memset
From: Arnd Bergmann @ 2017-11-02 11:34 UTC (permalink / raw)
To: Greg Kroah-Hartman, Jiri Slaby
Cc: Arnd Bergmann, Miquel Raynal, Gregory CLEMENT, Allen Yan,
linux-serial, linux-kernel
gcc points out that the length passed into memset here is wrong:
drivers/tty/serial/mvebu-uart.c: In function 'mvebu_uart_probe':
arch/x86/include/asm/string_32.h:324:29: error: 'memset' used with length equal to number of elements without multiplication by element size [-Werror=memset-elt-size]
Moreover, the structure was allocated with kzalloc a few lines earlier,
so that memset is also unnecessary. Let's drop it to shut up the
compiler warning.
Fixes: 95f787685a22 ("serial: mvebu-uart: dissociate RX and TX interrupts")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/tty/serial/mvebu-uart.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/tty/serial/mvebu-uart.c b/drivers/tty/serial/mvebu-uart.c
index 16b0a5aa14e2..85eb5c86d177 100644
--- a/drivers/tty/serial/mvebu-uart.c
+++ b/drivers/tty/serial/mvebu-uart.c
@@ -817,7 +817,6 @@ static int mvebu_uart_probe(struct platform_device *pdev)
}
/* Manage interrupts */
- memset(mvuart->irq, 0, UART_IRQ_COUNT);
if (platform_irq_count(pdev) == 1) {
/* Old bindings: no name on the single unamed UART0 IRQ */
irq = platform_get_irq(pdev, 0);
--
2.9.0
^ permalink raw reply related
* [PATCH] serial: sh-sci: Fix unlocked access to SCSCR register
From: Simon Horman @ 2017-11-02 10:14 UTC (permalink / raw)
To: Greg Kroah-Hartman, linux-serial
Cc: Geert Uytterhoeven, Magnus Damm, linux-renesas-soc, Wolfram Sang
From: Takatoshi Akiyama <takatoshi.akiyama.kj@ps.hitachi-solutions.com>
The SCSCR register access in sci_break_ctl() is not locked.
sci_start_tx() and sci_set_termios() changes the SCSCR register,
but does not lock sci_port.
Therefore, this patch adds lock during register access.
Also, remove the log output that leads to a double lock.
Some analysis of where locks are not taken is as follows.
It appears that the lock is not taken in:
- sci_start_tx(), sci_stop_tx() as this is installed as a callback.
And all callers of the callback take the lock.
- start_rx as callers take the lock.
- stop_rx. this is both installed as a callback and called directly.
In both cases the caller takes the lock.
Signed-off-by: Takatoshi Akiyama <takatoshi.akiyama.kj@ps.hitachi-solutions.com>
Signed-off-by: Takeshi Kihara <takeshi.kihara.df@renesas.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
v2 [Simon Horman]
* Also take lock around call to sci_start_rx() in sci_rx_dma_release()
* Enhanced changelog to describe where locks are not taken and why.
v1 [Takatoshi Akiyama]
This is a patch from the Gen3 3.3.2 BSP.
Geert, please consider it for mainline.
---
drivers/tty/serial/sh-sci.c | 25 ++++++++++++++++---------
1 file changed, 16 insertions(+), 9 deletions(-)
diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
index d5714deaaf92..d5e07ddae523 100644
--- a/drivers/tty/serial/sh-sci.c
+++ b/drivers/tty/serial/sh-sci.c
@@ -1226,8 +1226,11 @@ static void sci_rx_dma_release(struct sci_port *s, bool enable_pio)
dma_free_coherent(chan->device->dev, s->buf_len_rx * 2, s->rx_buf[0],
sg_dma_address(&s->sg_rx[0]));
dma_release_channel(chan);
- if (enable_pio)
+ if (enable_pio) {
+ spin_lock_irqsave(&port->lock, flags);
sci_start_rx(port);
+ spin_unlock_irqrestore(&port->lock, flags);
+ }
}
static void sci_dma_rx_complete(void *arg)
@@ -1294,8 +1297,11 @@ static void sci_tx_dma_release(struct sci_port *s, bool enable_pio)
dma_unmap_single(chan->device->dev, s->tx_dma_addr, UART_XMIT_SIZE,
DMA_TO_DEVICE);
dma_release_channel(chan);
- if (enable_pio)
+ if (enable_pio) {
+ spin_lock_irqsave(&port->lock, flags);
sci_start_tx(port);
+ spin_unlock_irqrestore(&port->lock, flags);
+ }
}
static void sci_submit_rx(struct sci_port *s)
@@ -2004,6 +2010,7 @@ static void sci_enable_ms(struct uart_port *port)
static void sci_break_ctl(struct uart_port *port, int break_state)
{
unsigned short scscr, scsptr;
+ unsigned long flags;
/* check wheter the port has SCSPTR */
if (!sci_getreg(port, SCSPTR)->size) {
@@ -2014,6 +2021,7 @@ static void sci_break_ctl(struct uart_port *port, int break_state)
return;
}
+ spin_lock_irqsave(&port->lock, flags);
scsptr = serial_port_in(port, SCSPTR);
scscr = serial_port_in(port, SCSCR);
@@ -2027,6 +2035,7 @@ static void sci_break_ctl(struct uart_port *port, int break_state)
serial_port_out(port, SCSPTR, scsptr);
serial_port_out(port, SCSCR, scscr);
+ spin_unlock_irqrestore(&port->lock, flags);
}
static int sci_startup(struct uart_port *port)
@@ -2255,6 +2264,7 @@ static void sci_set_termios(struct uart_port *port, struct ktermios *termios,
int min_err = INT_MAX, err;
unsigned long max_freq = 0;
int best_clk = -1;
+ unsigned long flags;
if ((termios->c_cflag & CSIZE) == CS7)
smr_val |= SCSMR_CHR;
@@ -2364,6 +2374,8 @@ static void sci_set_termios(struct uart_port *port, struct ktermios *termios,
serial_port_out(port, SCCKS, sccks);
}
+ spin_lock_irqsave(&port->lock, flags);
+
sci_reset(port);
uart_update_timeout(port, termios->c_cflag, baud);
@@ -2381,9 +2393,6 @@ static void sci_set_termios(struct uart_port *port, struct ktermios *termios,
case 27: smr_val |= SCSMR_SRC_27; break;
}
smr_val |= cks;
- dev_dbg(port->dev,
- "SCR 0x%x SMR 0x%x BRR %u CKS 0x%x DL %u SRR %u\n",
- scr_val, smr_val, brr, sccks, dl, srr);
serial_port_out(port, SCSCR, scr_val | s->hscif_tot);
serial_port_out(port, SCSMR, smr_val);
serial_port_out(port, SCBRR, brr);
@@ -2397,7 +2406,6 @@ static void sci_set_termios(struct uart_port *port, struct ktermios *termios,
scr_val = s->cfg->scscr & (SCSCR_CKE1 | SCSCR_CKE0);
smr_val |= serial_port_in(port, SCSMR) &
(SCSMR_CKEDG | SCSMR_SRC_MASK | SCSMR_CKS);
- dev_dbg(port->dev, "SCR 0x%x SMR 0x%x\n", scr_val, smr_val);
serial_port_out(port, SCSCR, scr_val | s->hscif_tot);
serial_port_out(port, SCSMR, smr_val);
}
@@ -2434,7 +2442,6 @@ static void sci_set_termios(struct uart_port *port, struct ktermios *termios,
scr_val |= SCSCR_RE | SCSCR_TE |
(s->cfg->scscr & ~(SCSCR_CKE1 | SCSCR_CKE0));
- dev_dbg(port->dev, "SCSCR 0x%x\n", scr_val);
serial_port_out(port, SCSCR, scr_val | s->hscif_tot);
if ((srr + 1 == 5) &&
(port->type == PORT_SCIFA || port->type == PORT_SCIFB)) {
@@ -2481,8 +2488,6 @@ static void sci_set_termios(struct uart_port *port, struct ktermios *termios,
s->rx_frame = (100 * bits * HZ) / (baud / 10);
#ifdef CONFIG_SERIAL_SH_SCI_DMA
s->rx_timeout = DIV_ROUND_UP(s->buf_len_rx * 2 * s->rx_frame, 1000);
- dev_dbg(port->dev, "DMA Rx t-out %ums, tty t-out %u jiffies\n",
- s->rx_timeout * 1000 / HZ, port->timeout);
if (s->rx_timeout < msecs_to_jiffies(20))
s->rx_timeout = msecs_to_jiffies(20);
#endif
@@ -2490,6 +2495,8 @@ static void sci_set_termios(struct uart_port *port, struct ktermios *termios,
if ((termios->c_cflag & CREAD) != 0)
sci_start_rx(port);
+ spin_unlock_irqrestore(&port->lock, flags);
+
sci_port_disable(s);
if (UART_ENABLE_MS(port, termios->c_cflag))
--
2.11.0
^ permalink raw reply related
* Re: [PATCH/RFC] serial: sh-sci: Fix unlocked access to SCSCR register
From: Simon Horman @ 2017-11-02 10:10 UTC (permalink / raw)
To: Wolfram Sang
Cc: Geert Uytterhoeven, Wolfram Sang, Magnus Damm, linux-serial,
linux-renesas-soc
In-Reply-To: <20161107155209.GC5140@katana>
On Mon, Nov 07, 2016 at 04:52:09PM +0100, Wolfram Sang wrote:
> On Mon, Nov 07, 2016 at 04:42:53PM +0100, Simon Horman wrote:
> > From: Takatoshi Akiyama <takatoshi.akiyama.kj@ps.hitachi-solutions.com>
> >
> > The SCSCR register access in sci_break_ctl() is not locked.
> >
> > sci_start_tx() and sci_set_termios() changes the SCSCR register,
> > but does not lock sci_port.
>
> Maybe naive question: Shouldn't stop_tx and/or (start|stop)_rx be
> protected, too? They change SCSCR as well?
In the case of stop_tx, this is installed as a callback where
the caller takes the lock.
In the case of start_rx, I think the lock should be taken in
sci_rx_dma_release() as other callers already take the lock.
In the case of stop_rx, this is both installed as a callback and
called directly. In both cases the caller takes the lock.
>
> > Therefore, this patch adds lock during register access.
> >
> > Also, remove the log output that leads to a double lock.
> >
> > Signed-off-by: Takatoshi Akiyama <takatoshi.akiyama.kj@ps.hitachi-solutions.com>
> > Signed-off-by: Takeshi Kihara <takeshi.kihara.df@renesas.com>
> > Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
^ permalink raw reply
* Re: [patch v10 2/4] drivers: jtag: Add Aspeed SoC 24xx and 25xx families JTAG master driver
From: kbuild test robot @ 2017-11-02 0:58 UTC (permalink / raw)
Cc: kbuild-all, gregkh, arnd, linux-kernel, linux-arm-kernel,
devicetree, openbmc, joel, jiri, tklauser, linux-serial, mec,
vadimp, system-sw-low-level, robh+dt, openocd-devel-owner,
linux-api, davem, mchehab, Oleksandr Shamray, Jiri Pirko
In-Reply-To: <1509365528-28803-3-git-send-email-oleksandrs@mellanox.com>
[-- Attachment #1: Type: text/plain, Size: 1431 bytes --]
Hi Oleksandr,
I love your patch! Perhaps something to improve:
[auto build test WARNING on linus/master]
[also build test WARNING on v4.14-rc7]
[cannot apply to next-20171018]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Oleksandr-Shamray/JTAG-driver-introduction/20171102-045624
config: m68k-allyesconfig (attached as .config)
compiler: m68k-linux-gcc (GCC) 4.9.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=m68k
All warnings (new ones prefixed by >>):
>> drivers//jtag/jtag-aspeed.c:704:1: warning: initialization from incompatible pointer type
};
^
drivers//jtag/jtag-aspeed.c:704:1: warning: (near initialization for 'aspeed_jtag_ops.xfer')
vim +704 drivers//jtag/jtag-aspeed.c
697
698 static const struct jtag_ops aspeed_jtag_ops = {
699 .freq_get = aspeed_jtag_freq_get,
700 .freq_set = aspeed_jtag_freq_set,
701 .status_get = aspeed_jtag_status_get,
702 .idle = aspeed_jtag_idle,
703 .xfer = aspeed_jtag_xfer
> 704 };
705
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 44335 bytes --]
^ permalink raw reply
* Re: [PATCH v10 1/5] serdev: Make .remove in struct serdev_device_driver optional
From: Rob Herring @ 2017-11-01 23:48 UTC (permalink / raw)
To: Andrey Smirnov
Cc: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org,
Chris Healy, Guenter Roeck, Lucas Stach, Nikita Yushchenko,
Lee Jones, Greg Kroah-Hartman, Pavel Machek, Andy Shevchenko,
Johan Hovold, Sebastian Reichel
In-Reply-To: <20171031163656.24552-2-andrew.smirnov@gmail.com>
On Tue, Oct 31, 2017 at 11:36 AM, Andrey Smirnov
<andrew.smirnov@gmail.com> wrote:
> Using devres infrastructure it is possible to write a serdev driver
> that doesn't have any code that needs to be called as a part of
> .remove. Add code to make .remove optional.
>
> Cc: linux-kernel@vger.kernel.org
> Cc: linux-serial@vger.kernel.org
> Cc: Rob Herring <robh@kernel.org>
> Cc: cphealy@gmail.com
> Cc: Guenter Roeck <linux@roeck-us.net>
> Cc: Lucas Stach <l.stach@pengutronix.de>
> Cc: Nikita Yushchenko <nikita.yoush@cogentembedded.com>
> Cc: Lee Jones <lee.jones@linaro.org>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: Pavel Machek <pavel@ucw.cz>
> Cc: Andy Shevchenko <andy.shevchenko@gmail.com>
> Cc: Johan Hovold <johan@kernel.org>
> Cc: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
> Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
> Reviewed-by: Guenter Roeck <linux@roeck-us.net>
> Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
> ---
> drivers/tty/serdev/core.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
Acked-by: Rob Herring <robh@kernel.org>
^ permalink raw reply
* Re: [PATCH v10 2/5] serdev: Introduce devm_serdev_device_open()
From: Rob Herring @ 2017-11-01 23:48 UTC (permalink / raw)
To: Andrey Smirnov
Cc: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org,
Chris Healy, Guenter Roeck, Lucas Stach, Nikita Yushchenko,
Lee Jones, Greg Kroah-Hartman, Pavel Machek, Andy Shevchenko,
Johan Hovold, Sebastian Reichel
In-Reply-To: <20171031163656.24552-3-andrew.smirnov@gmail.com>
On Tue, Oct 31, 2017 at 11:36 AM, Andrey Smirnov
<andrew.smirnov@gmail.com> wrote:
> Add code implementing managed version of serdev_device_open() for
> serdev device drivers that "open" the device during driver's lifecycle
> only once (e.g. opened in .probe() and closed in .remove()).
>
> Cc: linux-kernel@vger.kernel.org
> Cc: linux-serial@vger.kernel.org
> Cc: Rob Herring <robh@kernel.org>
> Cc: cphealy@gmail.com
> Cc: Guenter Roeck <linux@roeck-us.net>
> Cc: Lucas Stach <l.stach@pengutronix.de>
> Cc: Nikita Yushchenko <nikita.yoush@cogentembedded.com>
> Cc: Lee Jones <lee.jones@linaro.org>
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: Pavel Machek <pavel@ucw.cz>
> Cc: Andy Shevchenko <andy.shevchenko@gmail.com>
> Cc: Johan Hovold <johan@kernel.org>
> Cc: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
> Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
> Reviewed-by: Guenter Roeck <linux@roeck-us.net>
> Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
> ---
> Documentation/driver-model/devres.txt | 3 +++
> drivers/tty/serdev/core.c | 27 +++++++++++++++++++++++++++
> include/linux/serdev.h | 1 +
> 3 files changed, 31 insertions(+)
Acked-by: Rob Herring <robh@kernel.org>
^ permalink raw reply
* Re: [patch v10 2/4] drivers: jtag: Add Aspeed SoC 24xx and 25xx families JTAG master driver
From: kbuild test robot @ 2017-11-01 22:14 UTC (permalink / raw)
Cc: kbuild-all-JC7UmRfGjtg, gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r,
arnd-r2nGTMty4D4, linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
devicetree-u79uwXL29TY76Z2rM5mHXA, openbmc-uLR06cmDAlY/bJ5BZ2RsiQ,
joel-U3u1mxZcP9KHXe+LvDLADg, jiri-rHqAuBHg3fBzbRFIqnYvSA,
tklauser-93Khv+1bN0NyDzI6CaY1VQ,
linux-serial-u79uwXL29TY76Z2rM5mHXA, mec-WqBc5aa1uDFeoWH0uzbU5w,
vadimp-VPRAkNaXOzVWk0Htik3J/w,
system-sw-low-level-VPRAkNaXOzVWk0Htik3J/w,
robh+dt-DgEjT+Ai2ygdnm+yROfE0A,
openocd-devel-owner-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
linux-api-u79uwXL29TY76Z2rM5mHXA, davem-fT/PcQaiUtIeIZ0/mPfg9Q,
mchehab-DgEjT+Ai2ygdnm+yROfE0A, Oleksandr Shamray, Jiri Pirko
In-Reply-To: <1509365528-28803-3-git-send-email-oleksandrs-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 1558 bytes --]
Hi Oleksandr,
I love your patch! Yet something to improve:
[auto build test ERROR on linus/master]
[also build test ERROR on v4.14-rc7]
[cannot apply to next-20171018]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Oleksandr-Shamray/JTAG-driver-introduction/20171102-045624
config: blackfin-allyesconfig (attached as .config)
compiler: bfin-uclinux-gcc (GCC) 6.2.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=blackfin
All errors (new ones prefixed by >>):
>> drivers//jtag/jtag-aspeed.c:703:10: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
.xfer = aspeed_jtag_xfer
^~~~~~~~~~~~~~~~
drivers//jtag/jtag-aspeed.c:703:10: note: (near initialization for 'aspeed_jtag_ops.xfer')
cc1: some warnings being treated as errors
vim +703 drivers//jtag/jtag-aspeed.c
697
698 static const struct jtag_ops aspeed_jtag_ops = {
699 .freq_get = aspeed_jtag_freq_get,
700 .freq_set = aspeed_jtag_freq_set,
701 .status_get = aspeed_jtag_status_get,
702 .idle = aspeed_jtag_idle,
> 703 .xfer = aspeed_jtag_xfer
704 };
705
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 46048 bytes --]
^ permalink raw reply
* Re: [patch v10 1/4] drivers: jtag: Add JTAG core driver
From: kbuild test robot @ 2017-11-01 21:43 UTC (permalink / raw)
Cc: kbuild-all, gregkh, arnd, linux-kernel, linux-arm-kernel,
devicetree, openbmc, joel, jiri, tklauser, linux-serial, mec,
vadimp, system-sw-low-level, robh+dt, openocd-devel-owner,
linux-api, davem, mchehab, Oleksandr Shamray, Jiri Pirko
In-Reply-To: <1509365528-28803-2-git-send-email-oleksandrs@mellanox.com>
[-- Attachment #1: Type: text/plain, Size: 4588 bytes --]
Hi Oleksandr,
I love your patch! Yet something to improve:
[auto build test ERROR on linus/master]
[also build test ERROR on v4.14-rc7]
[cannot apply to next-20171018]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Oleksandr-Shamray/JTAG-driver-introduction/20171102-045624
config: blackfin-allyesconfig (attached as .config)
compiler: bfin-uclinux-gcc (GCC) 6.2.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=blackfin
All errors (new ones prefixed by >>):
drivers/jtag/jtag.c: In function 'jtag_ioctl':
>> drivers/jtag/jtag.c:130:10: error: too many arguments to function 'jtag->ops->xfer'
err = jtag->ops->xfer(jtag, &xfer, xfer_data);
^~~~
At top level:
drivers/jtag/jtag.c:42:21: warning: 'jtag_class' defined but not used [-Wunused-variable]
static struct class jtag_class = {
^~~~~~~~~~
vim +130 drivers/jtag/jtag.c
46
47 static long jtag_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
48 {
49 struct jtag *jtag = file->private_data;
50 struct jtag_run_test_idle idle;
51 struct jtag_xfer xfer;
52 u8 *xfer_data;
53 u32 data_size;
54 u32 value;
55 int err;
56
57 if (!arg)
58 return -EINVAL;
59
60 switch (cmd) {
61 case JTAG_GIOCFREQ:
62
63 if (jtag->ops->freq_get)
64 err = jtag->ops->freq_get(jtag, &value);
65 else
66 err = -EOPNOTSUPP;
67 if (err)
68 break;
69
70 if (put_user(value, (__u32 *)arg))
71 err = -EFAULT;
72 break;
73
74 case JTAG_SIOCFREQ:
75 if (get_user(value, (__u32 *)arg))
76 return -EFAULT;
77 if (value == 0)
78 return -EINVAL;
79
80 if (jtag->ops->freq_set)
81 err = jtag->ops->freq_set(jtag, value);
82 else
83 err = -EOPNOTSUPP;
84 break;
85
86 case JTAG_IOCRUNTEST:
87 if (copy_from_user(&idle, (void *)arg,
88 sizeof(struct jtag_run_test_idle)))
89 return -EFAULT;
90
91 if (idle.mode > JTAG_XFER_SW_MODE)
92 return -EINVAL;
93
94 if (idle.endstate > JTAG_STATE_PAUSEDR)
95 return -EINVAL;
96
97 if (jtag->ops->idle)
98 err = jtag->ops->idle(jtag, &idle);
99 else
100 err = -EOPNOTSUPP;
101 break;
102
103 case JTAG_IOCXFER:
104 if (copy_from_user(&xfer, (void *)arg,
105 sizeof(struct jtag_xfer)))
106 return -EFAULT;
107
108 if (xfer.length >= JTAG_MAX_XFER_DATA_LEN)
109 return -EINVAL;
110
111 if (xfer.mode > JTAG_XFER_SW_MODE)
112 return -EINVAL;
113
114 if (xfer.type > JTAG_SDR_XFER)
115 return -EINVAL;
116
117 if (xfer.direction > JTAG_WRITE_XFER)
118 return -EINVAL;
119
120 if (xfer.endstate > JTAG_STATE_PAUSEDR)
121 return -EINVAL;
122
123 data_size = DIV_ROUND_UP(xfer.length, BITS_PER_BYTE);
124 xfer_data = memdup_user(u64_to_user_ptr(xfer.tdio), data_size);
125
126 if (!xfer_data)
127 return -EFAULT;
128
129 if (jtag->ops->xfer) {
> 130 err = jtag->ops->xfer(jtag, &xfer, xfer_data);
131 } else {
132 kfree(xfer_data);
133 return -EOPNOTSUPP;
134 }
135
136 if (err) {
137 return -EFAULT;
138 kfree(xfer_data);
139 }
140
141 err = copy_to_user(u64_to_user_ptr(xfer.tdio),
142 (void *)(xfer_data), data_size);
143
144 if (err) {
145 kfree(xfer_data);
146 return -EFAULT;
147 }
148
149 kfree(xfer_data);
150 if (copy_to_user((void *)arg, &xfer, sizeof(struct jtag_xfer)))
151 return -EFAULT;
152 break;
153
154 case JTAG_GIOCSTATUS:
155 if (jtag->ops->status_get)
156 err = jtag->ops->status_get(jtag, &value);
157 else
158 err = -EOPNOTSUPP;
159 if (err)
160 break;
161
162 err = put_user(value, (__u32 *)arg);
163 if (err)
164 err = -EFAULT;
165 break;
166
167 default:
168 return -EINVAL;
169 }
170 return err;
171 }
172
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 46042 bytes --]
^ permalink raw reply
* Re: [PATCH v3] dt-bindings: mvebu-uart: update documentation with extended UART
From: Rob Herring @ 2017-11-01 21:43 UTC (permalink / raw)
To: Miquel Raynal
Cc: Mark Rutland, Greg Kroah-Hartman, Antoine Tenart,
Thomas Petazzoni, Nadav Haklai, Wilson Ding,
devicetree-u79uwXL29TY76Z2rM5mHXA,
linux-serial-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <20171030142151.26213-1-miquel.raynal-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
On Mon, Oct 30, 2017 at 03:21:51PM +0100, Miquel Raynal wrote:
> Update the device tree binding documentation for the Marvell EBU UART,
> in order to allow describing the extended UART IP block, in addition to
> the already supported standard UART IP. This requires adding a new
> compatible string, the introduction of a clocks property, and extensions
> to the interrupts property.
>
> Signed-off-by: Miquel Raynal <miquel.raynal-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
> Reviewed-by: Gregory CLEMENT <gregory.clement-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
> ---
>
> Hi,
>
> This patch was part of a bigger series called "Support armada-37xx second
> UART port" and needed to be adapted.
>
> Changes since v2:
> - Removed the "status" from the examples.
> - Desbribed better the mandatory clock property.
>
> Thank you,
> Miquèl
>
> .../devicetree/bindings/serial/mvebu-uart.txt | 50 +++++++++++++++++++---
> 1 file changed, 45 insertions(+), 5 deletions(-)
Acked-by: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [patch v10 1/4] drivers: jtag: Add JTAG core driver
From: kbuild test robot @ 2017-11-01 21:34 UTC (permalink / raw)
Cc: kbuild-all, gregkh, arnd, linux-kernel, linux-arm-kernel,
devicetree, openbmc, joel, jiri, tklauser, linux-serial, mec,
vadimp, system-sw-low-level, robh+dt, openocd-devel-owner,
linux-api, davem, mchehab, Oleksandr Shamray, Jiri Pirko
In-Reply-To: <1509365528-28803-2-git-send-email-oleksandrs@mellanox.com>
[-- Attachment #1: Type: text/plain, Size: 871 bytes --]
Hi Oleksandr,
I love your patch! Perhaps something to improve:
[auto build test WARNING on linus/master]
[also build test WARNING on v4.14-rc7]
[cannot apply to next-20171018]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Oleksandr-Shamray/JTAG-driver-introduction/20171102-045624
config: i386-tinyconfig (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
# save the attached .config to linux build tree
make ARCH=i386
All warnings (new ones prefixed by >>):
>> ./usr/include/linux/jtag.h:74: found __[us]{8,16,32,64} type without #include <linux/types.h>
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 6687 bytes --]
^ permalink raw reply
* [PATCH] serial: imx: add hibernation support
From: Philipp Zabel @ 2017-11-01 12:51 UTC (permalink / raw)
To: linux-serial
Cc: Greg Kroah-Hartman, Jiri Slaby, Uwe Kleine-König,
linux-kernel, kernel, Philipp Zabel
During hibernation, freeze/thaw/restore dev_pm_ops are called instead of
suspend/resume. Hook up the hibernation ops. The _noirq parts are
identical, but suspend/resume are replaced with variants that do not
enable wakeup from i.MX UART. There is no need to restore register
contents in thaw_noirq.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
---
drivers/tty/serial/imx.c | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index dfeff3951f934..6bbe7dd58ac62 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -2346,11 +2346,39 @@ static int imx_serial_port_resume(struct device *dev)
return 0;
}
+static int imx_serial_port_freeze(struct device *dev)
+{
+ struct platform_device *pdev = to_platform_device(dev);
+ struct imx_port *sport = platform_get_drvdata(pdev);
+
+ uart_suspend_port(&imx_reg, &sport->port);
+
+ /* Needed to enable clock in suspend_noirq */
+ return clk_prepare(sport->clk_ipg);
+}
+
+static int imx_serial_port_thaw(struct device *dev)
+{
+ struct platform_device *pdev = to_platform_device(dev);
+ struct imx_port *sport = platform_get_drvdata(pdev);
+
+ uart_resume_port(&imx_reg, &sport->port);
+
+ clk_unprepare(sport->clk_ipg);
+
+ return 0;
+}
+
static const struct dev_pm_ops imx_serial_port_pm_ops = {
.suspend_noirq = imx_serial_port_suspend_noirq,
.resume_noirq = imx_serial_port_resume_noirq,
+ .freeze_noirq = imx_serial_port_suspend_noirq,
+ .restore_noirq = imx_serial_port_resume_noirq,
.suspend = imx_serial_port_suspend,
.resume = imx_serial_port_resume,
+ .freeze = imx_serial_port_freeze,
+ .thaw = imx_serial_port_thaw,
+ .restore = imx_serial_port_thaw,
};
static struct platform_driver serial_imx_driver = {
--
2.11.0
^ permalink raw reply related
* [PATCH] serial: core: remove redundant assignment to port
From: Colin King @ 2017-11-01 10:49 UTC (permalink / raw)
To: Greg Kroah-Hartman, Jiri Slaby, linux-serial
Cc: kernel-janitors, linux-kernel
From: Colin Ian King <colin.king@canonical.com>
The final assignment to port is never read, hence it is redundant
and can be removed. Also move the declaration of port to a more
local scope. Cleans up clang warning:
drivers/tty/serial/serial_core.c:1498:2: warning: Value stored
to 'port' is never read
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
drivers/tty/serial/serial_core.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
index f4e6c8662987..cdac01fe11ca 100644
--- a/drivers/tty/serial/serial_core.c
+++ b/drivers/tty/serial/serial_core.c
@@ -1482,10 +1482,10 @@ static void uart_set_termios(struct tty_struct *tty,
static void uart_close(struct tty_struct *tty, struct file *filp)
{
struct uart_state *state = tty->driver_data;
- struct tty_port *port;
if (!state) {
struct uart_driver *drv = tty->driver->driver_state;
+ struct tty_port *port;
state = drv->state + tty->index;
port = &state->port;
@@ -1495,7 +1495,6 @@ static void uart_close(struct tty_struct *tty, struct file *filp)
return;
}
- port = &state->port;
pr_debug("uart_close(%d) called\n", tty->index);
tty_port_close(tty->port, tty, filp);
--
2.14.1
^ permalink raw reply related
* [PATCH v10 2/5] serdev: Introduce devm_serdev_device_open()
From: Andrey Smirnov @ 2017-10-31 16:36 UTC (permalink / raw)
To: linux-kernel
Cc: Andrey Smirnov, linux-serial, Rob Herring, cphealy, Guenter Roeck,
Lucas Stach, Nikita Yushchenko, Lee Jones, Greg Kroah-Hartman,
Pavel Machek, Andy Shevchenko, Johan Hovold, Sebastian Reichel
In-Reply-To: <20171031163656.24552-1-andrew.smirnov@gmail.com>
Add code implementing managed version of serdev_device_open() for
serdev device drivers that "open" the device during driver's lifecycle
only once (e.g. opened in .probe() and closed in .remove()).
Cc: linux-kernel@vger.kernel.org
Cc: linux-serial@vger.kernel.org
Cc: Rob Herring <robh@kernel.org>
Cc: cphealy@gmail.com
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: Lucas Stach <l.stach@pengutronix.de>
Cc: Nikita Yushchenko <nikita.yoush@cogentembedded.com>
Cc: Lee Jones <lee.jones@linaro.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Johan Hovold <johan@kernel.org>
Cc: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
Documentation/driver-model/devres.txt | 3 +++
drivers/tty/serdev/core.c | 27 +++++++++++++++++++++++++++
include/linux/serdev.h | 1 +
3 files changed, 31 insertions(+)
diff --git a/Documentation/driver-model/devres.txt b/Documentation/driver-model/devres.txt
index 69f08c0f23a8..e9c6b5cfeec1 100644
--- a/Documentation/driver-model/devres.txt
+++ b/Documentation/driver-model/devres.txt
@@ -383,6 +383,9 @@ RESET
devm_reset_control_get()
devm_reset_controller_register()
+SERDEV
+ devm_serdev_device_open()
+
SLAVE DMA ENGINE
devm_acpi_dma_controller_register()
diff --git a/drivers/tty/serdev/core.c b/drivers/tty/serdev/core.c
index f500f6a2ca88..b3a785665c6f 100644
--- a/drivers/tty/serdev/core.c
+++ b/drivers/tty/serdev/core.c
@@ -116,6 +116,33 @@ void serdev_device_close(struct serdev_device *serdev)
}
EXPORT_SYMBOL_GPL(serdev_device_close);
+static void devm_serdev_device_release(struct device *dev, void *dr)
+{
+ serdev_device_close(*(struct serdev_device **)dr);
+}
+
+int devm_serdev_device_open(struct device *dev, struct serdev_device *serdev)
+{
+ struct serdev_device **dr;
+ int ret;
+
+ dr = devres_alloc(devm_serdev_device_release, sizeof(*dr), GFP_KERNEL);
+ if (!dr)
+ return -ENOMEM;
+
+ ret = serdev_device_open(serdev);
+ if (ret) {
+ devres_free(dr);
+ return ret;
+ }
+
+ *dr = serdev;
+ devres_add(dev, dr);
+
+ return ret;
+}
+EXPORT_SYMBOL_GPL(devm_serdev_device_open);
+
void serdev_device_write_wakeup(struct serdev_device *serdev)
{
complete(&serdev->write_comp);
diff --git a/include/linux/serdev.h b/include/linux/serdev.h
index e69402d4a8ae..9929063bd45d 100644
--- a/include/linux/serdev.h
+++ b/include/linux/serdev.h
@@ -193,6 +193,7 @@ static inline int serdev_controller_receive_buf(struct serdev_controller *ctrl,
int serdev_device_open(struct serdev_device *);
void serdev_device_close(struct serdev_device *);
+int devm_serdev_device_open(struct device *, struct serdev_device *);
unsigned int serdev_device_set_baudrate(struct serdev_device *, unsigned int);
void serdev_device_set_flow_control(struct serdev_device *, bool);
int serdev_device_write_buf(struct serdev_device *, const unsigned char *, size_t);
--
2.13.6
^ permalink raw reply related
* [PATCH v10 1/5] serdev: Make .remove in struct serdev_device_driver optional
From: Andrey Smirnov @ 2017-10-31 16:36 UTC (permalink / raw)
To: linux-kernel
Cc: Andrey Smirnov, linux-serial, Rob Herring, cphealy, Guenter Roeck,
Lucas Stach, Nikita Yushchenko, Lee Jones, Greg Kroah-Hartman,
Pavel Machek, Andy Shevchenko, Johan Hovold, Sebastian Reichel
In-Reply-To: <20171031163656.24552-1-andrew.smirnov@gmail.com>
Using devres infrastructure it is possible to write a serdev driver
that doesn't have any code that needs to be called as a part of
.remove. Add code to make .remove optional.
Cc: linux-kernel@vger.kernel.org
Cc: linux-serial@vger.kernel.org
Cc: Rob Herring <robh@kernel.org>
Cc: cphealy@gmail.com
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: Lucas Stach <l.stach@pengutronix.de>
Cc: Nikita Yushchenko <nikita.yoush@cogentembedded.com>
Cc: Lee Jones <lee.jones@linaro.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Johan Hovold <johan@kernel.org>
Cc: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
drivers/tty/serdev/core.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/tty/serdev/core.c b/drivers/tty/serdev/core.c
index c68fb3a8ea1c..f500f6a2ca88 100644
--- a/drivers/tty/serdev/core.c
+++ b/drivers/tty/serdev/core.c
@@ -252,8 +252,8 @@ static int serdev_drv_probe(struct device *dev)
static int serdev_drv_remove(struct device *dev)
{
const struct serdev_device_driver *sdrv = to_serdev_device_driver(dev->driver);
-
- sdrv->remove(to_serdev_device(dev));
+ if (sdrv->remove)
+ sdrv->remove(to_serdev_device(dev));
return 0;
}
--
2.13.6
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox