30 Jun, 2011

1 commit

  • Add ISA PNP IDs of the following cards to aha152x driver:
    AVA-1502
    AVA-1505
    AHA-1510
    AVA-1515
    AHA-1520
    AHA-1522
    AHA-1530
    AHA-1532
    AIC-6360
    (list from SCSI.INF file)

    This makes my AHA-1530P card (has ADP3015 ID) work automatically.

    Signed-off-by: Ondrej Zary
    Signed-off-by: James Bottomley

    Ondrej Zary
     

17 Nov, 2010

1 commit

  • Move the mid-layer's ->queuecommand() invocation from being locked
    with the host lock to being unlocked to facilitate speeding up the
    critical path for drivers who don't need this lock taken anyway.

    The patch below presents a simple SCSI host lock push-down as an
    equivalent transformation. No locking or other behavior should change
    with this patch. All existing bugs and locking orders are preserved.

    Additionally, add one parameter to queuecommand,
    struct Scsi_Host *
    and remove one parameter from queuecommand,
    void (*done)(struct scsi_cmnd *)

    Scsi_Host* is a convenient pointer that most host drivers need anyway,
    and 'done' is redundant to struct scsi_cmnd->scsi_done.

    Minimal code disturbance was attempted with this change. Most drivers
    needed only two one-line modifications for their host lock push-down.

    Signed-off-by: Jeff Garzik
    Acked-by: James Bottomley
    Signed-off-by: Linus Torvalds

    Jeff Garzik
     

30 Mar, 2010

1 commit

  • …it slab.h inclusion from percpu.h

    percpu.h is included by sched.h and module.h and thus ends up being
    included when building most .c files. percpu.h includes slab.h which
    in turn includes gfp.h making everything defined by the two files
    universally available and complicating inclusion dependencies.

    percpu.h -> slab.h dependency is about to be removed. Prepare for
    this change by updating users of gfp and slab facilities include those
    headers directly instead of assuming availability. As this conversion
    needs to touch large number of source files, the following script is
    used as the basis of conversion.

    http://userweb.kernel.org/~tj/misc/slabh-sweep.py

    The script does the followings.

    * Scan files for gfp and slab usages and update includes such that
    only the necessary includes are there. ie. if only gfp is used,
    gfp.h, if slab is used, slab.h.

    * When the script inserts a new include, it looks at the include
    blocks and try to put the new include such that its order conforms
    to its surrounding. It's put in the include block which contains
    core kernel includes, in the same order that the rest are ordered -
    alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
    doesn't seem to be any matching order.

    * If the script can't find a place to put a new include (mostly
    because the file doesn't have fitting include block), it prints out
    an error message indicating which .h file needs to be added to the
    file.

    The conversion was done in the following steps.

    1. The initial automatic conversion of all .c files updated slightly
    over 4000 files, deleting around 700 includes and adding ~480 gfp.h
    and ~3000 slab.h inclusions. The script emitted errors for ~400
    files.

    2. Each error was manually checked. Some didn't need the inclusion,
    some needed manual addition while adding it to implementation .h or
    embedding .c file was more appropriate for others. This step added
    inclusions to around 150 files.

    3. The script was run again and the output was compared to the edits
    from #2 to make sure no file was left behind.

    4. Several build tests were done and a couple of problems were fixed.
    e.g. lib/decompress_*.c used malloc/free() wrappers around slab
    APIs requiring slab.h to be added manually.

    5. The script was run on all .h files but without automatically
    editing them as sprinkling gfp.h and slab.h inclusions around .h
    files could easily lead to inclusion dependency hell. Most gfp.h
    inclusion directives were ignored as stuff from gfp.h was usually
    wildly available and often used in preprocessor macros. Each
    slab.h inclusion directive was examined and added manually as
    necessary.

    6. percpu.h was updated not to include slab.h.

    7. Build test were done on the following configurations and failures
    were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
    distributed build env didn't work with gcov compiles) and a few
    more options had to be turned off depending on archs to make things
    build (like ipr on powerpc/64 which failed due to missing writeq).

    * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
    * powerpc and powerpc64 SMP allmodconfig
    * sparc and sparc64 SMP allmodconfig
    * ia64 SMP allmodconfig
    * s390 SMP allmodconfig
    * alpha SMP allmodconfig
    * um on x86_64 SMP allmodconfig

    8. percpu.h modifications were reverted so that it could be applied as
    a separate patch and serve as bisection point.

    Given the fact that I had only a couple of failures from tests on step
    6, I'm fairly confident about the coverage of this conversion patch.
    If there is a breakage, it's likely to be something in one of the arch
    headers which should be easily discoverable easily on most builds of
    the specific arch.

    Signed-off-by: Tejun Heo <tj@kernel.org>
    Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>

    Tejun Heo
     

