Re: [PATCH] Re: AMD 53c974 SCSI driver in 2.6

From: Christoph Hellwig (hch_at_infradead.org)
Date: 10/31/03

  • Next message: Oliver M. Bolzer: "Re: [PATCH #2] Re: SATA and 2.6.0-test9"
    Date:	Fri, 31 Oct 2003 11:46:17 +0000
    To: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
    
    

    On Fri, Oct 31, 2003 at 12:25:08PM +0100, Guennadi Liakhovetski wrote:
    > (Replying fromo the web-interface, hope, the email will not be scrued up
    > completely).

    Seems fine.

    > > Any reason you fix this driver? The tmcsim one for the same hardware
    > > looks like much better structured (though a bit obsufacted :))?
    >
    > This is the easiest to asnwer: Kurt Garloff wrote to me, saying that he
    > would fix the tmcsim driver, so, I didn't want to duplicate the work. Also,
    > I was considering this mostly as a fun-excersice, not really hoping / aiming

    Ah, okay.

    > > > +#ifdef AM53C974_MULTIPLE_CARD
    > > > +#error "FIXME! Multiple card support is broken. Looks like it never
    > > really worked. Might have to be fixed."
    > > > static struct Scsi_Host *first_host; /* Head of list of AMD boards */
    > > > +#endif
    > >
    > > Why do you need the undef? It looks like you need to kill a #define for
    > > this symbol somewhere else :)
    >
    > So that, when it is fixed, somebody can easily switch it on / off:-)

    Then just comment ou the #define. Rule of the thumb: #undef always means
    you screwed up elsewhere :)

    >
    > > > - save_flags(flags);
    > > > - cli();
    > > > + local_irq_save(flags);
    > >
    > > That's not safe on SMP, you must mark the driver BROKEN_ON_SMP or better
    > > fix this.
    >
    > Yes. Again - the fix was pretty much mechanical. I didn't understand why it
    > was considered SMP-safe to just disable local interrupts, so, just preferred
    > to go the "minimal modifications" path.

    cli() disabled all intereupts in 2.4 which was safe, you only disable local
    interrupts which is ok on UP but doesn't work on SMP. The right fix would
    be to introduce spinlocks. But given the driver design this might be
    everything but easy - that's why I think killing the driver in favour of tmcsim
    might be the better idea.

    > > Not sure whether you're interested in fixing this, but the proper way
    > > to fix that would be to call request_irq for each card, mark the irq's
    > > sharable. The irq handler then can use the void * argument to find the
    > > right host and you can kill all this ugly host list walking. That shold
    > > get multiple host support working again in theory (ok, except that the
    > > driver has a totally broken single state machine..)
    >
    > Sure - in irq-handler. But are these lists needed anywhere else, where a
    > function is called in an "abstract" context without a dev-pointer? Probably,
    > not.

    A poper driver shouldn't do that, but we already know this one isn't..

    > > > if (cmd->use_sg) {
    > > > cmd->SCp.buffer = (struct scatterlist *) cmd->buffer;
    > > > cmd->SCp.buffers_residual = cmd->use_sg - 1;
    > > > - cmd->SCp.ptr = (char *) cmd->SCp.buffer->address;
    > > > + cmd->SCp.ptr = (char *) page_address(cmd->SCp.buffer->page) +
    > > cmd->SCp.buffer->offset;
    > >
    > > This means you need a dma_mask < highmem to work. I don't think we
    > > want such crude hacks merged, could you please convert it to the proper
    > > dma API?
    >
    > Found in a "working" driver (which has to be fixed too, then). Will try to
    > find a proper fix (for the new driver).

    Oh. What driver did you find this construct in?

    -
    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: Oliver M. Bolzer: "Re: [PATCH #2] Re: SATA and 2.6.0-test9"

    Relevant Pages

    • Linux 2.6.9-rc2
      ... ALSA update, and tons of small fixes pretty much ... work on trying to fix up the drivers as we go along, but they can be a bit ... Update unlink testing code in the usbtest driver ...
      (Linux-Kernel)
    • Linux 2.6.5-rc1
      ... Merging from Andrew, but also i2c updates, ALSA CVS merge, netconsole, ... prism54 driver merge, sata updates, carmel driver, pcmcia and nfs client ... fix missing include in include/asm-ia64/sn/router.h ... Fix CONFIG_DEBUG build on x86-64 & small cleanup ...
      (Linux-Kernel)
    • Linux 2.6.11-rc1
      ... small char/generic_serial.c cleanup ... lockd: fix two struct definitions ... serial driver for TI USB 3410/5052 chips ... Split ACPI boot table parsing ...
      (Linux-Kernel)
    • Linux 2.6.9-rc1
      ... cpufreq, agp, sata, network drivers - you name it. ... o cciss /proc dependency fix ... bus driver for multiple PowerPCs ... o USB: Make removable-LUN support a non-test option in the ...
      (Linux-Kernel)
    • Linux 2.6.7-rc2
      ... An ALSA update, and tons of sparse type-fixes from Al Viro. ... USB, firewire, network driver, XFS, CIFS updates. ... o Fix nodemask clearing bug in NUMA API ...
      (Linux-Kernel)