Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5721793rdb; Wed, 13 Dec 2023 18:26:28 -0800 (PST) X-Google-Smtp-Source: AGHT+IFs4FHr8Pd2KaTHKCuGnwLHPXER0PF+5vcdXxkmEondCIBqN8wjf53tciQ6TkhSqucvgSg2 X-Received: by 2002:a17:90a:7446:b0:28a:3457:d7fc with SMTP id o6-20020a17090a744600b0028a3457d7fcmr7389443pjk.37.1702520787994; Wed, 13 Dec 2023 18:26:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702520787; cv=none; d=google.com; s=arc-20160816; b=muDIpklOqynCKdmB8mGGKqQKGJsU//YEBQmPe4oWwpw1OvpYlvlYe/TnvauIE8K4/r ArWACdgrHwnA5nHDgRnL7hi2QhdC8WM+FYNHhWt8pofdGursbgh5OE3r9BPBUl/G1cZ1 q3eUePpqgmWzlrrgWlCVo4IrcBboAiEi1A03s118NxS+/oq1r/ZLyYQJyjA19847g/aL d+tPdloYshPbaytaV0szPdTxxA+Z/RK+LIMZw4Bozla29DoqN9U1uGrRZ8XqqrckMJho r/gTCPsdAwPO33nAlY646Nmm21eF9ZjNuRfXfpWR6j4amlF6k8S8SvNdrkI1tuW0ci74 4AQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:subject:user-agent:mime-version:date:message-id :dkim-signature; bh=rCDmrs4EfBjJ9fKRTxCGDKODMdBalwZ1fPCloc9jytw=; fh=h5vW2ypxWSn7PS0bIzJqk5VSZ2cVExvp4dDIoxb5UuY=; b=mAvXYKSxu5tiCft6bGFlwdB0F2fdVtO/VAinO+492Z0FZXYlYY/qtZvMOCXjYcmMWg vTDk9cYAXGZaocDDdgUC80UI3c6CPgBm1S7wvrlGfWKP5vxBCF24Yin0ju7e06DkYebX un9t0vB7SDsg279h+u/JJLRbWBUfCThw8fSzGkjjAssM8CuyBA21wJDQMtknuyaDMEg4 NmcxGzNZidB4DVLhtCJouzcC7vzZm1qhLuZKcMwXJzmE5G/5QdtBWMn1/bTG13e2ouUp L2+UTskPDp2RG+DdvuM9+eGr8cSZdYu0SuiG5mYv6+Uq3qpwOtPS9GeG1J03HUYiuzbK 8IWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=J1nxI5Kw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id a3-20020a17090abe0300b00280ca5f4ca5si11759811pjs.113.2023.12.13.18.26.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 18:26:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=J1nxI5Kw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 71E7C81C98CC; Wed, 13 Dec 2023 18:26:25 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234093AbjLNC0M (ORCPT + 99 others); Wed, 13 Dec 2023 21:26:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46252 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229525AbjLNC0L (ORCPT ); Wed, 13 Dec 2023 21:26:11 -0500 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.10]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C7405B7; Wed, 13 Dec 2023 18:26:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1702520778; x=1734056778; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=bTE8VtNJbCiL/s1yAvkGTFLh3wedrZObxMgUdd+VPZY=; b=J1nxI5Kwc9+Ehlu5BDd007bylo4nKEl28fYlkmza6EbwGpOm3ElIOD3k BrEBRUiWuxM2H0ySM9jX6V3w6RJMQotMev1DAdREmjVDsfp4q21I4eJIU YVYwLIM5+C4va7GLe8pP+0uH1Zf+ssDTUB+UPLJLxqKFja0OhHtP0Z611 SZhmEChS+UX5qF6ubZfQRpAMt6xRx4LjFPa/izpFzoh6ryLqQ49czX/Jv kT4dN3g6Rjr1GLTFDSQ97bF188zo+m9Ohf6nT0fA3MpRt9GxXbY4h+pTe YiVnNgysg38deBv52nQLUUgo0ppZcmKf703a8HhuptzKEhnxrsJpOaSyu w==; X-IronPort-AV: E=McAfee;i="6600,9927,10923"; a="2229869" X-IronPort-AV: E=Sophos;i="6.04,274,1695711600"; d="scan'208";a="2229869" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by fmvoesa104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Dec 2023 18:26:15 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.04,274,1695711600"; d="scan'208";a="22211022" Received: from zhaohaif-mobl.ccr.corp.intel.com (HELO [10.254.210.186]) ([10.254.210.186]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Dec 2023 18:26:13 -0800 Message-ID: Date: Thu, 14 Dec 2023 10:26:10 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 2/2] iommu/vt-d: don's issue devTLB flush request when device is disconnected To: Baolu Lu , bhelgaas@google.com, dwmw2@infradead.org, will@kernel.org, robin.murphy@arm.com Cc: linux-pci@vger.kernel.org, iommu@lists.linux.dev, linux-kernel@vger.kernel.org, Haorong Ye References: <20231213034637.2603013-1-haifeng.zhao@linux.intel.com> <20231213034637.2603013-3-haifeng.zhao@linux.intel.com> <96051115-c928-4f3c-bd65-4f3f8e83ca9c@linux.intel.com> From: Ethan Zhao In-Reply-To: <96051115-c928-4f3c-bd65-4f3f8e83ca9c@linux.intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Wed, 13 Dec 2023 18:26:25 -0800 (PST) On 12/13/2023 7:59 PM, Baolu Lu wrote: > On 2023/12/13 11:46, Ethan Zhao wrote: >> For those endpoint devices connect to system via hotplug capable ports, >> users could request a warm reset to the device by flapping device's link >> through setting the slot's link control register, as pciehpt_ist() DLLSC >> interrupt sequence response, pciehp will unload the device driver and >> then power it off. > > Is it possible for pciehp to disable ATS on the device before unloading > the driver? Or should the device follow some specific steps to warm > reset the device? > In this case, link down first, then pciehp_ist() got DLLSC interrupt to know that, I don't think it makes sense to disable device ATS here, but it could flag the device is ATS disabled, well,  "disconnected" is enough to let vt-d like software knows the device state. > What happens if IOMMU issues device TLB invalidation after link down but > before pci_dev_is_disconnected() returns true? Seems it wouldn't happen with hotplug cases, safe_removal or supprise_removal. Thanks, Ethan > > Best regards, > baolu