Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp1654049ybm; Sat, 30 May 2020 16:19:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzxCdB8i6P9Cohqa8Yew1Vl5ZcONfowBOKCZZoGrH9vIimtUAVcLvUhjYTGetK4L1Rqk0p6 X-Received: by 2002:a17:906:e0c:: with SMTP id l12mr13133288eji.435.1590880740687; Sat, 30 May 2020 16:19:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590880740; cv=none; d=google.com; s=arc-20160816; b=AUJmE9+qji2I1ztmhGg9nG2CYdpXvRWZ0o2zGeITBlsMQw4L4qWQoPBS6DJsLW+gAC +gQj7COYNfiC81fPt02IxbaUixeoemlxV4eaWkA7FWasu0v391UWBAiO2fMxrngWUsK9 SfgUncPXeDsgO32hkFOjLBPMAuoe3CIOfgh5j0s96vuRZk4HVmTcuvlfDysoA/ZlJ5BY kDkUCV3H4v67hNeznZeuCTxk1Thm86rJB7LIo6h0JEMfh9fVz29tKOK3q7NNwV0Ou/RW eS3GYj5cVjB00FomlHRTdpud9wn/f0aApNEm+gMf1Y40RBVthHJS8E+WmHYSFBfpDEup oQXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:subject:from:references:in-reply-to :message-id:cc:to; bh=JBx1YD+6HQt33PIfSIEckd/+pgAKBfclo7zos+JdcQg=; b=FJPMkGPZ4LN4O3qe53GAXH8oAWkRKajT3m54bTNrL2tY2ThyHwtEKa4TtV1sF9inQQ m8CjYxfmjQyaubcwWavI1RqckkNNptzdHL6re29GoF7wb/rwjOi4hyxRdtVFRiCOl7to t9OBRCsGfvPQIR/r1KXwGPZkNYA/A1lKhzuzuRSxKlRMeA+0Pjp1MWPJyUyhPWsfO2oG ScGgk9rkwk8b3YPb0tKoZu93YIOSs44oER9ugbz36FJZkw5WYlk0wJ9rXgRDQVjJqDAz cAmPhYIE7t5kbOrGyoSAepH5AWmQ1rH3bcXUd0oEoXi5KovYr7ndAqdyxVjdAbl/yqFu EVoQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w11si1127388edi.236.2020.05.30.16.18.38; Sat, 30 May 2020 16:19:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729587AbgE3XQb (ORCPT + 99 others); Sat, 30 May 2020 19:16:31 -0400 Received: from kvm5.telegraphics.com.au ([98.124.60.144]:51092 "EHLO kvm5.telegraphics.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729565AbgE3XQ3 (ORCPT ); Sat, 30 May 2020 19:16:29 -0400 Received: by kvm5.telegraphics.com.au (Postfix, from userid 502) id 0CE8A27F9B; Sat, 30 May 2020 19:16:28 -0400 (EDT) To: Geert Uytterhoeven Cc: Joshua Thompson , linux-m68k@lists.linux-m68k.org, linux-kernel@vger.kernel.org Message-Id: <317909d69244f06581973c5839382f5516cd9a1c.1590880333.git.fthain@telegraphics.com.au> In-Reply-To: References: From: Finn Thain Subject: [PATCH 4/4] m68k/mac: Improve IOP debug messages Date: Sun, 31 May 2020 09:12:13 +1000 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Always dump the full message and reply. Avoid printing partial lines as this output gets mixed up with the output from called functions. Don't output the state of idle channels. Cc: Joshua Thompson Tested-by: Stan Johnson Signed-off-by: Finn Thain --- arch/m68k/mac/iop.c | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/arch/m68k/mac/iop.c b/arch/m68k/mac/iop.c index 8d6946edf2c8..373a74c99356 100644 --- a/arch/m68k/mac/iop.c +++ b/arch/m68k/mac/iop.c @@ -347,8 +347,8 @@ void iop_complete_message(struct iop_msg *msg) int chan = msg->channel; int i,offset; - iop_pr_debug("msg %p iop_num %d channel %d\n", msg, msg->iop_num, - msg->channel); + iop_pr_debug("iop_num %d chan %d reply %*ph\n", + msg->iop_num, msg->channel, IOP_MSG_LEN, msg->reply); offset = IOP_ADDR_RECV_MSG + (msg->channel * IOP_MSG_LEN); @@ -372,6 +372,9 @@ static void iop_do_send(struct iop_msg *msg) volatile struct mac_iop *iop = iop_base[msg->iop_num]; int i,offset; + iop_pr_debug("iop_num %d chan %d message %*ph\n", + msg->iop_num, msg->channel, IOP_MSG_LEN, msg->message); + offset = IOP_ADDR_SEND_MSG + (msg->channel * IOP_MSG_LEN); for (i = 0 ; i < IOP_MSG_LEN ; i++, offset++) { @@ -394,8 +397,6 @@ static void iop_handle_send(uint iop_num, uint chan) struct iop_msg *msg; int i,offset; - iop_pr_debug("iop_num %d chan %d\n", iop_num, chan); - iop_writeb(iop, IOP_ADDR_SEND_STATE + chan, IOP_MSG_IDLE); if (!(msg = iop_send_queue[iop_num][chan])) return; @@ -405,6 +406,9 @@ static void iop_handle_send(uint iop_num, uint chan) for (i = 0 ; i < IOP_MSG_LEN ; i++, offset++) { msg->reply[i] = iop_readb(iop, offset); } + iop_pr_debug("iop_num %d chan %d reply %*ph\n", + iop_num, chan, IOP_MSG_LEN, msg->reply); + if (msg->handler) (*msg->handler)(msg); msg->status = IOP_MSGSTATUS_UNUSED; msg = msg->next; @@ -424,8 +428,6 @@ static void iop_handle_recv(uint iop_num, uint chan) int i,offset; struct iop_msg *msg; - iop_pr_debug("iop_num %d chan %d\n", iop_num, chan); - msg = iop_get_unused_msg(); msg->iop_num = iop_num; msg->channel = chan; @@ -437,6 +439,8 @@ static void iop_handle_recv(uint iop_num, uint chan) for (i = 0 ; i < IOP_MSG_LEN ; i++, offset++) { msg->message[i] = iop_readb(iop, offset); } + iop_pr_debug("iop_num %d chan %d message %*ph\n", + iop_num, chan, IOP_MSG_LEN, msg->message); iop_writeb(iop, IOP_ADDR_RECV_STATE + chan, IOP_MSG_RCVD); @@ -446,9 +450,6 @@ static void iop_handle_recv(uint iop_num, uint chan) if (msg->handler) { (*msg->handler)(msg); } else { - iop_pr_debug("unclaimed message on iop_num %d chan %d\n", - iop_num, chan); - iop_pr_debug("%*ph\n", IOP_MSG_LEN, msg->message); memset(msg->reply, 0, IOP_MSG_LEN); iop_complete_message(msg); } @@ -559,35 +560,34 @@ irqreturn_t iop_ism_irq(int irq, void *dev_id) int i,state; u8 events = iop->status_ctrl & (IOP_INT0 | IOP_INT1); - iop_pr_debug("status %02X\n", iop->status_ctrl); - do { + iop_pr_debug("iop_num %d status %02X\n", iop_num, + iop->status_ctrl); + /* INT0 indicates state change on an outgoing message channel */ if (events & IOP_INT0) { iop->status_ctrl = IOP_INT0 | IOP_RUN | IOP_AUTOINC; - iop_pr_debug("new status %02X, send states", - iop->status_ctrl); for (i = 0; i < NUM_IOP_CHAN; i++) { state = iop_readb(iop, IOP_ADDR_SEND_STATE + i); - iop_pr_cont(" %02X", state); if (state == IOP_MSG_COMPLETE) iop_handle_send(iop_num, i); + else if (state != IOP_MSG_IDLE) + iop_pr_debug("chan %d send state %02X\n", + i, state); } - iop_pr_cont("\n"); } /* INT1 for incoming messages */ if (events & IOP_INT1) { iop->status_ctrl = IOP_INT1 | IOP_RUN | IOP_AUTOINC; - iop_pr_debug("new status %02X, recv states", - iop->status_ctrl); for (i = 0; i < NUM_IOP_CHAN; i++) { state = iop_readb(iop, IOP_ADDR_RECV_STATE + i); - iop_pr_cont(" %02X", state); if (state == IOP_MSG_NEW) iop_handle_recv(iop_num, i); + else if (state != IOP_MSG_IDLE) + iop_pr_debug("chan %d recv state %02X\n", + i, state); } - iop_pr_cont("\n"); } events = iop->status_ctrl & (IOP_INT0 | IOP_INT1); -- 2.26.2