From patchwork Tue Apr 17 13:23:12 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: 10345519 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 2914C60216 for ; Tue, 17 Apr 2018 15:57:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 18F382267B for ; Tue, 17 Apr 2018 15:57:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0BB5E22B27; Tue, 17 Apr 2018 15:57:52 +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=BAD_ENC_HEADER,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 692C52267B for ; Tue, 17 Apr 2018 15:57:51 +0000 (UTC) Received: from localhost ([::1]:47013 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f8SzO-0006Pq-Ln for patchwork-qemu-devel@patchwork.kernel.org; Tue, 17 Apr 2018 11:57:50 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34048) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f8Sxp-0005i7-NF for qemu-devel@nongnu.org; Tue, 17 Apr 2018 11:56:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f8Sxj-0006ny-Sx for qemu-devel@nongnu.org; Tue, 17 Apr 2018 11:56:13 -0400 Received: from mail-by2nam01on0078.outbound.protection.outlook.com ([104.47.34.78]:50678 helo=NAM01-BY2-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 1f8Sxj-0006n2-JA for qemu-devel@nongnu.org; Tue, 17 Apr 2018 11:56:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=/2ZbXAb5F4Sq6sBI/IGgdJkaVbcZB1+oV/be8Bk5H3E=; b=1/99lwjCXBR89UyWmLhurJIWk3eFpGi3uutIA63wGZohrjCk5rlEHhV8RUSDbf+wzUwu2yOWlq9eSRg6MDzigpsbXrj4h+ufJqPehYhF4ScJEbHuuf2dVx/DHUwVGzbwaUz/MdeC2rAvqxZVRj11Pn8yzD3hfaAh27VBeXEXxng= Received: from BYAPR02CA0020.namprd02.prod.outlook.com (2603:10b6:a02:ee::33) by CY1PR02MB2011.namprd02.prod.outlook.com (2a01:111:e400:c5ab::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.675.14; Tue, 17 Apr 2018 13:23:30 +0000 Received: from BL2NAM02FT052.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e46::202) by BYAPR02CA0020.outlook.office365.com (2603:10b6:a02:ee::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.675.10 via Frontend Transport; Tue, 17 Apr 2018 13:23:30 +0000 Authentication-Results: spf=none (sender IP is 149.199.60.83) smtp.mailfrom=xhdsaipava40.localdomain; nongnu.org; dkim=none (message not signed) header.d=none;nongnu.org; dmarc=none action=none header.from=xilinx.com; Received-SPF: None (protection.outlook.com: xhdsaipava40.localdomain does not designate permitted sender hosts) Received: from xsj-pvapsmtpgw01 (149.199.60.83) by BL2NAM02FT052.mail.protection.outlook.com (10.152.77.0) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.675.14 via Frontend Transport; Tue, 17 Apr 2018 13:23:29 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66] helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.63) (envelope-from ) id 1f8Qa1-0003CT-9n; Tue, 17 Apr 2018 06:23:29 -0700 Received: from [127.0.0.1] (helo=xsj-smtp-dlp2.xlnx.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1f8QZw-0006Ph-6J; Tue, 17 Apr 2018 06:23:24 -0700 Received: from xsj-pvapsmtp01 (smtp.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id w3HDNLvT011503; Tue, 17 Apr 2018 06:23:21 -0700 Received: from [172.23.37.96] (helo=xhdsaipava40.localdomain) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1f8QZt-0006PM-A2; Tue, 17 Apr 2018 06:23:21 -0700 Received: by xhdsaipava40.localdomain (Postfix, from userid 14131) id 79FF84C10BC; Tue, 17 Apr 2018 18:53:20 +0530 (IST) From: Sai Pavan Boddu To: , , , , Date: Tue, 17 Apr 2018 18:53:12 +0530 Message-ID: <1523971392-25164-2-git-send-email-saipava@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1523971392-25164-1-git-send-email-saipava@xilinx.com> References: <1523971392-25164-1-git-send-email-saipava@xilinx.com> X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005 X-TM-AS-Result: No--1.605-7.0-31-1 X-imss-scan-details: No--1.605-7.0-31-1;No--1.605-5.0-31-1 X-TM-AS-User-Approved-Sender: No;No X-TM-AS-Result-Xfilter: Match text exemption rules:No X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.83; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(396003)(376002)(346002)(39380400002)(39860400002)(2970300002)(428003)(249900001)(189003)(199004)(50226002)(50466002)(48376002)(4326008)(47776003)(356003)(90966002)(5660300001)(86372001)(26005)(110136005)(16586007)(52956003)(8936002)(2201001)(81166006)(8676002)(36756003)(81156014)(42186006)(6666003)(2616005)(316002)(498600001)(486006)(11346002)(476003)(446003)(126002)(336012)(105586002)(103686004)(51416003)(106466001)(76176011)(305945005)(2906002)(6266002)(42882007)(63266004)(107986001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR02MB2011; H:xsj-pvapsmtpgw01; FPR:; SPF:None; LANG:en; PTR:unknown-60-83.xilinx.com; MX:0; A:0; X-Microsoft-Exchange-Diagnostics: 1; BL2NAM02FT052; 1:1xW6VvOW7HEJI89IJMTdoD8uNlhZ3+AT7m0dmcneY1qvxwODwNSrylPIOJjxAKw0V/lJzVrIRtXGP32+xiDjHWHVXd8v7cVBkWxiFg6xVVYgEXea+3/J4uDP5CNI1oVg MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4534165)(4627221)(201703031133081)(2017052603328)(7153060); SRVR:CY1PR02MB2011; X-Microsoft-Exchange-Diagnostics: 1; CY1PR02MB2011; 3:lXHvLGHuTwibd7t6Mn/oEfHATU5KXr3a0Utz4AQrrHoHrwUQZIJSRHIOGsxXfrXnKhqGxP8KMja+VftpqufQQaCVq46cpf995vM38HtX82i26jN71nc5VZ3B3AqcPNAKJu7ose4RwARcCDpJ5uDIpCosuspEcXBkvrFn0fKZOO0jnozM65TtK4T+NiLo5eSJFs9V4saG2eN25jVq7/2IjQVliD93+l3QpgVB7Rg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XMRfVhcDKu1u5HX0KA7BQ2dPaB/hzfvEXKn+rKCfli9glm5LUb54JmCOk/C6Mn8hLl2WRzNC8G8N/w8vm9Oo//LIsTB5YH0J/sSuW7RM5a5EIBadBq2ziyFY5XmnJ9PJM/rlW/vBkPCSmz8TAsHxByxJD5vW7ME01k0EcLlLnXyjxZSlhvRwgwLPKculpMIuh6rJexFM+9Low/vPJYS5JcbviNnkAgbqo3I0NXsNaqur8 X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(192813158149592); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3231232)(944501327)(52105095)(3002001)(10201501046)(93006095)(93001095)(6055026)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061750153)(20161123564045)(20161123560045)(20161123562045)(20161123558120)(6072148)(201708071742011); SRVR:CY1PR02MB2011; BCL:0; PCL:0; RULEID:; SRVR:CY1PR02MB2011; X-Microsoft-Exchange-Diagnostics: 1; CY1PR02MB2011; 4:il+jdkMywF7andVs88Dz8WqWaSb96fRfn/BzU5sQnOaqpB1wgH11ql8v3k4KsVXpBXGV50737WtJR0IHBJhOLVLpVixgZReb0iGiv2/xHbc/iZ3g52xhCfsG1bVbsTSFOdMUXL/QdcNa/0BOpEjigjEt1wy9tUnu938hrMsVdTPUlKCQbo9LiW4zZupzCi/T51kMadTWQaQZeoPXubMskALd0H6XO7yoyAtY2hKKiCSfGUpuK9qt9IfYNKOC2LbQDwmlm+FlFXo6SLPD/jfb2wDiYwfVX0BzCQesbqAyKa+tjaMyGMdXDAWhEw0W+9tr X-Forefront-PRVS: 0645BEB7AA X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR02MB2011; 23:48IYD3P0X7gtycuTXhF8Bxzw0nAqzNHvmi6UxI3Jw?= =?us-ascii?Q?8EQll3I6HhimJOp6SA1KD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5S667EiWzmmZ1b3j/gVxNHtDV/eT4ywRLU5kNKZXfvMpSOetFP0ZaVGjhVA5YJL1H9ifF6kM/z1HWZG2x7ymW30Of6zbT0gch5wP0Y8BLes=; 24:CkRabh8grko0sa/qoGNQOQ3evleRPfnz43x8YaRx93ajFuavqutE1P0XBz4rWUqAoofhcVSNGkkXGwvzuUBhM/o0/ZysXddS75CI4eSeHF0= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR02MB2011; 7:X9TAwfhwPBbE9AfLhpLViOsglyLxnL80h/S91gOZsIhSofcSy+ybNDsV2XeOkGhLiO2GBeCISmeROxeK5ChgEwQ15SU8aiEB6RMMMuh9Fh4e1Y+Zd4QIFd4xs+2hmR/84c0wRodMxT0OgNl9wJDttjLLGyPC/2eINfnpIDYdUxllgVo6cyCudwEqApBMlTHeUOmLFD54IYk/R6X7tEdmBO82zeNabDN+UwtFT89Jsy2VgriilLqn1dY3w+Nli2zq X-MS-Office365-Filtering-Correlation-Id: c3f92bf4-b457-4e72-1b49-08d5a4666913 X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Apr 2018 13:23:29.8335 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c3f92bf4-b457-4e72-1b49-08d5a4666913 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.83]; Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR02MB2011 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.34.78 Subject: [Qemu-devel] [PATCH v1] 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: qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP For all the commands, which do not have an entry in xilinx_spips_num_dummies, present logic sends dummy byte when ever we are in SNOOP_NONE state, fix it to send only if cmd requires them. 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). Signed-off-by: Sai Pavan Boddu --- hw/ssi/xilinx_spips.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) 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; + } + } } for (i = 0; i < num_effective_busses(s); ++i) {