Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp7387704rwl; Thu, 23 Mar 2023 03:45:44 -0700 (PDT) X-Google-Smtp-Source: AK7set85XDYb4u3lGG+G90TnUAnv2lbF3v/vzScVnl+Qo5nThNh9io6y8ppC0DMSVu9Ps1K5aP0h X-Received: by 2002:a05:6402:1844:b0:501:c4e3:9914 with SMTP id v4-20020a056402184400b00501c4e39914mr8411522edy.33.1679568344281; Thu, 23 Mar 2023 03:45:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679568344; cv=none; d=google.com; s=arc-20160816; b=lF3fvP3pXpEITBM46qFV57GpMZ+1rHGRhYmSiFioZBBN3eBMD81pRr0BKZGh1Gr4AB 4yozDZEIefQ6SyEDVA5b3glDHRW2LW9Fs9lSfJ2helmwGUMeb5b3OfD3dPT/ppMz762H WTE3aPpThKcJsXcykn/RNziZ2RAudMZvrk46cQKOqhb4zdT5qb6ZqPgAeMUPKi37jzS7 x2Y7oqz8jeeadaRihkGC2FDS+In2ItCSO9Dr742Fu32jyWQugnEaGF6/qUZceo5WylbJ CxvSssSui+mgfFozmjJQwMpJvws4YeT4cVOiGfRWT5NmDTa5p4SA4g2X8GTDDO02xqTz eGxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=x4gGfbzba1hFOh69yFSCSNrEAtDOldJBZZWSAOaH1Tk=; b=WHtC1EtI4iXrJup+KB9Jo0butBn2y22AU3xO+ykiLZ3q0KgvcsleVDPDe1Ei7ev4ue 5PQPmf4/368lg6cC++ULo92ySHJrPN5HrqufOosCZFu7MvHec06eXlEJR445TILijc+p JQoaiDKrWkgml/wXEtE4SDYy2pneJspsrMbKQetZENKNy8pXhgiApMyaV5vZd2Law5/j mXE2PPaNhxKlZZX4TPPlzJV+IoI6pm6vtMrX9d7h4tONooYr7FEAG8HMvsbK+BuJ3qXa iwk49AxoUkpa3l+q1g7zbrtKlno+Al7gcjMQf6ZgwIY8pyiRohJy4Z8Q8UWVXB0rso6b xK0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b="L9F5G/jj"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b19-20020aa7d493000000b004fc0c645ab1si19997635edr.234.2023.03.23.03.45.20; Thu, 23 Mar 2023 03:45:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b="L9F5G/jj"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231282AbjCWKnH (ORCPT + 99 others); Thu, 23 Mar 2023 06:43:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44434 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230456AbjCWKmt (ORCPT ); Thu, 23 Mar 2023 06:42:49 -0400 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2391E39B93; Thu, 23 Mar 2023 03:40:00 -0700 (PDT) Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 32N9c2jD012567; Thu, 23 Mar 2023 10:38:33 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=qcppdkim1; bh=x4gGfbzba1hFOh69yFSCSNrEAtDOldJBZZWSAOaH1Tk=; b=L9F5G/jjhnIKdp/Nx/uu5HDtA7nrpL48Q13W+cpIPOQTNLQ735zPH7cMrYmPfoCFZh9g hiVH/eBv/gYVkXX+QRY0HLykYRkovu3s61CKmoJUvcq1EDXDNNzpXwo9jckbYm1uocR7 HJn9ZXhgLwpH3ExaLUJBo3P+OR/ptidwRSBqE7fg9ag6Nduh9ygCkAMu2Gdt6V9Obu67 2EUTgajr1uAo/MBV7JeApI2vsQh5AGj8DblSWg6v3md6TVq/XDWbrPtdFoJJNcIMqKbV 85w63Fb7CJ6+x3eSVxDJIdS/64Gt00bp6HcGWeMRzti7sRV2BJY6Kb8gFFG52Ppi5UNu oA== Received: from nasanppmta04.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3pgm9x8461-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 23 Mar 2023 10:38:33 +0000 Received: from nasanex01a.na.qualcomm.com (nasanex01a.na.qualcomm.com [10.52.223.231]) by NASANPPMTA04.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 32NAcW6f015397 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 23 Mar 2023 10:38:33 GMT Received: from [192.168.143.77] (10.80.80.8) by nasanex01a.na.qualcomm.com (10.52.223.231) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Thu, 23 Mar 2023 03:38:32 -0700 Message-ID: <3d34a25b-5311-e660-a724-b1c11bbaf5fc@quicinc.com> Date: Thu, 23 Mar 2023 03:38:31 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: Re: [RFC PATCH v3 1/5] ufs: mcq: Add supporting functions for mcq abort Content-Language: en-US To: John Garry , , , , , , , , , CC: , Alim Akhtar , "James E.J. Bottomley" , Arthur Simchaev , Eric Biggers , Kiwoong Kim , open list References: <90b7b370269674fd7c0f505b59e0993c5b95a316.1679564391.git.quic_nguyenb@quicinc.com> From: "Bao D. Nguyen" In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nasanex01a.na.qualcomm.com (10.52.223.231) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: Ut5nuLZeD5l4MgNjxhop62huPm-FlNFM X-Proofpoint-ORIG-GUID: Ut5nuLZeD5l4MgNjxhop62huPm-FlNFM X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-03-22_21,2023-03-22_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 phishscore=0 mlxlogscore=999 adultscore=0 spamscore=0 impostorscore=0 priorityscore=1501 clxscore=1011 mlxscore=0 bulkscore=0 lowpriorityscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303150002 definitions=main-2303230080 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/23/2023 3:07 AM, John Garry wrote: > On 23/03/2023 09:53, Bao D. Nguyen wrote: >> +static int ufshcd_mcq_poll_register(void __iomem *reg, u32 mask, >> +            u32 val, unsigned long timeout_ms) >> +{ >> +    unsigned long timeout = jiffies + msecs_to_jiffies(timeout_ms); >> +    int err = 0; >> + >> +    /* ignore bits that we don't intend to wait on */ >> +    val = val & mask; >> + >> +    while ((readl(reg) & mask) != val) { >> +        usleep_range(10, 50); >> +        if (time_after(jiffies, timeout)) { >> +            err = -ETIMEDOUT; >> +            break; >> +        } > > This looks just like readl_poll_timeout() I will make the change in the next revision. Thanks John. > >> +    } >> + >> +    return err; >> +} >