From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3DDC9C433F5 for ; Thu, 28 Apr 2022 07:56:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343543AbiD1H73 (ORCPT ); Thu, 28 Apr 2022 03:59:29 -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> 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.