Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3253109pxj; Mon, 7 Jun 2021 06:19:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxfbZFT6suEcLKJP2vxDeeGqyXx7UZs9c4NdhiSYDqCH3/wkjyseL0nEV9rSfzX37zrQFtI X-Received: by 2002:a17:906:49ce:: with SMTP id w14mr18055206ejv.273.1623071954808; Mon, 07 Jun 2021 06:19:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623071954; cv=none; d=google.com; s=arc-20160816; b=CZ1rrLTT0jfJ5wizPjLSq5qS90lKYvAzg48pi7Zi/7yzeJZLHzFLCXGWdUox7kraMg sSZEdKhvC+i+XbEkcFFD5UtuAbWo6INWjrKZUZA3IkX5P8h6sJSs8FMU/aFJvgmiBs7i 6g1In5NTtyMa5dCFz+OScAhy+4khI3mL8SGqkqkQrzK5cLJRsxInMUY9Y9Bgd+Qv4XKh rVaSQ0qViVo1XEr3P00mqpqoZIzH7zY2mq6cFJbJY+VaGlsAgPCGfcn/LPt/cqBMuFiL HefLWOuf+xktR0BcNXcJmHb7ziisx5GvExLrgHSw7bb5ODoPnZ5xuTOulJf7pET+tlV2 IRjA== 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=mM0c4RmSQK5G4zflLceMiua7LZ5Ms4HlY99Uf5aKnqk=; b=TQUh7TNuRhQYZ8aoy2Tk1kVYgLEb67vsXlCyF5yl26ZAoYUtNfgbaYji+Fcb1XgNlN DvnjRWDFC11PYtdxPdxtIBWd8d0jPlXcmOwiX6mPJYy6MI5zVfadsbQxKuNjs/yik9Hb 94BW2CuoF+tPjCiFh5uWSIQrY6TKLIVJO02J70kHe3nT67EPspqLzD8nK2eDPxhucJKB cqq7SRVf969zUG3jrZ41u86AX/BCh1OfMg9cUrzdMubUz/QfefRhk9gAJL+x0u0aCqJD PuJfzovFOHalfhOho9zu7Spmclp7+m0fAKkghMBWQpLsLFdLNsxnMCYpymw1q34w7qYr ZCMA== 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 a14si12077869edy.464.2021.06.07.06.18.51; Mon, 07 Jun 2021 06:19:14 -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 S230396AbhFGNQ0 (ORCPT + 99 others); Mon, 7 Jun 2021 09:16:26 -0400 Received: from mga06.intel.com ([134.134.136.31]:17614 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230333AbhFGNQW (ORCPT ); Mon, 7 Jun 2021 09:16:22 -0400 IronPort-SDR: mk52y3lIzpqqsuxivELXE7AesZGZ2IzfASfzT17nQpkAfDQH7ATeBeQbORLXrgZk3EJ5NgesMY ht2d/ES7jGSA== X-IronPort-AV: E=McAfee;i="6200,9189,10008"; a="265774000" X-IronPort-AV: E=Sophos;i="5.83,255,1616482800"; d="scan'208";a="265774000" 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:30 -0700 IronPort-SDR: G7vQsWiA/NyYqrg2pxgdz/zVX2MYeCaZWAhQdACyfC0c62EV/Y7wao2mn4wX2QZbkaSc/g7moF 9FkRONsaikdw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.83,255,1616482800"; d="scan'208";a="551881931" 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:29 -0700 From: Heikki Krogerus To: Benjamin Berg Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH 6/7] usb: typec: ucsi: Filter out spurious events Date: Mon, 7 Jun 2021 16:14:41 +0300 Message-Id: <20210607131442.20121-7-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 Ignoring events without changes. Signed-off-by: Heikki Krogerus --- drivers/usb/typec/ucsi/ucsi.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c index a4123f77d1f16..ce80a433ef9db 100644 --- a/drivers/usb/typec/ucsi/ucsi.c +++ b/drivers/usb/typec/ucsi/ucsi.c @@ -839,6 +839,11 @@ static void ucsi_handle_connector_change(struct work_struct *work) goto out_ack; } + if (!status.change) { + dev_dbg(con->ucsi->dev, "con%d: spurious event\n", con->num); + goto out_ack; + } + event = kzalloc(sizeof(*event), GFP_KERNEL); if (!event) goto out_ack; -- 2.30.2