Return-Path: Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (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 3wjkJP0nWrzDqL2 for ; Thu, 8 Jun 2017 08:49:24 +1000 (AEST) Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.20/8.16.0.20) with SMTP id v57MmoBf110052 for ; Wed, 7 Jun 2017 18:49:22 -0400 Received: from e33.co.us.ibm.com (e33.co.us.ibm.com [32.97.110.151]) by mx0a-001b2d01.pphosted.com with ESMTP id 2axtegg96n-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Wed, 07 Jun 2017 18:49:22 -0400 Received: from localhost by e33.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 7 Jun 2017 16:49:22 -0600 Received: from b03cxnp08026.gho.boulder.ibm.com (9.17.130.18) by e33.co.us.ibm.com (192.168.1.133) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 7 Jun 2017 16:49:19 -0600 Received: from b03ledav003.gho.boulder.ibm.com (b03ledav003.gho.boulder.ibm.com [9.17.130.234]) by b03cxnp08026.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id v57MnJT720250952; Wed, 7 Jun 2017 15:49:19 -0700 Received: from b03ledav003.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 259F16A03B; Wed, 7 Jun 2017 16:49:19 -0600 (MDT) Received: from oc3016140333.ibm.com (unknown [9.41.179.225]) by b03ledav003.gho.boulder.ibm.com (Postfix) with ESMTP id DA2576A03C; Wed, 7 Jun 2017 16:49:18 -0600 (MDT) From: Eddie James To: openbmc@lists.ozlabs.org Cc: joel@jms.id.au, "Edward A. James" Subject: [PATCH linux dev-4.10] drivers: fsi: occ: Fix 1 byte response and rc for O_NONBLOCK Date: Wed, 7 Jun 2017 17:49:15 -0500 X-Mailer: git-send-email 1.8.3.1 X-TM-AS-GCONF: 00 x-cbid: 17060722-0008-0000-0000-000007F880E3 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00007191; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000212; SDB=6.00871620; UDB=6.00433535; IPR=6.00651612; BA=6.00005405; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00015736; XFM=3.00000015; UTC=2017-06-07 22:49:20 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17060722-0009-0000-0000-000042838F73 Message-Id: <1496875755-7736-1-git-send-email-eajames@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-06-07_14:, , 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-1703280000 definitions=main-1706070408 X-BeenThere: openbmc@lists.ozlabs.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Development list for OpenBMC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Jun 2017 22:49:25 -0000 From: "Edward A. James" Couple of bug fixes. Signed-off-by: Edward A. James --- drivers/fsi/occ.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/fsi/occ.c b/drivers/fsi/occ.c index fc014b6..a1508f2 100644 --- a/drivers/fsi/occ.c +++ b/drivers/fsi/occ.c @@ -188,7 +188,7 @@ static ssize_t occ_read_common(struct occ_client *client, char __user *ubuf, if (!test_bit(XFR_COMPLETE, &xfr->flags)) { if (test_bit(CLIENT_NONBLOCKING, &client->flags)) { - rc = -ERESTARTSYS; + rc = -EAGAIN; goto done; } @@ -593,11 +593,13 @@ static void occ_worker(struct work_struct *work) goto done; } - /* already got 3 bytes resp, also need 2 bytes checksum */ - rc = occ_getsram(sbefifo, 0xFFFBF008, &xfr->buf[8], - resp_data_length - 1); - if (rc) - goto done; + if (resp_data_length > 1) { + /* already got 3 bytes resp, also need 2 bytes checksum */ + rc = occ_getsram(sbefifo, 0xFFFBF008, &xfr->buf[8], + resp_data_length - 1); + if (rc) + goto done; + } xfr->resp_data_length = resp_data_length + 7; -- 1.8.3.1