From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qt1-f174.google.com (mail-qt1-f174.google.com [209.85.160.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9502E2153F1 for ; Tue, 22 Apr 2025 23:41:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745365317; cv=none; b=sICS5K/Ab3IgIU1RTjL/uYZEasTj6q1IgP2ebWkAP7gH9JwOGqgTJ1pjkPhAXS75dp6XAtjfffZZZifFhXq6E0oNsEWAmsfLbfZy3G388JuHPTTy5xWIqVUbGhtT4g5im5eqzZ0fZd6WCtWEaSzQwQHg8J3V/SMvhj37hNigti8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745365317; c=relaxed/simple; bh=d7gFECswBR82rOuJZXYrMO6x34hzdB9wF7yn3yimsy0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=fPXU/QmZx8iu2tU0hUc1FMNtGM7x1lAztaN+UoooeKMtbBb3ACy/RXvJQfMGhPGkX5ozh/XqC8/qwDN84MfcZ4FM052IESXu0YCkPMEs+x8Esv8vo2VRhZ/sqxz+879Cf1n8EDzyC0kxQrRUjKExyDeLN1ASP4m4ifTN3aAllrY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca; spf=pass smtp.mailfrom=ziepe.ca; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b=KmI9jC2K; arc=none smtp.client-ip=209.85.160.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ziepe.ca Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="KmI9jC2K" Received: by mail-qt1-f174.google.com with SMTP id d75a77b69052e-476ab588f32so83178561cf.2 for ; Tue, 22 Apr 2025 16:41:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1745365314; x=1745970114; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=d7gFECswBR82rOuJZXYrMO6x34hzdB9wF7yn3yimsy0=; b=KmI9jC2K6mVfdrT/JKcCjRxSZJ34NfN1lwMtmTTY44LQxNRxO9tyaiY9fNSN16ZlJB OAqZSYK/zAUkC3j8tMdVWOgc69xj+tLv033Wx+xJ/R/KHsKd1Ggu+r/gj3NeIdYInPe/ 1qe6+yFI05Tn5uEvkWkZPvx2bPfnAlLFOfB/QzQHioHm1R2wJ3TDC7QHzhPkgUL6fEu7 3Dp5G4CJVtD2a0lNTloyLnSKKzlpOekSTE+xT1XT7v4PvhcppkGh5+7AJJzz3yr5pi7H SrVgZBuGjseZvEgJ/QoLnHT7zPg+4QdLBXpJRIpwJjM0THel7Jb/EmOCIB7UB93nw3lp pniQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745365314; x=1745970114; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=d7gFECswBR82rOuJZXYrMO6x34hzdB9wF7yn3yimsy0=; b=L/rjrBUqxL+t06xK9oazojKu8DNw9FB8eROWRLvUKVa+jCEiTuj0CMSHAzqn6RBcGx 5NM0q2B7j0OrU10Q0i8a1Lxng4kd0SQXewrsS1PnhZ83yTjy/TkGjx/h8HmPPF35iQ+k 5udcLAbSYY8QqWBoi152J7TZS7U6FwqfzYui6mAxWDuxcYwRkOSl2GuzhWRfLb4z5Qb9 Grc9rCtXbbNErkkaZ+xf2BQwkW2fTBQYTk5buon77ueZqUkCIRPt5u98ltUSGq9cTG3b TprJMSITjbFiOTiOylnJnhEGW+s6WWomyQ5yqBkSg913F6IyMRqHeSMmyMswePkvKiuz XYEw== X-Forwarded-Encrypted: i=1; AJvYcCV1qZFy3KxFdzE7yevDG1NbcvfFhR1MsTki6XkSbf7GvHZ8KV5hBDceyjIYz2RKcsIW7EReE+GIj0VtWns=@vger.kernel.org X-Gm-Message-State: AOJu0Yx7Qn8Mu18rpJLvXppZCMwLTsfbdWFz2hPoqoaUWMy9aO8ED3rq lv5XCNOA2W/QYfJdoBh8SkLgCKXkllRTv4dGzEpXSp0GpUYKjtIGDwlQJ7TZ88s= X-Gm-Gg: ASbGnctTSoXlm6rHOubaWteIhsMhCANJq89h+pd9+6k0YOSw9BblkGA2yeOI/ppu080 s9zPZjVzYvLvRYkqu3TEfpX14rBzdCkk2bUpKIBqmVi0R7TotxfKDOv0ENBLa8Bn/OMfrqfSZ3b bSia4gwFpoRFqydi9WWdPPjwhTZAU6RSaYuYA1guAS1pBqiaEhD0XwKRLZdqqXmV7M9MwO0ydEK mlCXArl7lxyaVylHeo6dNCdCIaM2U3ERpfM/2s3nvxaLl4o7vYQ5dKFLWvwcEmwyEC3X1mT20+b 6Esih9mbdJghG5tj+NJg0SlQqRYKd2yFlmJ8Ilf4eBk9fulBUqIFKJAq/OYQ8JHKI+bcMDNfTxT DBLc1RO1Cx6shcpkGPIY= X-Google-Smtp-Source: AGHT+IHMJVzBS9ofe/pFhoyhF1nSXR0nkPPB8mnB6Kmq2s/kk2ojN9lhj/BWknemUlGIDrPDFrdQpA== X-Received: by 2002:a05:622a:255:b0:476:6189:4f30 with SMTP id d75a77b69052e-47aec4b5239mr303709741cf.36.1745365314381; Tue, 22 Apr 2025 16:41:54 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-142-167-219-86.dhcp-dynamic.fibreop.ns.bellaliant.net. [142.167.219.86]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-47ae9c4d68csm62754761cf.47.2025.04.22.16.41.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Apr 2025 16:41:53 -0700 (PDT) Received: from jgg by wakko with local (Exim 4.97) (envelope-from ) id 1u7NFR-00000006xuY-19ey; Tue, 22 Apr 2025 20:41:53 -0300 Date: Tue, 22 Apr 2025 20:41:53 -0300 From: Jason Gunthorpe To: William McVicker Cc: Robin Murphy , Lorenzo Pieralisi , Hanjun Guo , Sudeep Holla , "Rafael J. Wysocki" , Len Brown , Russell King , Greg Kroah-Hartman , Danilo Krummrich , Stuart Yoder , Laurentiu Tudor , Nipun Gupta , Nikhil Agarwal , Joerg Roedel , Will Deacon , Rob Herring , Saravana Kannan , Bjorn Helgaas , linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, iommu@lists.linux.dev, devicetree@vger.kernel.org, linux-pci@vger.kernel.org, Charan Teja Kalla Subject: Re: [PATCH v2 4/4] iommu: Get DT/ACPI parsing into the proper probe path Message-ID: <20250422234153.GD1213339@ziepe.ca> References: <20250422190036.GA1213339@ziepe.ca> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Tue, Apr 22, 2025 at 02:55:28PM -0700, William McVicker wrote: > On this note, I was looking through `of_dma_configure_id()` and am also > wondering if we may hit other race conditions if the device is still being > probed and the dma properties (like the coherent dma mask) haven't been fully > populated? Just checking if the driver is bound, doesn't seem like enough to > start configuring the DMA when async probing can happen. I think the reasoning at work here is that the plugin path for a struct device should synchronously setup the iommu. There is enough locking there that the iommu code won't allow the device plugin to continue until the iommu is fully setup under the global lock. The trick of using dev->driver is only a way to tell if this function is being called from the driver plugin path just before starting the driver, or from the iommu code just before configuring the iommu. Given that explanation can you see issues with of_dma_configure_id() ? Jason