From nobody Thu Jul 29 14:13:32 2021 X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id E029B12BD98D for ; Thu, 29 Jul 2021 14:13:35 +0000 (UTC) (envelope-from gljennjohn@gmail.com) Received: from mail-ed1-x52a.google.com (mail-ed1-x52a.google.com [IPv6:2a00:1450:4864:20::52a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GbCDv5j3sz4jHN for ; Thu, 29 Jul 2021 14:13:35 +0000 (UTC) (envelope-from gljennjohn@gmail.com) Received: by mail-ed1-x52a.google.com with SMTP id y7so6191273eda.5 for ; Thu, 29 Jul 2021 07:13:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:in-reply-to:references:reply-to :mime-version:content-transfer-encoding; bh=uCQfBWBAVR89DjjlJMTmh+gcaAqn6/BDIY+G6w+Py6s=; b=ixpWQtZJvH4bC5mj+dDWvW8fHYNhxTBpb1750neLDIzhY2YsNS/s8jtI+7L14WCPST RAlqKFbDvT3eG8B+kiijg2T31ClsZRHsJydCUsZuhmMl9WJGA2b+IlVUayleJaLYw/zP euswUzmG9re0NGJx00tn1w9HDF1LnMLNQSQ7KOpZyLJ8uNYNCf5pSpu2m+mUVBIWinb4 3N9pfJzx4quwea45OMs0JJf7mdrs9wrMrRe9UIaPNbCW1AFSE9i7WOHo7X9ibFstvJGK flMpLWz5KW8D8BWlxD7DsK6yB6eV0ma+Hw3RAaNZjjqVhO+p8JW75/nu+pPERuIX725h N8HA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:reply-to:mime-version:content-transfer-encoding; bh=uCQfBWBAVR89DjjlJMTmh+gcaAqn6/BDIY+G6w+Py6s=; b=BcehN02iVi7CWHZmlhmef/gtf5UMfsTzpOAclVHp0WZtyz6isv3FEyx+UXKQxE4Ui7 I/3jL8qZqPuxqCVYr24EmKpP5HsaXIOc5d7JaYkYiGNyst6AjGScim3R59q+KtRy6Wcl kFtzdEq+OLghX5PHKMBd8QMbiam0POwoYiFnukBI6bmalK2rccXDbO+aEZt6Zm7dct9O 9yEkax0qOnEAc1yBQJJNQMpgcWgbBIgDm3bFG9SNDjQAkZSh+xFUeNC0qHLyhfXVBKTN r/eNFo0Ip2j4Wp8cuHzZ3NVSeN97siwjAw9PTYedTiG+0CGWZyN7fH+nqQfBgqnk0/lh q/gg== X-Gm-Message-State: AOAM532+WBuBgQ5YBeMSVITuJmA2iq+p7Dp/wzgDYCmt1ZY0QhVyxyr7 5pyV96XeTlDLhjvGFG8rK7fncV8DByY= X-Google-Smtp-Source: ABdhPJzy9FwPFI3U3ArWl2Lwnu0I5Ro9cqpqXyGIJyuc/2cNwDwzkkZMEG4r0Dode/J1ChG/b3ynFw== X-Received: by 2002:a05:6402:22b0:: with SMTP id cx16mr6286780edb.185.1627568014881; Thu, 29 Jul 2021 07:13:34 -0700 (PDT) Received: from ernst.home (pd9e2360f.dip0.t-ipconnect.de. [217.226.54.15]) by smtp.gmail.com with ESMTPSA id n11sm1036900ejg.111.2021.07.29.07.13.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Jul 2021 07:13:34 -0700 (PDT) Date: Thu, 29 Jul 2021 16:13:32 +0200 From: Gary Jennejohn To: Sha Faisal via freebsd-hackers Cc: sfaisal@juniper.net, Justin Hibbits , Kumara N Babu , Vikram M Gadagkar Subject: Re: Generic-xhci driver issue and changes for 64-but physical memory space Message-ID: <20210729141332.08d62f21@ernst.home> In-Reply-To: <1A9919BF-4D07-4D71-B795-D6CFF6CD0FF1@juniper.net> References: <5A15D0DF-6D41-4F17-B07A-D5A061057644@juniper.net> <30397365-BC3C-41C4-BF55-0D13778EF0A8@juniper.net> <1A9919BF-4D07-4D71-B795-D6CFF6CD0FF1@juniper.net> Reply-To: gljennjohn@gmail.com X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; amd64-portbld-freebsd14.0) List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4GbCDv5j3sz4jHN X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] X-ThisMailContainsUnwantedMimeParts: N On Thu, 29 Jul 2021 11:20:13 +0000 Sha Faisal via freebsd-hackers wrote: > Mailing to freebsd-hackers, after adding my email id to subscriber list. > Please assist with the below query. > > Regards > Faisal > > From: Sha Faisal > Date: Thursday, 29 July 2021 at 12:19 AM > To: "hackers@freebsd.org" > Cc: Justin Hibbits , Kumara N Babu , Vikram M Gadagkar > Subject: Generic-xhci driver issue and changes for 64-but physical memory space > > Hello FreeBSD-hackers > > Inn one of our new platforms we have physical RAM placed above the 4GB mark. > And the eUSB device is capable of doing 64-bit DMA. > > The USBPHY uses the generic-xhci driver and when we were bringing-up we hit the issue below and the code panics > > xhci0: mem 0x10243000-0x10243fff irq 15 on simplebus1 > xhci0: 64 bytes context size, 32-bit DMA > panic: vm_wait in early boot > > I modified the below function call , and the usb driver is up and it works fine. Please suggest if this change is fine and can be incorporated. > > > #define IS_DMA_32B 1 > > #define IS_DMA_64B 0 > > > err = xhci_init(sc, dev, IS_DMA_64B); > As a locally maintained patch this would be acceptable. But I greatly doubt that this change would make it into the source tree as written. Since the generic-xhci driver knows basically nothing about the hardware it takes the conservative approach of always using 32-bit DMA. Strangely enough, the code in xhci.c, which tries to determine the DMA size by reading a register in the controller, thinks that this controller only supports 32-bit DMA. If I were the maintainer of this code the only way I would allow this change would be if it used the pci register values unique to this controller to set the dma32 flag in xhci_init() to 0 and otherwise keep the default value of 1. -- Gary Jennejohn