Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2801768pxu; Sat, 19 Dec 2020 02:37:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJwO9FrTfjk6NoywuZ2EbQm/cEvSxC+A+xPF5oP0w5zRnyT8OWST3sIS71zaIskweJ03eKy+ X-Received: by 2002:a17:907:1004:: with SMTP id ox4mr7816368ejb.240.1608374230536; Sat, 19 Dec 2020 02:37:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608374230; cv=none; d=google.com; s=arc-20160816; b=rAgQHd5Y897Ls5qVWPxNfr1tZDBIVtTbDSfam63RNXwSf8NBtSYBk73V7UFxYLKSq4 9PnAMtFE2OnVwT7zm7fOyG2hRTMgrIPHchsDTqrcLhnAKUVk28GsimU3T3V11pEgcY9c bfgbgkneDTq6v9+U2r6zTuMg6VveH1sW2nON2I6FZEbygjLNNtoYQnszk9WgK+Sz3zsp AWy1sU/r+oo94RJcBpD367oe/gx6er+u0Il+5aHUniqaOMckdKj6OVb8QMDnq6HLT1aC I8JdTC4OqvoRvPU6QhRTl7EZn4uptgXrDQ1+T2OwAkGrq+OEDMR6JK8RZQGayZoOyOkt ekcg== 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:date; bh=k49V7f0SSc0FDF/Ox+WrGXtLEyeL+WgofC1UkK43peQ=; b=IdvjjpGrEEO+FzLwGEU6ujMIfsEmcpg/Kl7YN4cMuGSojH6puIA581JwRThUG2MWke YQeiQ6TGbi8SZOmW38B/gE0eCf9m0cpRFi0K414u4dzcdPttFHNDlKZsnLLyuFnLAUPO 84Tz/rx1i6re+pRDL1tR4vDlpu3hx5tqmVHWCYcCsetu9BNP3zU/3qEsoM7BFapM4b12 szs718PaxitChxZKWtoVStE4eTqrczYmZsjZArsO1r9Qi5+8srpRhOTMvp4Me1OtwiJ3 c4ZNd7JzJ9llYg/opa2wPmNGFGNP4uy4oeQCh29xFm/UG26bOOiitnjn5dU7tZC3cQtB ZDKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="S9/o0I90"; 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=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o7si7692495edq.20.2020.12.19.02.36.47; Sat, 19 Dec 2020 02:37: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=@linuxfoundation.org header.s=korg header.b="S9/o0I90"; 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=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726490AbgLSKgB (ORCPT + 99 others); Sat, 19 Dec 2020 05:36:01 -0500 Received: from mail.kernel.org ([198.145.29.99]:59510 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726439AbgLSKgB (ORCPT ); Sat, 19 Dec 2020 05:36:01 -0500 Date: Sat, 19 Dec 2020 11:36:40 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1608374120; bh=Avl70r/8VtpPOV5EvV5bOYpuJ7voLpyxA8PcyZcJzGU=; h=From:To:Cc:Subject:References:In-Reply-To:From; b=S9/o0I9080BCkI6Npb4SHVxYFW1s+7lhvCsVuGORINNmm6GC01noqodsfKaoI6eqR 3PETyvxbVR9dTMGYD09Q/WqQBzznfJWhSoIvQ3D25yYfvzrNv2KdcVZFvRxxDi6JN7 KHTP/sj1ZD2aVG77kRpBeHs6JP+V/IHCTnJgA9ss= From: Greg KH To: Daejun Park Cc: "avri.altman@wdc.com" , "jejb@linux.ibm.com" , "martin.petersen@oracle.com" , "asutoshd@codeaurora.org" , "stanley.chu@mediatek.com" , "cang@codeaurora.org" , "huobean@gmail.com" , "bvanassche@acm.org" , ALIM AKHTAR , "linux-scsi@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Sung-Jun Park , yongmyung lee , Jinyoung CHOI , Adel Choi , BoRam Shin , SEUNGUK SHIN Subject: Re: [PATCH v16 1/3] scsi: ufs: Introduce HPB feature Message-ID: References: <20201219091802epcms2p2c86f7ae2e81aa015702572a8ef180dae@epcms2p2> <20201219091847epcms2p7afeebd03c47eed0b65f89375a881233e@epcms2p7> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201219091847epcms2p7afeebd03c47eed0b65f89375a881233e@epcms2p7> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Dec 19, 2020 at 06:18:47PM +0900, Daejun Park wrote: > +static int ufshpb_get_state(struct ufshpb_lu *hpb) > +{ > + return atomic_read(&hpb->hpb_state); > +} > + > +static void ufshpb_set_state(struct ufshpb_lu *hpb, int state) > +{ > + atomic_set(&hpb->hpb_state, state); > +} You have a lock for the state, and yet the state is an atomic variable and you do not use the lock here at all. You don't use the lock at all infact... So either the lock needs to be dropped, or you need to use the lock and make the state a normal variable please. > +static void ufshpb_hpb_lu_prepared(struct ufs_hba *hba) > +{ > + struct ufshpb_lu *hpb; > + struct scsi_device *sdev; > + bool init_success; > + > + init_success = !ufshpb_check_hpb_reset_query(hba); > + > + shost_for_each_device(sdev, hba->host) { > + hpb = sdev->hostdata; > + if (!hpb) > + continue; > + > + if (init_success) { > + dev_info(hba->dev, "set state to present\n"); Why be noisy? Why does userspace need to see this all the time, shouldn't only errors be printing something? thanks, greg k-h