16 Oct, 2008

1 commit


27 Jul, 2008

1 commit


23 May, 2008

1 commit

  • drivers/scsi/aha152x.c:3585:60: warning: Using plain integer as NULL pointer
    drivers/scsi/aha152x.c:3845:56: warning: Using plain integer as NULL pointer
    drivers/scsi/qla1280.c:2814:37: warning: Using plain integer as NULL pointer
    drivers/scsi/atp870u.c:750:47: warning: Using plain integer as NULL pointer
    drivers/scsi/3w-9xxx.c:1281:36: warning: Using plain integer as NULL pointer
    drivers/scsi/3w-9xxx.c:1293:36: warning: Using plain integer as NULL pointer
    drivers/scsi/3w-9xxx.c:1301:35: warning: Using plain integer as NULL pointer
    drivers/scsi/hptiop.c:447:10: warning: Using plain integer as NULL pointer
    drivers/scsi/hptiop.c:457:10: warning: Using plain integer as NULL pointer
    drivers/scsi/hptiop.c:479:24: warning: Using plain integer as NULL pointer
    drivers/scsi/hptiop.c:483:22: warning: Using plain integer as NULL pointer
    drivers/scsi/hptiop.c:1213:23: warning: Using plain integer as NULL pointer
    drivers/scsi/hptiop.c:1214:23: warning: Using plain integer as NULL pointer

    Signed-off-by: Harvey Harrison
    Signed-off-by: Linus Torvalds

    Harvey Harrison
     

11 May, 2008

