public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Alessandro Zummo <alessandro.zummo@towertech.it>
To: Dmitry Torokhov <dtor_core@ameritech.net>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH 5/8] RTC subsystem, dev interface
Date: Mon, 9 Jan 2006 04:12:06 +0100	[thread overview]
Message-ID: <20060109041206.6115bafb@inspiron> (raw)
In-Reply-To: <200601082150.22213.dtor_core@ameritech.net>

On Sun, 8 Jan 2006 21:50:21 -0500
Dmitry Torokhov <dtor_core@ameritech.net> wrote:

 Hi,

   I will reply in two different emails as I need
 to do some research on some questions of yours.

> > +	if (down_trylock(&rtc->char_sem))
> > +		return -EBUSY;
> > +
> 
> Does the device have to be opened for exclusively? Can it support
> concurrent reads?

 I'm trying to make the things work the same way as with the old
 interface. Once this new code will be as stable as the old one, new
 features can be added. 

 Concurrent reads are certainly possible, but we'd need to lock
 out writes in proper places, and I do not feel safe
 to do it at this stage.

 [..]

> > +			ret = -ERESTARTSYS;
> > +			break;
> > +		}
> > +		schedule();
> > +	} while (1);
> > +	set_current_state(TASK_RUNNING);
> > +	remove_wait_queue(&rtc->irq_queue, &wait);
> > +
> 
> 
> The above looks very much like open-coded wait_event_interruptible();

 Ditto, plus there's the irq data inside 

> > +	kobject_hotplug(&class_dev->kobj, KOBJ_ADD);
> > +
> 
> This is kobject_hotplug abuse; you are not adding a new object here.

 Yes. But I've checked the code and should not harm. I've asked
 for that a couple of weeks ago in this same mailing list
 and got no answer. If there's a working alternative to obtain
 the same result, I'm obviously willing to try.

> > +/* interface registration */
> > +
> > +struct class_interface rtc_dev_interface = {
> > +	.add = &rtc_dev_add_device,
> > +	.remove = &rtc_dev_remove_device,
> > +};
> > +
> 
> I wonder if doing rtc dev as a class device interface is a good idea.
> It may be cleaner to fold it into the core.

 What the code implements is actually an interface, so this should
 be the riht place. It is also fully optional, everything could work
 without it. Probably the interface implementation hasn't all the primitives
 to handle this kind of work, but I'm not willing to go into that right now ;)

 Thank you for your hard work Dmitry, after weeks viewing the same
 code I'm going to be lost in all of those locks issues ;)

-- 

 Best regards,

 Alessandro Zummo,
  Tower Technologies - Turin, Italy

  http://www.towertech.it


  reply	other threads:[~2006-01-09  3:11 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-08 23:12 [PATCH 0/8] RTC subsystem Alessandro Zummo
2006-01-08 23:12 ` [PATCH 1/8] RTC subsystem, class Alessandro Zummo
2006-01-08 23:12 ` [PATCH 2/8] RTC subsystem, ARM cleanup Alessandro Zummo
2006-01-08 23:12 ` [PATCH 3/8] RTC subsystem, sysfs interface Alessandro Zummo
     [not found]   ` <200601082102.40992.dtor_core@ameritech.net>
2006-01-09  2:13     ` Alessandro Zummo
2006-01-08 23:12 ` [PATCH 4/8] RTC subsystem, proc interface Alessandro Zummo
     [not found]   ` <200601082056.30227.dtor_core@ameritech.net>
2006-01-09  2:04     ` Alessandro Zummo
2006-01-09  2:50       ` Dmitry Torokhov
2006-01-08 23:12 ` [PATCH 5/8] RTC subsystem, dev interface Alessandro Zummo
2006-01-09  2:50   ` Dmitry Torokhov
2006-01-09  3:12     ` Alessandro Zummo [this message]
2006-01-09  6:39       ` Dmitry Torokhov
2006-01-09  9:14         ` Alessandro Zummo
2006-01-08 23:12 ` [PATCH 6/8] RTC subsystem, X1205 driver Alessandro Zummo
2006-01-08 23:12 ` [PATCH 7/8] RTC subsystem, test device/driver Alessandro Zummo
2006-01-08 23:12 ` [PATCH 8/8] RTC subsystem, DS1672 driver Alessandro Zummo

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=20060109041206.6115bafb@inspiron \
    --to=alessandro.zummo@towertech.it \
    --cc=dtor_core@ameritech.net \
    --cc=linux-kernel@vger.kernel.org \
    /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