29 Aug, 2005

35 commits

  • If both CONFIG_XMON and CONFIG_XMON_DEFAULT is enabled in the .config,
    there is no way to disable xmon again. setup_system calls first xmon_init,
    later parse_early_param. So a new 'xmon=off' cmdline option will do the right
    thing.

    Signed-off-by: Olaf Hering
    Signed-off-by: Paul Mackerras

    Olaf Hering
     
  • We can now remove CONFIG_MSCHUNKS as it doesn't do anything interesting
    anymore.

    The only macro in abs_addr.h which is called by non-iSeries code is
    phys_to_abs(), so remove the other dummy implementations, and we add a
    firmware feature check to phys_to_abs().

    Signed-off-by: Michael Ellerman
    Signed-off-by: Paul Mackerras

    Michael Ellerman
     
  • lmb_phys_mem_size() can always return lmb.memory.size, as long as it's called
    after lmb_analyze(), which it is. There's no need to recalculate the size on
    every call.

    lmb_analyze() was calculating a few things we then threw away, so just don't
    calculate them to start with.

    Signed-off-by: Michael Ellerman
    Signed-off-by: Paul Mackerras

    Michael Ellerman
     
  • We no longer need the lmb code to know about abs and phys addresses, so
    remove the physbase variable from the lmb_property struct.

    Signed-off-by: Michael Ellerman
    Signed-off-by: Paul Mackerras

    Michael Ellerman
     
  • abs_to_phys() is a macro that turns out to do nothing, and also has the
    unfortunate property that it's not the inverse of phys_to_abs() on iSeries.

    The following is for my benefit as much as everyone else.

    With CONFIG_MSCHUNKS enabled, the lmb code is changed such that it keeps
    a physbase variable for each lmb region. This is used to take the possibly
    discontiguous lmb regions and present them as a contiguous address space
    beginning from zero.

    In this context each lmb region's base address is its "absolute" base
    address, and its physbase is it's "physical" address (from Linux's point of
    view). The abs_to_phys() macro does the mapping from "absolute" to "physical".

    Note: This is not related to the iSeries mapping of physical to absolute
    (ie. Hypervisor) addresses which is maintained with the msChunks structure.
    And the msChunks structure is not controlled via CONFIG_MSCHUNKS.

    Once upon a time you could compile for non-iSeries with CONFIG_MSCHUNKS
    enabled. But these days CONFIG_MSCHUNKS depends on CONFIG_PPC_ISERIES, so
    for non-iSeries code abs_to_phys() is a no-op.

    On iSeries we always have one lmb region which spans from 0 to
    systemcfg->physicalMemorySize (arch/ppc64/kernel/iSeries_setup.c line 383).
    This region has a base (ie. absolute) address of 0, and a physbase address
    of 0 (as calculated in lmb_analyze() (arch/ppc64/kernel/lmb.c line 144)).

    On iSeries, abs_to_phys(aa) is defined as lmb_abs_to_phys(aa), which finds
    the lmb region containing aa (and there's only one, ie. 0), and then does:

    return lmb.memory.region[0].physbase + (aa - lmb.memory.region[0].base)

    physbase == base == 0, so you're left with "return aa".

    So remove abs_to_phys(), and lmb_abs_to_phys() which is the implementation
    of abs_to_phys() for iSeries.

    Signed-off-by: Michael Ellerman
    Signed-off-by: Paul Mackerras

    Michael Ellerman
     
  • The lmb code is all written to use a pointer to an lmb struct. But it's always
    the same lmb struct, called "lmb". So we take the address of lmb, call it
    _lmb and then start using _lmb->foo everywhere, which is silly.

    This patch removes the _lmb pointers and replaces them with direct references
    to the one "lmb" struct. We do the same for some _mem and _rsv pointers which
    point to lmb.memory and lmb.reserved respectively.

    This patch looks quite busy, but it's basically just:
    s/_lmb->/lmb./g
    s/_mem->/lmb.memory./g
    s/_rsv->/lmb.reserved./g
    s/_rsv/&lmb.reserved/g
    s/mem->/lmb.memory./g

    Signed-off-by: Michael Ellerman
    Signed-off-by: Paul Mackerras

    Michael Ellerman
     
  • physRpn_to_absRpn is a no-op on non-iSeries platforms, remove the two
    redundant calls.

    There's only one caller on iSeries so fold the logic in there so we can get
    rid of it completely.

    Signed-off-by: Michael Ellerman
    Signed-off-by: Paul Mackerras

    Michael Ellerman
     
  • The only caller of chunk_offset() and abs_chunk() is phys_to_abs(), so
    fold the former two into the latter.

    Signed-off-by: Michael Ellerman
    Signed-off-by: Paul Mackerras

    Michael Ellerman
     
  • Rename the msChunks struct to get rid of the StUdlY caps and make it a bit
    clearer what it's for.

    Signed-off-by: Michael Ellerman
    Signed-off-by: Paul Mackerras

    Michael Ellerman
     
  • Chunks are 256KB, so use constants for the size/shift/mask, rather than
    getting them from the msChunks struct. The iSeries debugger (??) might still
    need access to the values in the msChunks struct, so we keep them around
    for now, but set them from the constant values.

    Replace msChunks_entry typedef with regular u32.

    Simplify msChunks_alloc() to manipulate klimit directly, rather than via
    a parameter.

    Move msChunks_alloc() and msChunks into iSeries_setup.c, as that's where
    they're used.

    Signed-off-by: Michael Ellerman
    Signed-off-by: Paul Mackerras

    Michael Ellerman
     
  • The msChunks code was written to work on pSeries, but now it's only used on
    iSeries. This means there's no need to do PTRRELOC anymore, so remove it all.

    A few places were getting "extern reloc_offset()" from abs_addr.h, move it
    into system.h instead.

    Signed-off-by: Michael Ellerman
    Signed-off-by: Paul Mackerras

    Michael Ellerman
     
  • Signed-off-by: Stephen Rothwell
    Signed-off-by: Paul Mackerras

    Stephen Rothwell
     
  • Make firmware_has_feature() evaluate at compile time for the non pSeries
    case and tidy up code where possible.

    Signed-off-by: Stephen Rothwell
    Signed-off-by: Paul Mackerras

    Stephen Rothwell
     
  • Create the firmware_has_feature() inline and move the firmware feature
    stuff into its own header file.

    Signed-off-by: Stephen Rothwell
    Signed-off-by: Paul Mackerras

    Stephen Rothwell
     
  • The firmware_features field of struct cpu_spec should really be a separate
    variable as the firmware features do not depend on the chip and the
    bitmask is constructed independently. By removing it, we save 112 bytes
    from the cpu_specs array and we access the bitmask directly instead of via
    the cur_cpu_spec pointer.

    Signed-off-by: Stephen Rothwell
    Signed-off-by: Paul Mackerras

    Stephen Rothwell
     
  • The ppc64 head.S defines several zero-initialized structures, such as
    the empty_zero_page and the kernel top-level pagetable. Currently
    they are defined to be in the data section. However, they're not used
    until after the bss is cleared, so this patch moves them to the bss,
    saving two and a half pages from the vmlinux.

    Signed-off-by: David Gibson
    Signed-off-by: Paul Mackerras

    David Gibson
     
  • This patch adjust some comments in head.S for accuracy, clarity, and
    spelling.

    Signed-off-by: David Gibson
    Signed-off-by: Paul Mackerras

    David Gibson
     
  • arch/ppc64/kernel/head.S #defines SECONDARY_PROCESSORS then has some
    #ifdefs based on it. Whatever purpose this had is long lost, this
    patch removes it.

    Likewise, head.S defines H_SET_ASR, which is now defined, along with
    other hypervisor call numbers in hvcall.h. This patch deletes it, as
    well, from head.S.

    Signed-off-by: David Gibson
    Signed-off-by: Paul Mackerras

    David Gibson
     
  • An #if/#else construct near the top of ppc64's head.S appears to
    create overlapping sections of code for iSeries and pSeries (i.e. one
    thing on iSeries and something different in the same place on
    pSeries). In fact, checking the various absolute offsets, it doesn't.
    This patch unravels the #ifdefs to make it more obvious what's going
    on. This accomplishes another microstep towards a single kernel image
    which can boot both iSeries and pSeries.

    Signed-off-by: David Gibson
    Signed-off-by: Paul Mackerras

    David Gibson
     
  • As well as the interrupt vectors and initialization code, head.S
    contains several asm functions which are used during runtime. This
    patch moves these to misc.S, a more sensible location for random asm
    support code. A couple The functions moved are:
    disable_kernel_fp
    giveup_fpu
    disable_kernel_altivec
    giveup_altivec
    __setup_cpu_power3 (empty function)

    Signed-off-by: David Gibson
    Signed-off-by: Paul Mackerras

    David Gibson
     
  • On ppc64 machines with segment tables, CPU0's segment table is at a
    fixed address, currently 0x9000. This patch moves it to the free
    space at 0x6000, just below the fwnmi data area. This saves 8k of
    space in vmlinux and the runtime kernel image.

    Signed-off-by: David Gibson
    Signed-off-by: Paul Mackerras

    David Gibson
     
  • In the ppc64 kernel head.S there is currently quite a lot of unused
    space between the naca (at fixed address 0x4000) and the fwnmi data
    area (at fixed address 0x7000). This patch moves various exception
    vectors and support code into this region to use the wasted space.

    The functions load_up_fpu and load_up_altivec are moved down as well,
    since they are essentially continuations of the fp_unavailable_common
    and altivec_unavailable_common vectors, respectively.

    Likewise, the fwnmi vectors themselves are moved down into this area,
    because while the location of the fwnmi data area is fixed by the RPA,
    the vectors themselves can be anywhere sufficiently low.

    Signed-off-by: David Gibson
    Signed-off-by: Paul Mackerras

    David Gibson
     
  • Comments in head.S suggest that the iSeries naca has a fixed address,
    because tools expect to find it there. The only tool which appears to
    access the naca is addRamDisk, but both the in-kernel version and the
    version used in RHEL and SuSE in fact locate the NACA the same way as
    the hypervisor does, by following the pointer in the hvReleaseData
    structure.

    Since the requirement for a fixed address seems to be obsolete, this
    patch removes the naca from head.S and replaces it with a normal C
    initializer.

    For good measure, it removes an old version of addRamDisk.c which was
    sitting, unused, in the ppc32 tree.

    Signed-off-by: David Gibson
    Signed-off-by: Paul Mackerras

    David Gibson
     
  • This patch just splits out the pSeries specific parts of vio.c.

    Signed-off-by: Stephen Rothwell
    Signed-off-by: Paul Mackerras

    Stephen Rothwell
     
  • This patch allows us to have a different bus if matching function for
    each platform.

    Signed-off-by: Stephen Rothwell
    Signed-off-by: Paul Mackerras

    Stephen Rothwell
     
  • Since the iSeries vio iommu tables cannot be used until after the vio bus has
    been initialised, move the initialisation of the tables to there.

    Signed-off-by: Stephen Rothwell
    Signed-off-by: Paul Mackerras

    Stephen Rothwell
     
  • This patch splits the iSeries specific parts out of vio.c.

    Signed-off-by: Stephen Rothwell
    Signed-off-by: Paul Mackerras

    Stephen Rothwell
     
  • arch/ppc64/Kconfig defines a "General setup" menu, but also sources
    init/Kconfig which also defines a "General setup" menu. Both of these
    menus appear at the top level of make menuconfig. Having two menus with
    the same name is confusing. This patch renames the ppc64/Kconfig menu to
    be "Bus Options" and moves options in this menu which are not bus related
    to the end of the "Platform support" menu.

    There are many variations among architectures on the exact naming of the
    "Bus Options" menu. I chose to use the simplest one, which is also used
    in arch/ppc/Kconfig.

    Signed-off-by: Frank Rowand
    Signed-off-by: Paul Mackerras

    Frank Rowand
     
  • OpenFirmware marks devices as failed in the device-tree when a hardware
    problem is detected. The kernel needs to fail config reads/writes to
    prevent a kernel crash when incorrect data is read.

    This patch validates that the device-node is not marked "fail" when
    config space reads/writes are attempted.

    Signed-off-by: Jake Moilanen
    Signed-off-by: Paul Mackerras

    Jake Moilanen
     
  • This patch updates the format of the flattened device-tree passed
    between the boot trampoline and the kernel to support a more compact
    representation, for use by embedded systems mostly.

    Signed-off-by: Benjamin Herrenschmidt
    Signed-off-by: Paul Mackerras

    Benjamin Herrenschmidt
     
  • Implement 4-level pagetables for ppc64

    This patch implements full four-level page tables for ppc64, thereby
    extending the usable user address range to 44 bits (16T).

    The patch uses a full page for the tables at the bottom and top level,
    and a quarter page for the intermediate levels. It uses full 64-bit
    pointers at every level, thus also increasing the addressable range of
    physical memory. This patch also tweaks the VSID allocation to allow
    matching range for user addresses (this halves the number of available
    contexts) and adds some #if and BUILD_BUG sanity checks.

    Signed-off-by: David Gibson
    Signed-off-by: Paul Mackerras

    David Gibson
     
  • Make the bootheader for ppc64 independent from kernel and libc headers.
    * add -nostdinc -isystem $gccincludes to not include libc headers
    * declare all functions in header files, also the stuff from string.S
    * declare some functions static
    * use stddef.h to get size_t (hopefully ok)
    * remove ppc32-types.h, only elf.h used the __NN types

    With further modifications by Paul Mackerras and Stephen Rothwell.

    Signed-off-by: Olaf Hering
    Signed-off-by: Paul Mackerras

    Olaf Hering
     
  • Linus Torvalds
     
  • Bugfix (usage of uninitialized pointer in zfcp_port_dequeue) and compile
    fixes for the zfcp device driver.

    Signed-off-by: Heiko Carstens
    Acked-by: James Bottomley
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Heiko Carstens
     
  • struct zfcp_port::scsi_id was removed by commit
    3859f6a248cbdfbe7b41663f3a2b51f48e30b281

    Signed-off-by: Alexey Dobriyan
    Signed-off-by: Linus Torvalds

    Alexey Dobriyan
     

28 Aug, 2005

5 commits

  • Linus Torvalds
     
  • [ Same race and same patch also by Steven Rostedt ]

    I have a laptop (G3 powerbook) which will pretty reliably hit a race
    between con_open and con_close late in the boot process and oops in
    vt_ioctl due to tty->driver_data being NULL.

    What happens is this: process A opens /dev/tty6; it comes into
    con_open() (drivers/char/vt.c) and assign a non-NULL value to
    tty->driver_data. Then process A closes that and concurrently process
    B opens /dev/tty6. Process A gets through con_close() and clears
    tty->driver_data, since tty->count == 1. However, before process A
    can decrement tty->count, we switch to process B (e.g. at the
    down(&tty_sem) call at drivers/char/tty_io.c line 1626).

    So process B gets to run and comes into con_open with tty->count == 2,
    as tty->count is incremented (in init_dev) before con_open is called.
    Because tty->count != 1, we don't set tty->driver_data. Then when the
    process tries to do anything with that fd, it oopses.

    The simple and effective fix for this is to test tty->driver_data
    rather than tty->count in con_open. The testing and setting of
    tty->driver_data is serialized with respect to the clearing of
    tty->driver_data in con_close by the console_sem. We can't get a
    situation where con_open sees tty->driver_data != NULL and then
    con_close on a different fd clears tty->driver_data, because
    tty->count is incremented before con_open is called. Thus this patch
    eliminates the race, and in fact with this patch my laptop doesn't
    oops.

    Signed-off-by: Paul Mackerras
    [ Same patch
    Signed-off-by: Steven Rostedt
    in http://marc.theaimsgroup.com/?l=linux-kernel&m=112450820432121&w=2 ]
    Signed-off-by: Linus Torvalds

    Paul Mackerras
     
  • This patch fixes a severe problem with 2.6.13-rc7.

    Due to recent SCSI changes it is not possible to add any LUNs to the zfcp
    device driver anymore. With registration of remote ports this is fixed.

    Signed-off-by: Andreas Herrmann
    Acked-by: James Bottomley
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andreas Herrmann
     
  • I know that scsi procfs is legacy code but this is a fix for a memory leak.

    While reading through sg.c I realized that the implementation of
    /proc/scsi/sg/devices with seq_file is leaking memory due to freeing the
    pointer returned by the next() iterator method. Since next() might return
    NULL or an error this is wrong. This patch fixes it through using the
    seq_files private field for holding the reference to the iterator object.

    Here is a small bash script to trigger the leak. Use slabtop to watch
    the size-32 usage grow and grow.

    #!/bin/sh

    while true; do
    cat /proc/scsi/sg/devices > /dev/null
    done

    Signed-off-by: Jan Blunck
    Acked-by: James Bottomley
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jan Blunck
     
  • Fixed race between submitting streaming URBs in the driver and starting
    the actual transfer in hardware (demodulator and USB controller) which
    sometimes lead to garbled data transfers. URBs are now submitted first,
    then the transfer is enabled. Dibusb devices and clones are now fully
    functional again.

    Signed-off-by: Patrick Boettcher
    Signed-off-by: Linus Torvalds

    Patrick Boettcher