From patchwork Thu Apr 19 05:57:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sai Pavan Boddu X-Patchwork-Id: 10349143 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 92C4E60244 for ; Thu, 19 Apr 2018 05:58:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7DDB6287F5 for ; Thu, 19 Apr 2018 05:58:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 711D228821; Thu, 19 Apr 2018 05:58:43 +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 C4A7D287F5 for ; Thu, 19 Apr 2018 05:58:41 +0000 (UTC) Received: from localhost ([::1]:51474 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f92ae-0001sF-7v for patchwork-qemu-devel@patchwork.kernel.org; Thu, 19 Apr 2018 01:58:40 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44494) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f92Zy-0001Ws-Ns for qemu-devel@nongnu.org; Thu, 19 Apr 2018 01:58:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f92Zv-00037Q-Il for qemu-devel@nongnu.org; Thu, 19 Apr 2018 01:57:58 -0400 Received: from mail-sn1nam02on0066.outbound.protection.outlook.com ([104.47.36.66]:51664 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 1f92Zv-000375-4g for qemu-devel@nongnu.org; Thu, 19 Apr 2018 01:57:55 -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=y42R+s5VyuhmbWzTek5VktH82lX9A/BvYdfbmQzQMTI=; b=fzWnTLiZl3P2o+MVnkoVHrnYJou/+NPPWCB8tIMOd4tNWMwi6F5Qn0ZYlPA42DhOg/JDLevu8uv8cXgm7lI1iqkh/ZSIJmQ8MY8s7RqEkBcVIx5ny5DIpr0Ks41u7IuYMpIRWlawFxO79iZr9XL3aWdRLzm3d6h15yqNjD19h6E= Received: from MWHPR02MB2478.namprd02.prod.outlook.com (10.168.204.148) by MWHPR02MB2813.namprd02.prod.outlook.com (10.175.50.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.696.13; Thu, 19 Apr 2018 05:57:52 +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.0696.013; Thu, 19 Apr 2018 05:57:51 +0000 From: Sai Pavan Boddu To: francisco iglesias Thread-Topic: [Qemu-devel] [PATCH v2 1/1] xilinx_spips: send dummy cycles only if cmd requires it Thread-Index: AQHT12HcjWWI3ezOjEaaWb+3s2OuJaQHl0eg Date: Thu, 19 Apr 2018 05:57:51 +0000 Message-ID: References: <1524037298-23401-1-git-send-email-saipava@xilinx.com> <1524037298-23401-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; MWHPR02MB2813; 7:VUj4hFa0OsfJIZvx55UzHzCM5jHnsP/uDGi5/WDgOowc5977pkjRsWQ9ms2Q978xo3pdlihDqk6OlyyuqQCCTO3VyWn0KcPNPG2BIcggE0J1/cdw8wQZEHaB57RaWVQEGmIo7YbRVuM6YVTWzN1BwVuHizcWrlwGbHrXeV+82D9zfwHfCrmy0x8aqcqeHRBO42EWgdP6NetdMy9NSJ0DpDBvsm4mGJtoRLCzOyBOIyAhZqUgt2Cdl5OsSViqS/aV 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:MWHPR02MB2813; x-ms-traffictypediagnostic: MWHPR02MB2813: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(85827821059158)(192813158149592)(21748063052155); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3002001)(3231232)(944501327)(52105095)(6055026)(6041310)(20161123560045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(6072148)(201708071742011); SRVR:MWHPR02MB2813; BCL:0; PCL:0; RULEID:; SRVR:MWHPR02MB2813; x-forefront-prvs: 0647963F84 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(346002)(396003)(376002)(39860400002)(39380400002)(6916009)(229853002)(39060400002)(53936002)(8676002)(81166006)(33656002)(74316002)(26005)(5250100002)(8936002)(7736002)(6246003)(236005)(790700001)(3846002)(5660300001)(6116002)(478600001)(2900100001)(11346002)(476003)(446003)(55236004)(102836004)(59450400001)(14454004)(6506007)(25786009)(54906003)(19609705001)(4326008)(53546011)(316002)(66066001)(99286004)(3660700001)(55016002)(7696005)(86362001)(3280700002)(186003)(6306002)(2906002)(76176011)(6436002)(9686003)(54896002); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR02MB2813; H:MWHPR02MB2478.namprd02.prod.outlook.com; FPR:; SPF:None; LANG:en; MLV:ovrnspm; PTR:InfoNoRecords; x-microsoft-antispam-message-info: VLp8XVbvBgm5KJSX7Xi7hGCaHdHKjw6uSDXXGSeWP/u0QsaDCE5HgWq0a2zmsqMBLXIQiXW/w2+Spms50UmClBr57OiELe3KWEuLN4RJeavjQtvCh+m4qSdJrtetbUMxzhVGGQHR5XxZGCMWNkZf3cbxu/D51SGP0lDL+qgdR95YngNKiDn3/9jR62B6tmWz spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: bdaaf6d9-7689-4418-74c2-08d5a5ba7cc0 X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-Network-Message-Id: bdaaf6d9-7689-4418-74c2-08d5a5ba7cc0 X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Apr 2018 05:57:51.7343 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR02MB2813 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.36.66 X-Content-Filtered-By: Mailman/MimeDel 2.1.21 Subject: Re: [Qemu-devel] [PATCH v2 1/1] xilinx_spips: send dummy cycles 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" , Peter Crosthwaite Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP HI Franciso, From: francisco iglesias [mailto:frasse.iglesias@gmail.com] Sent: Thursday, April 19, 2018 3:39 AM To: Sai Pavan Boddu Cc: alistair@alistair23.me; Peter Crosthwaite ; Peter Maydell ; Edde ; qemu-devel@nongnu.org Developers Subject: Re: [Qemu-devel] [PATCH v2 1/1] xilinx_spips: send dummy cycles only if cmd requires it Hi Sai, About the subject, what do you think about changing it to below? xilinx_spips: Correct SNOOP_NONE state when flushing the txfifo On 18 April 2018 at 09:41, Sai Pavan Boddu > wrote: For all the commands, which do not have an entry in xilinx_spips_num_dummies, present logic sends dummy cycles when ever we are in SNOOP_NONE state, fix it to only send dummy cycles if the cmd requires them. It feels like below sentence goes together with the 'fix' above so maybe it could come directly after? (i.e. no new section but maybe with an 'also' after 'handle is') SNOOP_NONE state handle is moved above (previously its part of default else s/above/above in the if ladder/ s/its part of default/it was part of the default/ case), as its same as SNOOP_STRIPPING during data cycles. s/its/it's/ Signed-off-by: Sai Pavan Boddu > --- TODO: Maybe we could delete the SNOOP_NONE state as it seems to be same as SNOOP_STRIPPING I agree that a cleanup commit later on could be considered, but I think it's better not to include the todo in the commit message of this one so could we remove it? hw/ssi/xilinx_spips.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) Best regards, Francisco Iglesias /* 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; + s->cmd_dummies--; } 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..4f6760d 100644 --- a/hw/ssi/xilinx_spips.c +++ b/hw/ssi/xilinx_spips.c @@ -616,7 +616,8 @@ static void xilinx_spips_flush_txfifo(XilinxSPIPS *s) if (fifo8_is_empty(&s->tx_fifo)) { xilinx_spips_update_ixr(s); return; - } else if (s->snoop_state == SNOOP_STRIPING) { + } else if (s->snoop_state == SNOOP_STRIPING || + s->snoop_state == SNOOP_NONE) { for (i = 0; i < num_effective_busses(s); ++i) { tx_rx[i] = fifo8_pop(&s->tx_fifo); } @@ -626,11 +627,12 @@ static void xilinx_spips_flush_txfifo(XilinxSPIPS *s) for (i = 0; i < num_effective_busses(s); ++i) { tx_rx[i] = tx; } - } else { + } else if (s->cmd_dummies > 0) { The variable snoop_state already keeps track of the dummy cycles, the same the 'else' to 'else if' change above together with the 'cmd_dummies' decrementation below does, could we undo these two changes since it is already handled? [Sai Pavan Boddu] Yes, you are right. After we moved SNOOP_NONE above. We don’t need an of these changes here. Wonderful that it patch got minimized to single line now. Regards, Sai Pavan Thank you!