Received: by 2002:a05:6a10:c7c6:0:0:0:0 with SMTP id h6csp2040002pxy; Mon, 2 Aug 2021 17:37:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJweDhdDjIn0Qsv/WOBLQ4qT0jjpwaTEpdEIP2uoWiZaUiyKOscG7obfbwYr5bUNQ6L66U1L X-Received: by 2002:a05:6402:5145:: with SMTP id n5mr22354244edd.178.1627951031193; Mon, 02 Aug 2021 17:37:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627951031; cv=none; d=google.com; s=arc-20160816; b=dCnOLhtx8SFkSdJZOZOKIW457u5tQJtnUCSQbG/CIzu5GXFc4JWwXqjJuEC2L9jyr9 J826vST9G4vSv6HdmS9qmKOP4Xv3YwNUY2+cXW4EZKBam8F4TPT9MXP0r+RZc9s++w2/ cInCbdzVyPV4O5WVCbTAPR8qb/9w5ZJOjlV63+t4TRZwQ3GO3+c3Lle2lZB2lSrN+qX5 6d0TP1tpyO9HkFDcmgU8BGHoTrcuikclmjhwXVC84uR86Z07VgZ8M8+xS625eXpf08ON QHXRvgELrLKHdhtbwaey2XWWvSS63CL1svsr6XyYeLYD6J7JpkehxvXt2Vdo6KwPpr6f NZAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=5xi7k8IuxcGb5LOBYAbguxfQfTtnnwxeja/w2hdMqvk=; b=kAPQ48wYaR6mOnYK/rx2DqEasF/XACye12PvJNgKr/s5vzK1NOI3GtxNH8wDZWJ2Bn i2+z65Ir9IJhjzFvDdP0d9YEUSzgRWUMRmhQnvq/Rl/MW8S5eqWnzo/ZzeDReJIvArKT ElwgployTDRHQNzdTp8cu/cVbHRSU1AP05/YyUVwrFfhMYk7LvIQwZqI3/E6kRD8TT3E tCcHHhGuZnbs8IlG8w05ZJZZiSLc9UPcP4TtK/ugldFqOSAeOVyqF9mhsZd1kmh4bfbO SgnEjMM2S7iYNS9M+D1TpkRJiBdCkJHpejchZ8S/Yr5lGX9xk8z4w/cMrBVEZXzN88IP 7L8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=BPBmBK6O; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 17si8085666ejy.73.2021.08.02.17.36.44; Mon, 02 Aug 2021 17:37:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=BPBmBK6O; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232762AbhHCAfY (ORCPT + 99 others); Mon, 2 Aug 2021 20:35:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56802 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232686AbhHCAfY (ORCPT ); Mon, 2 Aug 2021 20:35:24 -0400 Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 27B74C061764 for ; Mon, 2 Aug 2021 17:35:13 -0700 (PDT) Received: by mail-pl1-x62f.google.com with SMTP id i10so21677960pla.3 for ; Mon, 02 Aug 2021 17:35:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=5xi7k8IuxcGb5LOBYAbguxfQfTtnnwxeja/w2hdMqvk=; b=BPBmBK6Oa9Fz1/ejFbBvP9PntE5M4Y/6SY4aMOApSL2NBqNeYpiuuKQDXikcP2is+8 KwthFSUh59S+lqmZMHGQL/iqOYk5FHP9SnNinoO4RO1xwhcM5rgxlMILuWQmOKxcAIPn zJeKBCiGKcqtCYJZisFLf8biie1/ZYgMr5jveWfaC7x1qCTFlIIrCJZk1gP3QbL2B3La Ki8/oXSrAOROvW1S45zSi238dvzbRFlHJnddY1BZDizVXmVMNUBr92JGVnZXe7iI0YEZ CtoFFJcaY3q9gKDkWDB+mb3Sj0a3DGfi6gqy+vFZujkPJ+AkR329+XyiHF4N0jYmEkuh IbTg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=5xi7k8IuxcGb5LOBYAbguxfQfTtnnwxeja/w2hdMqvk=; b=C0wB4S64mcDWwLkQ9Nqz7FJW9GUS/LEOWDBzbR4DCJEkNWl/6y3lj90tdHDCjdss1x YN8lbTzWxHcyfVwyTFTm2crLLDYdw2KmehgOX3OllFx7BOQpaIrPytcFjOfLNC58eyKG a1llUIXhpSyMaPo8b9dlPaquNKIVVzIB6PVt99rLnn4cVvP83ZznuMcbwzXtrmhd1LxZ DOErv24yxwBrlKMUFtqdGpjCe+tOUi0LwTtKcTuv3hSokuf3jP9Xnvm06NkIq348tlNK 5NvkV0iHROT6bR6zvnnT9l6PJNHfwVZ6FNJzxGnylrVlPEuuEyYJwleOf+irx3mrn6qQ SgWg== X-Gm-Message-State: AOAM532Sh2GqBRf3zRIjZYTOLZMWFGG5Q4Q/DnOZLxRhmGYYgL/fG/dE qUj7u0U89Dm/tfNpqrhXph/vTPi8aqAFsfd1QqKeEQ== X-Received: by 2002:a17:90b:1a92:: with SMTP id ng18mr20057710pjb.86.1627950912360; Mon, 02 Aug 2021 17:35:12 -0700 (PDT) MIME-Version: 1.0 References: <20210624171759.4125094-1-dianders@chromium.org> In-Reply-To: From: Rajat Jain Date: Mon, 2 Aug 2021 17:34:36 -0700 Message-ID: Subject: Re: [PATCH v2 0/3] iommu: Enable non-strict DMA on QCom SD/MMC To: Doug Anderson Cc: Robin Murphy , Joerg Roedel , Will Deacon , Bjorn Andersson , Ulf Hansson , Adrian Hunter , Bjorn Helgaas , John Garry , Rob Clark , quic_c_gdjako@quicinc.com, Saravana Kannan , Sai Prakash Ranjan , Veerabhadrarao Badiganti , Linux MMC List , linux-arm-msm , linux-pci@vger.kernel.org, "list@263.net:IOMMU DRIVERS" , Sonny Rao , Joel Fernandes , Andrew Morton , Jonathan Corbet , Jordan Crouse , Konrad Dybcio , Krishna Reddy , "Maciej W. Rozycki" , Nicolin Chen , "Paul E. McKenney" , Peter Zijlstra , Randy Dunlap , Thierry Reding , Viresh Kumar , Vlastimil Babka , Linux ARM , Linux Doc Mailing List , LKML Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Rob, On Mon, Aug 2, 2021 at 5:09 PM Rajat Jain wrote: > > Hi Robin, Doug, > > On Wed, Jul 14, 2021 at 8:14 AM Doug Anderson wrote: > > > > Hi, > > > > On Tue, Jul 13, 2021 at 11:07 AM Robin Murphy wrote: > > > > > > On 2021-07-08 15:36, Doug Anderson wrote: > > > [...] > > > >> Or document for the users that want performance how to > > > >> change the setting, so that they can decide. > > > > > > > > Pushing this to the users can make sense for a Linux distribution but > > > > probably less sense for an embedded platform. So I'm happy to make > > > > some way for a user to override this (like via kernel command line), > > > > but I also strongly believe there should be a default that users don't > > > > have to futz with that we think is correct. > > > > > > FYI I did make progress on the "punt it to userspace" approach. I'm not > > > posting it even as an RFC yet because I still need to set up a machine > > > to try actually testing any of it (it's almost certainly broken > > > somewhere), but in the end it comes out looking surprisingly not too bad > > > overall. If you're curious to take a look in the meantime I put it here: > > > > > > https://gitlab.arm.com/linux-arm/linux-rm/-/commits/iommu/fq BTW, is there another mirror to this? I (and another colleague) are getting the following error when trying to clone it: rajatja@rajat2:~/rob_iommu$ git clone https://git.gitlab.arm.com/linux-arm/linux-rm.git Cloning into 'linux-rm'... remote: Enumerating objects: 125712, done. remote: Counting objects: 100% (125712/125712), done. remote: Compressing objects: 100% (41203/41203), done. error: RPC failed; curl 18 transfer closed with outstanding read data remaining error: 804 bytes of body are still expected fetch-pack: unexpected disconnect while reading sideband packet fatal: early EOF fatal: fetch-pack: invalid index-pack output rajatja@rajat2:~/rob_iommu$ We've tried both git and https methods. > > I was wondering if you got any closer to testing / sending it out? I > looked at the patches and am trying to understand, would they also > make it possible to convert at runtime, an existing "non-strict" > domain (for a particular device) into a "strict" domain leaving the > other devices/domains as-is? Please let me know when you think your > patches are good to be tested, and I'd also be interested in trying > them out. > > > > > Being able to change this at runtime through sysfs sounds great and it > > fills all the needs I'm aware of, thanks! In Chrome OS we can just use > > this with some udev rules and get everything we need. > > I still have another (inverse) use case where this does not work: > We have an Intel chromebook with the default domain type being > non-strict. There is an LTE modem (an internal PCI device which cannot > be marked external), which we'd like to be treated as a "Strict" DMA > domain. > > Do I understand it right that using Rob's patches, I could potentially > switch the domain to "strict" *after* booting (since we don't use > initramfs), but by that time, the driver might have already attached > to the modem device (using "non-strict" domain), and thus the damage > may have already been done? So perhaps we still need a device property > that the firmware could use to indicate "strictness" for certain > devices at boot? > > Thanks, > Rajat