From owner-svn-src-all@freebsd.org Tue Mar 26 11:03:10 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A8998154CFBB; Tue, 26 Mar 2019 11:03:10 +0000 (UTC) (envelope-from kib@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) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4AE4E8BB40; Tue, 26 Mar 2019 11:03:10 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 233A41ED13; Tue, 26 Mar 2019 11:03:10 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x2QB3Aoa051349; Tue, 26 Mar 2019 11:03:10 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x2QB398m051346; Tue, 26 Mar 2019 11:03:09 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201903261103.x2QB398m051346@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 26 Mar 2019 11:03:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r345530 - stable/12/sys/dev/isci X-SVN-Group: stable-12 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/12/sys/dev/isci X-SVN-Commit-Revision: 345530 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 4AE4E8BB40 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.97 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.97)[-0.967,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Mar 2019 11:03:10 -0000 Author: kib Date: Tue Mar 26 11:03:09 2019 New Revision: 345530 URL: https://svnweb.freebsd.org/changeset/base/345530 Log: MFC r345070: isci(4): Use controller->lock for busdma tags. Modified: stable/12/sys/dev/isci/isci.c stable/12/sys/dev/isci/isci.h stable/12/sys/dev/isci/isci_controller.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/dev/isci/isci.c ============================================================================== --- stable/12/sys/dev/isci/isci.c Tue Mar 26 11:01:29 2019 (r345529) +++ stable/12/sys/dev/isci/isci.c Tue Mar 26 11:03:09 2019 (r345530) @@ -408,7 +408,8 @@ isci_allocate_dma_buffer_callback(void *arg, bus_dma_s } int -isci_allocate_dma_buffer(device_t device, struct ISCI_MEMORY *memory) +isci_allocate_dma_buffer(device_t device, struct ISCI_CONTROLLER *controller, + struct ISCI_MEMORY *memory) { uint32_t status; @@ -416,7 +417,8 @@ isci_allocate_dma_buffer(device_t device, struct ISCI_ 0x40 /* cacheline alignment */, 0x0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, memory->size, 0x1 /* we want physically contiguous */, - memory->size, 0, NULL, NULL, &memory->dma_tag); + memory->size, 0, busdma_lock_mutex, &controller->lock, + &memory->dma_tag); if(status == ENOMEM) { isci_log_message(0, "ISCI", "bus_dma_tag_create failed\n"); Modified: stable/12/sys/dev/isci/isci.h ============================================================================== --- stable/12/sys/dev/isci/isci.h Tue Mar 26 11:01:29 2019 (r345529) +++ stable/12/sys/dev/isci/isci.h Tue Mar 26 11:03:09 2019 (r345530) @@ -253,7 +253,8 @@ struct isci_softc { int isci_allocate_resources(device_t device); -int isci_allocate_dma_buffer(device_t device, struct ISCI_MEMORY *memory); +int isci_allocate_dma_buffer(device_t device, struct ISCI_CONTROLLER *lock, + struct ISCI_MEMORY *memory); void isci_remote_device_reset(struct ISCI_REMOTE_DEVICE *remote_device, union ccb *ccb); Modified: stable/12/sys/dev/isci/isci_controller.c ============================================================================== --- stable/12/sys/dev/isci/isci_controller.c Tue Mar 26 11:01:29 2019 (r345529) +++ stable/12/sys/dev/isci/isci_controller.c Tue Mar 26 11:03:09 2019 (r345530) @@ -428,7 +428,8 @@ int isci_controller_allocate_memory(struct ISCI_CONTRO uncached_controller_memory->size = sci_mdl_decorator_get_memory_size( controller->mdl, SCI_MDE_ATTRIBUTE_PHYSICALLY_CONTIGUOUS); - error = isci_allocate_dma_buffer(device, uncached_controller_memory); + error = isci_allocate_dma_buffer(device, controller, + uncached_controller_memory); if (error != 0) return (error); @@ -443,7 +444,8 @@ int isci_controller_allocate_memory(struct ISCI_CONTRO SCI_MDE_ATTRIBUTE_CACHEABLE | SCI_MDE_ATTRIBUTE_PHYSICALLY_CONTIGUOUS ); - error = isci_allocate_dma_buffer(device, cached_controller_memory); + error = isci_allocate_dma_buffer(device, controller, + cached_controller_memory); if (error != 0) return (error); @@ -456,7 +458,7 @@ int isci_controller_allocate_memory(struct ISCI_CONTRO request_memory->size = controller->queue_depth * isci_io_request_get_object_size(); - error = isci_allocate_dma_buffer(device, request_memory); + error = isci_allocate_dma_buffer(device, controller, request_memory); if (error != 0) return (error); @@ -478,7 +480,8 @@ int isci_controller_allocate_memory(struct ISCI_CONTRO status = bus_dma_tag_create(bus_get_dma_tag(device), 0x1, 0x0, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, isci_io_request_get_max_io_size(), - SCI_MAX_SCATTER_GATHER_ELEMENTS, max_segment_size, 0, NULL, NULL, + SCI_MAX_SCATTER_GATHER_ELEMENTS, max_segment_size, 0, + busdma_lock_mutex, &controller->lock, &controller->buffer_dma_tag); sci_pool_initialize(controller->request_pool);