From: Finn Thain <fthain@linux-m68k.org>
To: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>
Cc: Hannes Reinecke <hare@suse.com>,
Michael Schmitz <schmitzmic@gmail.com>,
Ondrej Zary <linux@zary.sk>, Stan Johnson <userm57@yahoo.com>,
stable@vger.kernel.org, linux-scsi@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH 01/11] scsi: mac_scsi: Revise printk(KERN_DEBUG ...) messages
Date: Wed, 07 Aug 2024 13:36:28 +1000 [thread overview]
Message-ID: <7573c79f4e488fc00af2b8a191e257ca945e0409.1723001788.git.fthain@linux-m68k.org> (raw)
In-Reply-To: <cover.1723001788.git.fthain@linux-m68k.org>
After a bus fault, capture and log the chip registers immediately,
if the NDEBUG_PSEUDO_DMA macro is defined. Remove some
printk(KERN_DEBUG ...) messages that aren't needed any more.
Don't skip the debug message when bytes == 0. Show all of the byte
counters in the debug messages.
Cc: stable@vger.kernel.org # 5.15+
Tested-by: Stan Johnson <userm57@yahoo.com>
Signed-off-by: Finn Thain <fthain@linux-m68k.org>
---
This is not really a bug fix, but has been sent to @stable because it is a
prerequisite for the bug fixes which follow.
---
drivers/scsi/mac_scsi.c | 42 +++++++++++++++++++++--------------------
1 file changed, 22 insertions(+), 20 deletions(-)
diff --git a/drivers/scsi/mac_scsi.c b/drivers/scsi/mac_scsi.c
index a402c4dc4645..5ae8f4a1e9ca 100644
--- a/drivers/scsi/mac_scsi.c
+++ b/drivers/scsi/mac_scsi.c
@@ -286,13 +286,14 @@ static inline int macscsi_pread(struct NCR5380_hostdata *hostdata,
while (!NCR5380_poll_politely(hostdata, BUS_AND_STATUS_REG,
BASR_DRQ | BASR_PHASE_MATCH,
BASR_DRQ | BASR_PHASE_MATCH, 0)) {
- int bytes;
+ int bytes, chunk_bytes;
if (macintosh_config->ident == MAC_MODEL_IIFX)
write_ctrl_reg(hostdata, CTRL_HANDSHAKE_MODE |
CTRL_INTERRUPTS_ENABLE);
- bytes = mac_pdma_recv(s, d, min(hostdata->pdma_residual, 512));
+ chunk_bytes = min(hostdata->pdma_residual, 512);
+ bytes = mac_pdma_recv(s, d, chunk_bytes);
if (bytes > 0) {
d += bytes;
@@ -302,23 +303,23 @@ static inline int macscsi_pread(struct NCR5380_hostdata *hostdata,
if (hostdata->pdma_residual == 0)
goto out;
- if (NCR5380_poll_politely2(hostdata, STATUS_REG, SR_REQ, SR_REQ,
- BUS_AND_STATUS_REG, BASR_ACK,
- BASR_ACK, 0) < 0)
- scmd_printk(KERN_DEBUG, hostdata->connected,
- "%s: !REQ and !ACK\n", __func__);
if (!(NCR5380_read(BUS_AND_STATUS_REG) & BASR_PHASE_MATCH))
goto out;
if (bytes == 0)
udelay(MAC_PDMA_DELAY);
- if (bytes >= 0)
+ if (bytes > 0)
continue;
- dsprintk(NDEBUG_PSEUDO_DMA, hostdata->host,
- "%s: bus error (%d/%d)\n", __func__, d - dst, len);
NCR5380_dprint(NDEBUG_PSEUDO_DMA, hostdata->host);
+ dsprintk(NDEBUG_PSEUDO_DMA, hostdata->host,
+ "%s: bus error [%d/%d] (%d/%d)\n",
+ __func__, d - dst, len, bytes, chunk_bytes);
+
+ if (bytes == 0)
+ continue;
+
result = -1;
goto out;
}
@@ -345,13 +346,14 @@ static inline int macscsi_pwrite(struct NCR5380_hostdata *hostdata,
while (!NCR5380_poll_politely(hostdata, BUS_AND_STATUS_REG,
BASR_DRQ | BASR_PHASE_MATCH,
BASR_DRQ | BASR_PHASE_MATCH, 0)) {
- int bytes;
+ int bytes, chunk_bytes;
if (macintosh_config->ident == MAC_MODEL_IIFX)
write_ctrl_reg(hostdata, CTRL_HANDSHAKE_MODE |
CTRL_INTERRUPTS_ENABLE);
- bytes = mac_pdma_send(s, d, min(hostdata->pdma_residual, 512));
+ chunk_bytes = min(hostdata->pdma_residual, 512);
+ bytes = mac_pdma_send(s, d, chunk_bytes);
if (bytes > 0) {
s += bytes;
@@ -370,23 +372,23 @@ static inline int macscsi_pwrite(struct NCR5380_hostdata *hostdata,
goto out;
}
- if (NCR5380_poll_politely2(hostdata, STATUS_REG, SR_REQ, SR_REQ,
- BUS_AND_STATUS_REG, BASR_ACK,
- BASR_ACK, 0) < 0)
- scmd_printk(KERN_DEBUG, hostdata->connected,
- "%s: !REQ and !ACK\n", __func__);
if (!(NCR5380_read(BUS_AND_STATUS_REG) & BASR_PHASE_MATCH))
goto out;
if (bytes == 0)
udelay(MAC_PDMA_DELAY);
- if (bytes >= 0)
+ if (bytes > 0)
continue;
- dsprintk(NDEBUG_PSEUDO_DMA, hostdata->host,
- "%s: bus error (%d/%d)\n", __func__, s - src, len);
NCR5380_dprint(NDEBUG_PSEUDO_DMA, hostdata->host);
+ dsprintk(NDEBUG_PSEUDO_DMA, hostdata->host,
+ "%s: bus error [%d/%d] (%d/%d)\n",
+ __func__, s - src, len, bytes, chunk_bytes);
+
+ if (bytes == 0)
+ continue;
+
result = -1;
goto out;
}
--
2.39.5
next prev parent reply other threads:[~2024-08-07 3:39 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-07 3:36 [PATCH 00/11] NCR5380: Bug fixes and other improvements Finn Thain
2024-08-07 3:36 ` [PATCH 09/11] scsi: NCR5380: Remove redundant result calculation from NCR5380_transfer_pio() Finn Thain
2024-08-07 3:36 ` [PATCH 06/11] scsi: NCR5380: Initialize buffer for MSG IN and STATUS transfers Finn Thain
2024-08-07 3:36 ` [PATCH 02/11] scsi: mac_scsi: Refactor polling loop Finn Thain
2024-08-07 3:36 ` [PATCH 07/11] scsi: NCR5380: Handle BSY signal loss during information transfer phases Finn Thain
2024-08-07 3:36 ` [PATCH 10/11] scsi: NCR5380: Remove obsolete comment Finn Thain
2024-08-07 3:36 ` [PATCH 04/11] scsi: NCR5380: Check for phase match during PDMA fixup Finn Thain
2024-08-07 3:36 ` [PATCH 08/11] scsi: NCR5380: Drop redundant member from struct NCR5380_cmd Finn Thain
2024-08-07 3:36 ` [PATCH 03/11] scsi: mac_scsi: Disallow bus errors during PDMA send Finn Thain
2024-08-07 3:36 ` [PATCH 05/11] scsi: mac_scsi: Enable scatter/gather by default Finn Thain
2024-08-07 3:36 ` Finn Thain [this message]
2024-08-07 3:36 ` [PATCH 11/11] scsi: NCR5380: Clean up indentation Finn Thain
2024-08-13 2:07 ` [PATCH 00/11] NCR5380: Bug fixes and other improvements Martin K. Petersen
2024-08-17 1:34 ` Martin K. Petersen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7573c79f4e488fc00af2b8a191e257ca945e0409.1723001788.git.fthain@linux-m68k.org \
--to=fthain@linux-m68k.org \
--cc=James.Bottomley@HansenPartnership.com \
--cc=hare@suse.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=linux@zary.sk \
--cc=martin.petersen@oracle.com \
--cc=schmitzmic@gmail.com \
--cc=stable@vger.kernel.org \
--cc=userm57@yahoo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®