LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Stefan Richter <stefanr@s5r6.in-berlin.de>
To: "Kristian Høgsberg" <krh@bitplanet.net>
Cc: linux1394-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] firewire: reread config ROM when device reset the bus
Date: Mon, 03 Mar 2008 17:51:33 +0100	[thread overview]
Message-ID: <47CC2C95.1050205@s5r6.in-berlin.de> (raw)
In-Reply-To: <59ad55d30803030817l6fce6716x2a97cc809b15b234@mail.gmail.com>

Kristian Høgsberg wrote:
> I would just add a
> 
>   case REREAD_BIB_CHANGED:
>     break;
> 
> to the switch to make that clear,

Yes, that's nicer.

> but otherwise
> 
> Signed-off-by: Kristian Høgsberg <krh@redhat.com>

Thanks.

...
>>  --- linux.orig/drivers/firewire/fw-cdev.c
>>  +++ linux/drivers/firewire/fw-cdev.c
>>  @@ -269,20 +270,25 @@ static int ioctl_get_info(struct client
>>   {
>>         struct fw_cdev_get_info *get_info = buffer;
>>         struct fw_cdev_event_bus_reset bus_reset;
>>  +       struct fw_device *device = client->device;
>>  +       unsigned long ret = 0;
>>
>>         client->version = get_info->version;
>>         get_info->version = FW_CDEV_VERSION;
>>
>>  +       down(&device->device.sem);
>>         if (get_info->rom != 0) {
>>                 void __user *uptr = u64_to_uptr(get_info->rom);
>>                 size_t want = get_info->rom_length;
>>  -               size_t have = client->device->config_rom_length * 4;
>>  +               size_t have;
>>
>>  -               if (copy_to_user(uptr, client->device->config_rom,
>>  -                                min(want, have)))
>>  -                       return -EFAULT;
>>  +               have = device->config_rom_length * 4;
>>  +               ret = copy_to_user(uptr, device->config_rom, min(want, have));
>>         }
>>  -       get_info->rom_length = client->device->config_rom_length * 4;
>>  +       get_info->rom_length = device->config_rom_length * 4;
>>  +       up(&device->device.sem);
>>  +       if (ret != 0)
>>  +               return -EFAULT;
>>
>>         client->bus_reset_closure = get_info->bus_reset_closure;
>>         if (get_info->bus_reset != 0) {

Maybe I should rather use fw-device.c::idr_rwsem instead of device.sem, 
to have better control over who takes the mutex when.  Could also be a 
new dedicated mutex but we don't want to end up with too many of them... 
Do you have an opinion?
-- 
Stefan Richter
-=====-==--- --== ---==
http://arcgraph.de/sr/

  reply	other threads:[~2008-03-03 16:51 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-02 18:35 [PATCH] firewire: replace static ROM cache by allocated cache Stefan Richter
2008-03-03  0:48 ` [PATCH] firewire: reread config ROM when device reset the bus Stefan Richter
2008-03-03 16:17   ` Kristian Høgsberg
2008-03-03 16:51     ` Stefan Richter [this message]
2008-03-03 17:28       ` Kristian Høgsberg
2008-03-03 17:58         ` Stefan Richter
2008-03-03 18:35           ` Stefan Richter
2008-03-04  5:54             ` Greg KH
2008-03-04  8:39               ` Stefan Richter
2008-03-05  0:34     ` [PATCH update] " Stefan Richter
2008-03-05  0:48       ` Stefan Richter
2008-03-05 23:53         ` Stefan Richter
2008-03-06  1:25           ` Stefan Richter
2008-03-03 20:28   ` [PATCH] " Jarod Wilson

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=47CC2C95.1050205@s5r6.in-berlin.de \
    --to=stefanr@s5r6.in-berlin.de \
    --cc=krh@bitplanet.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux1394-devel@lists.sourceforge.net \
    --subject='Re: [PATCH] firewire: reread config ROM when device reset the bus' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).