Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753368AbeAQNdP (ORCPT + 1 other); Wed, 17 Jan 2018 08:33:15 -0500 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:37871 "EHLO out1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752612AbeAQNdN (ORCPT ); Wed, 17 Jan 2018 08:33:13 -0500 X-ME-Sender: Date: Wed, 17 Jan 2018 14:33:00 +0100 From: Greg KH To: ShuFanLee Cc: heikki.krogerus@linux.intel.com, cy_huang@richtek.com, shufan_lee@richtek.com, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org Subject: Re: [PATCH] USB TYPEC: RT1711H Type-C Chip Driver Message-ID: <20180117133300.GC3188@kroah.com> References: <1515567552-7692-1-git-send-email-leechu729@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1515567552-7692-1-git-send-email-leechu729@gmail.com> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On Wed, Jan 10, 2018 at 02:59:12PM +0800, ShuFanLee wrote: > +static inline void rt1711h_poll_ctrl(struct rt1711h_chip *chip) > +{ > + cancel_delayed_work_sync(&chip->poll_work); > + > + if (atomic_read(&chip->poll_count) == 0) { > + atomic_inc(&chip->poll_count); > + cpu_idle_poll_ctrl(true); > + } > + > + schedule_delayed_work(&chip->poll_work, msecs_to_jiffies(40)); > +} This is very odd, and not good. What are you trying to do here? And why are you thinking that poll_count should be an atomic variable? This feels really strange, and not something you should be doing in an irq handler, right? thanks, greg k-h