2 commits

  • Reported-by: Frank de Jong
    > after trying to unload the module:
    > BUG: unable to handle kernel paging request at 00100100
    > IP: [] :aha152x:aha152x_exit+0x47/0x6a
    > *pde = 00000000
    > Oops: 0000 [#1] PREEMPT SMP
    > Modules linked in: aha152x(-) w83781d hwmon_vid tun ne 8390 bonding
    > usb_storage snd_usb_audio snd_usb_lib snd_rawmidi pwc snd_seq_device
    > compat_ioctl32 snd_hwdep videodev v4l1_compat 3c59x mii intel_agp
    > agpgart snd_pcm_oss snd_pcm snd_timer snd_page_alloc snd_mixer_oss snd
    >
    > Pid: 2837, comm: rmmod Not tainted (2.6.25.3 #1)
    > EIP: 0060:[] EFLAGS: 00210212 CPU: 0
    > EIP is at aha152x_exit+0x47/0x6a [aha152x]
    > EAX: 00000001 EBX: 000ffdc4 ECX: f7c517a8 EDX: 00000001
    > ESI: 00000000 EDI: 00000003 EBP: e7880000 ESP: e7881f58
    > DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
    > Process rmmod (pid: 2837, ti=e7880000 task=f27eb580 task.ti=e7880000)
    > Stack: fba03700 c01419d2 31616861 00783235 e795ee70 c0157709 b7f24000 e79ae000
    > c0158271 ffffffff b7f25000 e79ae004 e795e370 b7f25000 e795e37c e795e370
    > 009ae000 fba03700 00000880 e7881fa8 00000000 bf93ec20 bf93ec20 c0102faa
    > Call Trace:
    > [] sys_delete_module+0x112/0x1a0
    > [] remove_vma+0x39/0x50
    > [] do_munmap+0x181/0x1f0
    > [] sysenter_past_esp+0x5f/0x85
    > [] rsc_parse+0x0/0x3c0

    The problem is that the driver calls aha152x_release() under a
    list_for_each_entry(). Unfortunately, aha152x_release() deletes from
    the list in question. Fix this by using list_for_each_entry_safe().

    Cc: Stable Tree
    Signed-off-by: James Bottomley

    James Bottomley
     
  • Reported-by: Frank de Jong
    > [1.] One line summary of the problem:
    > linux-2.6.25.3, aha152x'->init suspiciously returned 1, it should
    > follow 0/-E convention. The module / driver works okay. Unloading the
    > module is impossible.

    The driver is apparently returning 0 on failure and 1 on success.
    That's a bit unfortunate. Fix it by altering to -ENODEV and 0.

    Cc: Stable Tree
    Signed-off-by: James Bottomley

    James Bottomley
     

29 Apr, 2008

1 commit

  • drivers/scsi/aic7xxx/aic7770_osm.c:53:58: warning: Using plain integer as NULL pointer
    drivers/scsi/aic7xxx/aic7xxx_osm_pci.c:355:47: warning: Using plain integer as NULL pointer
    drivers/scsi/aic7xxx/aic7xxx_osm_pci.c:372:55: warning: Using plain integer as NULL pointer
    drivers/scsi/aha152x.c:997:28: warning: Using plain integer as NULL pointer
    drivers/scsi/aha152x.c:1003:28: warning: Using plain integer as NULL pointer
    drivers/scsi/aha152x.c:1165:46: warning: Using plain integer as NULL pointer
    drivers/scsi/fdomain.c:1446:40: warning: Using plain integer as NULL pointer
    drivers/scsi/sym53c8xx_2/sym_hipd.c:1650:51: warning: Using plain integer as NULL pointer
    drivers/scsi/sym53c8xx_2/sym_hipd.c:3171:42: warning: Using plain integer as NULL pointer
    drivers/scsi/sym53c8xx_2/sym_hipd.c:5732:52: warning: Using plain integer as NULL pointer
    drivers/scsi/ncr53c8xx.c:8189:31: warning: Using plain integer as NULL pointer
    drivers/scsi/ncr53c8xx.c:8225:34: warning: Using plain integer as NULL pointer
    drivers/scsi/dpt_i2o.c:156:32: warning: Using plain integer as NULL pointer
    drivers/scsi/ultrastor.c:954:42: warning: Using plain integer as NULL pointer
    drivers/scsi/ultrastor.c:1104:18: warning: Using plain integer as NULL pointer

    Signed-off-by: Harvey Harrison
    Signed-off-by: Linus Torvalds

    Harvey Harrison
     

25 Apr, 2008

1 commit

  • - remove pointless casts from void*

    - remove needless references to 'irq' function argument, when that
    information is already stored somewhere in a driver-private struct.

    - where the 'irq' function argument is known never to be used, rename
    it to 'dummy' to make this more obvious

    - remove always-false tests for dev_id==NULL

    - remove always-true tests for 'irq == host_struct->irq'

    - replace per-irq lookup functions and tables with a direct reference
    to data object obtained via 'dev_id' function argument, passed from
    request_irq()

    This change's main purpose is to prepare for the patchset in
    jgarzik/misc-2.6.git#irq-remove, that explores removal of the
    never-used 'irq' argument in each interrupt handler.

    Signed-off-by: Jeff Garzik
    Signed-off-by: James Bottomley

    Jeff Garzik
     

12 Jan, 2008

1 commit


23 Oct, 2007

1 commit


20 Oct, 2007

1 commit

  • * Convert files to UTF-8.

    * Also correct some people's names
    (one example is Eißfeldt, which was found in a source file.
    Given that the author used an ß at all in a source file
    indicates that the real name has in fact a 'ß' and not an 'ss',
    which is commonly used as a substitute for 'ß' when limited to
    7bit.)

    * Correct town names (Goettingen -> Göttingen)

    * Update Eberhard Mönkeberg's address (http://lkml.org/lkml/2007/1/8/313)

    Signed-off-by: Jan Engelhardt
    Signed-off-by: Adrian Bunk

    Jan Engelhardt
     

13 Oct, 2007

1 commit

  • We were releasing the IRQ before removing the host, so commands could
    still be coming in which would never be seen by the interrupt handler.
    Just remove the host before releasing the IRQ to close this race.

    Signed-off-by: Matthew Wilcox
    Signed-off-by: James Bottomley

    Matthew Wilcox
     

04 Aug, 2007

6 commits

  • And finally this is the regular !use_sg cleanup
    and use of data accessors.

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

    Boaz Harrosh
     
  • check_condition code-path was similar but more
    complicated to Reset. It went like this:

    1. extra space was allocated at aha152x_scdata for mirroring
    scsi_cmnd members.
    2. At aha152x_internal_queue() every not check_condition
    (REQUEST_SENSE) command was copied to above members in
    case of error.
    3. At busfree_run() in the DONE_CS phase if a Status of
    SAM_STAT_CHECK_CONDITION was detected. The command was
    re-queued Internally using aha152x_internal_queue(,,check_condition,)
    The old command members are over written with the
    REQUEST_SENSE info.
    4. At busfree_run() in the DONE_CS phase again. If it is a
    check_condition command, info was restored from mirror
    made at first call to aha152x_internal_queue() (see 2)
    and the command is completed.

    What I did is:

    1. Allocate less space in aha152x_scdata only for the 16-byte
    original command. (which is actually not needed by scsi-ml
    anymore at this stage. But this is to much knowledge of scsi-ml)
    2. If Status == SAM_STAT_CHECK_CONDITION, then like before
    re-queue a REQUEST_SENSE command. But only now save original
    command members. (Less of them)
    3. In aha152x_internal_queue(), just like for Reset, use the
    check_condition hint to set differently the working members.
    execute the command.
    4. At busfree_run() in the DONE_CS phase again. restore needed
    members.

    While at it. This patch fixes a BUG. Old code when sending
    a REQUEST_SENSE for a failed command. Would than return with
    cmd->resid == 0 which was the status of the REQUEST_SENSE.
    The failing command resid was lost. And when would resid
    be interesting if not on a failing command?

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

    Boaz Harrosh
     
  • What Reset code was doing: Save command's important/dangerous
    Info on stack. NULL those members from scsi_cmnd.
    Issue a Reset. wait for it to finish than restore members
    and return.

    What I do is save or NULL nothing. But use the "resetting"
    hint in aha152x_internal_queue() to NULL out working members
    and leave struct scsi_cmnd alone.

    The indent here looks funny but it will change/drop in last
    patch and it is clear this way what changed.

    Signed-off-by: James Bottomley

    Boaz Harrosh
     
  • hunk by hunk:
    - CHECK_CONDITION is what happens to cmnd->status >> 1
    or after status_byte() macro. But here it is used
    directly on status which means 0x1 which is an undefined
    bit in the standard. And is a status that will never
    return from a target.

    - in busfree_run at the DONE_SC phase we have 3 distinct
    operation:
    1-if(DONE_SC->SCp.phase & check_condition)
    The REQUEST_SENSE command return.
    - Restore original command
    - Than continue to operation 3.
    2-if(DONE_SC->SCp.Status==SAM_STAT_CHECK_CONDITION)
    A regular command returned with a status.
    - Internally re-Q a REQUEST_SENSE.
    - Do not do operation 3.
    3-
    - Complete the command and return it to scsi-ml
    So the 0x2 in both these operations (1,2) means the scsi
    check-condition status, hence SAM_STAT_CHECK_CONDITION

    - Here the code asks about !(DONE_SC->SCp.Status & not_issued)
    but "not_issued" is an enum belonging to the "phase" member
    and not to the Status returned from target. The reason this
    works is because not_issued==1 and Also CHECK_CONDITION==1
    (remember from hunk 1). So actually the code was asking
    !(DONE_SC->SCp.Status & CHECK_CONDITION). Which means
    "Has the status been read from target yet?"
    Staus is read at status_run(). "not_issued" is
    cleared in seldo_run() which is usually earlier than
    status_run().

    So this patch does nothing as far as assembly is concerned
    but it does let the reader understand what is going on.

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

    Boaz Harrosh
     
  • Cause highmem buffers to be bounced to low memory until this
    driver supports highmem addresses. Otherwise it just oopses
    on NULL buffer addresses.

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

    Boaz Harrosh
     
  • The symbol conflicts with the rather global one in
    include/linux/locks.h.

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

    Boaz Harrosh
     

22 May, 2007

1 commit


15 Feb, 2007

1 commit

  • After Al Viro (finally) succeeded in removing the sched.h #include in module.h
    recently, it makes sense again to remove other superfluous sched.h includes.
    There are quite a lot of files which include it but don't actually need
    anything defined in there. Presumably these includes were once needed for
    macros that used to live in sched.h, but moved to other header files in the
    course of cleaning it up.

    To ease the pain, this time I did not fiddle with any header files and only
    removed #includes from .c-files, which tend to cause less trouble.

    Compile tested against 2.6.20-rc2 and 2.6.20-rc2-mm2 (with offsets) on alpha,
    arm, i386, ia64, mips, powerpc, and x86_64 with allnoconfig, defconfig,
    allmodconfig, and allyesconfig as well as a few randconfigs on x86_64 and all
    configs in arch/arm/configs on arm. I also checked that no new warnings were
    introduced by the patch (actually, some warnings are removed that were emitted
    by unnecessarily included header files).

    Signed-off-by: Tim Schmielau
    Acked-by: Russell King
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Tim Schmielau
     

22 Nov, 2006

1 commit


12 Oct, 2006

1 commit


07 Oct, 2006

1 commit

  • - Eliminate casts to/from void*

    - Eliminate checks for conditions that never occur. These typically
    fall into two classes:

    1) Checking for 'dev_id == NULL', then it is never called with
    NULL as an argument.

    2) Checking for invalid irq number, when the only caller (the
    system) guarantees the irq handler is called with the proper
    'irq' number argument.

    Signed-off-by: Jeff Garzik

    Jeff Garzik
     

