<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/drivers/scsi/mac_scsi.c, branch linux-6.9.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-6.9.y</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-6.9.y'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2023-12-06T02:51:37Z</updated>
<entry>
<title>scsi: mac: Convert to platform remove callback returning void</title>
<updated>2023-12-06T02:51:37Z</updated>
<author>
<name>Uwe Kleine-König</name>
<email>u.kleine-koenig@pengutronix.de</email>
</author>
<published>2023-12-03T16:05:52Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=69b43bf38b11cf361a1372281aa0ffe0c5cb2d32'/>
<id>urn:sha1:69b43bf38b11cf361a1372281aa0ffe0c5cb2d32</id>
<content type='text'>
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.

To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new(), which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().

In the error path emit an error message replacing the (less useful)
message by the core. Apart from the improved error message there is no
change in behaviour.

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König &lt;u.kleine-koenig@pengutronix.de&gt;
Link: https://lore.kernel.org/r/89ce161dad52d99df07135531512ccecb7f25d14.1701619134.git.u.kleine-koenig@pengutronix.de
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
<entry>
<title>scsi: NCR5380: Add SCp members to struct NCR5380_cmd</title>
<updated>2022-02-23T02:11:03Z</updated>
<author>
<name>Finn Thain</name>
<email>fthain@linux-m68k.org</email>
</author>
<published>2022-02-18T19:50:36Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=ff1269cb3d978655fb4f61f87d08a46af9854567'/>
<id>urn:sha1:ff1269cb3d978655fb4f61f87d08a46af9854567</id>
<content type='text'>
This is necessary for the eventual removal of SCp from struct scsi_cmnd.

Link: https://lore.kernel.org/r/20220218195117.25689-9-bvanassche@acm.org
Cc: Michael Schmitz &lt;schmitzmic@gmail.com&gt;
Cc: Ondrej Zary &lt;linux@zary.sk&gt;
Suggested-by: Bart Van Assche &lt;bvanassche@acm.org&gt;
Signed-off-by: Finn Thain &lt;fthain@linux-m68k.org&gt;
Signed-off-by: Bart Van Assche &lt;bvanassche@acm.org&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
<entry>
<title>scsi: NCR5380: Remove the NCR5380_CMD_SIZE macro</title>
<updated>2022-02-23T02:11:03Z</updated>
<author>
<name>Bart Van Assche</name>
<email>bvanassche@acm.org</email>
</author>
<published>2022-02-18T19:50:35Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=cd614642e1a24e501633d5aea79c1bafb10d9f36'/>
<id>urn:sha1:cd614642e1a24e501633d5aea79c1bafb10d9f36</id>
<content type='text'>
This makes it easier to find users of the NCR5380_cmd data structure with
'grep'.

Link: https://lore.kernel.org/r/20220218195117.25689-8-bvanassche@acm.org
Cc: Finn Thain &lt;fthain@telegraphics.com.au&gt;
Cc: Hannes Reinecke &lt;hare@suse.com&gt;
Cc: Ondrej Zary &lt;linux@rainbow-software.org&gt;
Cc: Michael Schmitz &lt;schmitzmic@gmail.com&gt;
Reviewed-by: Johannes Thumshirn &lt;johannes.thumshirn@wdc.com&gt;
Reviewed-by: Himanshu Madhani &lt;himanshu.madhani@oracle.com&gt;
Reviewed-by: Hannes Reinecke &lt;hare@suse.de&gt;
Acked-by: Finn Thain &lt;fthain@linux-m68k.org&gt;
Signed-off-by: Bart Van Assche &lt;bvanassche@acm.org&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
<entry>
<title>scsi: NCR5380: Remove context check</title>
<updated>2020-12-08T01:24:09Z</updated>
<author>
<name>Ahmed S. Darwish</name>
<email>a.darwish@linutronix.de</email>
</author>
<published>2020-12-06T07:51:57Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=e7734ef14ead1fd78dc28be3de7ab13128b5c315'/>
<id>urn:sha1:e7734ef14ead1fd78dc28be3de7ab13128b5c315</id>
<content type='text'>
NCR5380_poll_politely2() uses in_interrupt() and irqs_disabled() to check
if it is safe to sleep.

