Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp4809395rwd; Tue, 30 May 2023 10:09:24 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5hI4QDrZPjEf6l7hbxtqukkS/vQw2KmK4MPfVwQKN3kJl1psA1kdLsYgZun4pntqziNkEm X-Received: by 2002:a05:6a20:3d84:b0:10d:515:ff2d with SMTP id s4-20020a056a203d8400b0010d0515ff2dmr12244621pzi.4.1685466563914; Tue, 30 May 2023 10:09:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685466563; cv=none; d=google.com; s=arc-20160816; b=gWAOkFiMoGHAemidxqtwbsmQzm/fKXSlraZxDR+jjpiE0NFrFu2j065qVN0LbWa+KO LhxpcqZefRyEHpy6vCbCCXQO4Or8RY49HjwGpcYzdoDZc4K1/cPblAizTl1zMrZGd7sI t1WPTf9AqdEhB+ICtMvqDdkAixwR05RBcJ57IiA/VcC5yjTQmjGNtpWuXp0EjMFoEcMH jnK/VxfI357lbCS2OSPtlGrUE1uRpLPcAlaWDgpFMi3H5sRUwjOq0iOGCWqnOTFJan3w TdP9Igdbq9BsrLoLnRzx2rmit+zd8ZunIqQkyV+B7gqsqyp23wP9F7YewdMZmxRgnVsd XBfg== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=gsNGsWSaS7lpPpyMBVfZ9bJ67f3xBItv6YYFZ/1ZFJ0=; b=MTLEcA662XHUJRnP+ZIUUn4lpkg3k+Pipr6hWrKcsDEFHgaB29XShOu//OcsI7RBMU gSLWQ0MbFdzyGJmW3W1zqbmJ3XVvHbU1QbYx/8bwyonHPydQ2FkhppFt/bM9OWzVXzd+ WGmwo4S1YvfN2mPD+L5am4f/2pEqU4Byo3G78l92Yfrbgm+VHb/AghWIRuF4WQ/lWGCQ qgt40ZM+80YI1PuEa7cLnQotycu0iWAA96Ir8I7qaliihSf0kHOJX6aVE7yYNI0rEYC1 SWZATGAyL3LmySWGkVsN2K1Hzpbot4euRodGPJomOR4EyUfgjAHdvyx4knbCHUbKRN7n vF4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=G7AcSZea; 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=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f30-20020a63381e000000b005347efdfecbsi10886180pga.111.2023.05.30.10.09.09; Tue, 30 May 2023 10:09:23 -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=@linuxfoundation.org header.s=korg header.b=G7AcSZea; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232001AbjE3Qnd (ORCPT + 99 others); Tue, 30 May 2023 12:43:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55842 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232022AbjE3Qnb (ORCPT ); Tue, 30 May 2023 12:43:31 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1F8EB136; Tue, 30 May 2023 09:43:23 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 5DA3E62A23; Tue, 30 May 2023 16:43:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 62D53C433D2; Tue, 30 May 2023 16:43:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1685465001; bh=SX7UeiLhXb5cPPeAxGsmaERjxLzomdFIpLg43h9HsBI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=G7AcSZeaQi2zDTX6sWT3r7dQjqAz2JQpnfNxRlAsfFxKw8suEcMQ6zm45uvqTTHRL rup3+qRHi0Hwdh+qrbSwe32RY62oFeyp/DRwSAtklT333grZNQkmZLzHT33ZalbSBP kGxedLsRGE9vmPR9NlNFIE86u/xCsT22K5ckVzWQ= Date: Tue, 30 May 2023 17:43:18 +0100 From: Greg Kroah-Hartman To: Prashanth K Cc: Matthias Brugger , AngeloGioacchino Del Regno , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v6] usb: common: usb-conn-gpio: Set last role to unknown before initial detection Message-ID: <2023053037-entertain-challenge-5e27@gregkh> References: <1685421871-25391-1-git-send-email-quic_prashk@quicinc.com> <2023053058-baffling-unveiling-e597@gregkh> <498a0b96-4c40-cad6-8da7-e9819035ef22@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <498a0b96-4c40-cad6-8da7-e9819035ef22@quicinc.com> X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham 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 Tue, May 30, 2023 at 08:56:26PM +0530, Prashanth K wrote: > > > On 30-05-23 07:58 pm, Greg Kroah-Hartman wrote: > > On Tue, May 30, 2023 at 10:14:31AM +0530, Prashanth K wrote: > > > Currently if we bootup a device without cable connected, then > > > usb-conn-gpio won't call set_role() since last_role is same as > > > current role. This happens because during probe last_role gets > > > initialised to zero. > > > > > > To avoid this, added a new constant in enum usb_role, last_role > > > is set to USB_ROLE_UNKNOWN before performing initial detection. > > > > > > While at it, also handle default case for the usb_role switch > > > in cdns3 to avoid build warnings. > > > > > > Fixes: 4602f3bff266 ("usb: common: add USB GPIO based connection detection driver") > > > Signed-off-by: Prashanth K > > > > Breaks the build :( > > > > Please be more careful when submitting stuff, especially on v6 of a > > patch :( > > Hi, sorry for the trouble, I didn't see any issue in while building locally > nor any warning/errors from test robot. Can you please point me to the error > report if available. If the build is breaking due to enum value > USB_ROLE_UNKNOWN unhandled in switch cases of other drivers, then i will > revert thing back to v1 where i used a macro for USB_ROLE_UNKNOWN in > usb-conn-gpio driver. Something like this in usb-conn-gpio.c would can help > us avoid adding default case in other drivers using usb_role. > > #define USB_ROLE_UNKNWON (USB_ROLE_NONE - 1) Just fix up the drivers that need it at the same time: CC [M] drivers/usb/roles/intel-xhci-usb-role-switch.o drivers/usb/roles/intel-xhci-usb-role-switch.c: In function ‘intel_xhci_usb_set_role’: drivers/usb/roles/intel-xhci-usb-role-switch.c:84:9: error: enumeration value ‘USB_ROLE_UNKNOWN’ not handled in switch [-Werror=switch] 84 | switch (role) { | ^~~~~~ cc1: all warnings being treated as errors thanks, greg k-h