From: Oliver Neukum <oneukum@suse.com>
To: "Wu, Wentong" <wentong.wu@intel.com>, Oliver Neukum <oneukum@suse.com>
Cc: "gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
"arnd@arndb.de" <arnd@arndb.de>,
"mka@chromium.org" <mka@chromium.org>,
"lee@kernel.org" <lee@kernel.org>,
"wsa@kernel.org" <wsa@kernel.org>,
"kfting@nuvoton.com" <kfting@nuvoton.com>,
"broonie@kernel.org" <broonie@kernel.org>,
"linus.walleij@linaro.org" <linus.walleij@linaro.org>,
"hdegoede@redhat.com" <hdegoede@redhat.com>,
"maz@kernel.org" <maz@kernel.org>,
"brgl@bgdev.pl" <brgl@bgdev.pl>,
"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
"linux-i2c@vger.kernel.org" <linux-i2c@vger.kernel.org>,
"linux-spi@vger.kernel.org" <linux-spi@vger.kernel.org>,
"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
"andriy.shevchenko@linux.intel.com"
<andriy.shevchenko@linux.intel.com>,
"heikki.krogerus@linux.intel.com"
<heikki.krogerus@linux.intel.com>,
"andi.shyti@linux.intel.com" <andi.shyti@linux.intel.com>,
"sakari.ailus@linux.intel.com" <sakari.ailus@linux.intel.com>,
"bartosz.golaszewski@linaro.org" <bartosz.golaszewski@linaro.org>,
"Pandruvada, Srinivas" <srinivas.pandruvada@intel.com>,
"Wang, Zhifeng" <zhifeng.wang@intel.com>
Subject: Re: [PATCH v14 1/4] usb: Add support for Intel LJCA device
Date: Tue, 5 Sep 2023 10:46:26 +0200 [thread overview]
Message-ID: <f6f8a9c4-faf1-f9da-e688-a29eb267fabc@suse.com> (raw)
In-Reply-To: <DM6PR11MB4316C70D7C14B56ED349F01F8DE8A@DM6PR11MB4316.namprd11.prod.outlook.com>
On 05.09.23 04:20, Wu, Wentong wrote:
Hi,
>> That is that you will hang arbitrarily long in disconnect?
> This routine isn't called in an interrupt context, and it allows sleep or wait
> something before the real shutdown like many drivers' remove() or
> disconnect() do.
It is, however, in the context of a kernel thread. We can wait, but not for
arbitrary periods.
> If we want to speed up the disconnect(), below changes is to complete the
> cmd_completion if usb_kill_urb() has been called, but there is still possibility
> ljca client init one more transfer before auxiliary_device_delete()
>
> @@ -206,7 +206,11 @@ static void ljca_recv(struct urb *urb)
>
> if (urb->status) {
> /* sync/async unlink faults aren't errors */
> - if (urb->status == -ENOENT || urb->status == -ECONNRESET ||
> + if (urb->status == -ENOENT) {
> + complete(&adap->cmd_completion);
> + return;
I'd say you'd break suspend() by such a change.
You cannot complete in the interrupt handler, unless you can determine
why the URB is killed.
> + }
> + if (urb->status == -ECONNRESET ||
> urb->status == -ESHUTDOWN)
> return;
>
> perhaps we could add one more 'status' field in ljca_adapter to represent
> disconnect() happen or not, and it will be checked in the beginning of
> ljca_send() to avoid any new transfer.
That would be a solution.
Regards
Oliver
next prev parent reply other threads:[~2023-09-05 16:01 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-04 5:44 [PATCH v14 0/4] Add Intel LJCA device driver Wentong Wu
2023-09-04 5:44 ` [PATCH v14 1/4] usb: Add support for Intel LJCA device Wentong Wu
2023-09-04 7:45 ` Hans de Goede
2023-09-04 7:52 ` Wu, Wentong
2023-09-04 10:33 ` Oliver Neukum
2023-09-04 13:52 ` Wu, Wentong
2023-09-04 14:06 ` Oliver Neukum
2023-09-05 2:20 ` Wu, Wentong
2023-09-05 8:46 ` Oliver Neukum [this message]
2023-09-05 8:53 ` Wu, Wentong
2023-09-05 10:04 ` gregkh
2023-09-06 3:29 ` Wu, Wentong
2023-09-04 5:44 ` [PATCH v14 2/4] i2c: Add support for Intel LJCA USB I2C driver Wentong Wu
2023-09-04 5:44 ` [PATCH v14 3/4] spi: Add support for Intel LJCA USB SPI driver Wentong Wu
2023-09-04 5:44 ` [PATCH v14 4/4] gpio: update Intel LJCA USB GPIO driver Wentong Wu
2023-09-04 7:38 ` [PATCH v14 0/4] Add Intel LJCA device driver Bartosz Golaszewski
2023-09-04 8:25 ` Wu, Wentong
2023-09-04 7:44 ` Hans de Goede
2023-09-04 7:56 ` Wu, Wentong
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=f6f8a9c4-faf1-f9da-e688-a29eb267fabc@suse.com \
--to=oneukum@suse.com \
--cc=andi.shyti@linux.intel.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=arnd@arndb.de \
--cc=bartosz.golaszewski@linaro.org \
--cc=brgl@bgdev.pl \
--cc=broonie@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=hdegoede@redhat.com \
--cc=heikki.krogerus@linux.intel.com \
--cc=kfting@nuvoton.com \
--cc=lee@kernel.org \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=maz@kernel.org \
--cc=mka@chromium.org \
--cc=sakari.ailus@linux.intel.com \
--cc=srinivas.pandruvada@intel.com \
--cc=wentong.wu@intel.com \
--cc=wsa@kernel.org \
--cc=zhifeng.wang@intel.com \
/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