Such usage in drivers is phased out and Linus clearly requested that code
which changes behaviour depending on context should either be separated, or
the context be explicitly conveyed in an argument passed by the caller.

Below is a context analysis of NCR5380_poll_politely2() uppermost callers:

  - NCR5380_maybe_reset_bus(), task, invoked during device probe.
    -&gt; NCR5380_poll_politely()
    -&gt; do_abort()

  - NCR5380_select(), task, but can only sleep in the "release, then
    re-acquire" regions of the spinlock held by its caller.
    Sleeping invocations (lock released):
    -&gt; NCR5380_poll_politely2()

    Atomic invocations (lock acquired):
    -&gt; NCR5380_reselect()
       -&gt; NCR5380_poll_politely()
       -&gt; do_abort()
       -&gt; NCR5380_transfer_pio()

  - NCR5380_intr(), interrupt handler
    -&gt; NCR5380_dma_complete()
       -&gt; NCR5380_transfer_pio()
	  -&gt; NCR5380_poll_politely()
    -&gt; NCR5380_reselect() (see above)

  - NCR5380_information_transfer(), task, but can only sleep in the
    "release, then re-acquire" regions of the caller-held spinlock.
    Sleeping invocations (lock released):
      - NCR5380_transfer_pio() -&gt; NCR5380_poll_politely()
      - NCR5380_poll_politely()

    Atomic invocations (lock acquired):
      - NCR5380_transfer_dma()
	-&gt; NCR5380_dma_recv_setup()
           =&gt; generic_NCR5380_precv() -&gt; NCR5380_poll_politely()
	   =&gt; macscsi_pread() -&gt; NCR5380_poll_politely()

	-&gt; NCR5380_dma_send_setup()
 	   =&gt; generic_NCR5380_psend -&gt; NCR5380_poll_politely2()
	   =&gt; macscsi_pwrite() -&gt; NCR5380_poll_politely()

	-&gt; NCR5380_poll_politely2()
        -&gt; NCR5380_dma_complete()
           -&gt; NCR5380_transfer_pio()
	      -&gt; NCR5380_poll_politely()
      - NCR5380_transfer_pio() -&gt; NCR5380_poll_politely

  - NCR5380_reselect(), atomic, always called with hostdata spinlock
    held.

Since NCR5380_poll_politely2() already takes a "wait" argument in jiffies,
use it to determine if the function can sleep. Modify atomic callers, which
passed an unused wait value in terms of HZ, to pass zero.

Link: https://lore.kernel.org/r/20201206075157.19067-1-a.darwish@linutronix.de
Cc: Michael Schmitz &lt;schmitzmic@gmail.com&gt;
Cc: &lt;linux-m68k@lists.linux-m68k.org&gt;
Suggested-by: Finn Thain &lt;fthain@telegraphics.com.au&gt;
Co-developed-by: Sebastian Andrzej Siewior &lt;bigeasy@linutronix.de&gt;
Acked-by: Finn Thain &lt;fthain@telegraphics.com.au&gt;
Signed-off-by: Ahmed S. Darwish &lt;a.darwish@linutronix.de&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
<entry>
<title>scsi: atari_scsi: sun3_scsi: Set sg_tablesize to 1 instead of SG_NONE</title>
<updated>2019-11-13T03:21:34Z</updated>
<author>
<name>Finn Thain</name>
<email>fthain@telegraphics.com.au</email>
</author>
<published>2019-11-02T01:06:54Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=79172ab20bfd8437b277254028efdb68484e2c21'/>
<id>urn:sha1:79172ab20bfd8437b277254028efdb68484e2c21</id>
<content type='text'>
Since the scsi subsystem adopted the blk-mq API, a host with zero
sg_tablesize crashes with a NULL pointer dereference.

