From nobody Mon Apr 11 17:01:15 2022 X-Original-To: bugs@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 7BADBCFE432 for ; Mon, 11 Apr 2022 17:01:15 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4KcZrC1dmBz4f6H for ; Mon, 11 Apr 2022 17:01:15 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0512C26CAA for ; Mon, 11 Apr 2022 17:01:15 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 23BH1Edc063869 for ; Mon, 11 Apr 2022 17:01:14 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 23BH1ElL063868 for bugs@FreeBSD.org; Mon, 11 Apr 2022 17:01:14 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 263223] MPR driver fails to attach on Dell Precision 5810 with "mpr0: IOC Facts allocation failed with error 12" Date: Mon, 11 Apr 2022 17:01:15 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: rwarning@atto.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1649696475; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+AUVKhH7cmK7riabt+z2eIEJsWk1yeq/1ldXhrWVgqE=; b=Q6vkx6WGYG3cB0aCJwaLGtD+uinfuAXbOfDADAqi8KuOzo1BMCIK1jRiUW8WhFrroUtv53 Ms+LxQjig5wqO4gHkKUwU/hljTxqy5LEtzjShLNofcn1SjmnRUcqtkbmcSXsws7awO1CYH YgLJ03tLteh8TmwJg7Zh4jwigfHSRZaSc07IJu1wd8fHmAHrvyLzm/SdrVRQ0wph6sXdco a3yRJjytVKMQ+SzLjlQ1cfsYwhNkmyXUcPqOWWUSJdpadncqNuKXPqaQyULmpGjz7QiFd8 0/pgfK2QBPiplgy+GlLZIJ8vq4Io6phzzhVU65MCSO5qSw1m2c4m8I7mPxvkrw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1649696475; a=rsa-sha256; cv=none; b=piZ/UHaGKIFx9wmNkN/ZsEETU64qMY9fYXJgvuSlzNNz22Djprw7WApzJiTtR5/Ud4ppsz KX+zmdkCpKbZNF7xrHPCMJJo2ket46QxputKqrRu17Rt3LJRzgUe9Y8czigodRqknQ4Y32 h26i3Nh//2OSltDeVpgpRLGkMhExYg+VoLDr0nxXDkSzMQj6f8rMwh6iisAyN27ht+YcHV DZ4CXyrM3rrWAuqla3lBLLO8RO694RpqOxXeoNgUYaiHc8bE+KwbUAWs2jMYZvkPvWGRSc 7CxeIxTchojinxvjNoa84uPT7WLw2v9/4nim1huNMJDV+CwOV7CS8rgEQIZNDg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D263223 Bug ID: 263223 Summary: MPR driver fails to attach on Dell Precision 5810 with "mpr0: IOC Facts allocation failed with error 12" Product: Base System Version: CURRENT Hardware: amd64 OS: Any Status: New Severity: Affects Only Me Priority: --- Component: kern Assignee: bugs@FreeBSD.org Reporter: rwarning@atto.com Created attachment 233149 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D233149&action= =3Dedit Tarball described in the comments I'm a developer working for ATTO technology, currently looking into the feasibility of adding support for our H12XXGT adapters to the FreeBSD kerne= l. These adapters use an LSI (Broadcom now) MPT-3 fusion chip-set that is supported by the mpr driver. When adding our PCI IDs to the mpr driver I found that our adapter was fail= ing to attach due to bus_dmamem_alloc failing in mpr_alloc_nvme_prp_pages of mp= r.c of the mpr driver. Further investigation showed that DMA memory allocations= are restricted to the first 4Gb of memory on the system. On my particular system mpr_alloc_nvme_prp_pages was attempting to allocate ~512Mb of contiguous physical memory and could find nothing within the first 4Gb to satisfy this. Our board does not have this restriction. To the best of my knowledge, neit= her does any other MPT-3 fusion chipset. The restriction is that DMA memory mus= t be within a 4Gb window, must not cross a 4Gb boundary, but can be anywhere wit= hin a 64bit address space. Attached is a patch that demonstrates a fix for this issue. The patch remov= es the lower address limit of BUS_SPACE_MAXADDR_32BIT and replaces it with a 4= Gb boundary limit. I ran some preliminary tests with the patch on one of our H1280GTs and a Broadcom SAS3816. IO and data integrity appear to be fine. I have not yet tested NVMe functionality, nor have I tested that sense data is being reported correctly. The patch is still incomplete as a fix. There's some chip diagnostics that = I'm unfamiliar with in mpr_user.c that needs to be updated. I also noticed from= the busdma(9) man page that the memory boundary limits must not exceed the maxi= mum segment size. That is not done in the patch. I'm also sure I overlooked something in the style guidelines. For simplicity's sake, the patch is also missing PCI IDs for the H1280GT. Attached is a tarball with: 1. The patch itself (patch.diff) 2. Output of uname -a (uname.txt) 3. /var/log/messages output of the mpr driver failing to attach to our H128= 0GT (messages.bad) 4. /var/log/messages output of the mpr driver attaching to our H1280GT with= the patch applied (messages.good) Both message files have a Broadcom SAS3816 in the system for reference. Both have debug output for the mpr driver cranked up to the maximum setting. --=20 You are receiving this mail because: You are the assignee for the bug.=