[PATCH] interrupt driven hvc_console as vio device (final)

From: Ryan Arnold (rsa_at_us.ibm.com)
Date: 08/27/04

  • Next message: Wouter Van Hemel: "Re: Summarizing the PWC driver questions/answers"
    To: Kernel Mailing List <linux-kernel@vger.kernel.org>
    Date:	Fri, 27 Aug 2004 04:40:44 -0500
    
    

    Andrew,

    Here is the revised hvc_console patch which fixes the issues you were
    concerned with in the previous patch. Your two concerns were:

    1. Yielding in hvc_close(). This was replaced with
    tty_wait_until_sent() which seem to be built for this exact scenario. I
    also restructured hvc_close() to be more elegant and less confusing than
    in the previous patch.

    2. Spinlocks in hvc_chars_in_buffer() and hvc_write_room() which simply
    protected values read from hvc_struct instances. I removed the
    spinlocks and didn't put in memory barriers because they really weren't
    needed.

    Paul MacKerras approved the architecture portions of the previous
    incarnation of this patch and I have touched the arch code in this
    revision. Ben Herrenschmidt, who contributed a portion of the orignal
    code this patch was based on has signed off on this patch.

    Changelog:

    This is an hvc_console patch which provides driver and ppc64
    architecture fixes to enable the hvc_console driver to register itself
    as a vio device with the vio bus, provide hotplug add/remove for vty
    adapters, and act as an interrupt driven driver on Power-5 hardware or
    remain as a polling driver on Power-4 hardware.

    arch/ppc64/kernel/hvconsole.c
    -----------------------------------------------------------------------
    -Changed hvc_get_chars() and hvc_put_chars() api to take vtermno rather
    than index number.

    -Added hvc_find_vtys() function which walks the bus looking for
    vterm/vty devices to callback to the hvc_console driver. This provides
    console output functionality prior to early console init (pre mem init
    and pre device probe).

    include/asm-ppc64/hvconsole.h
    -----------------------------------------------------------------------

    -Changed hvc_get_chars() and hvc_put_chars() api to take vtermno rather
    than index number.

    -Added hvc_find_vtys() function.

    -Added hvc_instantiate() function which is implemented by a console
    driver wanting to receive a callback of and early console init.

    drivers/char/hvc_console.c
    -----------------------------------------------------------------------

    -Switch khvcd from kernel_threads to kthreads which got rid of
    deprecated daemonize().

    -Added module exit clause to be thorough (not terribly necessary with a
    console driver of course)

    -Added early discovery of vterm/vty adapters by doing a bus walk on
    early console init which results in hvc_instantiate() callback and
    addition of the vtermno into a static array of vtermnos supported as
    console adapters (meaning the console api's work against these vtermnos
    prior to full console initialization).

    -This driver is now registered as a vio driver which means that vty
    adapters are now managed via probe/remove. This means hvc_console
    supports hotplug vty adapters.

    -Driver now requests more device nodes than what was found on the
    initial bus walk when registered as a tty driver to make room for
    hotplug vty adapters. These secondary vty adapters provide a tty tunnel
    between partitions.

    -Removed static hvc_struct array and replaced with a linux list that has
    elements (hvc_struct instances) added/removed on probe/remove AFTER
    early console init. This is important because kmalloc can't be done at
    early console init.

    -Driver now either runs in interrupt driven mode or in polling mode on
    older hardware. The khvcd is smart enough to not 'schedule()' when
    there are no interrupts.

    -kobjects are now used for ref counting on the hvc_struct instances.

    -This driver puts the tty layer to sleep on hvc_close() if there are
    pending data writes being blocked by firmware.

    -Removed useless spinlocks in hvc_chars_in_buffer() and hvc_write_room.

    Thanks,

    Ryan S. Arnold
    IBM Linux Technology Center

    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/


  • Next message: Wouter Van Hemel: "Re: Summarizing the PWC driver questions/answers"

    Relevant Pages

    • [PATCH] interrupt driven hvc_console as vio device
      ... This is an hvc_console patch which provides driver and ppc64 ... Paul MacKerras should probably approve this patch since it includes ... console output functionality prior to early console init (pre mem init ... -Added early discovery of vterm/vty adapters by doing a bus walk on ...
      (Linux-Kernel)
    • [PATCH] interrupt driven hvc_console as vio device (final)
      ... This is an hvc_console patch which provides driver and ppc64 ... console output functionality prior to early console init (pre mem init ... driver wanting to receive a callback of and early console init. ... -Added early discovery of vterm/vty adapters by doing a bus walk on ...
      (Linux-Kernel)
    • Re: Mostly revert "e1000/e1000e: Move PCI-Express device IDs over to e1000e"
      ... I think we have agreed on a solution where the ID's show up in the old driver if the new driver is not enabled at all. ... So I'd suggest the final patch be something like this, but I'm sendign it out just as an example of how we could solve this, not necessarily as a final patch. ... For PCI or PCI-X e1000 adapters, ...
      (Linux-Kernel)
    • Re: Mostly revert "e1000/e1000e: Move PCI-Express device IDs over to e1000e"
      ... Andrew was concerned about this when the driver was in -mm. ... He asked for a patch that would set E1000E to same value as E1000 ... For PCI or PCI-X e1000 adapters, ...
      (Linux-Kernel)
    • Re: [PATCH][SCSI] hptiop: add more adapter models and other fixes
      ... support for adapters based on Marvell IOP ... This patch is 1200 lines long ... and you'd be better off adding a second driver for the 4xxx cards. ...
      (Linux-Kernel)