05 Oct, 2006

1 commit

  • Maintain a per-CPU global "struct pt_regs *" variable which can be used instead
    of passing regs around manually through all ~1800 interrupt handlers in the
    Linux kernel.

    The regs pointer is used in few places, but it potentially costs both stack
    space and code to pass it around. On the FRV arch, removing the regs parameter
    from all the genirq function results in a 20% speed up of the IRQ exit path
    (ie: from leaving timer_interrupt() to leaving do_IRQ()).

    Where appropriate, an arch may override the generic storage facility and do
    something different with the variable. On FRV, for instance, the address is
    maintained in GR28 at all times inside the kernel as part of general exception
    handling.

    Having looked over the code, it appears that the parameter may be handed down
    through up to twenty or so layers of functions. Consider a USB character
    device attached to a USB hub, attached to a USB controller that posts its
    interrupts through a cascaded auxiliary interrupt controller. A character
    device driver may want to pass regs to the sysrq handler through the input
    layer which adds another few layers of parameter passing.

    I've build this code with allyesconfig for x86_64 and i386. I've runtested the
    main part of the code on FRV and i386, though I can't test most of the drivers.
    I've also done partial conversion for powerpc and MIPS - these at least compile
    with minimal configurations.

    This will affect all archs. Mostly the changes should be relatively easy.
    Take do_IRQ(), store the regs pointer at the beginning, saving the old one:

    struct pt_regs *old_regs = set_irq_regs(regs);

    And put the old one back at the end:

    set_irq_regs(old_regs);

    Don't pass regs through to generic_handle_irq() or __do_IRQ().

    In timer_interrupt(), this sort of change will be necessary:

    - update_process_times(user_mode(regs));
    - profile_tick(CPU_PROFILING, regs);
    + update_process_times(user_mode(get_irq_regs()));
    + profile_tick(CPU_PROFILING);

    I'd like to move update_process_times()'s use of get_irq_regs() into itself,
    except that i386, alone of the archs, uses something other than user_mode().

    Some notes on the interrupt handling in the drivers:

    (*) input_dev() is now gone entirely. The regs pointer is no longer stored in
    the input_dev struct.

    (*) finish_unlinks() in drivers/usb/host/ohci-q.c needs checking. It does
    something different depending on whether it's been supplied with a regs
    pointer or not.

    (*) Various IRQ handler function pointers have been moved to type
    irq_handler_t.

    Signed-Off-By: David Howells
    (cherry picked from 1b16e7ac850969f38b375e511e3fa2f474a33867 commit)

    David Howells
     

