From: Cornelia Huck <cohuck@redhat.com>
To: "Jason J. Herne" <jjherne@linux.ibm.com>
Cc: qemu-devel@nongnu.org, qemu-s390x@nongnu.org,
pasic@linux.ibm.com, alifm@linux.ibm.com, borntraeger@de.ibm.com
Subject: Re: [Qemu-devel] [PATCH v3 11/16] s390-bios: cio error handling
Date: Fri, 8 Mar 2019 10:21:20 +0100 [thread overview]
Message-ID: <20190308102120.14051cc2.cohuck@redhat.com> (raw)
In-Reply-To: <5cf175cf-892c-d909-f832-127bf3f4747a@linux.ibm.com>
On Thu, 7 Mar 2019 14:31:23 -0500
"Jason J. Herne" <jjherne@linux.ibm.com> wrote:
> On 3/4/19 1:35 PM, Cornelia Huck wrote:
> > On Fri, 1 Mar 2019 13:59:31 -0500
> > "Jason J. Herne" <jjherne@linux.ibm.com> wrote:
> >
> >> Add verbose error output for when unexpected i/o errors happen. This eases the
> >> burden of debugging and reporting i/o errors. No error information is printed
> >> in the success case, here is an example of what is output on error:
> >>
> >> cio device error
> >> ssid : 0x0000000000000000
> >> cssid : 0x0000000000000000
> >> sch_no: 0x0000000000000000
> >>
> >> Interrupt Response Block Data:
> >> Function Ctrl : [Start]
> >> Activity Ctrl : [Start-Pending]
> >> Status Ctrl : [Alert] [Primary] [Secondary] [Status-Pending]
> >> Device Status : [Unit-Check]
> >> Channel Status :
> >> cpa=: 0x000000007f8d6038
> >> prev_ccw=: 0x0000000000000000
> >> this_ccw=: 0x0000000000000000
> >> Eckd Dasd Sense Data (fmt 32-bytes):
> >> Sense Condition Flags :
> >> Residual Count =: 0x0000000000000000
> >> Phys Drive ID =: 0x000000000000009e
> >> low cyl address =: 0x0000000000000000
> >> head addr & hi cyl =: 0x0000000000000000
> >> format/message =: 0x0000000000000008
> >> fmt-dependent[0-7] =: 0x0000000000000004
> >> fmt-dependent[8-15]=: 0xe561282305082fff
> >> prog action code =: 0x0000000000000016
> >> Configuration info =: 0x00000000000040e0
> >> mcode / hi-cyl =: 0x0000000000000000
> >> cyl & head addr [0]=: 0x0000000000000000
> >> cyl & head addr [1]=: 0x0000000000000000
> >> cyl & head addr [2]=: 0x0000000000000000
> >>
> >> Signed-off-by: Jason J. Herne <jjherne@linux.ibm.com>
> >> ---
> >> pc-bios/s390-ccw/cio.c | 230 ++++++++++++++++++++++++++++++++++++++++++++++++
> >> pc-bios/s390-ccw/libc.h | 11 +++
> >> 2 files changed, 241 insertions(+)
> >>
> >> diff --git a/pc-bios/s390-ccw/cio.c b/pc-bios/s390-ccw/cio.c
> >> index e61cfd3..c528bbf 100644
> >> --- a/pc-bios/s390-ccw/cio.c
> >> +++ b/pc-bios/s390-ccw/cio.c
> >> @@ -82,6 +82,228 @@ static bool irb_error(Irb *irb)
> >> return irb->scsw.dstat != (SCSW_DSTAT_DEVEND | SCSW_DSTAT_CHEND);
> >> }
> >>
> >> +static void print_eckd_dasd_sense_data(SenseDataEckdDasd *sd)
> >> +{
> >> + char msgline[512];
> >> +
> >> + if (sd->config_info & 0x8000) {
> >> + sclp_print("Eckd Dasd Sense Data (fmt 24-bytes):\n");
> >> + } else {
> >> + sclp_print("Eckd Dasd Sense Data (fmt 32-bytes):\n");
> >> + }
> >> +
> >> + strcat(msgline, " Sense Condition Flags :");
> >> + if (sd->status[0] & SNS_STAT0_CMD_REJECT) {
> >> + strcat(msgline, " [Cmd-Reject]");
> >> + }
> >> + if (sd->status[0] & SNS_STAT0_INTERVENTION_REQ) {
> >> + strcat(msgline, " [Intervention-Required]");
> >> + }
> >> + if (sd->status[0] & SNS_STAT0_BUS_OUT_CHECK) {
> >> + strcat(msgline, " [Bus-Out-Parity-Check]");
> >> + }
> >> + if (sd->status[0] & SNS_STAT0_EQUIPMENT_CHECK) {
> >> + strcat(msgline, " [Equipment-Check]");
> >> + }
> >> + if (sd->status[0] & SNS_STAT0_DATA_CHECK) {
> >> + strcat(msgline, " [Data-Check]");
> >
> > I'm wondering whether it would make sense to factor the common bits
> > out. Might be overkill, though.
> >
>
> I'm not huge fan of this error code myself. It looks nice in output and may be useful for
> debugging which is why I decided to submit it. I did think about ways to make it look
> cleaner but didn't come up with anything great. I'd be open to suggestions, but I also
> think going too deep is overkill.
>
> ...
> > Maybe do basic_sense + print sense data only if there's actually a unit
> > check?
> >
> > (Also, I'm not sure if you can even do a basic_sense in case e.g. of
> > unexpected busy.)
> >
> >> + basic_sense(schid, &sd, sizeof(sd));
> >> + print_eckd_dasd_sense_data(&sd);
> >> rc = -1;
> >> break;
> >> }
>
> I've made a change that should address both issues. Preview:
>
> if (cutype == CU_TYPE_DASD_3990 || cutype == CU_TYPE_UNKNOWN) {
> if (!basic_sense(schid, cutype, &sd, sizeof(sd))) {
> print_eckd_dasd_sense_data(&sd);
> }
> }
>
> Now we only print sense data if basic sense works. So if it fails because of a busy status
> (or any reason) we won't try to print.
>
Sounds good!
next prev parent reply other threads:[~2019-03-08 9:21 UTC|newest]
Thread overview: 71+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-01 18:59 [Qemu-devel] [PATCH v3 00/16] s390: vfio-ccw dasd ipl support Jason J. Herne
2019-03-01 18:59 ` [Qemu-devel] [PATCH v3 01/16] s390 vfio-ccw: Add bootindex property and IPLB data Jason J. Herne
2019-03-04 13:40 ` Cornelia Huck
2019-03-06 14:55 ` Jason J. Herne
2019-03-06 15:27 ` Cornelia Huck
2019-03-06 16:28 ` Jason J. Herne
2019-03-06 17:31 ` Cornelia Huck
2019-03-04 16:09 ` Farhan Ali
2019-03-06 15:16 ` Jason J. Herne
2019-03-01 18:59 ` [Qemu-devel] [PATCH v3 02/16] s390-bios: decouple cio setup from virtio Jason J. Herne
2019-03-01 18:59 ` [Qemu-devel] [PATCH v3 03/16] s390-bios: decouple common boot logic " Jason J. Herne
2019-03-01 18:59 ` [Qemu-devel] [PATCH v3 04/16] s390-bios: Extend find_dev() for non-virtio devices Jason J. Herne
2019-03-01 18:59 ` [Qemu-devel] [PATCH v3 05/16] s390-bios: Factor finding boot device out of virtio code path Jason J. Herne
2019-03-04 17:07 ` Cornelia Huck
2019-03-04 19:26 ` [Qemu-devel] [qemu-s390x] " Thomas Huth
2019-03-05 8:38 ` Cornelia Huck
2019-03-01 18:59 ` [Qemu-devel] [PATCH v3 06/16] s390-bios: Clean up cio.h Jason J. Herne
2019-03-04 17:23 ` Cornelia Huck
2019-03-05 5:51 ` [Qemu-devel] [qemu-s390x] " Thomas Huth
2019-03-06 18:42 ` Jason J. Herne
2019-03-07 8:08 ` Cornelia Huck
2019-03-01 18:59 ` [Qemu-devel] [PATCH v3 07/16] s390-bios: Decouple channel i/o logic from virtio Jason J. Herne
2019-03-04 17:28 ` Cornelia Huck
2019-03-01 18:59 ` [Qemu-devel] [PATCH v3 08/16] s390-bios: Map low core memory Jason J. Herne
2019-03-04 17:46 ` Cornelia Huck
2019-03-05 6:27 ` [Qemu-devel] [qemu-s390x] " Thomas Huth
2019-03-06 19:28 ` Jason J. Herne
2019-03-07 8:11 ` Cornelia Huck
2019-03-06 19:42 ` Jason J. Herne
2019-03-01 18:59 ` [Qemu-devel] [PATCH v3 09/16] s390-bios: ptr2u32 and u32toptr Jason J. Herne
2019-03-05 7:22 ` [Qemu-devel] [qemu-s390x] " Thomas Huth
2019-03-07 14:11 ` Jason J. Herne
2019-03-01 18:59 ` [Qemu-devel] [PATCH v3 10/16] s390-bios: Support for running format-0/1 channel programs Jason J. Herne
2019-03-04 18:25 ` Cornelia Huck
2019-03-07 19:25 ` Jason J. Herne
2019-03-08 9:19 ` Cornelia Huck
2019-03-05 7:32 ` [Qemu-devel] [qemu-s390x] " Thomas Huth
2019-03-01 18:59 ` [Qemu-devel] [PATCH v3 11/16] s390-bios: cio error handling Jason J. Herne
2019-03-04 18:35 ` Cornelia Huck
2019-03-07 19:31 ` Jason J. Herne
2019-03-08 9:21 ` Cornelia Huck [this message]
2019-03-01 18:59 ` [Qemu-devel] [PATCH v3 12/16] s390-bios: Refactor virtio to run channel programs via cio Jason J. Herne
2019-03-05 12:30 ` Cornelia Huck
2019-03-07 15:09 ` Jason J. Herne
2019-03-07 15:37 ` Cornelia Huck
2019-03-01 18:59 ` [Qemu-devel] [PATCH v3 13/16] s390-bios: Use control unit type to determine boot method Jason J. Herne
2019-03-05 12:27 ` Cornelia Huck
2019-03-07 16:27 ` Jason J. Herne
2019-03-01 18:59 ` [Qemu-devel] [PATCH v3 14/16] s390-bios: Add channel command codes/structs needed for dasd-ipl Jason J. Herne
2019-03-01 18:59 ` [Qemu-devel] [PATCH v3 15/16] s390-bios: Support booting from real dasd device Jason J. Herne
2019-03-05 13:03 ` Cornelia Huck
2019-03-01 18:59 ` [Qemu-devel] [PATCH v3 16/16] s390-bios: dasd-ipl: Use control unit type to customize error data Jason J. Herne
2019-03-04 17:02 ` [Qemu-devel] [qemu-s390x] " Eric Farman
2019-03-07 14:38 ` Jason J. Herne
2019-03-07 18:15 ` Eric Farman
2019-03-07 18:26 ` Jason J. Herne
2019-03-04 17:51 ` [Qemu-devel] " Cornelia Huck
2019-03-01 21:26 ` [Qemu-devel] [PATCH v3 00/16] s390: vfio-ccw dasd ipl support no-reply
2019-03-01 21:30 ` no-reply
2019-03-01 21:35 ` no-reply
2019-03-01 21:38 ` no-reply
2019-03-01 21:45 ` no-reply
2019-03-01 21:49 ` no-reply
2019-03-04 16:24 ` Cornelia Huck
2019-03-04 17:53 ` Christian Borntraeger
2019-03-04 17:28 ` no-reply
2019-03-04 17:51 ` no-reply
2019-03-05 5:55 ` no-reply
2019-03-05 7:30 ` no-reply
2019-03-05 8:42 ` no-reply
2019-03-05 13:08 ` no-reply
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=20190308102120.14051cc2.cohuck@redhat.com \
--to=cohuck@redhat.com \
--cc=alifm@linux.ibm.com \
--cc=borntraeger@de.ibm.com \
--cc=jjherne@linux.ibm.com \
--cc=pasic@linux.ibm.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-s390x@nongnu.org \
/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;
as well as URLs for NNTP newsgroup(s).