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 81445CCA47B for ; Mon, 11 Jul 2022 11:12:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229701AbiGKLMU (ORCPT ); Mon, 11 Jul 2022 07:12:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53178 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229607AbiGKLMD (ORCPT ); Mon, 11 Jul 2022 07:12:03 -0400 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8F0C232DAB for ; Mon, 11 Jul 2022 03:21:39 -0700 (PDT) Received: by verein.lst.de (Postfix, from userid 2407) id 220B568AA6; Mon, 11 Jul 2022 12:21:35 +0200 (CEST) Date: Mon, 11 Jul 2022 12:21:34 +0200 From: Christoph Hellwig To: Robin Murphy Cc: Ben Dooks , linux-kernel@vger.kernel.org, iommu@lists.linux.dev, iommu@lists.linux-foundation.org, Christoph Hellwig , Sudip Mukherjee , Jude Onyenegecha , Marek Szyprowski Subject: Re: [PATCH] swiotlb: ensure io_tlb_default_mem spinlock always initialised Message-ID: <20220711102134.GB4639@lst.de> References: <20220708170811.270589-1-ben.dooks@sifive.com> <683344bd-dc9b-0bb5-9377-b3e9ab410a74@sifive.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 11, 2022 at 11:07:17AM +0100, Robin Murphy wrote: > If none of your peripherals should need SWIOTLB, then the fact that > you're ending up in swiotlb_map() at all is a clear sign that > something's wrong. Most likely someone's forgotten to set their DMA > masks correctly. Yes. > > However, by inspection it seems we do have a bug here as well, for which > the correct fix should be as below. The fireworks you're *supposed* to > get in that situation are considerably louder and more obvious than a > DEBUG_SPINLOCK complaint ;) This looks sensible, I'll pick it up.