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 X-Spam-Level: X-Spam-Status: No, score=-10.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D64F6C56202 for ; Thu, 26 Nov 2020 14:11:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7B9B22053B for ; Thu, 26 Nov 2020 14:11:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390350AbgKZOLJ (ORCPT ); Thu, 26 Nov 2020 09:11:09 -0500 Received: from frasgout.his.huawei.com ([185.176.79.56]:2165 "EHLO frasgout.his.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390344AbgKZOLJ (ORCPT ); Thu, 26 Nov 2020 09:11:09 -0500 Received: from fraeml702-chm.china.huawei.com (unknown [172.18.147.200]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4Chfl467S7z67JM9; Thu, 26 Nov 2020 22:09:20 +0800 (CST) Received: from lhreml724-chm.china.huawei.com (10.201.108.75) by fraeml702-chm.china.huawei.com (10.206.15.51) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2106.2; Thu, 26 Nov 2020 15:11:07 +0100 Received: from [10.210.172.213] (10.210.172.213) by lhreml724-chm.china.huawei.com (10.201.108.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1913.5; Thu, 26 Nov 2020 14:11:05 +0000 Subject: Re: [PATCH 02/14] scsi: hisi_sas: Remove preemptible(). To: Sebastian Andrzej Siewior , CC: Finn Thain , , Hannes Reinecke , Jack Wang , , Manish Rangankar , Michael Schmitz , , Nilesh Javali , Sathya Prakash , Sreekanth Reddy , Suganath Prabu Subramani , Vikram Auradkar , Xiang Chen , Xiaofei Tan , "James E . J . Bottomley" , "Martin K . Petersen" , Thomas Gleixner , "Ahmed S . Darwish" References: <20201126132952.2287996-1-bigeasy@linutronix.de> <20201126132952.2287996-3-bigeasy@linutronix.de> From: John Garry Message-ID: Date: Thu, 26 Nov 2020 14:10:43 +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: <20201126132952.2287996-3-bigeasy@linutronix.de> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.210.172.213] X-ClientProxiedBy: lhreml707-chm.china.huawei.com (10.201.108.56) To lhreml724-chm.china.huawei.com (10.201.108.75) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-m68k@vger.kernel.org On 26/11/2020 13:29, Sebastian Andrzej Siewior wrote: > From: "Ahmed S. Darwish" > > hisi_sas_task_exec() uses preemptible() to see if it's safe to block. > This does not work for CONFIG_PREEMPT_COUNT=n kernels in which > preemptible() always returns 0. > > The problem is masked when enabling some of the common Kconfig.debug > options (like CONFIG_DEBUG_ATOMIC_SLEEP), as they implicitly enable the > preemption counter. > > In general, driver leaf functions should not make logic decisions based > on the context they're called from. The caller should be the entity > responsible for explicitly indicating context. > > Since hisi_sas_task_exec() already has a gfp_t flags parameter, use it > as the explicit context marker. > > Fixes: 214e702d4b70 ("scsi: hisi_sas: Adjust task reject period during host reset") > Fixes: 550c0d89d52d ("scsi: hisi_sas: Replace in_softirq() check in hisi_sas_task_exec()") > Signed-off-by: Ahmed S. Darwish > Signed-off-by: Sebastian Andrzej Siewior > Cc: Xiaofei Tan > Cc: Xiang Chen > Cc: John Garry Acked-by: John Garry