16 Jul, 2008

1 commit


14 Jul, 2008

7 commits


28 Jun, 2008

1 commit


19 Jun, 2008

8 commits

  • Emphasize the recommendation to build only one stack.
    Trim the prompts to better fit into short attention spans.

    Signed-off-by: Stefan Richter

    Stefan Richter
     
  • If the low-level driver failed to initialize a card properly without
    noticing it, fw-core was blocked indefinitely when trying to send a
    PHY config packet. This hung up the events kernel thread, e.g. locked
    up keyboard input.
    https://bugzilla.redhat.com/show_bug.cgi?id=444694
    https://bugzilla.redhat.com/show_bug.cgi?id=446763

    This problem was introduced between 2.6.25 and 2.6.26-rc1 by commit
    2a0a2590498be7b92e3e76409c9b8ee722e23c8f "firewire: wait until PHY
    configuration packet was transmitted (fix bus reset loop)".

    The solution is to wait with timeout. I tested it with 7 different
    working controllers and 1 non-working controller. On the working ones,
    the packet callback complete()s usually --- but not always --- before a
    timeout of 10ms. Hence I chose a safer timeout of 100ms.

    On the few tests with the non-working controller ALi M5271, PHY config
    packet transmission always timed out so far. (Fw-ohci needs to be fixed
    for this controller independently of this deadline fix. Often the core
    doesn't even attempt to send a phy config because not even self ID
    reception works.)

    Signed-off-by: Stefan Richter

    Stefan Richter
     
  • The messages which can be enabled by fw-ohci's debug module parameter
    are changed from KERN_DEBUG to KERN_NOTICE level and uniformly prefixed
    with "firewire_ohci: ". This further simplifies communication with
    users when we ask them to capture debug messages.

    Signed-off-by: Stefan Richter

    Stefan Richter
     
  • Callers of fill_bus_reset_event() have to take card->lock. Otherwise
    access to node data may oops if node removal is in progress.

    A lockless alternative would be

    - event->local_node_id = card->local_node->node_id;
    + tmp = fw_node_get(card->local_node);
    + event->local_node_id = tmp->node_id;
    + fw_node_put(tmp);

    and ditto with the other node pointers which fill_bus_reset_event()
    accesses. But I went the locked route because one of the two callers
    already holds the lock. As a bonus, we don't need the memory barrier
    anymore because device->generation and device->node_id are written in
    a card->lock protected section.

    Signed-off-by: Stefan Richter
    Signed-off-by: Kristian Høgsberg

    Stefan Richter
     
  • OHCI 1.1 clause 5.10 requires that selfIDBufferPtr is valid when a 1 is
    written into LinkControl.rcvSelfID.

    This driver bug has so far not been known to cause harm because most
    chips obviously accept a later selfIDBufferPtr write, at least before
    HCControl.linkEnable is written.

    Signed-off-by: Stefan Richter
    Signed-off-by: Jarod Wilson
    Signed-off-by: Kristian Høgsberg

    Stefan Richter
     
  • We want the rcvPhyPkt bit in LinkControl off before we start using the
    chip. However, the spec says that the reset value of it is undefined.
    Hence switch it explicitly off.

    https://bugzilla.redhat.com/show_bug.cgi?id=244576#c48 shows that for
    example the nForce2 integrated FireWire controller seems to have it on
    by default.

    Signed-off-by: Stefan Richter
    Signed-off-by: Jarod Wilson

    Stefan Richter
     
  • header_length and payload_length are filled with random data if an
    unknown tcode was read from the AR buffer (i.e. if the AR buffer
    contained invalid data).

    We still need a better strategy to recover from this, but at least
    handle_ar_packet now doesn't return out of bound buffer addresses
    anymore.

    Signed-off-by: Stefan Richter

    Stefan Richter
     
  • BUG() at this place is wrong. (Unless if the low level driver would
    already do higher-level input validation of incoming request headers.)

    Invalid incoming requests or bugs in the controller which corrupt the
    AR-req buffer needlessly crashed the box because this is run in tasklet
    context.

    Signed-off-by: Stefan Richter

    Stefan Richter
     

