[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

esp_scsi, was Re: Modified Linux 4.1.20 (mac+scsi) on Quadra 660av



Fri, 28 Oct 2016 14:48:47 +1100 (AEDT)
On Thu, 27 Oct 2016, Michael Schmitz wrote:

> Am 03.08.2016 um 16:16 schrieb Finn Thain:
> > 
> > On Tue, 2 Aug 2016, Mac User wrote:
> > 
> > > > Please send pictures. You can use the kernel parameter 
> > > > "fbcon=font:ProFont6x11" to get more text on the screen if it 
> > > > scrolls too fast.
> > > >
> > >
> > > Please see attached.  Thanks..
> > > [...]
> > > scsi host0: esp
> > > scsi 0:0:0:0: Direct-Access SEAGATE ST318417N 0105 PQ: 0 ANSI: 3
> > > scsi target0:0:0: Beginning Domain Validation
> > > scsi host0: Reconnect IRQ2 timeout
> > 
> > A bit of Googling tells me that I've been here before (I had forgotten):
> > 
> > commit 02507a80b35edd720480540d917e9f92cc371009
> > Author: Finn Thain <fthain@telegraphics.com.au>
> > Date:   Sat Dec 5 12:30:42 2009 +1100
> > 
> >     [SCSI] mac_esp: fix PIO mode, take 2
> >     
> >     The mac_esp PIO algorithm no longer works in 2.6.31 and crashes my 
> >     Centris 660av. So here's a better one.
> >     
> >     Also, force async with esp_set_offset() rather than 
> >     esp_slave_configure().
> >     
> >     One of the SCSI drives I tested still doesn't like the PIO mode 
> >     and fails with "esp: esp0: Reconnect IRQ2 timeout" (the same drive 
> >     works fine in PDMA mode).
> >     
> >     This failure happens when esp_reconnect_with_tag() tries to read 
> >     in two tag bytes but the chip only provides one (0x20). I don't 
> >     know what causes this. I decided not to waste any more time trying 
> >     to fix it because the best solution is to rip out the PIO mode 
> >     altogether and use the DMA engine.
> >     
> > 
> > So it appears that this bug is not a regression. I guess you have 3 
> > options: find a compatible drive, implement DMA with the PSC chip, or 
> > debug the esp_reconnect_with_tag() implementation for PIO use.
> > 
> > Apple never provided public documentation for the PSC chip, which is 
> > why there's no DMA support for SCSI on AV Quadras, and also why we 
> > have code like this in macmace.c:
> > 
> >         /* Not sure what this does */
> > 
> >         while ((baka = psc_read_long(PSC_MYSTERY)) != psc_read_long(PSC_MYSTERY));
> >         if (!(baka & 0x60000000)) return IRQ_NONE;
> > 
> > You could tackle the esp_reconnect_with_tag() bug by increasing the 
> > ESP_RESELECT_TAG_LIMIT timeout and setting some kernel parameters:
> >   scsi_mod.scan=sync esp_scsi.esp_debug=0x241
> > 
> > In my experience, the only practical way to debug mac scsi drivers is 
> > to make the driver modular, boot over ethernet and then use insmod and 
> > rmmod to test changes to the module.
> > 
> 
> 
> Hi Finn,
> 
> the problem with trying to read two tag bytes does sound familiar - I 
> believe we ran into that one (or a similar one) while trying to revive 
> the Amiga ESP drivers.
> 

That's intriguing. I hadn't realised that those zorro_esp discussions on 
the mailing lists (linked below) covered the same bug I saw in mac_esp in 
2009.

http://linux-m68k.vger.kernel.narkive.com/pMVlraRz/patch-0-2-experimental-amiga-zorro-esp-driver
http://markmail.org/message/whgfl2d5jhk3y75t
http://markmail.org/message/qxrwcdpc625mczml

> Tuomas used scsi_deactivate_tcq() in a driver specific
> esp_slave_configure() hook but that interface later disappeared. In the
> last version I tested, I added the following code after domain
> validation in the driver specific esp_slave_configure()
> 
> +       /*
> +        * Hardwire TQC capability of target _off_ after
> +        * domain validation (which might have probed and
> +        * negotiated TQC available)
> +        */
> +       dev->tagged_supported = 0;
> +       dev->simple_tags = 0;
> +
> 
> I tried all sorts of things with the chip config registers, to no avail.

Nonetheless this issue should probably be addressed in the core esp_scsi 
driver to avoid duplicating fixes in the board-specific code.

If we can fix this issue in esp_scsi.c, it would be a good idea to get 
some reviews for a complete series of patches for the new zorro_esp.c as 
well as changes to esp_scsi.c and probably mac_esp.c too.

> Your report that this only happens with some disks exonerates the driver 

The fact that zorro_esp is also affected gives me confidence in mac_esp.

Maybe this is an erratum relating to the particular device found in the 
Quadra 660av, and has nothing to do with PIO/DMA/PDMA.

Stan, can you check the markings on the SCSI chip in your 660av? It's most 
probably the largest device near the two SCSI connectors, possibly 
Am53C94?

I wonder why this problem didn't affect the old ESP driver? (Stan pointed 
out earlier in this thread that "Debian 3.1 (with a Linux 2.2.25 kernel) 
works on the Quadra 660av".)

-- 

> 
> HTH,
> 
> 	Michael
> 
> 


Reply to: