Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp2103557pxb; Mon, 11 Jan 2021 00:28:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJyjPC9Uh1fxqGsGK0+uWj3QhiR/J8htQIj+3xjRSlxRH7RcFpTP/+QU/ULGAiN1jetgBHcj X-Received: by 2002:a17:906:3953:: with SMTP id g19mr9983323eje.429.1610353690165; Mon, 11 Jan 2021 00:28:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610353690; cv=none; d=google.com; s=arc-20160816; b=sL8esVjhFwMIkiZS+46NPZPhdlq1/GEEZIS/oZD2cBb1URw42j0ObqKNXtlEH+VCjE LOOg5OtjM2BWznSHa3M685i02T7pe1dQSuFoa99X2vzlO72R6Yt6oqAC5eLcmftyn6Xd U8+lbqyO2QFkbEwEsb00oOmT32fgahZxmIetf1nZBu78Hg5V6Z8+LUy1PGl5qYTaN3N6 rl+4H0ZQ4tHZiax4LBoQL39KQbyVU+e8Lm7qbXqq+ZpJPl9Exl1A21/aA2SIz15HUml6 iPUxWsqd7HErVmxfiJRNrEVtsDaDavpIotWjSWLNrsrERJOeZc9Mq+Cm/inmx4yGDpSC +BMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id :dkim-signature; bh=CSC3aRVO5ZxUUnNQTzCtcTLTQwLce1l3eFEfXxrgFOw=; b=jxFBDLbJ9ERJlDrZ32ZBYoMOGNc52TukL4AleuwYFmLJRqmeEHJJoL8vbxYLo8rwUX MaAX4/0BjcdDa8Ic15oRodymuPlYCdfdSqSvVIE4XC+HKrhjbW5WpOUOKcNuqF1QYrAF 8Ah5HdsDNTBe7FU0+g5rFsMSO7rj+jDJ45MPHHC/sYY8CegtOodTKp+22FfmTavF+RGb JNU/NcwD75seOZAXoZGQzeCAMd4j5VQRwd2pXFwrrQPfKuNtc3Uy2xPlD+mHlU92Juo9 ZofnYAZbvTgfsnR7vouICVKRaB3I7ohnThyfqbwXzNPiExX2FDNibmp6CYqe99pbjVB2 uuMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=A2QvxSj9; 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=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b14si6548730edw.332.2021.01.11.00.27.47; Mon, 11 Jan 2021 00:28:10 -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=@gmail.com header.s=20161025 header.b=A2QvxSj9; 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=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728006AbhAKI0f (ORCPT + 99 others); Mon, 11 Jan 2021 03:26:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44304 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727841AbhAKI0f (ORCPT ); Mon, 11 Jan 2021 03:26:35 -0500 Received: from mail-ej1-x632.google.com (mail-ej1-x632.google.com [IPv6:2a00:1450:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 04200C061786; Mon, 11 Jan 2021 00:25:55 -0800 (PST) Received: by mail-ej1-x632.google.com with SMTP id lt17so23523066ejb.3; Mon, 11 Jan 2021 00:25:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:subject:from:to:cc:date:in-reply-to:references :mime-version:content-transfer-encoding; bh=CSC3aRVO5ZxUUnNQTzCtcTLTQwLce1l3eFEfXxrgFOw=; b=A2QvxSj9cFoYe4LJJ0kyiWaOHT0y7JE2caRSNBaF8CGkO1ZiOerMPSDmrdxmEych4L pSZ4tWSYaaZcD3t33/VdIDRg8RAQ7zDYgoKg4K/dJSAe0v/Xvf1elYapiTEo1FuzhYfn EoyoKZHQtEyzhHAG+7eyakLFamulxVJPKw107KnhqL+PmnLeV+IDKB5X93MghGuHDcD+ f+zyX+2eJM8E4WN5GkJ5o9Mmv+E5SBZP1Xw0QgBkNBXFbQB7UiuHdrj23sOvvwtw1uw+ /1Lcz0xsuoue3xeC1weF6AXtG2WLUuGusAKLGKAHdbsziJWIpfcijqlPXo3J/3bUX99N YNPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:mime-version:content-transfer-encoding; bh=CSC3aRVO5ZxUUnNQTzCtcTLTQwLce1l3eFEfXxrgFOw=; b=JgWK4hCJTY5fs/0TVzfrb7+Guhnhr9DhriGXh+/YX5LTNsFqZ3L5lJ6O2Va6qlXtE4 DBIw9ClCMOeEZm1XbKle/8gN3YkNf9wNw6tToYG0+iQke91U+RNjvy77hMZP9LtIsSk+ vTWIPvrtTmAq841zPQODB34j5Jlai7prYqHPH7uec2q/YmJHDSTiXTDaXBK5razVqtPj +D85MnWkUUg+BwKtAlBkAdt4xnQghS2OWwaGO6OHoNB/5KmjiIqEVgHVbrRSneI3Rqtb ysOqcp6EWobtiTqGus15dc4s2czPysMHw1A3DfUaFQ/OYW5kYX/88CrUnQpeeRRTKIVP tYlw== X-Gm-Message-State: AOAM531afnJx3h3NaCf0cBne/WqTnbYkiHUNRbtfUQvrmvReoApcP3ue Wx9Qt9A+INval3p2WhQti6A= X-Received: by 2002:a17:907:d8e:: with SMTP id go14mr10191370ejc.472.1610353553680; Mon, 11 Jan 2021 00:25:53 -0800 (PST) Received: from ubuntu-laptop (ip5f5bfcff.dynamic.kabel-deutschland.de. [95.91.252.255]) by smtp.googlemail.com with ESMTPSA id dx7sm6737231ejb.120.2021.01.11.00.25.52 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 11 Jan 2021 00:25:53 -0800 (PST) Message-ID: <4d85d61319e6991dda75a68cb466c86c8fea30e4.camel@gmail.com> Subject: Re: [PATCH 2/2] scsi: ufs: Protect PM ops and err_handler from user access through sysfs From: Bean Huo To: Can Guo Cc: asutoshd@codeaurora.org, nguyenb@codeaurora.org, hongwus@codeaurora.org, ziqichen@codeaurora.org, rnayak@codeaurora.org, linux-scsi@vger.kernel.org, kernel-team@android.com, saravanak@google.com, salyzyn@google.com, Alim Akhtar , Avri Altman , "James E.J. Bottomley" , "Martin K. Petersen" , Stanley Chu , Bean Huo , Nitin Rawat , Adrian Hunter , Bart Van Assche , Satya Tangirala , open list Date: Mon, 11 Jan 2021 09:25:52 +0100 In-Reply-To: <4d1ad38dbe0235020183e474a3610294@codeaurora.org> References: <1609595975-12219-1-git-send-email-cang@codeaurora.org> <1609595975-12219-3-git-send-email-cang@codeaurora.org> <0ad818b10110c4c383afbc2c39235a4f7f17f4c7.camel@gmail.com> <4d1ad38dbe0235020183e474a3610294@codeaurora.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2021-01-11 at 09:30 +0800, Can Guo wrote: > > > +static inline bool ufshcd_is_sysfs_allowed(struct ufs_hba *hba) > > > +{ > > > + return !hba->shutting_down; > > > +} > > > + > > > > > > Can, > > > > Instead adding new shutting_down flag, can we use availible > > variable > > system_state? > > > > Thanks, > > Bean > > Hi Bean, > > I prefer the flag shutting_down, it tells us whether > ufshcd_shutdown() > has been invoked or not. It comes handy when debug some system crash > issues caused by UFS during reboot/shutdown tests. system_state is > too > wide in this case. > It is only a suggestion, and others LLD use system_state, you prefer adding new flags. Bean > Thanks, > Can Guo.