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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3B697C4332F for ; Mon, 4 Oct 2021 13:19:38 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 10CD56325C for ; Mon, 4 Oct 2021 13:19:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 10CD56325C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=QAW6Dry5jl379NpbQ+AYa5CfpO3WFa7cnAZIo3Oe5CE=; b=rFVSr28f+s/U2o Xz7SL99j+Rp/1F9glq3N8xcPiFsBdo9tORkUvsGV3fqDRoTbPYw8gZ+OT0JxuUCHLGo+9BMxYi+hy aEKEFtNgySlkOqzyJhETpyYNMTi63Ie/UGhM+NR0ddcLMcMcpYc5jSv4fik3itRGWqK9mYCEZwB3l lYXafdrzZZWQdkMgCIgOGKeK6nvramSCVdXSEfqNqvKcdXcOuyZjbZlfUQpcL/T9hzKiPeTQPLyhP iTbm9PvHfaQNFVhZhd2O22M8x3Kpq7Y0+c2bRnKz0TCiyv8wg3txfB19KZO4zPRR5eVEEFM/yNlCH yC9annkDwaskXgPoTaCw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mXNr1-006cVT-0n; Mon, 04 Oct 2021 13:18:03 +0000 Received: from mail-qt1-x834.google.com ([2607:f8b0:4864:20::834]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mXNqx-006cTM-Da for linux-arm-kernel@lists.infradead.org; Mon, 04 Oct 2021 13:18:00 +0000 Received: by mail-qt1-x834.google.com with SMTP id x9so5594187qtv.0 for ; Mon, 04 Oct 2021 06:17:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=JPvcFTOHIGx9xgqu5ddNdve5jNdRddJHTQcQMlxuUb4=; b=UMIFsC4ZdZIj3RkBCIxhu+WL1QM8xiwS679e8/Y8EifC/4Pc/Vov5qlsZsgb9rWOaZ KI+kC8rRZF7jDiNSIQrlK9BMn+6z26u2rf67nRVgdcuer9tVqIApteymS6Zbo6/roHCC 9FSGMGZlujafa/5QodHnnoqTIS6zB88kv0egPGAHfCpUvDOa3rZEt2QOVx9NtkubRJtU bfbymcUaq/18N5vh5iFrPxGaquVTUMwDGL/CAXrWYzYtrjyV04YSWH40toiZP/1QaKui hk2ZubrkTADUaeaeR4xji8rQcH7PUR3GsDeerelpgIS8DnSzbkuUqbL3r4OZKfMBxIlR Hzuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=JPvcFTOHIGx9xgqu5ddNdve5jNdRddJHTQcQMlxuUb4=; b=4YChulVAhRSxO4foK7R+alM8U7IZiBAWBqtmwb4OuLalfuaFPkmX+RC28sPg3l01Is ZGe6SuP1jKl2b8JGUBPBygb/u+4+0mmCULaH4k9T2QU/airQ8l/iQuio1DiXzRiviTCC 0rTwquTudD0kUKr2yL2YvTqlOPJqaOHhzZTlWxrgtwg7eYq/VwOSGI6VkC+m/QfWVK1L 5BSOXvI5xEWo4f9Il28SrgJ+0JmQmQr4HqiPWIC/6No2njSWy0+f7MJwTn1CmHWqa+Du V7Qic/S8WshpqTuIyAGdMbfc6v0S2HDPrdDDgoECoYq775Qghfef2ugVDL2EcdH65oSy R64A== X-Gm-Message-State: AOAM531bP5IEOaKuGo5V50MwXRbgvaR0wDBDhcfqkDSdP0u0k8SqHz9u 5CT7q4kVDeUZhbLb4nQpWcQHcaLaPrTxfA== X-Google-Smtp-Source: ABdhPJwdFLgMD3BnQcwrih7T2hB2I/DIr+gMNW6QdD7a1s9w2k10tDtk2GbyLGc/JQ96h26jkMNd0w== X-Received: by 2002:ac8:4084:: with SMTP id p4mr13618411qtl.255.1633353478081; Mon, 04 Oct 2021 06:17:58 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-142-162-113-129.dhcp-dynamic.fibreop.ns.bellaliant.net. [142.162.113.129]) by smtp.gmail.com with ESMTPSA id v17sm8247440qkp.75.2021.10.04.06.17.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Oct 2021 06:17:57 -0700 (PDT) Received: from jgg by mlx with local (Exim 4.94) (envelope-from ) id 1mXNqv-00ATdu-02; Mon, 04 Oct 2021 10:17:57 -0300 Date: Mon, 4 Oct 2021 10:17:56 -0300 From: Jason Gunthorpe To: Mark Brown Cc: Lino Sanfilippo , f.fainelli@gmail.com, rjui@broadcom.com, sbranden@broadcom.com, bcm-kernel-feedback-list@broadcom.com, nsaenz@kernel.org, linux-spi@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, p.rosenberger@kunbus.com, linux-integrity@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH] spi: bcm2835: do not unregister controller in shutdown handler Message-ID: <20211004131756.GW3544071@ziepe.ca> References: <20210928195657.5573-1-LinoSanfilippo@gmx.de> <20211001175422.GA53652@sirena.org.uk> <2c4d7115-7a02-f79e-c91b-3c2dd54051b2@gmx.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211004_061759_504088_6B1513BC X-CRM114-Status: GOOD ( 14.92 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Oct 04, 2021 at 01:49:21PM +0100, Mark Brown wrote: > This still leaves a potential race where something (eg, an interrupt > handler) could come in and try to schedule more SPI transfers on the > shut down hardware. I'm really not sure we can do something that's > totally robust here without also ensuring that all the client drivers > also have effective shutdown implementations (which seems ambitious) or > doing what we have now and unregistering the clients. I am, however, > wondering if we really need the shutdown callback at all - the commit > adding it just describes what it's doing, it doesn't explain why it's > particularly needed. I guess there might be an issue on reboot with > reset not completely resetting the hardware? Shutdown is supposed to quiet the HW so it is not doing DMAs any more. This is basically an 'emergency' kind of path, the HW should be violently stopped if available - ie clearing the bus master bits on PCI, for instance. When something like kexec happens we need the machine to be in a state where random DMA's are not corrupting memory. Due to the emergency sort of nature it is not appropriate to do locking complicated sorts of things like struct device unregistrations here. Jason _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel