Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp576529iob; Thu, 28 Apr 2022 08:09:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzZ7gS+JFA1WieEPL0xhWtV/m8b80zFdu7xlLFfojUOWPYwmreuo2Wfxox+FRp4Mr2Fvgkn X-Received: by 2002:a63:5551:0:b0:3ab:84c3:1a0 with SMTP id f17-20020a635551000000b003ab84c301a0mr13045320pgm.604.1651158575277; Thu, 28 Apr 2022 08:09:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651158575; cv=none; d=google.com; s=arc-20160816; b=jHevjn5/NYOHqaVd7XJCTeZhns3dKuoiT+5XZ4osp8BpklDwzPu38NjRLF8mndyvav kp/KWTmuXjlr4TfWF3V8sT3RzS+DTDtDIPYjtwFOSrOLKnX4nhmC3dny6kvCxh+GdW8L P98rAx/LCL5Ksd9z6OvTIEYFghF6NzciObnChakAhsN4REUYW9/1vrqRsKSZF+z7VACd hmXAshNJvh6oGthyfhtQ6dnzzqKJ07quPQymLKuqA+kuqhTE8EfYaDOxcaZh148V+Gij KJ3fGi0huWJupwwPaAZBPvbqdUt/DcdIidFoIe4euvhaCJP44tn9zmgIQNG98F/LHDz3 5JIQ== 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; bh=P6109H5/lsFQlPiMLRC+L54PMIi8Jg+9F0cNVjnkqhI=; b=f6reoOR2Fsy0YXCt4ktUa+++lBdHRzBKSpg2Cbw2PGu5kMnRZM+w75i0gtPYFGSS4q YueToGsIwMRLAsbqeQpAzfIm6XYERCix9VAWpdZWt8Dh540W8tNsfGeYm3Leon11H97w OvD3hurQRxOPedGKboTL6FgN27hldslTWcwdA8sAnQ64UVqJRDlPaZMSKYaAnSlJJqCS oPgFhkWVhUoIQGq2acyB3sFm91m9CqMV5hBEEAmw2jr8IjyiY42hM28DgojFsPxTvWgF mhKgvhEGpGDvqAwlYvjLaMYNVdU+yMFsn3jDUpxJIAleSok2H1AS4S/whgvstwQ0Tzgv tZNw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 143-20020a621695000000b004fdada2b1d5si4111817pfw.327.2022.04.28.08.09.17; Thu, 28 Apr 2022 08:09:35 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343577AbiD1H72 (ORCPT + 99 others); Thu, 28 Apr 2022 03:59:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43524 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343557AbiD1H71 (ORCPT ); Thu, 28 Apr 2022 03:59:27 -0400 Received: from theia.8bytes.org (8bytes.org [IPv6:2a01:238:4383:600:38bc:a715:4b6d:a889]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 30E505F26B for ; Thu, 28 Apr 2022 00:56:14 -0700 (PDT) Received: by theia.8bytes.org (Postfix, from userid 1000) id C5365452; Thu, 28 Apr 2022 09:56:11 +0200 (CEST) Date: Thu, 28 Apr 2022 09:56:10 +0200 From: Joerg Roedel To: Suravee Suthikulpanit Cc: linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, jon.grimm@amd.com, wei.huang2@amd.com, terry.bowman@amd.com Subject: Re: [PATCH] iommu/amd: Do not call sleep while holding spinlock Message-ID: References: <20220314024321.37411-1-suravee.suthikulpanit@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220314024321.37411-1-suravee.suthikulpanit@amd.com> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, SPF_PASS 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 On Sun, Mar 13, 2022 at 09:43:21PM -0500, Suravee Suthikulpanit wrote: > Smatch static checker warns: > drivers/iommu/amd/iommu_v2.c:133 free_device_state() > warn: sleeping in atomic context > > Fixes by storing the list of struct device_state in a temporary > list, and then free the memory after releasing the spinlock. > > Reported-by: Dan Carpenter > Fixes: dc6a709e5123 ("iommu/amd: Improve amd_iommu_v2_exit()") > Signed-off-by: Suravee Suthikulpanit > --- > drivers/iommu/amd/iommu_v2.c | 12 +++++++++++- > 1 file changed, 11 insertions(+), 1 deletion(-) Applied, thanks Suravee.