Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp841472pxk; Thu, 1 Oct 2020 15:30:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyGjUUJ8/j0QcCHori2yC2aDqupP4DIPdWiAPPE3PGHMUV+eFBvQG+lv58cEe/GT1+LVE1E X-Received: by 2002:a17:906:3c01:: with SMTP id h1mr10805696ejg.111.1601591437541; Thu, 01 Oct 2020 15:30:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601591437; cv=none; d=google.com; s=arc-20160816; b=v/At68pqxwbZa0D/GrguEfhbY+i/gn8ji2GbU8nobVoAzIfjuLUqsPZw0X3hyvsPQs qF2RIJcBAD/oyd4niUmeZ1UBA2JLvsNYn3ZJrJTFBqkm9uFw+kAdEiMkBVvHJhOqsdTZ Ykm0I50LcA4JLLUoTjKEueM5uS1XipFZI+tuZcq87HkVnA1UWblLIcz7wLqDsX0dcLNy iwR8BYQ8Xcbx9z9o0c15mdZxMvube8UpEb1WkEZtmpSF+fGiU34e03p9i/RXjQk4d3HG 9YBoZQAx7kZ0MvsrrvIOCvbh73GMUDqfKxV2kz/Q1Me3cBECE9QuMHcUZlpqHf2rV577 QxZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=dzHml+jwKeFJNXR2tTApwu496+pZFDv/DJiJ/AUcP+E=; b=QmGQhGbd046zoLlIbqlkt9U9hxiN0wZTzQ4FJdZMPrtGXaaTmuwgm2ibcBD+CDaO5y VpYTa2tiZvguJ2+C1W2Yy2wp3s/+rOrFOVNsfN7HhiTeym8SsaX0AAWhPy0V8d7XBwH5 8khokwLMlLEG50LQc/I5DIIeZicvvpBTH2nuAGymuHRaCExHIU+VuvFVOQC50pyjpK2G qhhdnDmseIGP4Yze2ZyDYz+OYn3GEwt98kVe5Zi/rQEq3i23bdO157C9cAJ3l9PGXlhn CnBwiHTgfkRwZgZrTZxLGOwYUVRt2TGe2Dqrx8HFmeson+KE5yc4Upe7uhfBCVBCv1mg r9NQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=QSZGkLG2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i11si4245555ejv.366.2020.10.01.15.30.14; Thu, 01 Oct 2020 15:30:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=QSZGkLG2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727244AbgJAW0q (ORCPT + 99 others); Thu, 1 Oct 2020 18:26:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46884 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725924AbgJAW0p (ORCPT ); Thu, 1 Oct 2020 18:26:45 -0400 Received: from mail-pg1-x541.google.com (mail-pg1-x541.google.com [IPv6:2607:f8b0:4864:20::541]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 61A1AC0613D0 for ; Thu, 1 Oct 2020 15:26:45 -0700 (PDT) Received: by mail-pg1-x541.google.com with SMTP id m34so111562pgl.9 for ; Thu, 01 Oct 2020 15:26:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to; bh=dzHml+jwKeFJNXR2tTApwu496+pZFDv/DJiJ/AUcP+E=; b=QSZGkLG2wBts2uriXrgmKHi2zaCSAsSUqvLroqogrPwsOsncbxUgL23DEiVyNPtv6M Ik8nDReWhdmL/+GEIlVKJFN8TvkasrJhOyqrF5o1y3kXjP5jhV0wA9IhVTDIOp8NTrCU I/Puc1fJlgPLhFmo8LaWYU8VF7YNfPrAu+YR4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to; bh=dzHml+jwKeFJNXR2tTApwu496+pZFDv/DJiJ/AUcP+E=; b=ESQKhJTNA8zTRCWnR7dqwbiwwzGB5AZFKdXasQp8qopx0uQD5ONMZKePvR6erLX4cn exgB629HTXIA1Qh+UURgNSFgWa/MntUHSP9jou41wprMt7M3mGvl7ablzImd5ML0zJ+y CQFX4it/Gb1Lo6lQD+JzeT/2z+5ovFuQp3b4GNtypVvcLJLkKxX36WWMesP8vL704wp7 qJFCSfc0OUz1xBH98X6t/vr9+qWwSuFt/iiC8Ti2dWR9yHgbJzCu/9+JJqehrX+66E21 Rag2gouRJQTE+0zjlodXG8ynyCHXTQutyh39DsQakpte1beiK3aq0Kvadrtx8RSsblNr aJ0A== X-Gm-Message-State: AOAM532hqVPD6zreYBe+aSvn+MsDbZEFUH/Mw6fbb/MH32Cv1S0REve+ nX0BRVqyBeJHjnU3CU0IXn7S7Q== X-Received: by 2002:a63:e655:: with SMTP id p21mr7819559pgj.420.1601591204713; Thu, 01 Oct 2020 15:26:44 -0700 (PDT) Received: from [10.136.13.65] ([192.19.228.250]) by smtp.gmail.com with ESMTPSA id h5sm829459pja.55.2020.10.01.15.26.43 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 01 Oct 2020 15:26:44 -0700 (PDT) Subject: Re: [PATCH v5 15/15] misc: bcm-vk: add ttyVK support To: Florian Fainelli , Arnd Bergmann , Greg Kroah-Hartman , Olof Johansson Cc: Kees Cook , linux-kernel@vger.kernel.org, bcm-kernel-feedback-list@broadcom.com References: <20201001012810.4172-1-scott.branden@broadcom.com> <20201001012810.4172-16-scott.branden@broadcom.com> <278afb05-8c8d-98d2-eed0-f73b954b03c7@gmail.com> From: Scott Branden Message-ID: <140a5cde-67fd-f4b1-e4a9-9c68adf964c4@broadcom.com> Date: Thu, 1 Oct 2020 15:26:41 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <278afb05-8c8d-98d2-eed0-f73b954b03c7@gmail.com> Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha-256; boundary="000000000000dc278a05b0a38256" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --000000000000dc278a05b0a38256 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Content-Language: en-CA Hi Florian, On 2020-09-30 7:36 p.m., Florian Fainelli wrote: > > > On 9/30/2020 6:28 PM, Scott Branden wrote: >> Add ttyVK support to driver to allow console access to VK card from host. >> >> Device node will be in the follow form /dev/bcm-vk.x_ttyVKy where: >> x is the instance of the VK card >> y is the tty device number on the VK card >> >> Signed-off-by: Scott Branden > > Was it not possible to: > > - emulate a standard 8250 UART and just expose an additional bar + MSI vector such that one could get a debug UART out of this device with little to no work on the host side? I don't see how such emulation is simpler than what we have.  For a standard 8250 UART implementation how would we emulate a FIFO in memory accessible over PCIe.  I don't see how to do that with shared memory?  Also, we don't have an additional bar available on the PCIe device.  There is currently little to no work on the device side using a circular buffer with read and write pointers. > > - or use virtio console and implement virtio on the firmware that runs on VK? Not that possible as the debug/console UARTs are used inside and outside of linux on the VK card. > > It's not a lot of code, but it just feels like this should not have to be done at all. If there was a simpler way to do it, yes, I would like a "UART" running over PCIe shared memory via a circular buffer. And that is what the code we developed does. --000000000000dc278a05b0a38256 Content-Type: application/pkcs7-signature; name="smime.p7s" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="smime.p7s" Content-Description: S/MIME Cryptographic Signature MIIQRQYJKoZIhvcNAQcCoIIQNjCCEDICAQExDzANBglghkgBZQMEAgEFADALBgkqhkiG9w0BBwGg gg2aMIIE6DCCA9CgAwIBAgIOSBtqCRO9gCTKXSLwFPMwDQYJKoZIhvcNAQELBQAwTDEgMB4GA1UE CxMXR2xvYmFsU2lnbiBSb290IENBIC0gUjMxEzARBgNVBAoTCkdsb2JhbFNpZ24xEzARBgNVBAMT Ckdsb2JhbFNpZ24wHhcNMTYwNjE1MDAwMDAwWhcNMjQwNjE1MDAwMDAwWjBdMQswCQYDVQQGEwJC RTEZMBcGA1UEChMQR2xvYmFsU2lnbiBudi1zYTEzMDEGA1UEAxMqR2xvYmFsU2lnbiBQZXJzb25h bFNpZ24gMiBDQSAtIFNIQTI1NiAtIEczMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA tpZok2X9LAHsYqMNVL+Ly6RDkaKar7GD8rVtb9nw6tzPFnvXGeOEA4X5xh9wjx9sScVpGR5wkTg1 fgJIXTlrGESmaqXIdPRd9YQ+Yx9xRIIIPu3Jp/bpbiZBKYDJSbr/2Xago7sb9nnfSyjTSnucUcIP ZVChn6hKneVGBI2DT9yyyD3PmCEJmEzA8Y96qT83JmVH2GaPSSbCw0C+Zj1s/zqtKUbwE5zh8uuZ p4vC019QbaIOb8cGlzgvTqGORwK0gwDYpOO6QQdg5d03WvIHwTunnJdoLrfvqUg2vOlpqJmqR+nH 9lHS+bEstsVJtZieU1Pa+3LzfA/4cT7XA/pnwwIDAQABo4IBtTCCAbEwDgYDVR0PAQH/BAQDAgEG MGoGA1UdJQRjMGEGCCsGAQUFBwMCBggrBgEFBQcDBAYIKwYBBQUHAwkGCisGAQQBgjcUAgIGCisG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