blk_queue_max_segments: set to minimum 1
scsi 0:0:0:0: Direct-Access     QEMU     QEMU HARDDISK    2.5+ PQ: 0 ANSI: 5
scsi target0:0:0: Beginning Domain Validation
scsi target0:0:0: Domain Validation skipping write tests
scsi target0:0:0: Ending Domain Validation
blk_queue_max_segments: set to minimum 1
scsi 0:0:1:0: Direct-Access     QEMU     QEMU HARDDISK    2.5+ PQ: 0 ANSI: 5
scsi target0:0:1: Beginning Domain Validation
scsi target0:0:1: Domain Validation skipping write tests
scsi target0:0:1: Ending Domain Validation
blk_queue_max_segments: set to minimum 1
scsi 0:0:2:0: CD-ROM            QEMU     QEMU CD-ROM      2.5+ PQ: 0 ANSI: 5
scsi target0:0:2: Beginning Domain Validation
scsi target0:0:2: Domain Validation skipping write tests
scsi target0:0:2: Ending Domain Validation
blk_queue_max_segments: set to minimum 1
blk_queue_max_segments: set to minimum 1
blk_queue_max_segments: set to minimum 1
blk_queue_max_segments: set to minimum 1
sr 0:0:2:0: Power-on or device reset occurred
sd 0:0:0:0: Power-on or device reset occurred
sd 0:0:1:0: Power-on or device reset occurred
sd 0:0:0:0: [sda] 10485762 512-byte logical blocks: (5.37 GB/5.00 GiB)
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
Unable to handle kernel NULL pointer dereference at virtual address (ptrval)
Oops: 00000000
Modules linked in:
PC: [&lt;001cd874&gt;] blk_mq_free_request+0x66/0xe2
SR: 2004  SP: (ptrval)  a2: 00874520
d0: 00000000    d1: 00000000    d2: 009ba800    d3: 00000000
d4: 00000000    d5: 08000002    a0: 0087be68    a1: 009a81e0
Process kworker/u2:2 (pid: 15, task=(ptrval))
Frame format=7 eff addr=0000007a ssw=0505 faddr=0000007a
wb 1 stat/addr/data: 0000 00000000 00000000
wb 2 stat/addr/data: 0000 00000000 00000000
wb 3 stat/addr/data: 0000 0000007a 00000000
push data: 00000000 00000000 00000000 00000000
Stack from 0087bd98:
        00000002 00000000 0087be72 009a7820 0087bdb4 001c4f6c 009a7820 0087bdd4
        0024d200 009a7820 0024d0dc 0087be72 009baa00 0087be68 009a5000 0087be7c
        00265d10 009a5000 0087be72 00000003 00000000 00000000 00000000 0087be68
        00000bb8 00000005 00000000 00000000 00000000 00000000 00265c56 00000000
        009ba60c 0036ddf4 00000002 ffffffff 009baa00 009ba600 009a50d6 0087be74
        00227ba0 009baa08 00000001 009baa08 009ba60c 0036ddf4 00000000 00000000
Call Trace: [&lt;001c4f6c&gt;] blk_put_request+0xe/0x14
 [&lt;0024d200&gt;] __scsi_execute+0x124/0x174
 [&lt;0024d0dc&gt;] __scsi_execute+0x0/0x174
 [&lt;00265d10&gt;] sd_revalidate_disk+0xba/0x1f02
 [&lt;00265c56&gt;] sd_revalidate_disk+0x0/0x1f02
 [&lt;0036ddf4&gt;] strlen+0x0/0x22
 [&lt;00227ba0&gt;] device_add+0x3da/0x604
 [&lt;0036ddf4&gt;] strlen+0x0/0x22
 [&lt;00267e64&gt;] sd_probe+0x30c/0x4b4
 [&lt;0002da44&gt;] process_one_work+0x0/0x402
 [&lt;0022b978&gt;] really_probe+0x226/0x354
 [&lt;0022bc34&gt;] driver_probe_device+0xa4/0xf0
 [&lt;0002da44&gt;] process_one_work+0x0/0x402
 [&lt;0022bcd0&gt;] __driver_attach_async_helper+0x50/0x70
 [&lt;00035dae&gt;] async_run_entry_fn+0x36/0x130
 [&lt;0002db88&gt;] process_one_work+0x144/0x402
 [&lt;0002e1aa&gt;] worker_thread+0x0/0x570
 [&lt;0002e29a&gt;] worker_thread+0xf0/0x570
 [&lt;0002e1aa&gt;] worker_thread+0x0/0x570
 [&lt;003768d8&gt;] schedule+0x0/0xb8
 [&lt;0003f58c&gt;] __init_waitqueue_head+0x0/0x12
 [&lt;00033e92&gt;] kthread+0xc2/0xf6
 [&lt;000331e8&gt;] kthread_parkme+0x0/0x4e
 [&lt;003768d8&gt;] schedule+0x0/0xb8
 [&lt;00033dd0&gt;] kthread+0x0/0xf6
 [&lt;00002c10&gt;] ret_from_kernel_thread+0xc/0x14
