Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp3240122pxb; Tue, 12 Jan 2021 09:36:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJxLvwxTW9xZq9QAULSDSqum+EsRs3bKUL1oNx7ukLmszB5nJArPVVTHhCLzPALpMeM04il1 X-Received: by 2002:a05:6402:17:: with SMTP id d23mr167895edu.341.1610472985699; Tue, 12 Jan 2021 09:36:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610472985; cv=none; d=google.com; s=arc-20160816; b=etrVnbKjDJeH2bkAq6fjb2hO2GRBqo7ceuYStQWhz0ftllAqo1as6zEIFO8ix4iYGa N3sj5Vl5WXvvBSR4jpEV6MygXlAhsEpOUugbGkPT8KlOkMBYy1kmpSrhdebi7wtLLFql NMVSijVHt1Zsjd2xDrMvzOw0/23drFizyP6M4HWh6WpERZFF1nIJluRMjBxzQaoYk4i+ dVN8JmEOGmXEDo3r1fuxZ0GveG7DQ2Rpo+wQtt2MHHkd62W37Jr0QR+BXo7vrq+VjL+H 5OXgw920zDB6UOjASoOowAI/KBpUQ87kfSNkK47Eq7EpiZu3w0xQhIwZd6ArGThw8ubm 36AA== 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:dkim-signature :dkim-signature:date; bh=LAolnOXmE55ZGWKDi1ZWtF/yiYKdSoWGTb8A4N47mNc=; b=HvNvOd3iuKTtpxQJ0pytHkwv2bMgTIHvqG0N+M9tqNElReHQIc/FmIKY+gzndfDawz d59R09VPHPb8g3lFDZ9JIV7y0d9arfn/OaABFaUsN9lxlxOSl8c+9DuvHdql1DWTZR6P 5SQbpGqvh17HmJdEAfo2+ErODXPt5SAkoD9BrFgwksgEEEAa0gAVYHdrFx58kbC/OKS8 2MGA3TEDKMuvmhdaD6p84w0NFAixyUNXyy2jqW7ufHyF1SrA5w997jlS68/rBpKXIpxu zKB66L/kiwWK8gfcwQmYqRlBXBP8snx+9MKx+zNZa9vAWxSN6c8aSMdXrxkFgUpKjx3A fRNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=D7X8h0lo; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j24si1377269ejd.743.2021.01.12.09.36.02; Tue, 12 Jan 2021 09:36:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=D7X8h0lo; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404229AbhALRdu (ORCPT + 99 others); Tue, 12 Jan 2021 12:33:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48484 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389692AbhALRdt (ORCPT ); Tue, 12 Jan 2021 12:33:49 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 408A8C061575; Tue, 12 Jan 2021 09:33:09 -0800 (PST) Date: Tue, 12 Jan 2021 18:33:06 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1610472787; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=LAolnOXmE55ZGWKDi1ZWtF/yiYKdSoWGTb8A4N47mNc=; b=D7X8h0loH2jqm2j9VY0Fe4Ez9zyjMZ5SS1CzWUwz+T+TWfHLLvL+NDgnrOYvP5Efb5UcNk Z7KA/yf0lWyuM3foAjm+e5MMzXbMhF7nkTOYoBxSnc3uzFYDt1fvahRdjUgmEd0ckcXg2W erYJvLLUO5nMuretieFN8QCuQkJbuMQR6kx8DGPgTkt4m2OfKra7qTPNQcEs81XcpG7d06 n+pPpf+DqmuUubIiVz5a6AcbsYDlH9p4WYSKL7x+39pY8KJEUPn/++e2r02bGTGJoQrVJa +s4Ze11j5JFxge+KBXdUtK+zdLrBGIUZQl/5pWjVdwJm28uSGswQNp80nZJfrA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1610472787; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=LAolnOXmE55ZGWKDi1ZWtF/yiYKdSoWGTb8A4N47mNc=; b=TezOMx8W2Z5YRX92l2k+O/anNGRYXpdMVxdknEAHVv20GwgQtERN6Bs4my/9OjvoNLYT1Y gJYHmsGS2boO7WCA== From: "Ahmed S. Darwish" To: John Garry Cc: "James E.J. Bottomley" , "Martin K. Petersen" , Jason Yan , Daniel Wagner , Artur Paszkiewicz , Jack Wang , linux-scsi@vger.kernel.org, LKML , Thomas Gleixner , "Sebastian A. Siewior" Subject: Re: [PATCH v2 00/19] scsi: libsas: Remove in_interrupt() check Message-ID: References: <20210112110647.627783-1-a.darwish@linutronix.de> <8683f401-29b6-4067-af51-7b518ad3a10f@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 12, 2021 at 04:00:57PM +0000, John Garry wrote: ... > > I boot-tested on my machines which have hisi_sas v2 and v3 hw, and it's ok. > I will ask some guys to test a bit more. > Thanks a lot! > And generally the changes look ok. But I just have a slight concern that we > don't pass the gfp_flags all the way from the origin caller. > > So we have some really long callchains, for example: > > host.c: sci_controller_error_handler(): atomic, irq handler (*) > OR host.c: sci_controller_completion_handler(), atomic, tasklet (*) > -> sci_controller_process_completions() > -> sci_controller_unsolicited_frame() > -> phy.c: sci_phy_frame_handler() > -> sci_change_state(SCI_PHY_SUB_AWAIT_SAS_POWER) > -> sci_phy_starting_await_sas_power_substate_enter() > -> host.c: sci_controller_power_control_queue_insert() > -> phy.c: sci_phy_consume_power_handler() > -> sci_change_state(SCI_PHY_SUB_FINAL) > -> sci_change_state(SCI_PHY_SUB_FINAL) > -> sci_controller_event_completion() > -> phy.c: sci_phy_event_handler() > -> sci_phy_start_sata_link_training() > -> sci_change_state(SCI_PHY_SUB_AWAIT_SATA_POWER) > -> sci_phy_starting_await_sata_power_substate_enter > -> host.c: sci_controller_power_control_queue_insert() > -> phy.c: sci_phy_consume_power_handler() > -> sci_change_state(SCI_PHY_SUB_FINAL) > > So if someone rearranges the code later, adds new callchains, etc., it could > be missed that the context may have changed than what we assume at the > bottom. But then passing the flags everywhere is cumbersome, and all the > libsas users see little or no significant changes anyway, apart from a > couple. > The deep call chains like the one you've quoted are all within the isci Intel driver (patches #5 => #7), due to the *massive* state transitions that driver has. But as the commit logs of these three patches show, almost all of such transitions happened under atomic context anyway and GFP_ATOMIC was thus used. The GFP_KERNEL call-chains were all very simple: a workqueue, functions already calling msleep() or wait_event_timeout() two or three lines nearby, and so on. All the other libsas clients (that is, except isci) also had normal call chains that were IMHO easy to follow. Thanks, -- Ahmed S. Darwish Linutronix GmbH