From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qt1-f180.google.com (mail-qt1-f180.google.com [209.85.160.180]) (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 42A28353EC0 for ; Mon, 15 Jun 2026 12:53:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781527981; cv=none; b=pv+VBYI+qYWOY4HKzJu3cBIokv4rqTRk7bmltTsybH5h3mJav2otNTL6dC05ZxTLqMkmRW2VduYLAINNtUdxwgqskBEcTinmtDiG994Pl0PfW6deaJm8jN3GUEjSYBRcP/jdY9HbeQz0gFX34AigeY+zoc3nKpwI4Qp4u7ebB0Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781527981; c=relaxed/simple; bh=s96ccR8Om1I0iIAfjhwlWNvcJJx/1nhwDO14q6/sSI4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=b3MgyC+LDL623szXaXiL3Suka6lalA6RDT/ii+wQ2wnJxoB9xvQS5yTwpF+I58JXU47HI/ccDbyya1i5aKY/qRuw+FGFKTdPNwLKN6XONUzmys7k0pFLHi172DYl+gZV0ZL00GkWve3zr8nBQ1tibGv6BNTO3ipmFAzHpT+yCoo= 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=AOoxJC1t; arc=none smtp.client-ip=209.85.160.180 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="AOoxJC1t" Received: by mail-qt1-f180.google.com with SMTP id d75a77b69052e-51764768c36so47271351cf.0 for ; Mon, 15 Jun 2026 05:53:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1781527979; x=1782132779; 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=/U++F8LMHjutudC/6qjVGvOhdK/NsDBOF4e5HFz5STo=; b=AOoxJC1tAithNPGcM/KglPxEqZtuBphjY8xvVYvv2FFqLkxbQ+oJhmzR0BeKU807qM QL3TPIR90Gpa1Qe0O8dMdqXn1wjETn/a8jIpU8TFG56aq9iWUiqEzgYeY5aEMNWTxLel bDLjhKWU0Lkv5bP2Y5JKiZslRdTJWhdBuqZStyQh3+QoKlzzIiC5beC/wT5ppzpNAy4H mkUrzzjtpDZ/XlDHJJgh8Su/Jasj7v34aNCpOASjloWfJVLWyZSoSaR/QCOcFqQbD5sB wFUWFUTObAuSIUuhYm2klE4zeLkaRqLU2dddm4u3gsgHvZs10f8QNcRvmosjfRl5dj3e HeBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781527979; x=1782132779; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/U++F8LMHjutudC/6qjVGvOhdK/NsDBOF4e5HFz5STo=; b=As6m2kH38aTJb0mnrPoDil1uC/VftWrHGOG8d5D6SuMU4Uee5EZwOi6O5S1Yja9diR OYKkDrKxfK47uK7fBJR7y+KTFjbdEsQzvj+SZAcsnim85mJsYJ2q3Fa5ayfCaLK20YVW xGK8rWndziAkuNVes2Y6zTn4gtGZvbAmaMlgnTdZDMBWZ9tQBNblHDo8EBAckzF1Heip 9yTAIUWfP1xYR64APLs5hspFlz8lsX7mSc4Y6ZgX8v1uHXEZnue0CdiXmNiqkyYfJSm1 elFHPLlOVIINtZEXopKt+u0+KL5jlKM9LB9l/NxEllmEf4kWraD4delUNBBJ4aJWYGmz ampg== X-Forwarded-Encrypted: i=1; AFNElJ+X+7oJWyU2LWI1ZK+tPUw2gtW6jFqyme/pJjvyKKbrRhBcv6oLrSELHIXfmXA8e49gAIS4847N/937xQ0=@vger.kernel.org X-Gm-Message-State: AOJu0Yxipcw0ZEPR7sTxF6ZBlHlVAl6r1h76tSloPg+Ee+GND7vhZ0O5 pevcUombABN8xvJl7hkUAEU6mpYFzyTBVwGRbpJ54rvN74mMxcAeRx/AcUAOdd6Azss= X-Gm-Gg: Acq92OHIkUPwKcZRrBvLxYI/E0cSZj8pu231pZic+PhFEeNTvuAY2ZWRzTDGNoyGq+K qdV0/jh4HWiFIvpi3dWP3r/S7ZivGcwtKVtP89u91QsHWMy/b3N60g41v80/4szgYjyMy+OIM6y 3jUeJeBPgQaRiI4DZW9AIKpFyKmzz9OPVRXKufcF9uQyxkg8KQW4PdHl9MKzvgyub+G3K24VVJq mZKBJDn0XnYg7Wal0eG2J3CHNJrI+9KNWXAJLNe9hr2B/QL9R+e0p8dtwWAHIkIRtkE1Wegd7eY yS3QoKj3R4c3Ec5OYTyH6UKwf9yLuxnXg7SqJLHXLJiHJ1mdz0fA3teq2JrW9mp8dU1GEeg4Km5 8qHlT0rv0N+yX0CpsQrVBiry7fGqF0FSrCfFQDZWyjqVgJNBMJGSvKf4kZUZ7uXS02DOSGJBn+0 5EpE7w1DvrhQDEdc/glHnTeCAE8IUT7eJWyYGSuNPCIpgN2KCzNvdGko5kNpkGeUaNSZcV+jROS Mu3PA== X-Received: by 2002:ac8:58d0:0:b0:517:87c4:2a95 with SMTP id d75a77b69052e-519534dbb14mr172028331cf.5.1781527979043; Mon, 15 Jun 2026 05:52:59 -0700 (PDT) Received: from ziepe.ca (crbknf0213w-47-54-130-67.pppoe-dynamic.high-speed.nl.bellaliant.net. [47.54.130.67]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-517fb61d948sm103230391cf.1.2026.06.15.05.52.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jun 2026 05:52:58 -0700 (PDT) Received: from jgg by wakko with local (Exim 4.97) (envelope-from ) id 1wZ6oD-0000000DQjI-3VJy; Mon, 15 Jun 2026 09:52:57 -0300 Date: Mon, 15 Jun 2026 09:52:57 -0300 From: Jason Gunthorpe To: Vikash Garodia Cc: Vishnu Reddy , Robin Murphy , joro@8bytes.org, will@kernel.org, m.szyprowski@samsung.com, iommu@lists.linux.dev, linux-kernel@vger.kernel.org, dikshita.agarwal@oss.qualcomm.com Subject: Re: [PATCH] dma-iommu: Introduce API to reserve IOVA regions for dynamically created devices Message-ID: <20260615125257.GS1066031@ziepe.ca> References: <20260119054936.3350128-1-busanna.reddy@oss.qualcomm.com> <20260612172649.GM1066031@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 Mon, Jun 15, 2026 at 12:26:25PM +0530, Vikash Garodia wrote: > To handle such case, we create the device dynamically and associated the > distinct IOVA range to them,via the api introduced in this patch. > This was prototyped in recent SOC here [1] > > [1] https://lore.kernel.org/linux-media/20260313-kaanapali-iris-v3-1-9c0d1a67af4b@oss.qualcomm.com/ Well, I'm not enthused by this: +static int iris_vpu_bus_dma_configure(struct device *dev) +{ + struct iris_context_bank *cb = dev_get_drvdata(dev); + + if (!cb) + return -ENODEV; + + return of_dma_configure_id(dev, dev->parent->of_node, true, &cb->f_id); +} A custom bus and then calling configure_id on the parent which would have already called of_dma_configure on that same of_node seems very hacky to me. Jason