Code: 0280 0006 0800 56c0 4400 0280 0000 00ff &lt;52b4&gt; 0c3a 082b 0006 0013 6706 2042 53a8 00c4 4ab9 0047 3374 6640 202d 000c 670c
Disabling lock debugging due to kernel taint

Avoid this by setting sg_tablesize = 1.

Link: https://lore.kernel.org/r/4567bcae94523b47d6f3b77450ba305823bca479.1572656814.git.fthain@telegraphics.com.au
Reported-and-tested-by: Michael Schmitz &lt;schmitzmic@gmail.com&gt;
Reviewed-by: Michael Schmitz &lt;schmitzmic@gmail.com&gt;
References: commit 68ab2d76e4be ("scsi: cxlflash: Set sg_tablesize to 1 instead of SG_NONE")
Signed-off-by: Finn Thain &lt;fthain@telegraphics.com.au&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
<entry>
<title>Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi</title>
<updated>2019-07-11T22:14:01Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2019-07-11T22:14:01Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=ba6d10ab8014ac10d25ca513352b6665e73b5785'/>
<id>urn:sha1:ba6d10ab8014ac10d25ca513352b6665e73b5785</id>
<content type='text'>
Pull SCSI updates from James Bottomley:
 "This is mostly update of the usual drivers: qla2xxx, hpsa, lpfc, ufs,
  mpt3sas, ibmvscsi, megaraid_sas, bnx2fc and hisi_sas as well as the
  removal of the osst driver (I heard from Willem privately that he
  would like the driver removed because all his test hardware has
  failed). Plus number of minor changes, spelling fixes and other
  trivia.

  The big merge conflict this time around is the SPDX licence tags.
  Following discussion on linux-next, we believe our version to be more
  accurate than the one in the tree, so the resolution is to take our
  version for all the SPDX conflicts"

Note on the SPDX license tag conversion conflicts: the SCSI tree had
done its own SPDX conversion, which in some cases conflicted with the
treewide ones done by Thomas &amp; co.

In almost all cases, the conflicts were purely syntactic: the SCSI tree
used the old-style SPDX tags ("GPL-2.0" and "GPL-2.0+") while the
treewide conversion had used the new-style ones ("GPL-2.0-only" and
"GPL-2.0-or-later").

In these cases I picked the new-style one.

In a few cases, the SPDX conversion was actually different, though.  As
explained by James above, and in more detail in a pre-pull-request
thread:

 "The other problem is actually substantive: In the libsas code Luben
  Tuikov originally specified gpl 2.0 only by dint of stating:

  * This file is licensed under GPLv2.

  In all the libsas files, but then muddied the water by quoting GPLv2
  verbatim (which includes the or later than language). So for these
  files Christoph did the conversion to v2 only SPDX tags and Thomas
  converted to v2 or later tags"

So in those cases, where the spdx tag substantially mattered, I took the
SCSI tree conversion of it, but then also took the opportunity to turn
the old-style "GPL-2.0" into a new-style "GPL-2.0-only" tag.

