From patchwork Thu Oct 12 15:59:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eddie James X-Patchwork-Id: 824930 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3yCbCX3HXpz9t2r for ; Fri, 13 Oct 2017 03:00:08 +1100 (AEDT) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3yCbCX0v7VzDr9C for ; Fri, 13 Oct 2017 03:00:08 +1100 (AEDT) X-Original-To: openbmc@lists.ozlabs.org Delivered-To: openbmc@lists.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=linux.vnet.ibm.com (client-ip=148.163.158.5; helo=mx0a-001b2d01.pphosted.com; envelope-from=eajames@linux.vnet.ibm.com; receiver=) Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3yCbCQ0ZKyzDr4T for ; Fri, 13 Oct 2017 03:00:01 +1100 (AEDT) Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id v9CFxGpH025031 for ; Thu, 12 Oct 2017 11:59:58 -0400 Received: from e19.ny.us.ibm.com (e19.ny.us.ibm.com [129.33.205.209]) by mx0b-001b2d01.pphosted.com with ESMTP id 2djac53j3w-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 12 Oct 2017 11:59:58 -0400 Received: from localhost by e19.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 12 Oct 2017 11:59:57 -0400 Received: from b01cxnp23032.gho.pok.ibm.com (9.57.198.27) by e19.ny.us.ibm.com (146.89.104.206) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Thu, 12 Oct 2017 11:59:56 -0400 Received: from b01ledav006.gho.pok.ibm.com (b01ledav006.gho.pok.ibm.com [9.57.199.111]) by b01cxnp23032.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v9CFxtZK35520630; Thu, 12 Oct 2017 15:59:55 GMT Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 25026AC043; Thu, 12 Oct 2017 12:00:35 -0400 (EDT) Received: from oc3016140333.ibm.com (unknown [9.41.174.252]) by b01ledav006.gho.pok.ibm.com (Postfix) with ESMTP id CD8F6AC040; Thu, 12 Oct 2017 12:00:34 -0400 (EDT) From: Eddie James To: openbmc@lists.ozlabs.org Subject: [PATCH linux dev-4.10] drivers: fsi: occ: Fix errno for canceling a read operation Date: Thu, 12 Oct 2017 10:59:53 -0500 X-Mailer: git-send-email 1.8.3.1 X-TM-AS-GCONF: 00 x-cbid: 17101215-0056-0000-0000-000003D903D9 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00007886; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000236; SDB=6.00930129; UDB=6.00468203; IPR=6.00710397; BA=6.00005635; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00017508; XFM=3.00000015; UTC=2017-10-12 15:59:57 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17101215-0057-0000-0000-000008100660 Message-Id: <1507823993-23017-1-git-send-email-eajames@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-10-12_09:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=1 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1710120229 X-BeenThere: openbmc@lists.ozlabs.org X-Mailman-Version: 2.1.24 Precedence: list List-Id: Development list for OpenBMC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Edward A. James" Errors-To: openbmc-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "openbmc" From: "Edward A. James" Should not return -ECANCELED when the device has been removed. Instead, use -ENODEV. Signed-off-by: Edward A. James --- drivers/fsi/occ.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/fsi/occ.c b/drivers/fsi/occ.c index 2e64ee2..1fe1a54 100644 --- a/drivers/fsi/occ.c +++ b/drivers/fsi/occ.c @@ -240,8 +240,10 @@ static ssize_t occ_read_common(struct occ_client *client, char __user *ubuf, spin_lock_irq(&client->lock); if (!test_bit(XFR_COMPLETE, &xfr->flags)) { - if (occ->cancel || test_bit(XFR_CANCELED, &xfr->flags)) + if (test_bit(XFR_CANCELED, &xfr->flags)) rc = -ECANCELED; + else if (occ->cancel) + rc = -ENODEV; else rc = -EINTR;