Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp2305299rdb; Fri, 8 Dec 2023 04:38:18 -0800 (PST) X-Google-Smtp-Source: AGHT+IGSc2h1X0rU3ZtAjbuw/QX4ZYdRk3Kv+OwS6Hj52BH/iSxeXynim4LrwAbAiWhHiKppt486 X-Received: by 2002:a05:6a20:6a0d:b0:190:22f3:caa3 with SMTP id p13-20020a056a206a0d00b0019022f3caa3mr1316266pzk.29.1702039097794; Fri, 08 Dec 2023 04:38:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702039097; cv=none; d=google.com; s=arc-20160816; b=poH2qp/I634znL5WNTnvJ/BjF+yqovQW5IXRr6IRwY2ODi/8iffqFWZXJ8X2yNuxZR HlKCrRRvuv1ti6l0Fk2LtyYc9XgUFIVAs3Prim4LxMVXLD4eqjiKH4oW8Fqqtuw/pbKL tbQYiaHWR+Nfhxmmo4rOAR6+QVdIMyjNK8gWQQu+1mpWEadTbJk/dYS7G18ZxHtpY77F 6zQWWFcty9EgSD7zHsRGb02RKyUMxGjhtezo/EQa/Iw50TB4Pq6M070WLVaJ1urZBlkq 0KjY5+mVWnhRrOMUintvR+t4pIFFlmu8LU4CDVbqXt3X/0UwPXr0MMAI2o1LMowi5Ajg wxbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=IR7p3VCuqTrXdfqqAHl0q0Bm2x8PVy01TiFzisyyuoQ=; fh=+5JkKWm3wbSEXQNP7qA9k/IPUTpG36q0NZMRwO+gaYU=; b=ERBINfnVYaur37c22juWvqLJrQMtxi+Xu78t0d4pDvRmpB55P55uASIZfGAEqH+8wC WORSN+rDiLVff1hWRkSbGLvFeZ+hp4QDGnX7l5r9eDyxQbQuoxhkI0lsp2GO79bZjIBL vty7EnTrrh4cUqXPOwTuwh5usd4rHr3AjwfX9gMCyC/3HynofcUWPxDgjxuAhhK0sTG7 z/zr5Wlf6vjruB3umTB3pwMmS9ecSXcijie/m0YoYt9QPzzM41P3Q/+JXoqNRsUmFpJ9 bonjOdAIAK0RwngExRJjju1gK1xbQnd2/fkaecmamtbK2KZfjt2d0UwD2crKJ7EMJLxG vtNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=U3xKEXqq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id bd9-20020a056a00278900b006cc0288a7basi1506900pfb.33.2023.12.08.04.38.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Dec 2023 04:38:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=U3xKEXqq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id F040D807E65A; Fri, 8 Dec 2023 04:38:14 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233450AbjLHMh7 (ORCPT + 99 others); Fri, 8 Dec 2023 07:37:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39724 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232504AbjLHMh6 (ORCPT ); Fri, 8 Dec 2023 07:37:58 -0500 Received: from mail-yw1-x1132.google.com (mail-yw1-x1132.google.com [IPv6:2607:f8b0:4864:20::1132]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E3C8A1989 for ; Fri, 8 Dec 2023 04:38:03 -0800 (PST) Received: by mail-yw1-x1132.google.com with SMTP id 00721157ae682-5d8ddcc433fso16988147b3.1 for ; Fri, 08 Dec 2023 04:38:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1702039083; x=1702643883; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=IR7p3VCuqTrXdfqqAHl0q0Bm2x8PVy01TiFzisyyuoQ=; b=U3xKEXqqOqr8kYcSF8ySZC1idHPI678Z8Hv6U2cYF+aOvzbHT7nVWHGXY4w0C5Lmqd jVK2iC42/uQf5jGO3daHIizo7iBfhTpBllT9GD2WuSNJYJHJO17YopQd4l3tTeEpBKg2 j8oThaJ48fgdN75HWqiPEsXO9N04Wjr2UtvuCqpEocQPOFku5PlVT+I3M0tehzNlyeuK 225f35ntPlfnqeCOWQQFJ3L3PQB994R80H37DUA6hwjhjwPnXOSxKgEam0KvlPmjcvkb Q1g+5DJx7LJUZndgHJBJKu9QEG9pdTehTZxIaVm4Ehrly7lRkT3bK52HTrAkxgEev/yE ymUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702039083; x=1702643883; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=IR7p3VCuqTrXdfqqAHl0q0Bm2x8PVy01TiFzisyyuoQ=; b=nc0LIad4AkmrYw3+5OtMxpwGQZo6nafRCYXeRucR6AbdXuOZjMy+UNMnksDZLxZ/qJ CZxvJCmqve4eh+clEGQL4YAr1ggcWO35bAmz9I4OZvDhZr4hnIjAOiPzOM32kkSu9IFz oSTO7JYwnYJP0595X94L+U5KKK8PXM/GYdDiLzC/ChuG711hcafxyMKxc3apfJ2+1xTh J0/p9Wi7TdNEGxvnXvs5L9k/aIgmaBK/donBmQTB3SnSoOHUo5qQkyE9gMOcx3dFkjal bGDBB31+ATOJ3gsJVRCrj+YhNQhdgppQ1INPcTvm1cLvITCoGuYfI74ZMeu2yomhb10+ SQbg== X-Gm-Message-State: AOJu0YxZP2QUzucCexa+mMRZHuxxE7gM5gcNEm8mT1iLvgSxPtRs5ST/ EVZUs1CY+z34phzeGPM7/f2n4q15xf/e84s7iQdAAQ== X-Received: by 2002:a05:690c:fc2:b0:5d7:1940:8dd9 with SMTP id dg2-20020a05690c0fc200b005d719408dd9mr3633060ywb.64.1702039083054; Fri, 08 Dec 2023 04:38:03 -0800 (PST) MIME-Version: 1.0 References: <20231208123603.29957-1-johan+linaro@kernel.org> In-Reply-To: <20231208123603.29957-1-johan+linaro@kernel.org> From: Dmitry Baryshkov Date: Fri, 8 Dec 2023 14:37:52 +0200 Message-ID: Subject: Re: [PATCH] usb: typec: ucsi: fix gpio-based orientation detection To: Johan Hovold Cc: Heikki Krogerus , Greg Kroah-Hartman , Neil Armstrong , Konrad Dybcio , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Fri, 08 Dec 2023 04:38:15 -0800 (PST) On Fri, 8 Dec 2023 at 14:37, Johan Hovold wrote: > > Fix the recently added connector sanity check which was off by one and > prevented orientation notifications from being handled correctly for the > second port when using GPIOs to determine orientation. > > Fixes: c6165ed2f425 ("usb: ucsi: glink: use the connector orientation GPIO to provide switch events") > Cc: Neil Armstrong > Signed-off-by: Johan Hovold Reviewed-by: Dmitry Baryshkov > --- > > I found this one through inspection when skimming the driver. > > Johan > > > drivers/usb/typec/ucsi/ucsi_glink.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/usb/typec/ucsi/ucsi_glink.c b/drivers/usb/typec/ucsi/ucsi_glink.c > index db6e248f8208..4853141cd10c 100644 > --- a/drivers/usb/typec/ucsi/ucsi_glink.c > +++ b/drivers/usb/typec/ucsi/ucsi_glink.c > @@ -228,7 +228,7 @@ static void pmic_glink_ucsi_notify(struct work_struct *work) > > con_num = UCSI_CCI_CONNECTOR(cci); > if (con_num) { > - if (con_num < PMIC_GLINK_MAX_PORTS && > + if (con_num <= PMIC_GLINK_MAX_PORTS && > ucsi->port_orientation[con_num - 1]) { > int orientation = gpiod_get_value(ucsi->port_orientation[con_num - 1]); > > -- > 2.41.0 > -- With best wishes Dmitry