Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2892304rwd; Mon, 29 May 2023 02:28:04 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ76Q0CQcbh3TemaJGHbkzHRmE9LSwb7N7X4u8G6vwnEyfSMYosNeggrq9N/lKRe8rcgt1s8 X-Received: by 2002:a17:90a:fb82:b0:253:5c1b:1043 with SMTP id cp2-20020a17090afb8200b002535c1b1043mr10277444pjb.19.1685352483731; Mon, 29 May 2023 02:28:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685352483; cv=none; d=google.com; s=arc-20160816; b=ZZw4Nd5Qt3CVsycR5ZMgIDsXpA6OjYW06khlRd6qlgMBQorRhoWb2YNanhL7Vepp41 qEbp0fzt7Urm4nxDm9HTIB90p5THd9wBXvhcid/tnwpHgfleu3uJ8ju5gluJZVJkCxTD 4f9InF+PlxOcjVAWQwzyXnc8WgmCEDk9byOQYi1leXJOjXNHOIxXRjmJQ+M5zxz0+LBS bg+dwdetTCkhyvALwErjCCucI/PXKrb0sIl+jIzpfAvzegDFG51FMvI4C43T6lsZSqVJ BfxzzS2jxP2+FBUtIHpSWbBr8WnFRD+ZIdhbxKYj+lu+fRKp2EFuVfaEYAQMbyOpg7+4 RxwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:in-reply-to :subject:cc:to:from:message-id:date:dkim-signature; bh=3wT7kwPz1idB1PnML3/sakJ6v1u+EL056fgQU0VbWbc=; b=a0cssv+vCGof1w/ODQGQbmmBdk+gNd1Kmfyqh8wFL8P7Dzq35rfOcVGib49W6EFOID Zg1AfgjLhKPHzohd6RmE9w00kMzEclMoThMlB74Efs59z6aOiUbZhbjWvqsqLbUy0zW5 0d/Got7FamjUQKozOhY8m/UHkcqgxiHzEbg1WJPq+YCSXOE+NNS513LD96U5gPRDaUMX qq1ceIjV+oRWLTe9e0OiGpE05Yk7WDCgb45K6ys3oup030FUHybgNPWOYVrO73+OtVn2 kL2mCQnKSgBzLAPrzp3WOpHm3+12NI0wL3KIr4jBNtsj/L/Gqym7a9X23DWP48zUZtaU HOKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ZBxiEkG3; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l125-20020a633e83000000b005347c0e5986si9032327pga.120.2023.05.29.02.27.52; Mon, 29 May 2023 02:28:03 -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=@kernel.org header.s=k20201202 header.b=ZBxiEkG3; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231668AbjE2JJz (ORCPT + 99 others); Mon, 29 May 2023 05:09:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59770 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231830AbjE2JJq (ORCPT ); Mon, 29 May 2023 05:09:46 -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 469529C; Mon, 29 May 2023 02:09:45 -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 D065361239; Mon, 29 May 2023 09:09:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 349B0C433D2; Mon, 29 May 2023 09:09:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1685351384; bh=dW8HaUANnD0KpZnNdrw8u54SlE9A4EhFPiSPNCIaXkc=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=ZBxiEkG3dS0o9jaQ/RLwikydt5DUrFAy0GJb6/BlTzGD+IRYhNHOKpfXMRcuPG7Co 8tfqxjbCPUY/c9NR+XcbCgs4iKvE7nxpbEOxPIL0171ugWn8Wz2enFqEvToTVpyPtH lfIonYn4nE7TDzfQ7fOlPJn+nVZUy512ZfRCAaBqajFqj2Bd5BIqD9wi7FG78DzXsV ycMD9ZMQ1U7MVgmv9eX4c+veCYn0Qhxaf9E6+X1fU/Qvhcbfy0onUprtxGO9OY4WgL FJubOLQmodWNddfZpb7zfCMNpBDNjTFzRy1ydc2sZoDGOOanYdQOqUb8w1m8HGmfID 76fKRV4hZ/Sgg== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-girl.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1q3Ysn-0012B5-Rv; Mon, 29 May 2023 10:09:41 +0100 Date: Mon, 29 May 2023 10:09:41 +0100 Message-ID: <86bki3cxm2.wl-maz@kernel.org> From: Marc Zyngier To: Biju Das Cc: Laurent Pinchart , "linux-kernel@vger.kernel.org" , Greg Kroah-Hartman , Zheng Wang , Geert Uytterhoeven , Yoshihiro Shimoda , Wolfram Sang , Krzysztof Kozlowski , "linux-usb@vger.kernel.org" , Prabhakar Mahadev Lad , "linux-renesas-soc@vger.kernel.org" Subject: Re: [PATCH] usb: gadget: udc: renesas_usb3: Fix RZ/V2M {modprobe,bind} error In-Reply-To: References: <20230526143615.372338-1-biju.das.jz@bp.renesas.com> <20230529061714.GA25984@pendragon.ideasonboard.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/28.2 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: biju.das.jz@bp.renesas.com, laurent.pinchart@ideasonboard.com, linux-kernel@vger.kernel.org, gregkh@linuxfoundation.org, zyytlz.wz@163.com, geert+renesas@glider.be, yoshihiro.shimoda.uh@renesas.com, wsa+renesas@sang-engineering.com, krzysztof.kozlowski@linaro.org, linux-usb@vger.kernel.org, prabhakar.mahadev-lad.rj@bp.renesas.com, linux-renesas-soc@vger.kernel.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false 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 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 Mon, 29 May 2023 09:42:34 +0100, Biju Das wrote: > > Hi Laurent, > > Thanks for the feedback. > > > Subject: Re: [PATCH] usb: gadget: udc: renesas_usb3: Fix RZ/V2M > > {modprobe,bind} error > > > > Hi Biju, > > > > Thank you for the patch. > > > > On Fri, May 26, 2023 at 03:36:15PM +0100, Biju Das wrote: > > > Currently {modprobe, bind} after {rmmod, unbind} results in probe > > failure. > > > > > > genirq: Flags mismatch irq 22. 00000004 (85070400.usb3drd) vs. > > > 00000004 (85070400.usb3drd) > > > renesas_usb3: probe of 85070000.usb3peri failed with error -16 > > > > > > Fix this issue by replacing "parent dev"->"dev" as the irq resource is > > > managed by this driver. > > > > If the dev pointer passed to devm_request_irq() is not the correct one, > > how does it work the first time the driver is loaded ? > > + Marc/ Kernel.org to give some feedback on this issue > > I believe there may be a bug in the genirq (kernel/irq) driver. > first time it works ok. Maybe this driver is caching on unload > with null value and comparing with actual one (irq 22) during reload?? > > Maybe genirq expert can comment what went wrong here?? You get shouted at because you are registering an interrupt handler for the same IRQ twice, and the interrupt is not configured with the SHARED flag. If, as I understand it, you only have a single device using this interrupt, then it means your driver is not freeing its interrupt on unload. And that's probably because the device object used when requesting the interrupt isn't the one you load/unload, as indicated by the message. On the first load of "usb3peri", you register an interrupt with "usb3drd" as the requester device. You then unload "usb3peri", which of course has no effect whatsoever on the interrupt. You could simply have done a "cat /proc/interrupt" and see that interrupt was still there after unload. So the only bug here is in the handling of the interrupt request. And that bug firmly lies in your code. My "expert" advise is to debug the problem rather than suspecting some random failure modes. Thanks, M. -- Without deviation from the norm, progress is not possible.