24 Sep, 2006

1 commit


10 Jul, 2006

2 commits

  • Currently struct scsi_cmnd has various fields that are used to backup
    original data after the corresponding fields have been overridden for
    EH commands. This means drivers can easily get at it and misuse it.
    Due to the old_ naming this doesn't happen for most of them, but two
    that have different names have been used wrong a lot (see previous
    patch). Another downside is that they unessecarily bloat the scsi_cmnd
    size.

    This patch moves them onstack in scsi_send_eh_cmnd to fix those two
    issues aswell as allowing future EH fixes like moving the EH command
    submissions to use SG lists like everything else.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: James Bottomley

    Christoph Hellwig
     
  • Stop poking into the old_ & co scsi_cmnd fields that should only be used
    in the EH code. Untested, but this is required to move ahead with the
    EH fixes.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: James Bottomley

    Christoph Hellwig
     

03 Jul, 2006

1 commit


15 Mar, 2006

1 commit


01 Mar, 2006

1 commit

  • - change interface of the reset functions from Scsi_Cmnd to Scsi_Host.
    - add functions with the original interface and rename the new
    functions to reflect the new interface.
    - call these from the pcmcia driver, thereby avoiding the need to
    construct a (broken) Scsi_Cmnd from a Scsi_Host.
    - just run the bh if the interrupt is from the controller and if so
    ensure that it's only called once per interrupt.

    Signed-off-by: Juergen E. Fischer
    Signed-off-by: James Bottomley

    Jürgen E. Fischer
     

28 Feb, 2006

1 commit


16 Dec, 2005

1 commit


10 Nov, 2005

1 commit


29 Oct, 2005

1 commit


18 Jun, 2005

1 commit


19 Apr, 2005

1 commit


17 Apr, 2005

1 commit

  • Initial git repository build. I'm not bothering with the full history,
    even though we have it. We can create a separate "historical" git
    archive of that later if we want to, and in the meantime it's about
    3.2GB when imported into git - space that would just make the early
    git days unnecessarily complicated, when we don't have a lot of good
    infrastructure for it.

    Let it rip!

    Linus Torvalds