Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1986832imm; Thu, 23 Aug 2018 12:08:40 -0700 (PDT) X-Google-Smtp-Source: AA+uWPyfzzc1dZHtaSZuMGZu6u46jYMrB+Ez8MsGEqZh/EYC7faIIsF+FiTRZ37GCmCGqZdQoFEz X-Received: by 2002:a62:5b85:: with SMTP id p127-v6mr64482675pfb.33.1535051320561; Thu, 23 Aug 2018 12:08:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535051320; cv=none; d=google.com; s=arc-20160816; b=ab+I/ZfsjWush7EukrqxTctuimP3Sct3ZWdyQh8WDQNuJbaQdG7XYKDAjzb+aTaRl6 OYDkeuC+8aDvQAovi3JIsHI047d9WMPilEBaCbnSb4Nqj6j1OPtziGHclRaeyBWfz0Oi S1uz1rNWYFIfjD/akBQ2UdB61qqhEpKfT9iEcBz4fvujp5IP7xozeZV+l7N0UR6u2weT B7hbgC9g3FYfPXNIWL1qLi6XzYqBi6eW/IyQhm3SbU1PcVb2DowSvIqtzJKNoo+IlbM5 doH8y1uP90h3fLQbKmGpvKz39/qSXUjcc2SfpE+SQCFUQQFcychco/YeUasc/AyEEkSF cdrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:reply-to:dkim-signature :arc-authentication-results; bh=ymxvm2UqAuKTNoLNJhrRHrcuAckMWIowYGkWldv05vE=; b=DFmI+e6S102k+/Dz2G3AU44k8RttJS/6OgjTuyK9DzGZRqWDzrC24Q653POvFu6VnP UjtU/whuHF/3NPYsXPuR2YXPPa2VHHdEpoAs/CPanLRTnswLtSBzb+QOGoUZbGZNaie8 KbVVVr/pR8vnJvUE+0RTldwy/k1+zwG2cLEFZxZNNY9Cei4l4EW8KCKc78zLkmcy8DpV 7wdPuQXUPf4fe88FlnoP+Y1zLsCVo53E2kTK4quO13k5gW5cgv50HVGXCkKaZLHlGAI7 ac2Or+w62KoEmlM5l4ZyBB/jemJFbM6TsxnGoIkwbi1cuy9Ja9Hgm65luT3lriPNLPx8 fwjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=tuu9R4Q7; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k1-v6si4732416pld.424.2018.08.23.12.08.24; Thu, 23 Aug 2018 12:08:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=tuu9R4Q7; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726535AbeHWWiB (ORCPT + 99 others); Thu, 23 Aug 2018 18:38:01 -0400 Received: from mail-oi0-f46.google.com ([209.85.218.46]:36501 "EHLO mail-oi0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726081AbeHWWiB (ORCPT ); Thu, 23 Aug 2018 18:38:01 -0400 Received: by mail-oi0-f46.google.com with SMTP id r69-v6so10570119oie.3 for ; Thu, 23 Aug 2018 12:06:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:reply-to:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=ymxvm2UqAuKTNoLNJhrRHrcuAckMWIowYGkWldv05vE=; b=tuu9R4Q7DCO90j3c15Nce61N6gMASit5655qOXb3912bvGNdWWG85/O8YjX1Xn9IOt wTu6S4TZT941BZsflAF1/sFq3UUc9HSLCKOVoLMJB6av9gMkIMxzMDSY5ZmbhPNb7r88 OTfNwHmcr1kUIINSs/UdjC2YddPZtvDc0aZwEoERiD9EFFJhUQc5baLPgVFX8ywsavh0 xZbRQGG25Ojmie9xaABBJqwH5ndKs6hxjusJuo/4spKAs8CHGyHWp13tH40k1zXqf30W UqPrz6GdVk1MzxQvLVA1xoTfLd+vT1bWagOyj949q+oTU8PWH3JcqPRe8iTAob5TAqnz iavg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:reply-to:subject:to:cc:references:from :message-id:date:user-agent:mime-version:in-reply-to :content-transfer-encoding:content-language; bh=ymxvm2UqAuKTNoLNJhrRHrcuAckMWIowYGkWldv05vE=; b=oNdakvwltO78tK2TznefW935+kR8bIhr9Y3TQLwsCDDd46ELIwAig6fYCn1DJGEogo SIajJGjaCS0dGRzHx1Z5J+u6l9j5AR29/RwX3n6ut9dS6IlghIozEweAaKTm8ZiMlmIi 6SUF5kdj3nPkg2IG8VbqR5t5AmRFXjH9Wr/R5C4pez4AKYTQTIWl3qlU9NhEAy8rCHBg OqSeWxhy5FG8XJJH/yO9FNSV1MAGNLlr58CE5vJYnYuvnU4pYFtgrzGeazJz5Tbia7e+ rrj7SpVckj+AMX2hk2JBfvt0BrHBvjOg6oLnn+1MviBKb2Kq0ystfO7ve0Nx7SNz0h/0 C/PA== X-Gm-Message-State: APzg51AghkfTdIehnAfqGni+S9sZ/qRU+Sv6DPF16x/jPwJDskp/SdFu j/T6omLEHkCmy0sRSzmaLQ== X-Received: by 2002:aca:d7c1:: with SMTP id o184-v6mr10069363oig.347.1535051216491; Thu, 23 Aug 2018 12:06:56 -0700 (PDT) Received: from serve.minyard.net ([47.184.170.128]) by smtp.gmail.com with ESMTPSA id k85-v6sm9868851oiy.2.2018.08.23.12.06.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 23 Aug 2018 12:06:55 -0700 (PDT) Received: from [IPv6:2001:470:b8f6:1b:a11a:38c7:7111:773f] (unknown [IPv6:2001:470:b8f6:1b:a11a:38c7:7111:773f]) by serve.minyard.net (Postfix) with ESMTPSA id 43660675; Thu, 23 Aug 2018 14:06:24 -0500 (CDT) Reply-To: minyard@acm.org Subject: Re: [RFC] IPMI state machine regression To: Andrew Banman Cc: Arnd Bergmann , Greg Kroah-Hartman , justin.ernst@hpe.com, rja@hpe.com, frank.ramsay@hpe.com, openipmi-developer@lists.sourceforge.net, linux-kernel@vger.kernel.org References: <20180821221443.hhgcnzw6xttaih3i@linux-tqvx.americas.hpqcorp.net> <20180822162352.q7qc2udqabbqxdya@linux-tqvx> <20180823165231.2v3oq2nifbudy6ub@linux-tqvx.americas.hpqcorp.net> From: Corey Minyard Message-ID: <8bbf7912-3dbd-8cb9-8fc3-c919f98033ac@acm.org> Date: Thu, 23 Aug 2018 14:06:23 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180823165231.2v3oq2nifbudy6ub@linux-tqvx.americas.hpqcorp.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-GB Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/23/2018 11:52 AM, Andrew Banman wrote: > >> I don't have any real hardware with a BT interface, just the one in qemu, >> but I've never seen it there. >> >> It actually looks like the state machine is working ok.  But the BMC is >> responding to a "Get Device ID" command with: >> >> Recv:: 1c 08 d5 > That completion code is spoofed in after bt_start_transaction when bt->state > is in WR_CONSUME. This is pretty visible from the message trace, but here > is another with an explicit debug printk (below). > > Maybe I'm totally reading this wrong, but I think that err gets passed > on to the upper layer: > > start_transaction: return 0xD5 -> return_hosed_msg -> deliver_recv_msg > -> ipmi_smi_msg_received Ah, yes, you are right.  I didn't write the BT state machine, so I'm not terribly familiar with how it works.  I'm pretty sure the author is no longer with HP. > > [ 120.367379] BT: IDLE [ ] TO=5000000 - 0 > [ 120.367384] BT: CAP_BEGIN [ ] TO=5000000 - 0 > [ 120.376634] **Timer: 1534434704.376633453 > [ 120.376646] BT: XACTION [ ] TO=5000000 - 92000 > [ 120.376683] BT: WR_BYTES [ ] TO=4908000 - 0 > [ 120.376995] BT: WR_CONSUME [ H2B ] TO=4908000 - 0 > [ 120.377025] Send: 18 08 > [ 120.377027] **Enqueue: 1534434704.377028726 > [ 120.377028] **Start2: 1534434704.377029859 So what appears to be happening is that the BT state machine sends the BT capabilities commands to the BMC.  While this is going on the upper layer sends a messages, but the state machine can't send because it's in the middle of another operation. The "device" in qemu is almost instantaneous, so you would never see it there. So this is almost certainly due to the timing and messaging changes. in the upper layer.  Another step may be necessary in initialization to allow this to happen. Let me poke at this a bit and I'll send another patch. Thanks, -corey > # Added DBG # [ 120.377028] bt_start_transaction returned IPMI_NOT_IN_MY_STATE_ERR 0xd5 > # Added DBG # [ 120.377030] 18 > # Added DBG # [ 120.377030] 08 > # Added DBG # [ 120.377030] > [ 120.377061] BT: WR_CONSUME [ ] TO=4908000 - 0 > [ 120.377137] BT: RD_WAIT [ ] TO=4908000 - 0 > [ 120.377140] Recv:: 1c 08 d5 > [ 120.377156] Send: 18 01 > [ 120.377161] **Enqueue: 1534434704.377161047 > [ 120.377164] **Start2: 1534434704.377164751 > # Added DBG # [ 120.377165] bt_start_transaction returned IPMI_NOT_IN_MY_STATE_ERR 0xd5 > # Added DBG # [ 120.377166] 18 > # Added DBG # [ 120.377167] 01 > # Added DBG # [ 120.377168] > [ 120.377226] BT: RD_WAIT [ ] TO=4908000 - 0 > [ 120.377237] Recv:: 1c 01 d5 > [ 120.377242] ipmi_si IPI0001:00: IPMI message handler: device id demangle failed: -22 > [ 120.377252] ipmi_si IPI0001:00: Unable to get the device id: -5 > [ 120.377252] ipmi_si IPI0001:00: Unable to register device: error -5 > >