diff mbox

KVM: s390: virtio_ccw: reset errors for new I/O.

Message ID 1365063906-61392-2-git-send-email-cornelia.huck@de.ibm.com (mailing list archive)
State New, archived
Headers show

Commit Message

Cornelia Huck April 4, 2013, 8:25 a.m. UTC
ccw_io_helper neglected to reset vcdev->err after a new channel
program had been successfully started, resulting in stale errors
delivered after one I/O failed. Reset the error after a new
channel program has been successfully started with no old I/O
pending.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
---
 drivers/s390/kvm/virtio_ccw.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Alexander Graf April 4, 2013, 9:28 a.m. UTC | #1
On 04.04.2013, at 10:25, Cornelia Huck wrote:

> ccw_io_helper neglected to reset vcdev->err after a new channel
> program had been successfully started, resulting in stale errors
> delivered after one I/O failed. Reset the error after a new
> channel program has been successfully started with no old I/O
> pending.
> 
> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>

Shouldn't this be CC: stable?


Alex

> ---
> drivers/s390/kvm/virtio_ccw.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/s390/kvm/virtio_ccw.c b/drivers/s390/kvm/virtio_ccw.c
> index 42d507c..5948f2a 100644
> --- a/drivers/s390/kvm/virtio_ccw.c
> +++ b/drivers/s390/kvm/virtio_ccw.c
> @@ -133,8 +133,11 @@ static int ccw_io_helper(struct virtio_ccw_device *vcdev,
> 	do {
> 		spin_lock_irqsave(get_ccwdev_lock(vcdev->cdev), flags);
> 		ret = ccw_device_start(vcdev->cdev, ccw, intparm, 0, 0);
> -		if (!ret)
> +		if (!ret) {
> +			if (!vcdev->curr_io)
> +				vcdev->err = 0;
> 			vcdev->curr_io |= flag;
> +		}
> 		spin_unlock_irqrestore(get_ccwdev_lock(vcdev->cdev), flags);
> 		cpu_relax();
> 	} while (ret == -EBUSY);
> -- 
> 1.7.12.4
> 

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Cornelia Huck April 4, 2013, 10:20 a.m. UTC | #2
On Thu, 4 Apr 2013 11:28:35 +0200
Alexander Graf <agraf@suse.de> wrote:

> 
> On 04.04.2013, at 10:25, Cornelia Huck wrote:
> 
> > ccw_io_helper neglected to reset vcdev->err after a new channel
> > program had been successfully started, resulting in stale errors
> > delivered after one I/O failed. Reset the error after a new
> > channel program has been successfully started with no old I/O
> > pending.
> > 
> > Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
> 
> Shouldn't this be CC: stable?

I don't think so, current code will not continue after errors anyway.

> 
> 
> Alex
> 
> > ---
> > drivers/s390/kvm/virtio_ccw.c | 5 ++++-
> > 1 file changed, 4 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/s390/kvm/virtio_ccw.c b/drivers/s390/kvm/virtio_ccw.c
> > index 42d507c..5948f2a 100644
> > --- a/drivers/s390/kvm/virtio_ccw.c
> > +++ b/drivers/s390/kvm/virtio_ccw.c
> > @@ -133,8 +133,11 @@ static int ccw_io_helper(struct virtio_ccw_device *vcdev,
> > 	do {
> > 		spin_lock_irqsave(get_ccwdev_lock(vcdev->cdev), flags);
> > 		ret = ccw_device_start(vcdev->cdev, ccw, intparm, 0, 0);
> > -		if (!ret)
> > +		if (!ret) {
> > +			if (!vcdev->curr_io)
> > +				vcdev->err = 0;
> > 			vcdev->curr_io |= flag;
> > +		}
> > 		spin_unlock_irqrestore(get_ccwdev_lock(vcdev->cdev), flags);
> > 		cpu_relax();
> > 	} while (ret == -EBUSY);
> > -- 
> > 1.7.12.4
> > 
> 

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Alexander Graf April 4, 2013, 11:34 a.m. UTC | #3
On 04.04.2013, at 12:20, Cornelia Huck wrote:

> On Thu, 4 Apr 2013 11:28:35 +0200
> Alexander Graf <agraf@suse.de> wrote:
> 
>> 
>> On 04.04.2013, at 10:25, Cornelia Huck wrote:
>> 
>>> ccw_io_helper neglected to reset vcdev->err after a new channel
>>> program had been successfully started, resulting in stale errors
>>> delivered after one I/O failed. Reset the error after a new
>>> channel program has been successfully started with no old I/O
>>> pending.
>>> 
>>> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
>> 
>> Shouldn't this be CC: stable?
> 
> I don't think so, current code will not continue after errors anyway.

Yeah, I got confused by the cover letter for a single patch. Usually, when you only send a single patch, you wouldn't also send a cover letter :).


Alex

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/s390/kvm/virtio_ccw.c b/drivers/s390/kvm/virtio_ccw.c
index 42d507c..5948f2a 100644
--- a/drivers/s390/kvm/virtio_ccw.c
+++ b/drivers/s390/kvm/virtio_ccw.c
@@ -133,8 +133,11 @@  static int ccw_io_helper(struct virtio_ccw_device *vcdev,
 	do {
 		spin_lock_irqsave(get_ccwdev_lock(vcdev->cdev), flags);
 		ret = ccw_device_start(vcdev->cdev, ccw, intparm, 0, 0);
-		if (!ret)
+		if (!ret) {
+			if (!vcdev->curr_io)
+				vcdev->err = 0;
 			vcdev->curr_io |= flag;
+		}
 		spin_unlock_irqrestore(get_ccwdev_lock(vcdev->cdev), flags);
 		cpu_relax();
 	} while (ret == -EBUSY);