From: "Souza, Jose" <jose.souza@intel.com>
To: "intel-xe@lists.freedesktop.org" <intel-xe@lists.freedesktop.org>,
"quic_mojha@quicinc.com" <quic_mojha@quicinc.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Cc: "Vivi, Rodrigo" <rodrigo.vivi@intel.com>,
"johannes@sipsolutions.net" <johannes@sipsolutions.net>,
"Cavitt, Jonathan" <jonathan.cavitt@intel.com>
Subject: Re: [PATCH 2/4] devcoredump: Add dev_coredump_timeout_set()
Date: Wed, 28 Feb 2024 13:12:36 +0000 [thread overview]
Message-ID: <cc11ba085ee36494cfb26d273a5e68e7a9f35ece.camel@intel.com> (raw)
In-Reply-To: <27b24aa4-f5d8-0936-051d-59f298da2315@quicinc.com>
On Wed, 2024-02-28 at 13:56 +0530, Mukesh Ojha wrote:
>
> On 2/28/2024 2:30 AM, José Roberto de Souza wrote:
> > Add function to set a custom coredump timeout.
> >
> > Current 5-minute timeout may be too short for users to search and
> > understand what needs to be done to capture coredump to report bugs.
> >
> > Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> > Cc: Mukesh Ojha <quic_mojha@quicinc.com>
> > Cc: Johannes Berg <johannes@sipsolutions.net>
> > Cc: Jonathan Cavitt <jonathan.cavitt@intel.com>
> > Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
> > ---
> > drivers/base/devcoredump.c | 23 +++++++++++++++++++++++
> > include/linux/devcoredump.h | 6 ++++++
> > 2 files changed, 29 insertions(+)
> >
> > diff --git a/drivers/base/devcoredump.c b/drivers/base/devcoredump.c
> > index e96427411b87c..2857ceb3eb3aa 100644
> > --- a/drivers/base/devcoredump.c
> > +++ b/drivers/base/devcoredump.c
> > @@ -326,6 +326,29 @@ void dev_coredump_put(struct device *dev)
> > }
> > EXPORT_SYMBOL_GPL(dev_coredump_put);
> >
> > +/**
> > + * dev_coredump_timeout_set - set coredump timeout
> > + * @dev: the struct device for the crashed device
> > + * @secs_timeout: new timeout in seconds
> > + *
> > + * If giving device has a coredump this sets a new timeout for coredump.
> > + */
> > +void dev_coredump_timeout_set(struct device *dev, unsigned long secs_timeout)
> > +{
> > + struct device *existing;
> > + struct devcd_entry *devcd;
> > +
> > + existing = class_find_device(&devcd_class, NULL, dev,
> > + devcd_match_failing);
> > + if (!existing)
> > + return;
> > +
> > + devcd = dev_to_devcd(existing);
> > + mod_delayed_work(system_wq, &devcd->del_wk, HZ * secs_timeout);
> > + put_device(existing);
> > +}
> > +EXPORT_SYMBOL_GPL(dev_coredump_timeout_set);
>
> Why don't we provide a new exported function like [1] as calling
> dev_coredumpm() and just another function to configure the timeout
> does not look good.
sounds good too, tried to be less intrusive.
will wait feedback in the first patch to send a new version.
thank you
>
> [1]
>
> dev_coredump_timeout(..., timeout);
> __dev_coredump_timeout(...);
>
> dev_coredumpm(..)
> __dev_coredump_timeout(..., DEVCD_TIMEOUT);
>
> dev_coredumpv()
> __dev_coredump_timeout(..., DEVCD_TIMEOUT);
>
> dev_coredumpsg()
> __dev_coredump_timeout(..., DEVCD_TIMEOUT);
>
> -Mukesh
>
> > +
> > /**
> > * dev_coredumpm - create device coredump with read/free methods
> > * @dev: the struct device for the crashed device
> > diff --git a/include/linux/devcoredump.h b/include/linux/devcoredump.h
> > index c8f7eb6cc1915..70fe72a5c6d36 100644
> > --- a/include/linux/devcoredump.h
> > +++ b/include/linux/devcoredump.h
> > @@ -65,6 +65,7 @@ void dev_coredumpsg(struct device *dev, struct scatterlist *table,
> > size_t datalen, gfp_t gfp);
> >
> > void dev_coredump_put(struct device *dev);
> > +void dev_coredump_timeout_set(struct device *dev, unsigned long secs_timeout);
> > #else
> > static inline void dev_coredumpv(struct device *dev, void *data,
> > size_t datalen, gfp_t gfp)
> > @@ -90,6 +91,11 @@ static inline void dev_coredumpsg(struct device *dev, struct scatterlist *table,
> > static inline void dev_coredump_put(struct device *dev)
> > {
> > }
> > +
> > +static inline void dev_coredump_timeout_set(struct device *dev,
> > + unsigned long secs_timeout)
> > +{
> > +}
> > #endif /* CONFIG_DEV_COREDUMP */
> >
> > #endif /* __DEVCOREDUMP_H */
next prev parent reply other threads:[~2024-02-28 13:12 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-27 21:00 [PATCH 1/4] devcoredump: Add dev_coredump_put() José Roberto de Souza
2024-02-27 21:00 ` [PATCH 2/4] devcoredump: Add dev_coredump_timeout_set() José Roberto de Souza
2024-02-28 8:26 ` Mukesh Ojha
2024-02-28 13:12 ` Souza, Jose [this message]
2024-02-27 21:00 ` [PATCH 3/4] drm/xe: Remove devcoredump during driver release José Roberto de Souza
2024-02-27 21:00 ` [PATCH 4/4] drm/xe: Increase devcoredump timeout José Roberto de Souza
2024-02-28 13:42 ` [PATCH 1/4] devcoredump: Add dev_coredump_put() Mukesh Ojha
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=cc11ba085ee36494cfb26d273a5e68e7a9f35ece.camel@intel.com \
--to=jose.souza@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=johannes@sipsolutions.net \
--cc=jonathan.cavitt@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=quic_mojha@quicinc.com \
--cc=rodrigo.vivi@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
all inboxes | Powered by JetHome®