From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id ECA59C433DB for ; Fri, 5 Mar 2021 07:37:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C32536501A for ; Fri, 5 Mar 2021 07:37:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229458AbhCEHhc (ORCPT ); Fri, 5 Mar 2021 02:37:32 -0500 Received: from mail.kernel.org ([198.145.29.99]:35884 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229616AbhCEHhb (ORCPT ); Fri, 5 Mar 2021 02:37:31 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id D83CF64F59; Fri, 5 Mar 2021 07:37:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1614929851; bh=bvUeCgMjKXHMnR9wZzhu5hhG5YUMC0Dr0Im0Q7UCMbU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=2ME6LsTuSFPZ6hKMAHos4aDNqZdYlA+yV1W605eGsrMCjan1eedf9MSPak5MD3ecX F/PD3E8Uk7jz2GTaDk+7IrDYapQmscvuBY8+u1G4nevAti8EM7AMB84EdZP+OX2EnY 2r8PrzcfJN5W1CTAHEBbYI5M5m4h3F+F5xxxW9WA= Date: Fri, 5 Mar 2021 08:37:28 +0100 From: Greg KH To: Chien Kun Niu Cc: stern@rowland.harvard.edu, erosca@de.adit-jv.com, gustavoars@kernel.org, a.darwish@linutronix.de, oneukum@suse.com, Kyle Tso , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, James Wei Subject: Re: [PATCH] ANDROID: usb: core: Send uevent when USB TOPO layer over 6 Message-ID: References: <20210226091612.508639-1-rickyniu@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org On Fri, Mar 05, 2021 at 03:17:37PM +0800, Chien Kun Niu wrote: > Greg KH 於 2021年3月3日 週三 下午5:10寫道: > > > > On Wed, Mar 03, 2021 at 05:03:25PM +0800, Chien Kun Niu wrote: > > > Hi , Greg > > > > > > What tool will "catch" this? Where is that code located at? > > > => I prepare merge the code to Android phone , so I used Android HLOS > > > to catch this uevent. > > > > Very odd quoting style, perhaps you might want to read up on how to do > > this properly at: > > https://en.wikipedia.org/wiki/Posting_style#Interleaved_style > > > > > uevents are not for stuff like this, you are trying to send "error > > > conditions" to userspace, please use the "proper" interfaces like this > > > and not abuse existing ones. > > > => Sorry , I am not sure what is the "proper" interfaces your mean. > > > Could you please give me more description? > > > > How does the kernel normally send error conditions that it detects in > > hardware to userspace? > > > > I will create a sysfs attribute to record the hub status. > If there is a new hub with over 6 USB TOPO layer connected, I will use > the sysfs_notify to send the "error conditions" to userspace. > Is it a proper interfaces to delivery "error conditions"? Maybe, it all depends on what you are wanting to show here. Try it out and see, it's easier to review patches that you have shown work properly for your use case than it is to try to discuss general issues. thanks, greg k-h