Similarly, when there were whitespace differences or other differences
to the comments around the copyright notices, I took the version from
the SCSI tree as being the more specific conversion.

Finally, in the spdx conversions that had no conflicts (because the
treewide ones hadn't been done for those files), I just took the SCSI
tree version as-is, even if it was old-style.  The old-style conversions
are perfectly valid, even if the "-only" and "-or-later" versions are
perhaps more descriptive.

* tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (185 commits)
  scsi: qla2xxx: move IO flush to the front of NVME rport unregistration
  scsi: qla2xxx: Fix NVME cmd and LS cmd timeout race condition
  scsi: qla2xxx: on session delete, return nvme cmd
  scsi: qla2xxx: Fix kernel crash after disconnecting NVMe devices
  scsi: megaraid_sas: Update driver version to 07.710.06.00-rc1
  scsi: megaraid_sas: Introduce various Aero performance modes
  scsi: megaraid_sas: Use high IOPS queues based on IO workload
  scsi: megaraid_sas: Set affinity for high IOPS reply queues
  scsi: megaraid_sas: Enable coalescing for high IOPS queues
  scsi: megaraid_sas: Add support for High IOPS queues
  scsi: megaraid_sas: Add support for MPI toolbox commands
  scsi: megaraid_sas: Offload Aero RAID5/6 division calculations to driver
  scsi: megaraid_sas: RAID1 PCI bandwidth limit algorithm is applicable for only Ventura
  scsi: megaraid_sas: megaraid_sas: Add check for count returned by HOST_DEVICE_LIST DCMD
  scsi: megaraid_sas: Handle sequence JBOD map failure at driver level
  scsi: megaraid_sas: Don't send FPIO to RL Bypass queue
  scsi: megaraid_sas: In probe context, retry IOC INIT once if firmware is in fault
  scsi: megaraid_sas: Release Mutex lock before OCR in case of DCMD timeout
  scsi: megaraid_sas: Call disable_irq from process IRQ poll
  scsi: megaraid_sas: Remove few debug counters from IO path
  ...
</content>
</entry>
<entry>
<title>scsi: mac_scsi: Treat Last Byte Sent time-out as failure</title>
<updated>2019-06-20T19:37:03Z</updated>
<author>
<name>Finn Thain</name>
<email>fthain@telegraphics.com.au</email>
</author>
<published>2019-06-09T01:19:11Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=7c1f3e3447a13a91e95fff6bac7312858c90b0cf'/>
<id>urn:sha1:7c1f3e3447a13a91e95fff6bac7312858c90b0cf</id>
<content type='text'>
A system bus error during a PDMA send operation can result in bytes being
lost. Theoretically that could cause the target to remain in DATA OUT phase
and the initiator (expecting a phase change) would time-out waiting for the
Last Byte Sent flag. Should that happen, fail the transfer so the core
driver will stop using PDMA with this target.

Cc: Michael Schmitz &lt;schmitzmic@gmail.com&gt;
Signed-off-by: Finn Thain &lt;fthain@telegraphics.com.au&gt;
Tested-by: Stan Johnson &lt;userm57@yahoo.com&gt;
Tested-by: Michael Schmitz &lt;schmitzmic@gmail.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
<entry>
<title>scsi: mac_scsi: Enable PDMA on Mac IIfx</title>
<updated>2019-06-20T19:37:03Z</updated>
<author>
<name>Finn Thain</name>
<email>fthain@telegraphics.com.au</email>
</author>
<published>2019-06-09T01:19:11Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=8fb9a64eb6e6fe502187c154434729871d9e5578'/>
<id>urn:sha1:8fb9a64eb6e6fe502187c154434729871d9e5578</id>
<content type='text'>
Add support for Apple's custom "SCSI DMA" chip. This patch doesn't make use
of its DMA capability. Just the PDMA capability is sufficient to improve
sequential read throughput by a factor of 5.

Cc: Michael Schmitz &lt;schmitzmic@gmail.com&gt;
Cc: Joshua Thompson &lt;funaho@jurai.org&gt;
Cc: Geert Uytterhoeven &lt;geert@linux-m68k.org&gt;
Signed-off-by: Finn Thain &lt;fthain@telegraphics.com.au&gt;
Tested-by: Stan Johnson &lt;userm57@yahoo.com&gt;
Tested-by: Michael Schmitz &lt;schmitzmic@gmail.com&gt;
Acked-by: Geert Uytterhoeven &lt;geert@linux-m68k.org&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
<entry>
<title>scsi: mac_scsi: Fix pseudo DMA implementation, take 2</title>
<updated>2019-06-20T19:37:03Z</updated>
<author>
<name>Finn Thain</name>
<email>fthain@telegraphics.com.au</email>
</author>
<published>2019-06-09T01:19:11Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=78ff751f8e6a9446e9fb26b2bff0b8d3f8974cbd'/>
<id>urn:sha1:78ff751f8e6a9446e9fb26b2bff0b8d3f8974cbd</id>
<content type='text'>
A system bus error during a PDMA transfer can mess up the calculation of
the transfer residual (the PDMA handshaking hardware lacks a byte
counter). This results in data corruption.

The algorithm in this patch anticipates a bus error by starting each
transfer with a MOVE.B instruction. If a bus error is caught the transfer
will be retried. If a bus error is caught later in the transfer (for a
MOVE.W instruction) the transfer gets failed and subsequent requests for
that target will use PIO instead of PDMA.

This avoids the "!REQ and !ACK" error so the severity level of that message
is reduced to KERN_DEBUG.

Cc: Michael Schmitz &lt;schmitzmic@gmail.com&gt;
Cc: Geert Uytterhoeven &lt;geert@linux-m68k.org&gt;
Cc: stable@vger.kernel.org # v4.14+
Fixes: 3a0f64bfa907 ("mac_scsi: Fix pseudo DMA implementation")
Signed-off-by: Finn Thain &lt;fthain@telegraphics.com.au&gt;
Reported-by: Chris Jones &lt;chris@martin-jones.com&gt;
Tested-by: Stan Johnson &lt;userm57@yahoo.com&gt;
Tested-by: Michael Schmitz &lt;schmitzmic@gmail.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
<entry>
<title>scsi: mac_scsi: Increase PIO/PDMA transfer length threshold</title>
<updated>2019-06-20T19:37:03Z</updated>
<author>
<name>Finn Thain</name>
<email>fthain@telegraphics.com.au</email>
</author>
<published>2019-06-09T01:19:11Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=7398cee4c3e6aea1ba07a6449e5533ecd0b92cdd'/>
<id>urn:sha1:7398cee4c3e6aea1ba07a6449e5533ecd0b92cdd</id>
<content type='text'>
Some targets introduce delays when handshaking the response to certain
commands. For example, a disk may send a 96-byte response to an INQUIRY
command (or a 24-byte response to a MODE SENSE command) too slowly.

Apparently the first 12 or 14 bytes are handshaked okay but then the system
bus error timeout is reached while transferring the next word.

Since the scsi bus phase hasn't changed, the driver then sets the target
borken flag to prevent further PDMA transfers. The driver also logs the
warning, "switching to slow handshake".

Raise the PDMA threshold to 512 bytes so that PIO transfers will be used
for these commands. This default is sufficiently low that PDMA will still
be used for READ and WRITE commands.

The existing threshold (16 bytes) was chosen more or less at random.
However, best performance requires the threshold to be as low as possible.
Those systems that don't need the PIO workaround at all may benefit from
mac_scsi.setup_use_pdma=1

Cc: Michael Schmitz &lt;schmitzmic@gmail.com&gt;
Cc: stable@vger.kernel.org # v4.14+
Fixes: 3a0f64bfa907 ("mac_scsi: Fix pseudo DMA implementation")
Signed-off-by: Finn Thain &lt;fthain@telegraphics.com.au&gt;
Tested-by: Stan Johnson &lt;userm57@yahoo.com&gt;
Tested-by: Michael Schmitz &lt;schmitzmic@gmail.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
</feed>
