mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Muhammad Mahdi Amirpour <ampr.mhd@gmail.com>
Cc: stern@rowland.harvard.edu, linux-usb@vger.kernel.org,
	linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4] usb: ohci-omap: implement overcurrent handling for GPIO-based power control
Date: Mon, 19 Oct 2026 08:46:06 +0200	[thread overview]
Message-ID: <2026101934-ferris-seldom-69d2@gregkh> (raw)
In-Reply-To: <20261018223312.120913-1-ampr.mhd@gmail.com>

On Mon, Oct 19, 2026 at 02:03:12AM +0330, Muhammad Mahdi Amirpour wrote:
> The OMAP OHCI driver has had optional GPIO lines for VBUS power control
> and overcurrent detection since the gpiolib conversion, but the
> overcurrent line was never wired up — it was marked with a TODO comment.
> 
> On boards like the OMAP1 OSK, the VBUS power switch (TPS2045) is
> controlled via a TPS65010 GPIO, and overcurrent is reported on a
> separate GPIO. Without this patch, an overcurrent condition is not
> detected by software and VBUS power is not cut, relying solely on the
> hardware current limiter.
> 
> This patch implements the missing overcurrent handling:
> - Requests a threaded IRQ on the overcurrent GPIO (both edges)
> - Cuts VBUS power via the power GPIO when overcurrent is detected
> - Reports overcurrent status and change through the root hub port
>   status callbacks so the USB hub core can react
> - Handles SetPortFeature/ClearPortFeature(POWER) to drive the VBUS
>   GPIO alongside the OHCI hardware register
> - Turns off VBUS on driver removal and probe failure
> 
> Signed-off-by: Muhammad Mahdi Amirpour <ampr.mhd@gmail.com>
> ---
> v4:
>   - Remove spinlock entirely; use READ_ONCE/WRITE_ONCE for the
>     overcurrent flags (Greg KH).  This also fixes the bug where
>     gpiod_set_value_cansleep() was called under spin_lock_irqsave(),
>     which sleeps on the I2C-attached TPS65010 (Sashiko).

Are you sure this is correct?  You never responded to my previous review
comments here, just submitted a new version which is a bit odd...

thanks,

greg k-h

  reply	other threads:[~2026-10-19  6:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-18 22:33 Muhammad Mahdi Amirpour
2026-10-19  6:46 ` Greg KH [this message]
2026-10-19 16:15 Muhammad Mahdi Amirpour
2026-10-20 20:23 ` Andreas Kemnade

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2026101934-ferris-seldom-69d2@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=ampr.mhd@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=stern@rowland.harvard.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®