Received: by 2002:a05:6a10:c7c6:0:0:0:0 with SMTP id h6csp2026879pxy; Mon, 2 Aug 2021 17:12:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw8eNUlxOsLSQuVYVJbFLsMQNB6j4yPfYd8Rb6yP4eL8raMnja/oBtDWdD9kxy/OHCyiI2D X-Received: by 2002:a17:906:70a:: with SMTP id y10mr17621435ejb.381.1627949526719; Mon, 02 Aug 2021 17:12:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627949526; cv=none; d=google.com; s=arc-20160816; b=c7LtGY87etVL2wkKWrmTSG23obULwuTOlvpfa7pNXcDpVtUz8C60zNMEDEPPGH/dYt MvPJ4cn3gzVVoRRJ7DNbzyN7uCtFfKe4Voh8fASkWYmqthGIDVuRFVy2covrJiZ64ekW 1h6U6ALJwzRKqXCUyESleYFhkamO1C0xCCarGzH8SQsNwuYgokvGhQlETtCfp4xYFX1w oiXH5CvvSWT1lPwleqA+U2qqlnc0/VGxpcAR67dpvHO8u+LJrR9DPuUXHmG/AntrlS1d YSArA8XTqi52kaKhPqpzzgrjvSI5AOfzaVv8Lx3oHum8R7Xu69SqG8aM6AoWjjea6dXD Onbg== 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=+j4BJpyfr/0bKpgqLUIWH//i3b70ShWiDMnlMOcrZc4=; b=tqcKpJUprrEf/UJ11Dyjxg4nP61Uic0EZPlHV71biR3Utxy/dRrUvXNjNLyL0J2QjY uxl/MwU5Xlj0neQuTiM9khsjChIjfbvDF+RK13hmtO8w0GNWbMelr2/yV5ezyJMmczsm wB1b5psxx2B5TrRMY/TKxbD0/1zeec7TsMj6JW3xJRzBf2QzB54sJRiom/X5tOO1Jt2F UrqxXE7ZH3ImKt8y3/JXz7Gz2dNW2X4mk4qxiSEts11myNK7ZfCA2VWtL5geHcRiItsu 6nAUqOXqF3OBVYXh8X6EdzvoNl3gTC0zYjOe1JsPsAWubDvcWpazZg2ypJ7f9wYkqGq+ fFyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=eEcbDKMN; 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 ht8si11368129ejc.381.2021.08.02.17.11.42; Mon, 02 Aug 2021 17:12:06 -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=eEcbDKMN; 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 S232888AbhHCAJ4 (ORCPT + 99 others); Mon, 2 Aug 2021 20:09:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50990 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232772AbhHCAJz (ORCPT ); Mon, 2 Aug 2021 20:09:55 -0400 Received: from mail-pl1-x631.google.com (mail-pl1-x631.google.com [IPv6:2607:f8b0:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AAFDCC061764 for ; Mon, 2 Aug 2021 17:09:45 -0700 (PDT) Received: by mail-pl1-x631.google.com with SMTP id u2so13329393plg.10 for ; Mon, 02 Aug 2021 17:09:45 -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=+j4BJpyfr/0bKpgqLUIWH//i3b70ShWiDMnlMOcrZc4=; b=eEcbDKMNyZMv+PMgaHxZKMzSnpGt/8lW8qX0LM8mMc1QuP2Uem3YTKkMxkzZhEpFSy ViAVjzj6ya5et0R6/1h6DHh6BqGEHxuEpXjs8SyGANf18SiilZkzQ7Ne2uFbgPOuWiqd kMZ2hNrdwjrUgJC6mrCRv6ZMCNHRkfRiTAhsTVlcWxX6RIY4FL8K6DJcJt2jUcJh0XZJ XimfGezD2Bo8/eWKrrfVTkz1RZ423OrsSRKzH9bCJOVLSQCRknWaPW//mRMiJMBJy6FB eT0yhYXtzbmVnMjkwBRujoC7WUH28TflA+iWjDphpVqDhoylN3G7VoFyA9Lfe/VP7u6Q P8ZQ== 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=+j4BJpyfr/0bKpgqLUIWH//i3b70ShWiDMnlMOcrZc4=; b=tdA3ZiVPs8ggy4Akpze9/Cm+CBQDBANw4h8MO3sS+3dsEx6K1caNmJFUghCmaT4JAZ sxkkL74m804/Bly7YMZokP0h+4fljShSNDovRdyth+rgpfAVx9o8Xf/dZxXQGI87xILC qaKDgXncFJzUVYv/8YL/Vts6SNgE9ZrNCg/4lha+05bUjmTKGN91RhAtjHqiRd06tHeR al403OPN55IWEKbSRL3Nqat3BlVdJKkpD32l7EGo6AzQswCbY9XNqXnfJYELQNYNBWEG QvGAZG2y8j9hGRdpkIIZv3jdFdR4jDaTPTicu1THSdJRNTirg0F4KhqXek2/0rJXwG6D XgwA== X-Gm-Message-State: AOAM532phjtKU4DmymDBjgqekGOUTG5SrG4m4u4HoyJ8JafTA3tGb+LD mrCdRZA4+vDLb3NeUFck/g+5bT2p2OqqW3dYJJ48uw== X-Received: by 2002:a63:1857:: with SMTP id 23mr673574pgy.403.1627949384952; Mon, 02 Aug 2021 17:09:44 -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:09:08 -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 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 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