Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936130AbdGTOzm (ORCPT ); Thu, 20 Jul 2017 10:55:42 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:48008 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934466AbdGTOzl (ORCPT ); Thu, 20 Jul 2017 10:55:41 -0400 From: Eddie James To: linux-kernel@vger.kernel.org Cc: gregkh@linuxfoundation.org, cbostic@linux.vnet.ibm.com, joel@jms.id.au, jk@ozlabs.org, eajames@linux.vnet.ibm.com, "Edward A. James" Subject: [PATCH] drivers/fsi/scom: Remove reset before every putscom Date: Thu, 20 Jul 2017 09:55:32 -0500 X-Mailer: git-send-email 1.8.3.1 X-TM-AS-GCONF: 00 x-cbid: 17072014-2213-0000-0000-000001FD4551 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00007393; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000214; SDB=6.00890325; UDB=6.00444809; IPR=6.00670493; BA=6.00005482; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00016299; XFM=3.00000015; UTC=2017-07-20 14:55:37 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17072014-2214-0000-0000-000056F08A63 Message-Id: <1500562532-20969-1-git-send-email-eajames@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-07-20_07:,, 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-1706020000 definitions=main-1707200232 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1405 Lines: 47 From: "Edward A. James" Reset causes problems for operations requiring multiple scoms (e.g. i2c over scom). Instead, reset scom engine during probe. Signed-off-by: Edward A. James --- drivers/fsi/fsi-scom.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/fsi/fsi-scom.c b/drivers/fsi/fsi-scom.c index 98d062f..e13353a 100644 --- a/drivers/fsi/fsi-scom.c +++ b/drivers/fsi/fsi-scom.c @@ -57,12 +57,6 @@ static int put_scom(struct scom_device *scom_dev, uint64_t value, int rc; uint32_t data; - data = cpu_to_be32(SCOM_RESET_CMD); - rc = fsi_device_write(scom_dev->fsi_dev, SCOM_RESET_REG, &data, - sizeof(uint32_t)); - if (rc) - return rc; - data = cpu_to_be32((value >> 32) & 0xffffffff); rc = fsi_device_write(scom_dev->fsi_dev, SCOM_DATA0_REG, &data, sizeof(uint32_t)); @@ -186,6 +180,7 @@ static loff_t scom_llseek(struct file *file, loff_t offset, int whence) static int scom_probe(struct device *dev) { + uint32_t data; struct fsi_device *fsi_dev = to_fsi_dev(dev); struct scom_device *scom; @@ -202,6 +197,9 @@ static int scom_probe(struct device *dev) scom->mdev.parent = dev; list_add(&scom->link, &scom_devices); + data = cpu_to_be32(SCOM_RESET_CMD); + fsi_device_write(fsi_dev, SCOM_RESET_REG, &data, sizeof(uint32_t)); + return misc_register(&scom->mdev); } -- 1.8.3.1