21 May, 2008

1 commit

  • If userspace ignores the POLLERR bit from poll(), and only attempts to
    read() the device when POLLIN is set, it can still make ioctl() calls on
    a device that has been removed from the system. The node_id and
    generation returned by GET_INFO will be outdated, but INITIATE_BUS_RESET
    would still cause a bus reset, and GET_CYCLE_TIMER will return data.
    And if you guess the correct generation to use, you can send requests to
    a different device on the bus, and get responses back.

    This patch prevents open, ioctl, compat_ioctl, and mmap against shutdown
    devices.

    Signed-off-by: Jay Fenlason
    Signed-off-by: Stefan Richter

    Jay Fenlason
     

03 May, 2008

1 commit

  • * git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6:
    [SCSI] aic94xx: fix section mismatch
    [SCSI] u14-34f: Fix 32bit only problem
    [SCSI] dpt_i2o: sysfs code
    [SCSI] dpt_i2o: 64 bit support
    [SCSI] dpt_i2o: move from virt_to_bus/bus_to_virt to dma_alloc_coherent
    [SCSI] dpt_i2o: use standard __init / __exit code
    [SCSI] megaraid_sas: fix suspend/resume sections
    [SCSI] aacraid: Add Power Management support
    [SCSI] aacraid: Fix jbod operations scan issues
    [SCSI] aacraid: Fix warning about macro side-effects
    [SCSI] add support for variable length extended commands
    [SCSI] Let scsi_cmnd->cmnd use request->cmd buffer
    [SCSI] bsg: add large command support
    [SCSI] aacraid: Fix down_interruptible() to check the return value correctly
    [SCSI] megaraid_sas; Update the Version and Changelog
    [SCSI] ibmvscsi: Handle non SCSI error status
    [SCSI] bug fix for free list handling
    [SCSI] ipr: Rename ipr's state scsi host attribute to prevent collisions
    [SCSI] megaraid_mbox: fix Dell CERC firmware problem

    Linus Torvalds
     

02 May, 2008

3 commits

  • - struct scsi_cmnd had a 16 bytes command buffer of its own.
    This is an unnecessary duplication and copy of request's
    cmd. It is probably left overs from the time that scsi_cmnd
    could function without a request attached. So clean that up.

    - Once above is done, few places, apart from scsi-ml, needed
    adjustments due to changing the data type of scsi_cmnd->cmnd.

    - Lots of drivers still use MAX_COMMAND_SIZE. So I have left
    that #define but equate it to BLK_MAX_CDB. The way I see it
    and is reflected in the patch below is.
    MAX_COMMAND_SIZE - means: The longest fixed-length (*) SCSI CDB
    as per the SCSI standard and is not related
    to the implementation.
    BLK_MAX_CDB. - The allocated space at the request level

    - I have audit all ISA drivers and made sure none use ->cmnd in a DMA
    Operation. Same audit was done by Andi Kleen.

    (*)fixed-length here means commands that their size can be determined
    by their opcode and the CDB does not carry a length specifier, (unlike
    the VARIABLE_LENGTH_CMD(0x7f) command). This is actually not exactly
    true and the SCSI standard also defines extended commands and
    vendor specific commands that can be bigger than 16 bytes. The kernel
    will support these using the same infrastructure used for VARLEN CDB's.
    So in effect MAX_COMMAND_SIZE means the maximum size command
    scsi-ml supports without specifying a cmd_len by ULD's

    Signed-off-by: Boaz Harrosh
    Signed-off-by: James Bottomley

    Boaz Harrosh
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6:
    firewire: fw-sbp2: log scsi_target ID at release
    ieee1394: fix NULL pointer dereference in sysfs access

    Linus Torvalds
     
  • Makes the good-by message more informative.

    Signed-off-by: Stefan Richter
    Signed-off-by: Jarod Wilson

    Stefan Richter
     

19 Apr, 2008

2 commits


