Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3943240pxj; Tue, 8 Jun 2021 02:33:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx6qm+vgvApJkW0+Nx0wabvLm2YIUU0fv46pHliDy5d+U+1v+tGcinaeg/z7nJi/vhqKYPX X-Received: by 2002:aa7:c654:: with SMTP id z20mr24292148edr.26.1623144833251; Tue, 08 Jun 2021 02:33:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623144833; cv=none; d=google.com; s=arc-20160816; b=kxdCokxKWb3Bh7GBkrGPQ063PcX5Zjq91H8JVC1dTyI74HjIkXJCH5/OdO8Um+JyQ3 qwtYxF2i6P5fC4a3g+XrKiaFcRmc8hBvhaGr23O2cRrK4DljMpdhC/VfizdsZ8ueiQoT iCeDq62zE0SXwhEG5GSledmcjuZX0kiuP9nUa1PTnfNbbnglLcgYh8HhXF098pGJMnHE K/n++wF+sHub7QoN1lHeiTUDHiul86bdD+xkG5YvenSj3W6pj9rfPObMHDPT/c8ZbJeF nuGtc/GBWUoF4w2HtWrX4gGePHYHcoRPxRiNfpoY2ox16MGXce8qgUTcZZAsOkWfKuM7 k9aw== 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:organization :from:references:cc:to:subject:dkim-signature; bh=0nP0gHTe3x9dAdv/JFwqsfNFClBUXlKdSohrAmZVKnU=; b=cJE5LzYYnm8IcvpDWLFvu6s8vQRlv8OCJJvDwGdINL5DBkpiiluhygo8aX3YMAGcUs xqRF/0BCcKfA4XC5ZCRP9jscpYMFXlj2Qve9TaqidWga5K+LKJIC4t13cSq1U4FHrF/P 9KqCJzF1MSna3IATPxZVR/lhPTGp14UFO64uHn08ay3qIp+9hSOZbLoz1GqJz5H1u0se eL9jHGk1HBQoJYX+TdPAh6eJ//xNAmX8BhjE1JeU3tQ40N9q7T3UtI17/xOSMCLewfOn g2/5EHnU45uCk392kCWKnCVTBzopipZlQUlHtTB/3ynfyTZodRer6uWGP6wRxNzDcJ29 FYPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=eeCPim92; 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 19si14783791ejx.529.2021.06.08.02.33.29; Tue, 08 Jun 2021 02:33:53 -0700 (PDT) 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=eeCPim92; 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 S230398AbhFHJdt (ORCPT + 99 others); Tue, 8 Jun 2021 05:33:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50002 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230306AbhFHJdt (ORCPT ); Tue, 8 Jun 2021 05:33:49 -0400 Received: from mail-lj1-x232.google.com (mail-lj1-x232.google.com [IPv6:2a00:1450:4864:20::232]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 87A51C061574; Tue, 8 Jun 2021 02:31:56 -0700 (PDT) Received: by mail-lj1-x232.google.com with SMTP id r14so6955478ljd.10; Tue, 08 Jun 2021 02:31:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:organization:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=0nP0gHTe3x9dAdv/JFwqsfNFClBUXlKdSohrAmZVKnU=; b=eeCPim92wu2BCXwdt2pnN6t8X7cDLh9Pm1NYGYdr8AuLW1/HVnjqseyjbMFYujURRK PEV0ckxktSm6QKfp/WZamYOH7IUGadjjRR1pivqp1lZrZEVM7JFaNeG7XqayN7hQSLDA V4i/iJy2sQXe0FHzPdNhkzQ5hkgV7q4VyRlZJAsjOB/RaU/4AGNmNj/pCkkvU6RthoLb 33S952Du/X1HPAh6TO+cp8+IH7rHwcewnOc/976EZBznL5/xK17ekHC6aOw/mNUW0NxV 4WxgQWEmIImA2MdaNPD1ICd4Ob0F0uLG0hFOE9HYIU5c2USsJG0mPHeOk5YcQUOAIGNg ar4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:organization :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=0nP0gHTe3x9dAdv/JFwqsfNFClBUXlKdSohrAmZVKnU=; b=Mww55pp0zVO5dM3rXvFIFHKqTPn7AL5HcCDsUVW7bT+CzqJ9BPR/2xl2f2A0vP5/0N v+C+s0vVgh89lDRiPG5cKvuwawPzW46rMNJvAy3fE3Jx6bMM2js1eFVXUZpI0HPZn1O6 nkUz53yLJamHDVkYvj/O2R4QM5hh9j/aGSc3P3uDW5jVT7QVZQW+90NRljxJFDO/Av3R BdkRbxYJNpjTu2W7VdULyQDz3WdV6FvNtmZa92ek8lrKGSs3Sz5EUrhrBzWWMIjJ5Z0T q7DG+ONi+RpDHvkpcdLUpkAlLsA/F33kyEzToFPFMVuyr77IxDib8/2ftFUIUjAntjce yhOg== X-Gm-Message-State: AOAM532XZ2d4AJd7oOAE4nw9Wdjh743gRlLsAYbtbszTfPm2JZAT79AH PjV0MTHmC4SXrgkbpPgU6b6LGeh8/5g= X-Received: by 2002:a2e:97c9:: with SMTP id m9mr11980520ljj.186.1623144714659; Tue, 08 Jun 2021 02:31:54 -0700 (PDT) Received: from [192.168.1.100] ([31.173.86.68]) by smtp.gmail.com with ESMTPSA id p36sm1825153lfa.227.2021.06.08.02.31.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 08 Jun 2021 02:31:54 -0700 (PDT) Subject: Re: [RFC PATCH 2/7] usb: typec: ucsi: Don't stop alt mode registration on busy condition To: Heikki Krogerus , Benjamin Berg Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org References: <20210607131442.20121-1-heikki.krogerus@linux.intel.com> <20210607131442.20121-3-heikki.krogerus@linux.intel.com> From: Sergei Shtylyov Organization: Brain-dead Software Message-ID: <2f4bf248-cd27-623d-5984-fafa931404fa@gmail.com> Date: Tue, 8 Jun 2021 12:31:45 +0300 User-Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210607131442.20121-3-heikki.krogerus@linux.intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello! On 07.06.2021 16:14, Heikki Krogerus wrote: > If the PPM tells it's busy, we can now simply try again. > > Signed-off-by: Heikki Krogerus > --- > drivers/usb/typec/ucsi/ucsi.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c > index 366c8a468bc18..a8e0e31dcddf5 100644 > --- a/drivers/usb/typec/ucsi/ucsi.c > +++ b/drivers/usb/typec/ucsi/ucsi.c > @@ -437,8 +437,11 @@ static int ucsi_register_altmodes(struct ucsi_connector *con, u8 recipient) > command |= UCSI_GET_ALTMODE_CONNECTOR_NUMBER(con->num); > command |= UCSI_GET_ALTMODE_OFFSET(i); > len = ucsi_send_command(con->ucsi, command, alt, sizeof(alt)); Could insert your check here, to reduce the indentation... > - if (len <= 0) > + if (len <= 0) { > + if (len == -EBUSY) > + continue; > return len; > + } > > /* > * This code is requesting one alt mode at a time, but some PPMs MBR, Sergei