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.5 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,URIBL_BLOCKED,USER_AGENT_MUTT autolearn=ham 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 B53CBC43218 for ; Sat, 27 Apr 2019 07:53:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 84492208CA for ; Sat, 27 Apr 2019 07:53:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1556351608; bh=F1/SyfQad7ViMMBtSYoO0HmqZF/1FHTyMgOydajuTts=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=fVe8YwB1ihPduCJcM3VppznxdIy8glt/4Jf/y//PhWQGbp3QP2AdFJpZfs8U3ATUU 9Wwg0CMXK8F/Kx0Caq6M4DCY0yyFtMeeSipYAvK6AGWqlsAV4bccZ2pKu948wljzOy pWL+Z+qobNs23lu/8EMYx10UuuIG+ezPga9yb22E= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726125AbfD0Hx1 (ORCPT ); Sat, 27 Apr 2019 03:53:27 -0400 Received: from mail.kernel.org ([198.145.29.99]:37122 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725925AbfD0Hx1 (ORCPT ); Sat, 27 Apr 2019 03:53:27 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9B1EB2067D; Sat, 27 Apr 2019 07:53:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1556351606; bh=F1/SyfQad7ViMMBtSYoO0HmqZF/1FHTyMgOydajuTts=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=jjmOovF3AsFUIUnOBpRiVGWYNX9ua5t6iHwnFH+5C8wi0hZ9tMIOPVWbAC6yI3TzM PQL8DAotzEF4D3V0hlkvT/tZpYs5aAwi9yh0Z7UNalaEwWhV2IJ9wqIn4nZ/fYlOSg CdTxo7cIDWteMK9yKfvJ0uLYFCBbfBNcIm1Qbeig= Date: Sat, 27 Apr 2019 09:53:23 +0200 From: Greg Kroah-Hartman To: Serge Semin Cc: Richard Leitner , Serge Semin , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] usb: usb251xb: Lock i2c-bus segment the hub resides Message-ID: <20190427075323.GA31478@kroah.com> References: <20190424144914.10580-1-fancer.lancer@gmail.com> <20190426104650.30240-1-fancer.lancer@gmail.com> <20190427070042.GD28250@kroah.com> <20190427071025.hdrm3e5abnl4yock@mobilestation> <20190427073200.GB30973@kroah.com> <20190427073940.6yzhklfus4qd6ver@mobilestation> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190427073940.6yzhklfus4qd6ver@mobilestation> User-Agent: Mutt/1.11.4 (2019-03-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Apr 27, 2019 at 10:39:41AM +0300, Serge Semin wrote: > On Sat, Apr 27, 2019 at 09:32:00AM +0200, Greg Kroah-Hartman wrote: > > On Sat, Apr 27, 2019 at 10:10:27AM +0300, Serge Semin wrote: > > > On Sat, Apr 27, 2019 at 09:00:42AM +0200, Greg Kroah-Hartman wrote: > > > > On Fri, Apr 26, 2019 at 01:46:50PM +0300, Serge Semin wrote: > > > > > SMBus slave configuration is activated by CFG_SEL[1:0]=0x1 pins > > > > > state. This is the mode the hub is supposed to be to let this driver > > > > > work correctly. But a race condition might happen right after reset > > > > > is cleared due to CFG_SEL[0] pin being multiplexed with SMBus SCL > > > > > function. In case if the reset pin is handled by a i2c GPIO expander, > > > > > which is also placed at the same i2c-bus segment as the usb251x > > > > > SMB-interface connected to, then the hub reset clearance might > > > > > cause the CFG_SEL[0] being latched in unpredictable state. So > > > > > sometimes the hub configuration mode might be 0x1 (as expected), > > > > > but sometimes being 0x0, which doesn't imply to have the hub SMBus-slave > > > > > interface activated and consequently causes this driver failure. > > > > > > > > > > In order to fix the problem we must make sure the GPIO-reset chip doesn't > > > > > reside the same i2c-bus segment as the SMBus-interface of the hub. If > > > > > it doesn't, we can safely block the segment for the time the reset is > > > > > cleared to prevent anyone generating a traffic at the i2c-bus SCL lane > > > > > connected to the CFG_SEL[0] pin. But if it does, nothing we can do, so > > > > > just return an error. If we locked the i2c-bus segment and tried to > > > > > communicate with the GPIO-expander, it would cause a deadlock. If we didn't > > > > > lock the i2c-bus segment, it would randomly cause the CFG_SEL[0] bit flip. > > > > > > > > > > Signed-off-by: Serge Semin > > > > > Signed-off-by: Greg Kroah-Hartman > > > > > > > > I signed off on this? Where? When? > > > > > > > > never add a s-o-b line that you did not create, that implies a legal > > > > agreement. > > > > > > > > > > Ah, shit. Sorry. I should have added Acked-by. That's what I was going to do, > > > since you already added the first version of this into linux-next tree. But > > > apparently copy-pasted and left as is... > > > > If I have already applied a patch, I can't apply it again (or a > > different version.) You need to send a fix-up patch for the reported > > issue, not a whole new one as I can not go back in time and rewrite > > history. > > > > thanks, > > > > greg k-h > > Ok. Should I send it in reply to this patch or as a completely separate one? A separate one.