Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp1842594iog; Sat, 25 Jun 2022 22:53:53 -0700 (PDT) X-Google-Smtp-Source: AGRyM1u2K/LPtDXwI0R7aFdaipMgFFsWC1P2WzaGPsw0cNZbu6cUMuUilp4LV0SxhNas6Oz2AzBi X-Received: by 2002:a17:906:478e:b0:722:fc33:5c65 with SMTP id cw14-20020a170906478e00b00722fc335c65mr7012919ejc.22.1656222833583; Sat, 25 Jun 2022 22:53:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656222833; cv=none; d=google.com; s=arc-20160816; b=c8HxBLRF8t80vCikuIFv+Ga1IjWsKGt1MNV95B3QHwdpUPaOIkau912Pm2K5JY0Yae D85gNhi1EdpXxlZgXOJP/Cxps2qyea7DXv9U4/cUq7d72S+CqpI+nkItJSOijcEKoOPh wfg4/rCQBkvrf0AHxXTRynO2NJXmQufSaol0wrNNcqUIcZPAjcNmZGQNdSXpMBi3HBEx Fd99A9bNPJSOboapTQeXay/UO9Lcc0RqvBy3eLwKDR8Jn9AMeOYyb4XvE/o1dS/JhHw5 nCwZyIn/KmssM495vP/LFzjNqCgqz48D1PVlfZrziDpaO/3zMrExVEwDPkugCVPVDQVQ SQYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=mmwbRy60sXjkejvOIm9sf6hOhgJALrCf30Qp/BNjzMM=; b=0XSO4MKxmsOPE4agVWlxZ0YSHBeL+NSK5TQbuUOUkjYyq3vyl/lYLJH6Ml6xxAzJL5 EHUQ4Qb6hM14eg7Pjsopea89vGK36cXbEQXngvXmgWDNanPsnWA1LZ3vgoagTPzWO/RG kGQp58Q+AtJDM+zb/nEJwmbSA6eKjcILWiw+mCdOPl5lEX/+vqNXXdx3zFNjY4MUOft1 4U8CvIoenecwr0YnHIHvhgA+fiDwtHR2a+qu5ayYLmKrUSwXnX/9DhQMPSHd8cwhx36e NSIC+rPoR+Ztqlq4QsggAKlcThbZ0QvYPXcmvPtyltJX0K0800DJYfALcxd7aoDrlskL T5Tg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=bFXmSZwH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h9-20020aa7cdc9000000b0042dce8438adsi8215112edw.487.2022.06.25.22.53.20; Sat, 25 Jun 2022 22:53:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=bFXmSZwH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233970AbiFZFGH (ORCPT + 99 others); Sun, 26 Jun 2022 01:06:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56388 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229957AbiFZFGH (ORCPT ); Sun, 26 Jun 2022 01:06:07 -0400 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 924B413D74; Sat, 25 Jun 2022 22:06:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1656219965; x=1687755965; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=hl2agD/+Sc11EfpsDPo10+vgPf/U1CBCR4RfoCDNlkA=; b=bFXmSZwHdnCoxMu28xGeT1n4OFVTt0dvhoVaI8w+VC1zMk5dlAwbRkLT g7Um8a8BsH3mzqen0cNLxu+tWScEMhvPRiw7g+j22bjylHcCQHoziilde 8TLbc60WZackqtAdxgyIQbuBsuNhpxtyR2FoEkgLE8wjFJSyGoe6At0Of eITL2aS+oz61Nr+NICMfQLw+336+UHeBhUsotoR4BZ6l5PnD1R7Sal+ye U4InhqcZecDIce2DTdd+Rv3PqbPeNDkZPf8mbCc84IEu2dAl1YtYP/rZG 5P4AzclF4osxq/uccPwkHssKoQsQMMFVcut2pPfJe78mwdBUv99GeQlzc A==; X-IronPort-AV: E=McAfee;i="6400,9594,10389"; a="306716079" X-IronPort-AV: E=Sophos;i="5.92,223,1650956400"; d="scan'208";a="306716079" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jun 2022 22:06:05 -0700 X-IronPort-AV: E=Sophos;i="5.92,223,1650956400"; d="scan'208";a="593819878" Received: from fyu1.sc.intel.com ([172.25.103.126]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jun 2022 22:06:05 -0700 Date: Sat, 25 Jun 2022 22:06:31 -0700 From: Fenghua Yu To: Jerry Snitselaar Cc: dmaengine@vger.kernel.org, Vinod Koul , linux-kernel@vger.kernel.org, Dave Jiang Subject: Re: [PATCH v2] dmaengine: idxd: Only call idxd_enable_system_pasid() if succeeded in enabling SVA feature Message-ID: References: <20220625221333.214589-1-jsnitsel@redhat.com> <20220626045144.9063-1-jsnitsel@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220626045144.9063-1-jsnitsel@redhat.com> X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Jerry, On Sat, Jun 25, 2022 at 09:51:44PM -0700, Jerry Snitselaar wrote: > On a Sapphire Rapids system if you boot without intel_iommu=on, the IDXD s/you// > driver will crash during probe in iommu_sva_bind_device(). .... > v2: Balance braces on if else block. Fix up commit description. This change log should be moved after "---". > > Fixes: 42a1b73852c4 ("dmaengine: idxd: Separate user and kernel pasid enabling") > Cc: Vinod Koul > Cc: linux-kernel@vger.kernel.org > Cc: Dave Jiang > Cc: Fenghua Yu > Signed-off-by: Jerry Snitselaar Please put the bug report link here: Link: https://lore.kernel.org/dmaengine/20220623170232.6whonfjuh3m5vcoy@cantor/ > --- i.e. put the change log here: v2: Balance braces on if else block. Fix up commit description. > drivers/dma/idxd/init.c | 13 +++++++------ > 1 file changed, 7 insertions(+), 6 deletions(-) > > diff --git a/drivers/dma/idxd/init.c b/drivers/dma/idxd/init.c > index 355fb3ef4cbf..aa3478257ddb 100644 > --- a/drivers/dma/idxd/init.c > +++ b/drivers/dma/idxd/init.c > @@ -512,15 +512,16 @@ static int idxd_probe(struct idxd_device *idxd) > dev_dbg(dev, "IDXD reset complete\n"); > > if (IS_ENABLED(CONFIG_INTEL_IDXD_SVM) && sva) { > - if (iommu_dev_enable_feature(dev, IOMMU_DEV_FEAT_SVA)) > + if (iommu_dev_enable_feature(dev, IOMMU_DEV_FEAT_SVA)) { > dev_warn(dev, "Unable to turn on user SVA feature.\n"); > - else > + } else { > set_bit(IDXD_FLAG_USER_PASID_ENABLED, &idxd->flags); > > - if (idxd_enable_system_pasid(idxd)) > - dev_warn(dev, "No in-kernel DMA with PASID.\n"); > - else > - set_bit(IDXD_FLAG_PASID_ENABLED, &idxd->flags); > + if (idxd_enable_system_pasid(idxd)) > + dev_warn(dev, "No in-kernel DMA with PASID.\n"); > + else > + set_bit(IDXD_FLAG_PASID_ENABLED, &idxd->flags); > + } > } else if (!sva) { > dev_warn(dev, "User forced SVA off via module param.\n"); > } > -- > 2.36.1 > Thanks. -Fenghua