Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3250967pxj; Mon, 7 Jun 2021 06:16:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwpeE94ld0Zp4PyKlva6E5ExkQbrTfPDTbyo9WWOLqtoyaDncxXX4uhg2ZpnlL6TIsjPfPj X-Received: by 2002:aa7:cfc7:: with SMTP id r7mr16795545edy.13.1623071779039; Mon, 07 Jun 2021 06:16:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623071779; cv=none; d=google.com; s=arc-20160816; b=0xyKymwlprAHE+A5U8H+xjjTpROS9gc1bx1S4mf3i4Ya1no01F+pxNyCCx5zetAluR 4KIeeeEGiCkq9yv99SItOVDVztecoIMhC7BHeFMYa5SunOCHnJz3uGMdrHT8w+Rr8Qsh r6OKAtbQ9i3JCSDR+fQlafMlY9v8/JHnK/dk/E55RwgWejmIOFZkB6uAw1Rp5vbFlHtH 7JmR22O7RVyhjA5+dzljD4hQSS0QKNrLmNV5biq58shwPybbUPi0ORIWCWJEfa6gK8RE AncLGnowEALAGuMw6uEvz3elYml4RpDhjNS588zxWXXshSwrY33f01INLEXHbCzuiQI4 fm5Q== 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:message-id:date:subject:cc:to:from :ironport-sdr:ironport-sdr; bh=RK1c7vC2lCeu57bsafit0v56MJkUZvH7RH1RiyhIqvo=; b=ZH7zsPdVxR914eZCWnRbwvkAJEd0XnO2c0mo8ymKHHsHOeTfr/u0QSbs8f8jEOC5CG W7kGisNHYjqBTCYipjeI+t8QZj2oTz1mBLnkahxSWn7+dTAleQlt+KFFzdfmkoZd93AF cA0PNfwVGavWkSmNXR+ApyFCfMOQUk4qqSOmXk/k2YQ6znxOx2NQS17AkcTK3fwtztlj D3a1fFlgBvKUdVGrt1hdRY5fLjD07yFYKdywFlYXbfZdikX/lIVN9HdrGVS/mFbnA3hN rDEw3Tww56wotcWGMeCXqASf6pfygunjUmfDcSANvUfGAdU0w5fzPSZmIRYpxd5gXbEQ Cozw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ba10si4001761edb.344.2021.06.07.06.15.56; Mon, 07 Jun 2021 06:16:19 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230311AbhFGNQP (ORCPT + 99 others); Mon, 7 Jun 2021 09:16:15 -0400 Received: from mga06.intel.com ([134.134.136.31]:17596 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230286AbhFGNQP (ORCPT ); Mon, 7 Jun 2021 09:16:15 -0400 IronPort-SDR: tBavJunpLrIJaTDUFzwAqPVD9WU12Nlr3q/LBHCYUyA1e88O+w+a0R3QywmAO4XB6NW3PRHdFE eAUKRS/85Z4Q== X-IronPort-AV: E=McAfee;i="6200,9189,10008"; a="265773975" X-IronPort-AV: E=Sophos;i="5.83,255,1616482800"; d="scan'208";a="265773975" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Jun 2021 06:14:23 -0700 IronPort-SDR: Rukd6daE8+rrbDufK/dGwRtteilroJL0Sg0stGAun2qE5Ec665Q2/CGRi9qJMviz+NqAK1kSo5 3qD2rzxnjxFg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.83,255,1616482800"; d="scan'208";a="551881872" Received: from black.fi.intel.com (HELO black.fi.intel.com.) ([10.237.72.28]) by fmsmga001.fm.intel.com with ESMTP; 07 Jun 2021 06:14:22 -0700 From: Heikki Krogerus To: Benjamin Berg Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH 2/7] usb: typec: ucsi: Don't stop alt mode registration on busy condition Date: Mon, 7 Jun 2021 16:14:37 +0300 Message-Id: <20210607131442.20121-3-heikki.krogerus@linux.intel.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210607131442.20121-1-heikki.krogerus@linux.intel.com> References: <20210607131442.20121-1-heikki.krogerus@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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)); - 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 -- 2.30.2