18 Apr, 2008

16 commits

  • This patch contains the following cleanups:
    - #if 0 the following unused structs:
    - fw-transaction.c:fw_low_memory_region
    - fw-transaction.c:fw_private_region
    - fw-transaction.c:fw_csr_region
    - fw-transaction.c:fw_unit_space_region
    - remove the following unused EXPORT_SYMBOL's:
    - fw-card.c:fw_core_add_descriptor
    - fw-card.c:fw_core_remove_descriptor
    - fw-iso.c:fw_iso_context_create
    - fw-iso.c:fw_iso_context_destroy
    - fw-iso.c:fw_iso_context_start
    - fw-iso.c:fw_iso_context_queue
    - fw-iso.c:fw_iso_context_stop

    Signed-off-by: Adrian Bunk
    Signed-off-by: Stefan Richter

    Adrian Bunk
     
  • Fix: The fact that nodes had different gap counts would be overlooked
    if the bus manager code would pick gap count 63 because of beta
    repeaters or because of very large hop counts. In this case, the bus
    manager code would miss that it actually has to send the PHY config
    packet with gap count 63.

    Related trivial changes: Use bool for an int used as bool, touch up
    some comments.

    Signed-off-by: Stefan Richter

    Stefan Richter
     
  • We now exit fw_send_phy_config /after/ the PHY config packet has been
    transmitted, instead of before. A subsequent fw_core_initiate_bus_reset
    will therefore not overlap with the transmission. This is meant to make
    the send PHY config packet + reset bus routine more deterministic.

    Fixes bus reset loop and eventual panic with
    - VIA VT6307 + IOGEAR hub + Unibrain Fire-i camera
    http://bugzilla.kernel.org/show_bug.cgi?id=10128
    - JMicron card

    Signed-off-by: Stefan Richter
    Signed-off-by: Jarod Wilson

    Stefan Richter
     
  • request_generation is internal to fw-ohci and unneeded in fw_card.

    Signed-off-by: Stefan Richter

    Stefan Richter
     
  • for code efficiency.

    Signed-off-by: Jarod Wilson
    Signed-off-by: Stefan Richter

    Jarod Wilson
     
  • Trivial change to replace more meaningless (to the untrained eye) hex
    values with defined CSR constants.

    Signed-off-by: Jarod Wilson
    Signed-off-by: Stefan Richter

    Jarod Wilson
     
  • When a device changes its configuration ROM, it announces this with a
    bus reset. firewire-core has to check which node initiated a bus reset
    and whether any unit directories went away or were added on this node.

    Tested with an IOI FWB-IDE01AB which has its link-on bit set if bus
    power is available but does not respond to ROM read requests if self
    power is off. This implements
    - recognition of the units if self power is switched on after fw-core
    gave up the initial attempt to read the config ROM,
    - shutdown of the units when self power is switched off.

    Also tested with a second PC running Linux/ieee1394. When the eth1394
    driver is inserted and removed on that node, fw-core now notices the
    addition and removal of the IPv4 unit on the ieee1394 node.

    Signed-off-by: Stefan Richter

    Stefan Richter
     
  • read_bus_info_block() is repeatedly called by workqueue jobs.
    These will step on each others toes eventually if there are multiple
    workqueue threads, and we end up with corrupt config ROM images.

    Signed-off-by: Stefan Richter

    Stefan Richter
     
  • Unlike the ohci1394 driver, fw-ohci uses the selfIDGeneration field of
    bus reset packets to determine the generation of incoming requests as
    per OHCI 1.1 clause 8.4.2.3. This is more precise --- provided that the
    controller inserts the correct generation. Texas Instruments chips
    often don't.

    This prevented the transmission of response packets, which for example
    broke AV/C transactions as used when communicating with miniDV cameras
    and any other AV/C devices.

    There is apparently no way to detect and adjust incorrect generations.
    Therefore we ignore the generation of bus reset packets from TI chips
    and use the generation of the self ID buffer instead. Alas this is
    received at a slightly wrong time. In rare cases, this could cause us
    to not respond to legitimate requests or to respond to expired requests.
    (The latter is less likely because the bus reset packet AR event is
    typically handled before the self ID complete event.)

    Bug reported by Mladen Kuntner, who was extraordinarily patient while
    dealing with the driver maintainers. Fix confirmed to be required and
    effective for TSB82AA2 and a TSB43AB22 or TSB43AB22A.
    https://bugzilla.redhat.com/show_bug.cgi?id=243081

    Signed-off-by: Stefan Richter
    Signed-off-by: Jarod Wilson

    Stefan Richter
     
  • Extend the logging of "AR evt_bus_reset, link internal" to "AR
    evt_bus_reset, generation ${selfIDGeneration}". That way we can check
    whether this generation matches the one seen in self ID complete event
    logging. See OHCI 1.1 clause 8.4.2.3.

    Also extend logging of "firewire_ohci: * selfIDs, generation *" by
    "local node ID ffc*" in self ID logging to make the local node in AT/AR
    event logs more obvious.

    Signed-off-by: Stefan Richter
    Signed-off-by: Jarod Wilson

    Stefan Richter
     
  • Add a debug option to watch bus reset interrupt events. Half of this
    patch is taken from Jarod Wilson's first version of the JMicron fix.

    BusReset interrupts are only generated if the respective module
    parameter flag was set before the controller is being initialized.
    Else we keep this event masked to reduce IRQ load in normal operation
    and to avoid potential problems with buggy chips.

    Note, this is unlike the other IRQ events whose logging can be enabled
    any time after chip initialization. This and the influence on what
    interrupts the chip generates is why I added an extra flag for it.

    Also, reorder the debug parameter flags according to their perceived
    usefulness.

    Signed-off-by: Stefan Richter
    Signed-off-by: Jarod Wilson

    Stefan Richter
     
  • I finally tracked down the issues with this JMicron PCI-e card in my
    possession to a failure to comply with section 7.2.3.2 of the OHCI 1.1
    specification (thanks to Kristian for the pointer to illustrate that it
    is indeed a flaw in this card, not the driver). The controller should
    simply flush the packets we've appended to its AT queue if a bus reset
    occurs before they've been transmitted and we'll try again, but
    something goes wrong and the controller winds up hung.

    However, we can avoid the problem by simply checking if the
    IntEvent.busReset register had been set before we try appending to the
    AT context. When busReset is set, the AT context is completely halted
    until busReset is cleared, so there's no point in appending AT packets
    until the register is cleared. So at_context_queue_packet() now checks
    for busReset being set, and bails with an RCODE_GENERATION packet ack,
    which results in us trying to append the packet again after recognizing
    the fact there has been a bus reset, and clearing busReset.

    Signed-off-by: Jarod Wilson
    Signed-off-by: Stefan Richter

    Jarod Wilson
     
  • While trying to debug this piece of crap JMicron PCI-e controller in my
    possession, one thought was that perhaps I was encountering register access
    failures. I'm not, but logging them would be good, so we can see if they
    are a real problem we should be taking into account anywhere in the code.

    Signed-off-by: Jarod Wilson
    Signed-off-by: Stefan Richter (added list contact)

    Jarod Wilson
     
  • I've now witnessed multiple occasions where one of my controllers (a very
    poorly working JMicron PCIe card) fails to get its registers properly set
    up in ohci_enable(), apparently due to an occasionally very slow to
    initiate SClk. The easy fix for this problem is to add a tiny while loop
    to try again a time or three after initially enabling LPS before we
    move on (or give up).

    Of course, the card still isn't fully functional yet, but this gets it at
    least one tiny step closer...

    Signed-off-by: Jarod Wilson
    Signed-off-by: Stefan Richter

    Jarod Wilson
     
  • Balance ohci_pmac_on and ohci_pmac_off if pci_driver.probe fails.

    Signed-off-by: Stefan Richter

    Stefan Richter
     
  • and make another expression more readable.

    Signed-off-by: Stefan Richter

    Stefan Richter