Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp139423pxb; Thu, 14 Jan 2021 01:55:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJyhCRSdtFYFAytx/dlJDMapkO2pM2SGdE/WX6CRrifXa4s6pVR0/wEjTCTBevf8uq8+JY1W X-Received: by 2002:a05:6402:8d5:: with SMTP id d21mr5256719edz.57.1610618158888; Thu, 14 Jan 2021 01:55:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610618158; cv=none; d=google.com; s=arc-20160816; b=W46SsX8u0OnT8KdMnS2+m2Cvif3lnA0MH/tz40UA2me+gz3VIm4iPHy4jkAg9qZDL9 fa5Eikt6P+dZ0e4jANw6dVj1AxMzNSYFL1WVYNJ+9+qDRs7AJfONPQUn/EFKxL22J01+ SNsTOdio9nMdYUNRwTPmphBcL7eGevfJ4DByOnPNwT5M/cZNNLJHGs9tWeCQQiYBaF8q SpMKAoe6w3FRZR45J3FO0hVNCDSrC/6XsWWmADJbP7KQ+LU4/HY2GtYIhbGkumXX5N+s 4XC+N8PmgvwMhkbW6cp1gfYDDGZ22N7uDKQRifz3upcY35lGc7KHYQXp+JIXnA5lMlKf xtBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=njJYIGtoCenucoPcr5ZuZFUAn2BLBVAI6xebe8cWm6o=; b=EKPHIxuYU5+J2BO4MeZDd00xUlltZFwY/70BTGDZWSuE2MIwYg3+fKfbivBMvfeTWj phNInunurDqO8wVYoXTOxySWgydKE5l32vyQ84+8CG0qvwZ8yQAtYvoMXViFKNNyU9JJ q1HYzT/vQq2lgDvQP2a10H32AJwnKDLHmDuogx4VS1Hg+wCyN5xu9jB9xYgUqPGqGfHz Th4WJcUcD4juPhFq+KCX9v82HSQgX6EhIlROBUwV1jSd57UtWysSMkwPZ0SAWBHlWpqW lwt5QDLrTctvjiIasQZkRS7FnySxuKIf05io5/DauvI0SXmXcBuqSBw6FchW3X5DFfXS f06g== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p15si806129eja.205.2021.01.14.01.55.34; Thu, 14 Jan 2021 01:55:58 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728317AbhANJx3 (ORCPT + 99 others); Thu, 14 Jan 2021 04:53:29 -0500 Received: from frasgout.his.huawei.com ([185.176.79.56]:2342 "EHLO frasgout.his.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728182AbhANJx2 (ORCPT ); Thu, 14 Jan 2021 04:53:28 -0500 Received: from fraeml712-chm.china.huawei.com (unknown [172.18.147.226]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4DGffy30TCz67ZsW; Thu, 14 Jan 2021 17:49:46 +0800 (CST) Received: from lhreml724-chm.china.huawei.com (10.201.108.75) by fraeml712-chm.china.huawei.com (10.206.15.61) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Thu, 14 Jan 2021 10:52:46 +0100 Received: from [10.210.171.141] (10.210.171.141) by lhreml724-chm.china.huawei.com (10.201.108.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Thu, 14 Jan 2021 09:52:45 +0000 Subject: Re: [PATCH v2 00/19] scsi: libsas: Remove in_interrupt() check To: "Ahmed S. Darwish" CC: "James E.J. Bottomley" , "Martin K. Petersen" , Jason Yan , Daniel Wagner , Artur Paszkiewicz , Jack Wang , , LKML , Thomas Gleixner , "Sebastian A. Siewior" References: <20210112110647.627783-1-a.darwish@linutronix.de> <8683f401-29b6-4067-af51-7b518ad3a10f@huawei.com> From: John Garry Message-ID: <20e1034c-98af-a000-65ed-ae5f0e7a758f@huawei.com> Date: Thu, 14 Jan 2021 09:51:35 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.1.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.210.171.141] X-ClientProxiedBy: lhreml714-chm.china.huawei.com (10.201.108.65) To lhreml724-chm.china.huawei.com (10.201.108.75) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/01/2021 17:33, Ahmed S. Darwish wrote: > 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. To me, the series looks fine. Well, the end result - I didn't go through patch by patch. So: Reviewed-by: John Garry I'm still hoping some guys are testing a bit for me, but I'll let you know if any problem. As an aside, your analysis showed some quite poor usage of spinlocks in some drivers, specifically grabbing a lock and then calling into a depth of 3 or 4 functions. Thanks, John