From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Finn Thain <fthain@telegraphics.com.au>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>,
linux-m68k@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
linux-serial@vger.kernel.org
Subject: Re: [PATCH 01/16 v3] pmac_zilog: fix unexpected irq
Date: Tue, 13 Dec 2011 07:06:23 +1100 [thread overview]
Message-ID: <1323720383.19891.21.camel@pasglop> (raw)
In-Reply-To: <alpine.LNX.2.00.1112130020000.2550@nippy.intranet>
On Tue, 2011-12-13 at 00:34 +1100, Finn Thain wrote:
> On Mon, 12 Dec 2011, Benjamin Herrenschmidt wrote:
>
> > Any chance you can test this patch ? I would not be surprised if it
> > broke m68k since I had to do some of the changes in there "blind", so
> > let me know... with this, I can again suspend/resume properly on a Pismo
> > while using the internal modem among other things.
>
> The patch works on a PowerBook 520 given a few changes (below). This
> PowerBook only has one serial port that I can test (the internal modem is
> not supported on 68k Macs).
Interesting. The modem is a soft-modem "geoport" or a hw serial modem ?
In the later case it's probably just a matter of finding the right GPIO
bit in Apple ASIC to turn the power on :-)
> Can you test a machine with two ports? The
> rest of my Mac hardware is in storage since I moved house last week.
I tried on 2 port powermacs, but I only have one adapter, so I've
basically been running with one serial port open and shooting irda frame
on the other (with nothing to check wether I got the frames on the other
hand), oh well ...
I'll apply your patch and commit via my tree.
Cheers,
Ben.
> Finn
>
>
> Index: linux-git/drivers/tty/serial/pmac_zilog.c
> ===================================================================
> --- linux-git.orig/drivers/tty/serial/pmac_zilog.c 2011-12-13 00:18:02.000000000 +1100
> +++ linux-git/drivers/tty/serial/pmac_zilog.c 2011-12-13 00:23:55.000000000 +1100
> @@ -1705,8 +1705,8 @@ static int __init pmz_init_port(struct u
> struct resource *r_ports;
> int irq;
>
> - r_ports = platform_get_resource(uap->node, IORESOURCE_MEM, 0);
> - irq = platform_get_irq(uap->node, 0);
> + r_ports = platform_get_resource(uap->pdev, IORESOURCE_MEM, 0);
> + irq = platform_get_irq(uap->pdev, 0);
> if (!r_ports || !irq)
> return -ENODEV;
>
> @@ -1763,8 +1763,10 @@ static void pmz_dispose_port(struct uart
>
> static int __init pmz_attach(struct platform_device *pdev)
> {
> + struct uart_pmac_port *uap;
> int i;
>
> + /* Iterate the pmz_ports array to find a matching entry */
> for (i = 0; i < pmz_ports_count; i++)
> if (pmz_ports[i].pdev == pdev)
> break;
> @@ -1773,15 +1775,23 @@ static int __init pmz_attach(struct plat
>
> uap = &pmz_ports[i];
> uap->port.dev = &pdev->dev;
> - dev_set_drvdata(&mdev->ofdev.dev, uap);
> + platform_set_drvdata(pdev, uap);
>
> - return uart_add_one_port(&pmz_uart_reg,
> - &pmz_ports[i]->port);
> + return uart_add_one_port(&pmz_uart_reg, &uap->port);
> }
>
> static int __exit pmz_detach(struct platform_device *pdev)
> {
> + struct uart_pmac_port *uap = platform_get_drvdata(pdev);
> +
> + if (!uap)
> + return -ENODEV;
> +
> uart_remove_one_port(&pmz_uart_reg, &uap->port);
> +
> + platform_set_drvdata(pdev, NULL);
> + uap->port.dev = NULL;
> +
> return 0;
> }
>
> @@ -1918,8 +1928,13 @@ static void __exit exit_pmz(void)
>
> for (i = 0; i < pmz_ports_count; i++) {
> struct uart_pmac_port *uport = &pmz_ports[i];
> +#ifdef CONFIG_PPC_PMAC
> if (uport->node != NULL)
> pmz_dispose_port(uport);
> +#else
> + if (uport->pdev != NULL)
> + pmz_dispose_port(uport);
> +#endif
> }
> /* Unregister UART driver */
> uart_unregister_driver(&pmz_uart_reg);
> @@ -1993,6 +2008,9 @@ static int __init pmz_console_setup(stru
> #ifdef CONFIG_PPC_PMAC
> if (uap->node == NULL)
> return -ENODEV;
> +#else
> + if (uap->pdev == NULL)
> + return -ENODEV;
> #endif
> port = &uap->port;
>
> Index: linux-git/drivers/tty/serial/pmac_zilog.h
> ===================================================================
> --- linux-git.orig/drivers/tty/serial/pmac_zilog.h 2011-12-13 00:18:02.000000000 +1100
> +++ linux-git/drivers/tty/serial/pmac_zilog.h 2011-12-13 00:23:55.000000000 +1100
> @@ -1,18 +1,9 @@
> #ifndef __PMAC_ZILOG_H__
> #define __PMAC_ZILOG_H__
>
> -#ifdef CONFIG_PPC_PMAC
> -/* We cannot use dev_* because this can be called early, way before
> - * we are matched with a device (when using it as a kernel console)
> - */
> #define pmz_debug(fmt, arg...) pr_debug("ttyPZ%d: " fmt, uap->port.line, ## arg)
> #define pmz_error(fmt, arg...) pr_err("ttyPZ%d: " fmt, uap->port.line, ## arg)
> #define pmz_info(fmt, arg...) pr_info("ttyPZ%d: " fmt, uap->port.line, ## arg)
> -#else
> -#define pmz_debug(fmt, arg...) dev_dbg(&uap->node->dev, fmt, ## arg)
> -#define pmz_error(fmt, arg...) dev_err(&uap->node->dev, fmt, ## arg)
> -#define pmz_info(fmt, arg...) dev_info(&uap->node->dev, fmt, ## arg)
> -#endif
>
> /*
> * At most 2 ESCCs with 2 ports each
WARNING: multiple messages have this Message-ID (diff)
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: Finn Thain <fthain@telegraphics.com.au>
Cc: linuxppc-dev@lists.ozlabs.org, linux-m68k@vger.kernel.org,
Geert Uytterhoeven <geert@linux-m68k.org>,
linux-serial@vger.kernel.org
Subject: Re: [PATCH 01/16 v3] pmac_zilog: fix unexpected irq
Date: Tue, 13 Dec 2011 07:06:23 +1100 [thread overview]
Message-ID: <1323720383.19891.21.camel@pasglop> (raw)
In-Reply-To: <alpine.LNX.2.00.1112130020000.2550@nippy.intranet>
On Tue, 2011-12-13 at 00:34 +1100, Finn Thain wrote:
> On Mon, 12 Dec 2011, Benjamin Herrenschmidt wrote:
>
> > Any chance you can test this patch ? I would not be surprised if it
> > broke m68k since I had to do some of the changes in there "blind", so
> > let me know... with this, I can again suspend/resume properly on a Pismo
> > while using the internal modem among other things.
>
> The patch works on a PowerBook 520 given a few changes (below). This
> PowerBook only has one serial port that I can test (the internal modem is
> not supported on 68k Macs).
Interesting. The modem is a soft-modem "geoport" or a hw serial modem ?
In the later case it's probably just a matter of finding the right GPIO
bit in Apple ASIC to turn the power on :-)
> Can you test a machine with two ports? The
> rest of my Mac hardware is in storage since I moved house last week.
I tried on 2 port powermacs, but I only have one adapter, so I've
basically been running with one serial port open and shooting irda frame
on the other (with nothing to check wether I got the frames on the other
hand), oh well ...
I'll apply your patch and commit via my tree.
Cheers,
Ben.
> Finn
>
>
> Index: linux-git/drivers/tty/serial/pmac_zilog.c
> ===================================================================
> --- linux-git.orig/drivers/tty/serial/pmac_zilog.c 2011-12-13 00:18:02.000000000 +1100
> +++ linux-git/drivers/tty/serial/pmac_zilog.c 2011-12-13 00:23:55.000000000 +1100
> @@ -1705,8 +1705,8 @@ static int __init pmz_init_port(struct u
> struct resource *r_ports;
> int irq;
>
> - r_ports = platform_get_resource(uap->node, IORESOURCE_MEM, 0);
> - irq = platform_get_irq(uap->node, 0);
> + r_ports = platform_get_resource(uap->pdev, IORESOURCE_MEM, 0);
> + irq = platform_get_irq(uap->pdev, 0);
> if (!r_ports || !irq)
> return -ENODEV;
>
> @@ -1763,8 +1763,10 @@ static void pmz_dispose_port(struct uart
>
> static int __init pmz_attach(struct platform_device *pdev)
> {
> + struct uart_pmac_port *uap;
> int i;
>
> + /* Iterate the pmz_ports array to find a matching entry */
> for (i = 0; i < pmz_ports_count; i++)
> if (pmz_ports[i].pdev == pdev)
> break;
> @@ -1773,15 +1775,23 @@ static int __init pmz_attach(struct plat
>
> uap = &pmz_ports[i];
> uap->port.dev = &pdev->dev;
> - dev_set_drvdata(&mdev->ofdev.dev, uap);
> + platform_set_drvdata(pdev, uap);
>
> - return uart_add_one_port(&pmz_uart_reg,
> - &pmz_ports[i]->port);
> + return uart_add_one_port(&pmz_uart_reg, &uap->port);
> }
>
> static int __exit pmz_detach(struct platform_device *pdev)
> {
> + struct uart_pmac_port *uap = platform_get_drvdata(pdev);
> +
> + if (!uap)
> + return -ENODEV;
> +
> uart_remove_one_port(&pmz_uart_reg, &uap->port);
> +
> + platform_set_drvdata(pdev, NULL);
> + uap->port.dev = NULL;
> +
> return 0;
> }
>
> @@ -1918,8 +1928,13 @@ static void __exit exit_pmz(void)
>
> for (i = 0; i < pmz_ports_count; i++) {
> struct uart_pmac_port *uport = &pmz_ports[i];
> +#ifdef CONFIG_PPC_PMAC
> if (uport->node != NULL)
> pmz_dispose_port(uport);
> +#else
> + if (uport->pdev != NULL)
> + pmz_dispose_port(uport);
> +#endif
> }
> /* Unregister UART driver */
> uart_unregister_driver(&pmz_uart_reg);
> @@ -1993,6 +2008,9 @@ static int __init pmz_console_setup(stru
> #ifdef CONFIG_PPC_PMAC
> if (uap->node == NULL)
> return -ENODEV;
> +#else
> + if (uap->pdev == NULL)
> + return -ENODEV;
> #endif
> port = &uap->port;
>
> Index: linux-git/drivers/tty/serial/pmac_zilog.h
> ===================================================================
> --- linux-git.orig/drivers/tty/serial/pmac_zilog.h 2011-12-13 00:18:02.000000000 +1100
> +++ linux-git/drivers/tty/serial/pmac_zilog.h 2011-12-13 00:23:55.000000000 +1100
> @@ -1,18 +1,9 @@
> #ifndef __PMAC_ZILOG_H__
> #define __PMAC_ZILOG_H__
>
> -#ifdef CONFIG_PPC_PMAC
> -/* We cannot use dev_* because this can be called early, way before
> - * we are matched with a device (when using it as a kernel console)
> - */
> #define pmz_debug(fmt, arg...) pr_debug("ttyPZ%d: " fmt, uap->port.line, ## arg)
> #define pmz_error(fmt, arg...) pr_err("ttyPZ%d: " fmt, uap->port.line, ## arg)
> #define pmz_info(fmt, arg...) pr_info("ttyPZ%d: " fmt, uap->port.line, ## arg)
> -#else
> -#define pmz_debug(fmt, arg...) dev_dbg(&uap->node->dev, fmt, ## arg)
> -#define pmz_error(fmt, arg...) dev_err(&uap->node->dev, fmt, ## arg)
> -#define pmz_info(fmt, arg...) dev_info(&uap->node->dev, fmt, ## arg)
> -#endif
>
> /*
> * At most 2 ESCCs with 2 ports each
next prev parent reply other threads:[~2011-12-12 20:06 UTC|newest]
Thread overview: 77+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-23 14:11 [PATCH 00/16] more mac68k fixes and cleanup Finn Thain
2011-10-23 14:11 ` [PATCH 01/16] pmac_zilog: fix unexpected irq Finn Thain
2011-10-23 14:11 ` Finn Thain
2011-11-24 14:34 ` Finn Thain
2011-11-24 14:34 ` Finn Thain
2011-11-24 14:56 ` Alan Cox
2011-11-24 14:56 ` Alan Cox
2011-11-24 20:41 ` Benjamin Herrenschmidt
2011-11-24 20:41 ` Benjamin Herrenschmidt
2011-11-25 3:15 ` Finn Thain
2011-11-25 3:15 ` Finn Thain
2011-11-28 0:30 ` Benjamin Herrenschmidt
2011-11-28 0:30 ` Benjamin Herrenschmidt
2011-11-24 15:28 ` David Laight
2011-11-24 15:28 ` David Laight
2011-11-24 20:43 ` Benjamin Herrenschmidt
2011-11-24 20:43 ` Benjamin Herrenschmidt
2011-12-06 15:13 ` [PATCH 01/16 v2] " Finn Thain
2011-12-06 15:13 ` Finn Thain
2011-12-06 15:27 ` Geert Uytterhoeven
2011-12-06 15:27 ` Geert Uytterhoeven
2011-12-07 1:26 ` Finn Thain
2011-12-07 1:26 ` Finn Thain
2011-12-06 15:39 ` Alan Cox
2011-12-06 15:39 ` Alan Cox
2011-12-07 3:49 ` [PATCH 01/16 v3] " Finn Thain
2011-12-07 3:49 ` Finn Thain
2011-12-08 3:17 ` Benjamin Herrenschmidt
2011-12-08 3:17 ` Benjamin Herrenschmidt
2011-12-08 4:20 ` Benjamin Herrenschmidt
2011-12-08 4:20 ` Benjamin Herrenschmidt
2011-12-08 4:30 ` Benjamin Herrenschmidt
2011-12-08 4:30 ` Benjamin Herrenschmidt
2011-12-08 11:26 ` Finn Thain
2011-12-08 11:26 ` Finn Thain
2011-12-08 11:54 ` Geert Uytterhoeven
2011-12-08 11:54 ` Geert Uytterhoeven
2011-12-08 19:44 ` Benjamin Herrenschmidt
2011-12-08 19:44 ` Benjamin Herrenschmidt
2011-12-11 23:48 ` Benjamin Herrenschmidt
2011-12-11 23:48 ` Benjamin Herrenschmidt
2011-12-11 23:55 ` Benjamin Herrenschmidt
2011-12-11 23:55 ` Benjamin Herrenschmidt
2011-12-12 13:34 ` Finn Thain
2011-12-12 13:34 ` Finn Thain
2011-12-12 20:06 ` Benjamin Herrenschmidt [this message]
2011-12-12 20:06 ` Benjamin Herrenschmidt
2011-12-13 1:24 ` Finn Thain
2011-12-13 1:24 ` Finn Thain
2011-10-23 14:11 ` [PATCH 02/16] macfb: fix black and white modes Finn Thain
2011-10-23 14:11 ` Finn Thain
2011-12-10 5:23 ` Finn Thain
2011-12-10 5:23 ` Finn Thain
2011-10-23 14:11 ` [PATCH 03/16] mac_sonic: add irq resources and cleanup Finn Thain
2011-11-13 10:28 ` Geert Uytterhoeven
2011-11-13 14:30 ` Finn Thain
2011-11-13 17:36 ` Geert Uytterhoeven
2011-12-10 5:23 ` Finn Thain
2011-10-23 14:11 ` [PATCH 04/16] m68k/mac: early console Finn Thain
2011-10-23 14:11 ` [PATCH 05/16] m68k/mac: cleanup mac_clear_irq Finn Thain
2011-10-23 14:11 ` [PATCH 06/16] m68k/mac: cleanup mac_irq_pending Finn Thain
2011-12-10 5:24 ` Finn Thain
2011-10-23 14:11 ` [PATCH 07/16] m68k/mac: cleanup forward declarations Finn Thain
2011-10-23 14:11 ` [PATCH 08/16] m68k/mac: enable via_alt_mapping on performa 580 Finn Thain
2011-10-23 14:11 ` [PATCH 09/16] m68k/mac: fix nubus slot irq disable and shutdown Finn Thain
2011-10-23 14:11 ` [PATCH 10/16] m68k/mac: oss irq fixes Finn Thain
2011-10-23 14:11 ` [PATCH 11/16] m68k/mac: fix baboon irq disable and shutdown Finn Thain
2011-10-23 14:11 ` [PATCH 12/16] m68k/mac: fix powerbook 150 adb_type Finn Thain
2011-10-23 14:11 ` [PATCH 13/16] mac_scsi: fix mac_scsi on some powerbooks Finn Thain
2011-12-10 5:24 ` Finn Thain
2011-10-23 14:11 ` [PATCH 14/16] m68k/mac: cleanup macro case Finn Thain
2011-10-23 14:11 ` [PATCH 15/16] mac_scsi: dont enable mac_scsi irq before requesting it Finn Thain
2011-12-10 5:24 ` Finn Thain
2011-10-23 14:11 ` [PATCH 16/16] mac_esp: rename irq Finn Thain
2011-12-10 5:24 ` Finn Thain
2011-10-31 18:35 ` [PATCH 00/16] more mac68k fixes and cleanup Geert Uytterhoeven
2011-10-31 19:16 ` Geert Uytterhoeven
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1323720383.19891.21.camel@pasglop \
--to=benh@kernel.crashing.org \
--cc=fthain@telegraphics.com.au \
--cc=geert@linux-m68k.org \
--cc=linux-m68k@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.