From patchwork Wed Apr 18 07:17:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sai Pavan Boddu X-Patchwork-Id: 10348167 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8FEB26031B for ; Wed, 18 Apr 2018 13:32:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7C8E8286F3 for ; Wed, 18 Apr 2018 13:32:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7336328640; Wed, 18 Apr 2018 13:32:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 031442869D for ; Wed, 18 Apr 2018 13:31:58 +0000 (UTC) Received: from localhost ([::1]:56996 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f8nBl-0004r0-DP for patchwork-qemu-devel@patchwork.kernel.org; Wed, 18 Apr 2018 09:31:57 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36654) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f8hLP-0000pn-Cl for qemu-devel@nongnu.org; Wed, 18 Apr 2018 03:17:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f8hLM-00037T-5a for qemu-devel@nongnu.org; Wed, 18 Apr 2018 03:17:31 -0400 Received: from mail-sn1nam02on0068.outbound.protection.outlook.com ([104.47.36.68]:63500 helo=NAM02-SN1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1f8hLL-00036X-QK for qemu-devel@nongnu.org; Wed, 18 Apr 2018 03:17:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=PW+C+dLWLInPj2Lfe1EMgH2uwKYeexwhQERpYHPktco=; b=TLh83jga20BKtMWwM192mL70mTuX6zqYrjlaZJgEw8PkmsO+dm+9Zo4vv8Lzm5Hx0lbcNIfAch1SChLxeWzLaG9+f4TsTzdUQqmdyk2usqhXZ7Q+qQK51DeekoJPzXk27b48u9P+lpCM1yuhmaKGk973pDwN6wmMFfvbMmSaGPY= Received: from MWHPR02MB2478.namprd02.prod.outlook.com (10.168.204.148) by MWHPR02MB2430.namprd02.prod.outlook.com (10.168.204.136) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.675.14; Wed, 18 Apr 2018 07:17:24 +0000 Received: from MWHPR02MB2478.namprd02.prod.outlook.com ([fe80::9dea:35e5:c8b:5ba3]) by MWHPR02MB2478.namprd02.prod.outlook.com ([fe80::9dea:35e5:c8b:5ba3%17]) with mapi id 15.20.0675.015; Wed, 18 Apr 2018 07:17:24 +0000 From: Sai Pavan Boddu To: francisco iglesias Thread-Topic: [PATCH v1 1/1] xilinx_spips: send dummy only if cmd requires it Thread-Index: AQHT1p16T4b0GSaTXUKVb0gDwG6MiqQGHCzw Date: Wed, 18 Apr 2018 07:17:24 +0000 Message-ID: References: <1523974696-1965-1-git-send-email-saipava@xilinx.com> <1523974696-1965-2-git-send-email-saipava@xilinx.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-TNEF-Correlator: authentication-results: gmail.com; dkim=none (message not signed) header.d=none; gmail.com; dmarc=none action=none header.from=xilinx.com; x-originating-ip: [182.72.145.30] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; MWHPR02MB2430; 7:50UhoKpnyN00Sxe06mCjD7kRU0cG+PV7xfMX5XiStPdKuSTtTvPZxRKKpPAyxvHXAGjw+S/hsF4IIud5hRapGTmqAZBueJC5WNGbNEp+zTC9JxcJwDimKnJgiAiJDC/jeGvUYQu6beIQN5lg7G+HyM5ZjyrjgOa9cygYJ8/AE+synRffhX9Zuucgf0PvFHSSGK5T1XFeGM1jMRkED7eQHH3lAxIeX8O9w9hrUiLlKZsVsblQ4tz3KsW9GfUjYRjt x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(48565401081)(2017052603328)(7153060)(7193020); SRVR:MWHPR02MB2430; x-ms-traffictypediagnostic: MWHPR02MB2430: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(85827821059158)(788757137089)(192813158149592)(21748063052155); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3002001)(93006095)(93001095)(10201501046)(3231232)(944501327)(52105095)(6055026)(6041310)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:MWHPR02MB2430; BCL:0; PCL:0; RULEID:; SRVR:MWHPR02MB2430; x-forefront-prvs: 06469BCC91 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(346002)(366004)(376002)(39380400002)(396003)(39860400002)(26005)(2906002)(6436002)(3660700001)(236005)(55016002)(6306002)(39060400002)(6246003)(54896002)(9686003)(53936002)(3280700002)(99286004)(4326008)(7696005)(53546011)(102836004)(446003)(19609705001)(6506007)(6116002)(3846002)(790700001)(76176011)(14454004)(55236004)(74316002)(54906003)(66066001)(316002)(478600001)(81166006)(9326002)(5250100002)(11346002)(7736002)(25786009)(5660300001)(8676002)(229853002)(8936002)(97736004)(33656002)(476003)(186003)(6916009)(2900100001)(86362001); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR02MB2430; H:MWHPR02MB2478.namprd02.prod.outlook.com; FPR:; SPF:None; LANG:en; MLV:ovrnspm; PTR:InfoNoRecords; x-microsoft-antispam-message-info: TrRwewNZfmOiGDqTw3DcsZ62Pv3oi/NH9p8orOQq2rEAjT42Cy7U7ptgRz6xTpBPeRZ4svz2hWOV7pj1yW5LUkhsmTgncLruRt6SoFT4ExbLZHn+Neh1wExBa5GXqA7kHr07sg8OBIQcXlt7+tX2iBwxAGysxjFAuuuqHaX3LX7+M+zhipxVjKCN1QE33NuJ spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 5b0a6496-d7f9-4eb0-a290-08d5a4fc6ee2 X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5b0a6496-d7f9-4eb0-a290-08d5a4fc6ee2 X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Apr 2018 07:17:24.1384 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR02MB2430 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.36.68 X-Mailman-Approved-At: Wed, 18 Apr 2018 09:29:38 -0400 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 Subject: Re: [Qemu-devel] [PATCH v1 1/1] xilinx_spips: send dummy only if cmd requires it X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , "alistair@alistair23.me" , Edde , "qemu-devel@nongnu.org Developers" , "crosthwaite.peter@gmail.com" Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Hi Francisco, From: francisco iglesias [mailto:frasse.iglesias@gmail.com] Sent: Wednesday, April 18, 2018 4:13 AM To: Sai Pavan Boddu Cc: alistair@alistair23.me; crosthwaite.peter@gmail.com; Peter Maydell ; Edde ; qemu-devel@nongnu.org Developers Subject: Re: [PATCH v1 1/1] xilinx_spips: send dummy only if cmd requires it Hi Sai, [PATCH v1] xilinx_spips: send dummy only if cmd requires it s/dummy/dummy cycles/ On 17 April 2018 at 16:18, Sai Pavan Boddu > wrote: For all the commands, which do not have an entry in xilinx_spips_num_dummies, present logic sends dummy byte when ever we s/dummy byte/dummy cycles/ are in SNOOP_NONE state, fix it to send only if cmd requires them. s/fix it to send only if cmd/fix it to only send dummy cycles if the command/ Only transmit max of 1 dummy byte(i.e 8 cycles) is a single snoop cycle. And also convert dummy bytes to cycles (required by m25p80). Maybe it is better to drop this two last lines (was already done before so it could be misleading when reading git history). Signed-off-by: Sai Pavan Boddu > --- hw/ssi/xilinx_spips.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) - } else if (s->snoop_state == SNOOP_STRIPING) { + } else if (s->snoop_state == SNOOP_STRIPING || + s->snoop_state == SNOOP_NONE) { [Sai Pavan Boddu] Yes, this can be done. As SNOOP_NONE state is moved above, the last bottom else can be used only to issue dummy cycles. I will send V2 with above changes and commit message fixed. Regards, Sai Pavan Thank you! Best regards, Francisco Iglesias for (i = 0; i < num_effective_busses(s); ++i) { -- 2.7.4 diff --git a/hw/ssi/xilinx_spips.c b/hw/ssi/xilinx_spips.c index 426f971..8278930 100644 --- a/hw/ssi/xilinx_spips.c +++ b/hw/ssi/xilinx_spips.c @@ -627,10 +627,17 @@ static void xilinx_spips_flush_txfifo(XilinxSPIPS *s) tx_rx[i] = tx; } } else { - /* Extract a dummy byte and generate dummy cycles according to the - * link state */ tx = fifo8_pop(&s->tx_fifo); - dummy_cycles = 8 / s->link_state; + if (s->cmd_dummies > 0) { + /* Extract a dummy byte and generate dummy cycles according to + * the link state */ + dummy_cycles = (s->cmd_dummies ? 1 : 0) * 8 / s->link_state; + s->cmd_dummies--; + } else { + for (i = 0; i < num_effective_busses(s); ++i) { + tx_rx[i] = tx; + } + } } Could we replace above with below in the same if ladder so we don't complicate the code more than necessary? (Should give the same result when num_effective_busses == 1)