* Re: [PATCH v3 32/33] irqchip: Andestech Internal Vector Interrupt Controller driver
From: Marc Zyngier @ 2017-12-11 9:16 UTC (permalink / raw)
To: Greentime Hu, greentime-MUIXKm3Oiri1Z/+hSey0Gg,
linux-kernel-u79uwXL29TY76Z2rM5mHXA, arnd-r2nGTMty4D4,
linux-arch-u79uwXL29TY76Z2rM5mHXA, tglx-hfZtesqFncYOwBW4kG4KsQ,
jason-NLaQJdtUoK4Be96aLqz0jA, robh+dt-DgEjT+Ai2ygdnm+yROfE0A,
netdev-u79uwXL29TY76Z2rM5mHXA, deanbo422-Re5JQEeQqe8AvxtiuMwx3w,
devicetree-u79uwXL29TY76Z2rM5mHXA,
viro-RmSDqhL/yNMiFSDQTTA3OLVCufUGDwFn,
dhowells-H+wXaHxf7aLQT0dZR+AlfA, will.deacon-5wv7dgnIgG8,
daniel.lezcano-QSEj5FYQhm4dnm+yROfE0A,
linux-serial-u79uwXL29TY76Z2rM5mHXA,
geert.uytterhoeven-Re5JQEeQqe8AvxtiuMwx3w,
linus.walleij-QSEj5FYQhm4dnm+yROfE0A, mark.rutland-5wv7dgnIgG8,
greg-U8xfFu+wG4EAvxtiuMwx3w
Cc: Rick Chen
In-Reply-To: <4fb7bd1cd2619287061fd68a38a774c8aef7dbe9.1512723245.git.green.hu-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
On 08/12/17 09:12, Greentime Hu wrote:
> From: Greentime Hu <greentime-MUIXKm3Oiri1Z/+hSey0Gg@public.gmane.org>
>
> This patch adds the Andestech Internal Vector Interrupt Controller
> driver. You can find the spec here. Ch4.9 of AndeStar SPA V3 Manual.
> http://www.andestech.com/product.php?cls=9
>
> Signed-off-by: Rick Chen <rick-MUIXKm3Oiri1Z/+hSey0Gg@public.gmane.org>
> Signed-off-by: Greentime Hu <greentime-MUIXKm3Oiri1Z/+hSey0Gg@public.gmane.org>
Reviewed-by: Marc Zyngier <marc.zyngier-5wv7dgnIgG8@public.gmane.org>
Once there is an agreement on this series being fit for mainline, let me
know how you want to get this merged (either as a whole series, or with
this driver going through the irq tree).
Thanks,
M.
--
Jazz is not dead. It just smells funny...
--
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: Have my PA8800 back online... (serial port missing on v4.14)
From: Andy Shevchenko @ 2017-12-11 8:26 UTC (permalink / raw)
To: Helge Deller, Frank Scheiner, linux-parisc, John David Anglin,
linux-serial
Cc: debian-hppa
In-Reply-To: <20171208190644.GA22228@ls3530.fritz.box>
On Fri, 2017-12-08 at 20:06 +0100, Helge Deller wrote:
> Adding the linux-serial mailing list:
Thanks for pointing to this out.
Details are below.
> > > Anyway, the *only* problem we have right now is, that the Linux
> > > kernel 4.14 doesn't detect all serial ports which were detected in
> > > earlier kernels.
> > > Thus the kernel will talk to the non-existant serial port at
> > > 0xfffffffff4050010 instead of 0xfffffffff4050000.
Wait, from this sentence you actually confirm that patch removes *non-
existant* ports.
Can you elaborate what you imply here?
> > > 4.13:
> > > [ 28.882849] Serial: 8250/16550 driver, 4 ports, IRQ sharing
> > > enabled
> > > [ 28.898720] 0000:e0:01.0: ttyS0 at MMIO 0xfffffffff4051000 (irq
> > > = 73, base_baud = 115200) is a 16450
> > > [ 28.934669] 0000:e0:01.1: ttyS1 at MMIO 0xfffffffff4050000 (irq
> > > = 73, base_baud = 115200) is a 16550A
> > > [ 28.963031] 0000:e0:01.1: ttyS2 at MMIO 0xfffffffff4050010 (irq
> > > = 73, base_baud = 115200) is a 16550A
> > > [ 28.984946] 0000:e0:01.1: ttyS3 at MMIO 0xfffffffff4050038 (irq
> > > = 73, base_baud = 115200) is a 16550A
>From here it looks like multi-function PCI device with two functions
with 1 + 3 serial ports each.
> > > ...but for v4.14.x only the following serial ports are detected:
> > > [ 28.671984] Serial: 8250/16550 driver, 4 ports, IRQ sharing
> > > enabled
> > > [ 28.708902] 0000:e0:01.1: ttyS0 at MMIO 0xfffffffff4050000 (irq
> > > = 73, base_baud = 115200) is a 16550A
> > > [ 28.731145] 0000:e0:01.1: ttyS1 at MMIO 0xfffffffff4050010 (irq
> > > = 73, base_baud = 115200) is a 16550A
I'm quite curious how ttyS0 and ttyS3 in previous run (old kernel)
appear.
> > >
> > >
> > > Maybe reverting this commit brings back the old behavior:
> > > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
> > > /commit/?id=7d8905d064058f4b65057e0101588f362f288bc0
> >
> > I'm unsure about this commit, it speaks more of avoiding duplicate
> > messages
> > for device enabling.
No, it's about trying IRQs twice, though it might be not fully clear
from commit message: the example there shows that IRQs are probed twice
and on some platforms it may be a problem.
>
> Reverting this commit:
>
> commit 7d8905d064058f4b65057e0101588f362f288bc0
> Author: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Date: Mon Jul 24 20:28:32 2017 +0300
>
> serial: 8250_pci: Enable device after we check black list
>
> indeed fixes the problem.
>
> After reverting, the serial port from the Diva card shows up as ttyS0
> (as before).
> With that patch applied, the serial port from the Diva card gets
> ignored and the previous ttyS1 port becomes ttyS0 which then breaks
> booting the parisc machine because the kernel expects the serial port
> on
> ttyS1.
> I'm not sure what the best way forward is.
> Fact is, that the patch above changes the behaviour and serial ports
> which were existant before suddenly vanish with kernel 4.14.
As stated in the commit message there "We can do this since PCI
specification requires class, device and vendor ID registers to be
always present in the configuration space."
So, my understanding that the patch reveals the issue with these ports.
(Of course, I agree this is regression and needs to be fixed ASAP)
> This following patch does work, and adds back the Diva serial port on
> parisc.
> Not sure if it's acceptable though.
For me it looks like the best quick solution right now.
The proper one sounds like a specific initialization routine for these
ports.
Send it as a formal patch and you may add
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
P.S. Sorry, we have no parisc hardware around to test.
>
> Helge
>
> diff --git a/drivers/tty/serial/8250/8250_pci.c
> b/drivers/tty/serial/8250/8250_pci.c
> index 0c101a7470b0..61319e968e8c 100644
> --- a/drivers/tty/serial/8250/8250_pci.c
> +++ b/drivers/tty/serial/8250/8250_pci.c
> @@ -3393,6 +3393,10 @@ static int
> serial_pci_is_class_communication(struct pci_dev *dev)
> * (Should we try to make guesses for multiport serial
> devices
> * later?)
> */
> + if (IS_ENABLED(CONFIG_PARISC) &&
> + (dev->class >> 8) == PCI_CLASS_COMMUNICATION_OTHER)
> + return 0;
> +
> if ((((dev->class >> 8) != PCI_CLASS_COMMUNICATION_SERIAL) &&
> ((dev->class >> 8) != PCI_CLASS_COMMUNICATION_MODEM)) ||
> (dev->class & 0xff) > 6)
--
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy
^ permalink raw reply
* Re: [PATCH 0/2] acpi, x86: Add SPCR table support
From: Jon Masters @ 2017-12-10 20:40 UTC (permalink / raw)
To: Prarit Bhargava, Ingo Molnar
Cc: Jonathan Corbet, x86, linux-pm, Catalin Marinas, Bhupesh Sharma,
linux-doc, Will Deacon, linux-kernel, linux-acpi, Ingo Molnar,
Rafael J. Wysocki, Lv Zheng, linux-serial, H. Peter Anvin,
Thomas Gleixner, linux-arm-kernel
In-Reply-To: <f078ada7-1e30-41cc-28dc-077ed2a5986d@redhat.com>
On 12/08/2017 09:29 AM, Prarit Bhargava wrote:
> If I disable "Serial Port Console Debug" in my BIOS I still see the SPCR configured:
>
> [root@prarit-lab ~]# dmesg | grep SPCR
> [ 0.000000] ACPI: SPCR 0x0000000069031000 000050 (v01
> 00000000 00000000)
>
> AFAICT the SPCR is always enabled on some systems.
It's part of some of the Windows design flows that it gets incorporated,
and it should always be present.
Jon (not talking about AArch64/ARM/arm/ARMv8-A/64-bit ARM/Go ARM Go).
^ permalink raw reply
* [PATCH] serial: bfin_uart: Delete an error message for a failed memory allocation in bfin_serial_probe()
From: SF Markus Elfring @ 2017-12-09 21:11 UTC (permalink / raw)
To: linux-serial, adi-buildroot-devel, Greg Kroah-Hartman, Jiri Slaby
Cc: LKML, kernel-janitors
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 9 Dec 2017 22:05:54 +0100
Omit an extra message for a memory allocation failure in this function.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/tty/serial/bfin_uart.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/tty/serial/bfin_uart.c b/drivers/tty/serial/bfin_uart.c
index 4755fa696321..558f6ebc4f01 100644
--- a/drivers/tty/serial/bfin_uart.c
+++ b/drivers/tty/serial/bfin_uart.c
@@ -1221,11 +1221,9 @@ static int bfin_serial_probe(struct platform_device *pdev)
if (bfin_serial_ports[pdev->id] == NULL) {
uart = kzalloc(sizeof(*uart), GFP_KERNEL);
- if (!uart) {
- dev_err(&pdev->dev,
- "fail to malloc bfin_serial_port\n");
+ if (!uart)
return -ENOMEM;
- }
+
bfin_serial_ports[pdev->id] = uart;
#ifdef CONFIG_EARLY_PRINTK
--
2.15.1
^ permalink raw reply related
* [PATCH] serial: fsl_lpuart: Delete an error message for a failed memory allocation in lpuart_start_rx_dma()
From: SF Markus Elfring @ 2017-12-09 20:41 UTC (permalink / raw)
To: linux-serial, Greg Kroah-Hartman, Jiri Slaby; +Cc: LKML, kernel-janitors
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 9 Dec 2017 21:34:23 +0100
Omit an extra message for a memory allocation failure in this function.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/tty/serial/fsl_lpuart.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c
index c84e6f0db54e..694751ebabf4 100644
--- a/drivers/tty/serial/fsl_lpuart.c
+++ b/drivers/tty/serial/fsl_lpuart.c
@@ -998,10 +998,8 @@ static inline int lpuart_start_rx_dma(struct lpuart_port *sport)
sport->rx_dma_rng_buf_len = 16;
ring->buf = kmalloc(sport->rx_dma_rng_buf_len, GFP_ATOMIC);
- if (!ring->buf) {
- dev_err(sport->port.dev, "Ring buf alloc failed\n");
+ if (!ring->buf)
return -ENOMEM;
- }
sg_init_one(&sport->rx_sgl, ring->buf, sport->rx_dma_rng_buf_len);
sg_set_buf(&sport->rx_sgl, ring->buf, sport->rx_dma_rng_buf_len);
--
2.15.1
^ permalink raw reply related
* [PATCH 3/3] serial: ifx6x60: Add some spaces for better code readability
From: SF Markus Elfring @ 2017-12-09 19:13 UTC (permalink / raw)
To: linux-serial, Greg Kroah-Hartman, Jiri Slaby; +Cc: LKML, kernel-janitors
In-Reply-To: <992f55e5-961d-79ea-a6cd-441ceb3ad058@users.sourceforge.net>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 9 Dec 2017 19:55:31 +0100
Use space characters at some source code places according to
the Linux coding style convention.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/tty/serial/ifx6x60.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/tty/serial/ifx6x60.c b/drivers/tty/serial/ifx6x60.c
index 1883e3382338..f40f64378406 100644
--- a/drivers/tty/serial/ifx6x60.c
+++ b/drivers/tty/serial/ifx6x60.c
@@ -248,8 +248,8 @@ static void mrdy_assert(struct ifx_spi_device *ifx_dev)
if (!val) {
if (!test_and_set_bit(IFX_SPI_STATE_TIMER_PENDING,
&ifx_dev->flags)) {
- mod_timer(&ifx_dev->spi_timer,jiffies + IFX_SPI_TIMEOUT_SEC*HZ);
-
+ mod_timer(&ifx_dev->spi_timer,
+ jiffies + IFX_SPI_TIMEOUT_SEC * HZ);
}
}
ifx_spi_power_state_set(ifx_dev, IFX_SPI_POWER_DATA_PENDING);
@@ -378,7 +378,7 @@ static int ifx_spi_decode_spi_header(unsigned char *buffer, int *length,
u16 *in_buffer = (u16 *)buffer;
h1 = *in_buffer;
- h2 = *(in_buffer+1);
+ h2 = *(in_buffer + 1);
if (h1 == 0 && h2 == 0) {
*received_cts = 0;
@@ -410,7 +410,7 @@ static void ifx_spi_setup_spi_header(unsigned char *txbuffer, int tx_count,
unsigned char more)
{
*(u16 *)(txbuffer) = tx_count;
- *(u16 *)(txbuffer+2) = IFX_SPI_PAYLOAD_SIZE;
+ *(u16 *)(txbuffer + 2) = IFX_SPI_PAYLOAD_SIZE;
txbuffer[1] |= (more << IFX_SPI_MORE_BIT) & IFX_SPI_MORE_MASK;
}
@@ -467,8 +467,8 @@ static int ifx_spi_prepare_tx_buffer(struct ifx_spi_device *ifx_dev)
/* have data and info for header -- set up SPI header in buffer */
/* spi header needs payload size, not entire buffer size */
ifx_spi_setup_spi_header(ifx_dev->tx_buffer,
- tx_count-IFX_SPI_HEADER_OVERHEAD,
- ifx_dev->spi_more);
+ tx_count - IFX_SPI_HEADER_OVERHEAD,
+ ifx_dev->spi_more);
/* swap actual data in the buffer */
ifx_dev->swap_buf((ifx_dev->tx_buffer), tx_count,
&ifx_dev->tx_buffer[IFX_SPI_TRANSFER_SIZE]);
@@ -1163,7 +1163,7 @@ static int ifx_spi_spi_probe(struct spi_device *spi)
ret = request_irq(gpio_to_irq(ifx_dev->gpio.reset_out),
ifx_spi_reset_interrupt,
- IRQF_TRIGGER_RISING|IRQF_TRIGGER_FALLING, DRVNAME,
+ IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, DRVNAME,
ifx_dev);
if (ret) {
dev_err(&spi->dev, "Unable to get irq %x\n",
--
2.15.1
^ permalink raw reply related
* [PATCH 2/3] serial: ifx6x60: Improve a size determination in ifx_spi_spi_probe()
From: SF Markus Elfring @ 2017-12-09 19:12 UTC (permalink / raw)
To: linux-serial, Greg Kroah-Hartman, Jiri Slaby; +Cc: LKML, kernel-janitors
In-Reply-To: <992f55e5-961d-79ea-a6cd-441ceb3ad058@users.sourceforge.net>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 9 Dec 2017 19:22:50 +0100
Replace the specification of a data structure by a pointer dereference
as the parameter for the operator "sizeof" to make the corresponding size
determination a bit safer according to the Linux coding style convention.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/tty/serial/ifx6x60.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/tty/serial/ifx6x60.c b/drivers/tty/serial/ifx6x60.c
index 832751479f41..1883e3382338 100644
--- a/drivers/tty/serial/ifx6x60.c
+++ b/drivers/tty/serial/ifx6x60.c
@@ -1005,7 +1005,7 @@ static int ifx_spi_spi_probe(struct spi_device *spi)
}
/* initialize structure to hold our device variables */
- ifx_dev = kzalloc(sizeof(struct ifx_spi_device), GFP_KERNEL);
+ ifx_dev = kzalloc(sizeof(*ifx_dev), GFP_KERNEL);
if (!ifx_dev)
return -ENOMEM;
--
2.15.1
^ permalink raw reply related
* [PATCH 1/3] serial: ifx6x60: Delete an error message for a failed memory allocation in ifx_spi_spi_probe()
From: SF Markus Elfring @ 2017-12-09 19:11 UTC (permalink / raw)
To: linux-serial, Greg Kroah-Hartman, Jiri Slaby; +Cc: LKML, kernel-janitors
In-Reply-To: <992f55e5-961d-79ea-a6cd-441ceb3ad058@users.sourceforge.net>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 9 Dec 2017 19:20:37 +0100
Omit an extra message for a memory allocation failure in this function.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/tty/serial/ifx6x60.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/tty/serial/ifx6x60.c b/drivers/tty/serial/ifx6x60.c
index 473f4f81d690..832751479f41 100644
--- a/drivers/tty/serial/ifx6x60.c
+++ b/drivers/tty/serial/ifx6x60.c
@@ -1006,10 +1006,9 @@ static int ifx_spi_spi_probe(struct spi_device *spi)
/* initialize structure to hold our device variables */
ifx_dev = kzalloc(sizeof(struct ifx_spi_device), GFP_KERNEL);
- if (!ifx_dev) {
- dev_err(&spi->dev, "spi device allocation failed");
+ if (!ifx_dev)
return -ENOMEM;
- }
+
saved_ifx_dev = ifx_dev;
ifx_dev->spi_dev = spi;
clear_bit(IFX_SPI_STATE_IO_IN_PROGRESS, &ifx_dev->flags);
--
2.15.1
^ permalink raw reply related
* [PATCH 0/3] tty/serial/ifx6x60: Adjustments for five function implementations
From: SF Markus Elfring @ 2017-12-09 19:10 UTC (permalink / raw)
To: linux-serial, Greg Kroah-Hartman, Jiri Slaby; +Cc: LKML, kernel-janitors
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 9 Dec 2017 20:03:45 +0100
Three update suggestions were taken into account
from static source code analysis.
Markus Elfring (3):
Delete an error message for a failed memory allocation in ifx_spi_spi_probe()
Improve a size determination in ifx_spi_spi_probe()
Add some spaces for better code readability
drivers/tty/serial/ifx6x60.c | 21 ++++++++++-----------
1 file changed, 10 insertions(+), 11 deletions(-)
--
2.15.1
^ permalink raw reply
* [PATCH 3/3] serial: ioc3: Adjust two function calls together with a variable assignment
From: SF Markus Elfring @ 2017-12-09 18:06 UTC (permalink / raw)
To: linux-serial, linux-ia64, Greg Kroah-Hartman, Jiri Slaby,
Pat Gefre
Cc: LKML, kernel-janitors
In-Reply-To: <962f1172-3f27-c6b5-653f-c09f2e8fe431@users.sourceforge.net>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 9 Dec 2017 18:48:57 +0100
The script "checkpatch.pl" pointed information out like the following.
ERROR: do not use assignment in if condition
Thus fix the affected source code places.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/tty/serial/ioc3_serial.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/tty/serial/ioc3_serial.c b/drivers/tty/serial/ioc3_serial.c
index d211bb1407d3..0170d6f2bcdf 100644
--- a/drivers/tty/serial/ioc3_serial.c
+++ b/drivers/tty/serial/ioc3_serial.c
@@ -1540,8 +1540,8 @@ ioc3uart_intr_one(struct ioc3_submodule *is,
* hasn't been delivered to the cpu yet anyway, even
* though we see it as asserted when we read the sio_ir.
*/
- if ((sio_ir = PENDING(card_ptr, idd))
- & hooks->intr_rx_high) {
+ sio_ir = PENDING(card_ptr, idd);
+ if (sio_ir & hooks->intr_rx_high) {
if (port->ip_flags & READ_ABORTED) {
rx_high_rd_aborted++;
}
@@ -2162,10 +2162,10 @@ static struct ioc3_submodule ioc3uart_ops = {
*/
static int __init ioc3uart_init(void)
{
- int ret;
-
/* register with serial core */
- if ((ret = uart_register_driver(&ioc3_uart)) < 0) {
+ int ret = uart_register_driver(&ioc3_uart);
+
+ if (ret < 0) {
printk(KERN_WARNING
"%s: Couldn't register IOC3 uart serial driver\n",
__func__);
--
2.15.1
^ permalink raw reply related
* [PATCH 2/3] serial: ioc3: Improve size determinations in ioc3uart_probe()
From: SF Markus Elfring @ 2017-12-09 18:05 UTC (permalink / raw)
To: linux-serial, linux-ia64, Greg Kroah-Hartman, Jiri Slaby,
Pat Gefre
Cc: LKML, kernel-janitors
In-Reply-To: <962f1172-3f27-c6b5-653f-c09f2e8fe431@users.sourceforge.net>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 9 Dec 2017 18:38:13 +0100
Replace the specification of two data structures by pointer dereferences
as the parameter for the operator "sizeof" to make the corresponding size
determination a bit safer according to the Linux coding style convention.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/tty/serial/ioc3_serial.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/tty/serial/ioc3_serial.c b/drivers/tty/serial/ioc3_serial.c
index 0007c2d65028..d211bb1407d3 100644
--- a/drivers/tty/serial/ioc3_serial.c
+++ b/drivers/tty/serial/ioc3_serial.c
@@ -2016,7 +2016,7 @@ ioc3uart_probe(struct ioc3_submodule *is, struct ioc3_driver_data *idd)
DPRINT_CONFIG(("%s (0x%p, 0x%p)\n", __func__, is, idd));
- card_ptr = kzalloc(sizeof(struct ioc3_card), GFP_KERNEL);
+ card_ptr = kzalloc(sizeof(*card_ptr), GFP_KERNEL);
if (!card_ptr)
return -ENOMEM;
@@ -2034,7 +2034,7 @@ ioc3uart_probe(struct ioc3_submodule *is, struct ioc3_driver_data *idd)
/* Create port structures for each port */
for (phys_port = 0; phys_port < PORTS_PER_CARD; phys_port++) {
- port = kzalloc(sizeof(struct ioc3_port), GFP_KERNEL);
+ port = kzalloc(sizeof(*port), GFP_KERNEL);
if (!port) {
ret = -ENOMEM;
goto out4;
--
2.15.1
^ permalink raw reply related
* [PATCH 1/3] serial: ioc3: Delete error messages for a failed memory allocation in ioc3uart_probe()
From: SF Markus Elfring @ 2017-12-09 18:03 UTC (permalink / raw)
To: linux-serial, linux-ia64, Greg Kroah-Hartman, Jiri Slaby,
Pat Gefre
Cc: LKML, kernel-janitors
In-Reply-To: <962f1172-3f27-c6b5-653f-c09f2e8fe431@users.sourceforge.net>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 9 Dec 2017 18:34:36 +0100
Omit extra messages for a memory allocation failure in this function.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/tty/serial/ioc3_serial.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/tty/serial/ioc3_serial.c b/drivers/tty/serial/ioc3_serial.c
index d8a1cdd6a53d..0007c2d65028 100644
--- a/drivers/tty/serial/ioc3_serial.c
+++ b/drivers/tty/serial/ioc3_serial.c
@@ -2017,11 +2017,9 @@ ioc3uart_probe(struct ioc3_submodule *is, struct ioc3_driver_data *idd)
DPRINT_CONFIG(("%s (0x%p, 0x%p)\n", __func__, is, idd));
card_ptr = kzalloc(sizeof(struct ioc3_card), GFP_KERNEL);
- if (!card_ptr) {
- printk(KERN_WARNING "ioc3_attach_one"
- ": unable to get memory for the IOC3\n");
+ if (!card_ptr)
return -ENOMEM;
- }
+
idd->data[is->id] = card_ptr;
Submodule_slot = is->id;
@@ -2038,8 +2036,6 @@ ioc3uart_probe(struct ioc3_submodule *is, struct ioc3_driver_data *idd)
for (phys_port = 0; phys_port < PORTS_PER_CARD; phys_port++) {
port = kzalloc(sizeof(struct ioc3_port), GFP_KERNEL);
if (!port) {
- printk(KERN_WARNING
- "IOC3 serial memory not available for port\n");
ret = -ENOMEM;
goto out4;
}
--
2.15.1
^ permalink raw reply related
* [PATCH 0/3] tty/serial/ioc3: Adjustments for three function implementations
From: SF Markus Elfring @ 2017-12-09 18:02 UTC (permalink / raw)
To: linux-serial, linux-ia64, Greg Kroah-Hartman, Jiri Slaby,
Pat Gefre
Cc: LKML, kernel-janitors
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 9 Dec 2017 19:00:19 +0100
Three update suggestions were taken into account
from static source code analysis.
Markus Elfring (3):
Delete error messages for a failed memory allocation in ioc3uart_probe()
Improve size determinations in ioc3uart_probe()
Adjust two function calls together with a variable assignment
drivers/tty/serial/ioc3_serial.c | 22 +++++++++-------------
1 file changed, 9 insertions(+), 13 deletions(-)
--
2.15.1
^ permalink raw reply
* Re: [PATCH/RFC 5/5] ARM: shmobile: defconfig: Disable CONFIG_EMBEDDED
From: Geert Uytterhoeven @ 2017-12-09 8:54 UTC (permalink / raw)
To: Rob Landley
Cc: Simon Horman, Geert Uytterhoeven, Greg Kroah-Hartman, Magnus Damm,
Yoshinori Sato, Rich Felker, Jiri Slaby,
linux-serial@vger.kernel.org, Linux-Renesas,
moderated list:H8/300 ARCHITECTURE, Linux-sh list
In-Reply-To: <1ad0fcaa-5edf-9206-4729-d1940842a31a@landley.net>
Hi Rob,
On Sat, Dec 9, 2017 at 3:18 AM, Rob Landley <rob@landley.net> wrote:
> On 12/05/2017 02:28 AM, Simon Horman wrote:
>> On Mon, Dec 04, 2017 at 10:46:22AM +0100, Geert Uytterhoeven wrote:
>>> On Fri, Dec 1, 2017 at 9:33 AM, Simon Horman <horms@verge.net.au> wrote:
>>>> On Thu, Nov 30, 2017 at 02:12:02PM +0100, Geert Uytterhoeven wrote:
>>>>> CONFIG_EXPERT exposes too many config options that do not matter for
>>>>> development. However, CONFIG_EMBEDDED selects CONFIG_EXPERT, so it
>>>>> cannot be disabled.
>>>>>
>>>>> Hence disable CONFIG_EMBEDDED, and compensate for the loss of
>>>>> CONFIG_DEBUG_KERNEL by enabling the latter.
>
> Didn't I already submit a patch to fix this in 2015?
>
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=560b8c0ed45a
>
> If it came back, it's a regression.
Your patch was for arch/sh/Kconfig, not for (arm32) shmobile_defconfig.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply
* Re: [PATCH/RFC 5/5] ARM: shmobile: defconfig: Disable CONFIG_EMBEDDED
From: Rob Landley @ 2017-12-09 2:18 UTC (permalink / raw)
To: Simon Horman, Geert Uytterhoeven
Cc: Geert Uytterhoeven, Greg Kroah-Hartman, Magnus Damm,
Yoshinori Sato, Rich Felker, Jiri Slaby,
linux-serial@vger.kernel.org, Linux-Renesas,
moderated list:H8/300 ARCHITECTURE, Linux-sh list
In-Reply-To: <20171205082833.fqwuyvlmupwektny@verge.net.au>
On 12/05/2017 02:28 AM, Simon Horman wrote:
> On Mon, Dec 04, 2017 at 10:46:22AM +0100, Geert Uytterhoeven wrote:
>> Hi Simon,
>>
>> On Fri, Dec 1, 2017 at 9:33 AM, Simon Horman <horms@verge.net.au> wrote:
>>> On Thu, Nov 30, 2017 at 02:12:02PM +0100, Geert Uytterhoeven wrote:
>>>> CONFIG_EXPERT exposes too many config options that do not matter for
>>>> development. However, CONFIG_EMBEDDED selects CONFIG_EXPERT, so it
>>>> cannot be disabled.
>>>>
>>>> Hence disable CONFIG_EMBEDDED, and compensate for the loss of
>>>> CONFIG_DEBUG_KERNEL by enabling the latter.
Didn't I already submit a patch to fix this in 2015?
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=560b8c0ed45a
If it came back, it's a regression.
Rob
^ permalink raw reply
* [PATCH 3/3] serial: ioc4: Adjust three function calls together with a variable assignment
From: SF Markus Elfring @ 2017-12-08 21:53 UTC (permalink / raw)
To: linux-serial, Greg Kroah-Hartman, Jiri Slaby, Pat Gefre
Cc: LKML, kernel-janitors
In-Reply-To: <514232dd-7e91-00f9-b95c-3e8f740090ca@users.sourceforge.net>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 8 Dec 2017 22:40:31 +0100
The script "checkpatch.pl" pointed information out like the following.
ERROR: do not use assignment in if condition
Thus fix the affected source code places.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/tty/serial/ioc4_serial.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/drivers/tty/serial/ioc4_serial.c b/drivers/tty/serial/ioc4_serial.c
index 6981ad2ca1b7..ba95a4cb8130 100644
--- a/drivers/tty/serial/ioc4_serial.c
+++ b/drivers/tty/serial/ioc4_serial.c
@@ -1945,7 +1945,8 @@ static void handle_intr(void *arg, uint32_t sio_ir)
* hasn't been delivered to the cpu yet anyway, even
* though we see it as asserted when we read the sio_ir.
*/
- if ((sio_ir = PENDING(port)) & hooks->intr_rx_high) {
+ sio_ir = PENDING(port);
+ if (sio_ir & hooks->intr_rx_high) {
if ((port->ip_flags & READ_ABORTED) == 0) {
port->ip_ienb &= ~hooks->intr_rx_high;
port->ip_flags |= INPUT_HIGH;
@@ -2902,16 +2903,18 @@ static struct ioc4_submodule ioc4_serial_submodule = {
*/
static int __init ioc4_serial_init(void)
{
- int ret;
-
/* register with serial core */
- if ((ret = uart_register_driver(&ioc4_uart_rs232)) < 0) {
+ int ret = uart_register_driver(&ioc4_uart_rs232);
+
+ if (ret < 0) {
printk(KERN_WARNING
"%s: Couldn't register rs232 IOC4 serial driver\n",
__func__);
goto out;
}
- if ((ret = uart_register_driver(&ioc4_uart_rs422)) < 0) {
+
+ ret = uart_register_driver(&ioc4_uart_rs422);
+ if (ret < 0) {
printk(KERN_WARNING
"%s: Couldn't register rs422 IOC4 serial driver\n",
__func__);
--
2.15.1
^ permalink raw reply related
* [PATCH 2/3] serial: ioc4: Improve four size determinations
From: SF Markus Elfring @ 2017-12-08 21:52 UTC (permalink / raw)
To: linux-serial, Greg Kroah-Hartman, Jiri Slaby, Pat Gefre
Cc: LKML, kernel-janitors
In-Reply-To: <514232dd-7e91-00f9-b95c-3e8f740090ca@users.sourceforge.net>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 8 Dec 2017 22:22:25 +0100
Replace the specification of data structures by pointer dereferences
as the parameter for the operator "sizeof" to make the corresponding size
determination a bit safer according to the Linux coding style convention.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/tty/serial/ioc4_serial.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/drivers/tty/serial/ioc4_serial.c b/drivers/tty/serial/ioc4_serial.c
index 9524a6d3e1d8..6981ad2ca1b7 100644
--- a/drivers/tty/serial/ioc4_serial.c
+++ b/drivers/tty/serial/ioc4_serial.c
@@ -1075,7 +1075,7 @@ static inline int ioc4_attach_local(struct ioc4_driver_data *idd)
/* Create port structures for each port */
for (port_number = 0; port_number < IOC4_NUM_SERIAL_PORTS;
port_number++) {
- port = kzalloc(sizeof(struct ioc4_port), GFP_KERNEL);
+ port = kzalloc(sizeof(*port), GFP_KERNEL);
if (!port)
goto free;
@@ -2797,7 +2797,7 @@ ioc4_serial_attach_one(struct ioc4_driver_data *idd)
ret = -ENODEV;
goto out1;
}
- serial = ioremap(tmp_addr1, sizeof(struct ioc4_serial));
+ serial = ioremap(tmp_addr1, sizeof(*serial));
if (!serial) {
printk(KERN_WARNING
"ioc4 (%p) : unable to remap ioc4 serial register\n",
@@ -2810,8 +2810,7 @@ ioc4_serial_attach_one(struct ioc4_driver_data *idd)
(void *)serial));
/* Get memory for the new card */
- control = kzalloc(sizeof(struct ioc4_control), GFP_KERNEL);
-
+ control = kzalloc(sizeof(*control), GFP_KERNEL);
if (!control) {
ret = -ENOMEM;
goto out2;
@@ -2819,7 +2818,7 @@ ioc4_serial_attach_one(struct ioc4_driver_data *idd)
idd->idd_serial_data = control;
/* Allocate the soft structure */
- soft = kzalloc(sizeof(struct ioc4_soft), GFP_KERNEL);
+ soft = kzalloc(sizeof(*soft), GFP_KERNEL);
if (!soft) {
ret = -ENOMEM;
goto out3;
--
2.15.1
^ permalink raw reply related
* [PATCH 1/3] serial: ioc4: Delete error messages for a failed memory allocation in two functions
From: SF Markus Elfring @ 2017-12-08 21:51 UTC (permalink / raw)
To: linux-serial, Greg Kroah-Hartman, Jiri Slaby, Pat Gefre
Cc: LKML, kernel-janitors
In-Reply-To: <514232dd-7e91-00f9-b95c-3e8f740090ca@users.sourceforge.net>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 8 Dec 2017 22:15:53 +0100
Omit extra messages for a memory allocation failure in these functions.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/tty/serial/ioc4_serial.c | 11 ++---------
1 file changed, 2 insertions(+), 9 deletions(-)
diff --git a/drivers/tty/serial/ioc4_serial.c b/drivers/tty/serial/ioc4_serial.c
index db5b979e5a0c..9524a6d3e1d8 100644
--- a/drivers/tty/serial/ioc4_serial.c
+++ b/drivers/tty/serial/ioc4_serial.c
@@ -1076,11 +1076,9 @@ static inline int ioc4_attach_local(struct ioc4_driver_data *idd)
for (port_number = 0; port_number < IOC4_NUM_SERIAL_PORTS;
port_number++) {
port = kzalloc(sizeof(struct ioc4_port), GFP_KERNEL);
- if (!port) {
- printk(KERN_WARNING
- "IOC4 serial memory not available for port\n");
+ if (!port)
goto free;
- }
+
spin_lock_init(&port->ip_lock);
/* we need to remember the previous ones, to point back to
@@ -2815,8 +2813,6 @@ ioc4_serial_attach_one(struct ioc4_driver_data *idd)
control = kzalloc(sizeof(struct ioc4_control), GFP_KERNEL);
if (!control) {
- printk(KERN_WARNING "ioc4_attach_one"
- ": unable to get memory for the IOC4\n");
ret = -ENOMEM;
goto out2;
}
@@ -2825,9 +2821,6 @@ ioc4_serial_attach_one(struct ioc4_driver_data *idd)
/* Allocate the soft structure */
soft = kzalloc(sizeof(struct ioc4_soft), GFP_KERNEL);
if (!soft) {
- printk(KERN_WARNING
- "ioc4 (%p): unable to get memory for the soft struct\n",
- (void *)idd->idd_pdev);
ret = -ENOMEM;
goto out3;
}
--
2.15.1
^ permalink raw reply related
* [PATCH 0/3] tty/serial/ioc4: Adjustments for four function implementations
From: SF Markus Elfring @ 2017-12-08 21:50 UTC (permalink / raw)
To: linux-serial, Greg Kroah-Hartman, Jiri Slaby, Pat Gefre
Cc: LKML, kernel-janitors
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 8 Dec 2017 22:47:43 +0100
Three update suggestions were taken into account
from static source code analysis.
Markus Elfring (3):
Delete error messages for a failed memory allocation in two functions
Improve four size determinations
Adjust three function calls together with a variable assignment
drivers/tty/serial/ioc4_serial.c | 33 ++++++++++++++-------------------
1 file changed, 14 insertions(+), 19 deletions(-)
--
2.15.1
^ permalink raw reply
* [PATCH 3/3] serial: max3100: Improve unlocking of a mutex in max3100_probe()
From: SF Markus Elfring @ 2017-12-08 20:13 UTC (permalink / raw)
To: linux-serial, Greg Kroah-Hartman, Jiri Slaby; +Cc: LKML, kernel-janitors
In-Reply-To: <82c37f92-b4ee-8bea-bd10-de3b6691151d@users.sourceforge.net>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 8 Dec 2017 20:52:37 +0100
* Add a jump target so that a call of the function "mutex_unlock" is stored
only once in this function implementation.
* Replace three calls by goto statements.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/tty/serial/max3100.c | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/drivers/tty/serial/max3100.c b/drivers/tty/serial/max3100.c
index 00c0e650537d..e4908410565c 100644
--- a/drivers/tty/serial/max3100.c
+++ b/drivers/tty/serial/max3100.c
@@ -747,8 +747,7 @@ static int max3100_probe(struct spi_device *spi)
retval = uart_register_driver(&max3100_uart_driver);
if (retval) {
printk(KERN_ERR "Couldn't register max3100 uart driver\n");
- mutex_unlock(&max3100s_lock);
- return retval;
+ goto unlock;
}
}
@@ -757,14 +756,14 @@ static int max3100_probe(struct spi_device *spi)
break;
if (i == MAX_MAX3100) {
dev_warn(&spi->dev, "too many MAX3100 chips\n");
- mutex_unlock(&max3100s_lock);
- return -ENOMEM;
+ retval = -ENOMEM;
+ goto unlock;
}
max3100s[i] = kzalloc(sizeof(*max3100s[i]), GFP_KERNEL);
if (!max3100s[i]) {
- mutex_unlock(&max3100s_lock);
- return -ENOMEM;
+ retval = -ENOMEM;
+ goto unlock;
}
max3100s[i]->spi = spi;
max3100s[i]->irq = spi->irq;
@@ -803,8 +802,11 @@ static int max3100_probe(struct spi_device *spi)
tx = MAX3100_WC | MAX3100_SHDN;
max3100_sr(max3100s[i], tx, &rx);
}
+
+ retval = 0;
+unlock:
mutex_unlock(&max3100s_lock);
- return 0;
+ return retval;
}
static int max3100_remove(struct spi_device *spi)
--
2.15.1
^ permalink raw reply related
* [PATCH 2/3] serial: max3100: Improve a size determination in max3100_probe()
From: SF Markus Elfring @ 2017-12-08 20:12 UTC (permalink / raw)
To: linux-serial, Greg Kroah-Hartman, Jiri Slaby; +Cc: LKML, kernel-janitors
In-Reply-To: <82c37f92-b4ee-8bea-bd10-de3b6691151d@users.sourceforge.net>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 8 Dec 2017 20:32:09 +0100
Replace the specification of a data structure by a pointer dereference
as the parameter for the operator "sizeof" to make the corresponding size
determination a bit safer according to the Linux coding style convention.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/tty/serial/max3100.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/tty/serial/max3100.c b/drivers/tty/serial/max3100.c
index b7b7e6582f3f..00c0e650537d 100644
--- a/drivers/tty/serial/max3100.c
+++ b/drivers/tty/serial/max3100.c
@@ -761,7 +761,7 @@ static int max3100_probe(struct spi_device *spi)
return -ENOMEM;
}
- max3100s[i] = kzalloc(sizeof(struct max3100_port), GFP_KERNEL);
+ max3100s[i] = kzalloc(sizeof(*max3100s[i]), GFP_KERNEL);
if (!max3100s[i]) {
mutex_unlock(&max3100s_lock);
return -ENOMEM;
--
2.15.1
^ permalink raw reply related
* [PATCH 1/3] serial: max3100: Delete an error message for a failed memory allocation in max3100_probe()
From: SF Markus Elfring @ 2017-12-08 20:11 UTC (permalink / raw)
To: linux-serial, Greg Kroah-Hartman, Jiri Slaby; +Cc: LKML, kernel-janitors
In-Reply-To: <82c37f92-b4ee-8bea-bd10-de3b6691151d@users.sourceforge.net>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 8 Dec 2017 20:20:58 +0100
Omit an extra message for a memory allocation failure in this function.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/tty/serial/max3100.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/tty/serial/max3100.c b/drivers/tty/serial/max3100.c
index 27d6049eb6a9..b7b7e6582f3f 100644
--- a/drivers/tty/serial/max3100.c
+++ b/drivers/tty/serial/max3100.c
@@ -763,8 +763,6 @@ static int max3100_probe(struct spi_device *spi)
max3100s[i] = kzalloc(sizeof(struct max3100_port), GFP_KERNEL);
if (!max3100s[i]) {
- dev_warn(&spi->dev,
- "kmalloc for max3100 structure %d failed!\n", i);
mutex_unlock(&max3100s_lock);
return -ENOMEM;
}
--
2.15.1
^ permalink raw reply related
* [PATCH 0/3] tty/serial/max3100: Adjustments for max3100_probe()
From: SF Markus Elfring @ 2017-12-08 20:10 UTC (permalink / raw)
To: linux-serial, Greg Kroah-Hartman, Jiri Slaby; +Cc: LKML, kernel-janitors
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 8 Dec 2017 21:05:43 +0100
Three update suggestions were taken into account
from static source code analysis.
Markus Elfring (3):
Delete an error message for a failed memory allocation
Improve a size determination
Improve unlocking of a mutex
drivers/tty/serial/max3100.c | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
--
2.15.1
^ permalink raw reply
* Re: [PATCH] serial: max310x: Delete an error message for a failed memory allocation in max310x_probe()
From: Jan Kundrát @ 2017-12-08 19:52 UTC (permalink / raw)
To: SF Markus Elfring
Cc: linux-serial, Alexander Shiyan, Greg Kroah-Hartman, Jiri Slaby,
LKML, kernel-janitors
In-Reply-To: <4153838e-4796-537c-7b7f-98404d4f3481@users.sourceforge.net>
On pátek 8. prosince 2017 20:00:34 CET, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Fri, 8 Dec 2017 19:53:10 +0100
>
> Omit an extra message for a memory allocation failure in this function.
>
> This issue was detected by using the Coccinelle software.
>
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
> ---
> drivers/tty/serial/max310x.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/tty/serial/max310x.c b/drivers/tty/serial/max310x.c
> index ecb6513a6505..2aad36f402fd 100644
> --- a/drivers/tty/serial/max310x.c
> +++ b/drivers/tty/serial/max310x.c
> @@ -1102,10 +1102,8 @@ static int max310x_probe(struct device
> *dev, struct max310x_devtype *devtype,
> /* Alloc port structure */
> s = devm_kzalloc(dev, sizeof(*s) +
> sizeof(struct max310x_one) * devtype->nr, GFP_KERNEL);
> - if (!s) {
> - dev_err(dev, "Error allocating port structure\n");
> + if (!s)
> return -ENOMEM;
> - }
>
> clk_osc = devm_clk_get(dev, "osc");
> clk_xtal = devm_clk_get(dev, "xtal");
I'm looking at this patch because I'm also making some modifications to
this driver. This patch makes sense; other drivers also simply return
ENOMEM. Tested on ARM, Armada 388; the "good" code path still obviously
works :).
Reviewed-by: Jan Kundrát <jan.kundrat@cesnet.cz>
^ permalink raw reply
* Re: [PATCH 1/2] acpi, spcr: Make SPCR avialable to other architectures
From: Prarit Bhargava @ 2017-12-08 19:42 UTC (permalink / raw)
To: Timur Tabi
Cc: ACPI Devel Maling List, Jonathan Corbet, the arch/x86 maintainers,
linux-pm, Catalin Marinas, Bhupesh Sharma, linux-doc, Will Deacon,
lkml, Ingo Molnar, Rafael J. Wysocki, Lv Zheng, linux-serial,
H. Peter Anvin, Thomas Gleixner,
linux-arm-kernel@lists.infradead.org, Jeffrey Hugo
In-Reply-To: <CAOZdJXV4E6gu=Ed6nOCcEp2afe_g8Ot-H5oO5=6+ye51cv9hUg@mail.gmail.com>
On 12/07/2017 01:43 PM, Timur Tabi wrote:
> On Thu, Dec 7, 2017 at 11:29 AM, Prarit Bhargava <prarit@redhat.com> wrote:
>> Other architectures can use SPCR to setup an early console or console but
>> the current code is ARM64 specific.
>>
>> Change the name of parse_spcr() to acpi_parse_spcr(). Add a weak
>> function acpi_arch_setup_console() that can be used for arch-specific
>> setup. Move SPCR initialization flag into ACPI code. Update the
>> Documention on the use of the SPCR earlycon.
>>
>> This patch does not change arm64 behaviour.
>
> Let's hope so. Our E44 erratum work-around has caused lots of
> problems in the past, so the code is a bit fragile.
So it does look like I broke something :( I'll fix this and do more testing.
One thing that I just learned (relative to x86) is that you have to test much
further and wider than on x86.
P.
>
>> +static bool qdf2400_erratum_44_present(struct acpi_table_header *h)
>> +{
>> + if (memcmp(h->oem_id, "QCOM ", ACPI_OEM_ID_SIZE))
>> + return false;
>> +
>> + if (!memcmp(h->oem_table_id, "QDF2432 ", ACPI_OEM_TABLE_ID_SIZE))
>> + return true;
>> +
>> + if (!memcmp(h->oem_table_id, "QDF2400 ", ACPI_OEM_TABLE_ID_SIZE) &&
>> + h->oem_revision == 1)
>> + return true;
>> +
>> + return false;
>> +}
>
> Please give us a chance to test this patch before merging. We've had a
> lot of problems with our E44 work-around, and we need to make sure
> that qdf2400_erratum_44_present function is called before the pl011
> driver is probed.
>
>> +
>> +/*
>> + * APM X-Gene v1 and v2 UART hardware is an 16550 like device but has its
>> + * register aligned to 32-bit. In addition, the BIOS also encoded the
>> + * access width to be 8 bits. This function detects this errata condition.
>> + */
>> +static bool xgene_8250_erratum_present(struct acpi_table_spcr *tb)
>> +{
>> + bool xgene_8250 = false;
>> +
>> + if (tb->interface_type != ACPI_DBG2_16550_COMPATIBLE)
>> + return false;
>> +
>> + if (memcmp(tb->header.oem_id, "APMC0D", ACPI_OEM_ID_SIZE) &&
>> + memcmp(tb->header.oem_id, "HPE ", ACPI_OEM_ID_SIZE))
>> + return false;
>> +
>> + if (!memcmp(tb->header.oem_table_id, "XGENESPC",
>> + ACPI_OEM_TABLE_ID_SIZE) && tb->header.oem_revision == 0)
>> + xgene_8250 = true;
>> +
>> + if (!memcmp(tb->header.oem_table_id, "ProLiant",
>> + ACPI_OEM_TABLE_ID_SIZE) && tb->header.oem_revision == 1)
>> + xgene_8250 = true;
>> +
>> + return xgene_8250;
>> +}
>
> I suspect that this function has the same issues as
> qdf2400_erratum_44_present().
>
>> +config ACPI_SPCR_TABLE
>> + bool "ACPI Serial Port Console Redirection Support"
>> + default y if ARM64
>> + help
>> + Enable support for Serial Port Console Redirection (SPCR) Table.
>> + This table provides information about the configuration of the
>> + earlycon console.
>> +
>
> So ACPI without SPCR has never been tested by us. Making it optional
> makes me a little nervous. We'll have to evaluate this change.
>
^ permalink raw reply
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